:root{--bg:#050508;--surface:rgba(12,12,18,0.97);--surface-2:rgba(18,18,28,0.98);--border:rgba(139,92,246,0.2);--border-2:rgba(139,92,246,0.4);--text:#f8fafc;--text-2:#e2e8f0;--text-muted:#94a3b8;--purple:#8b5cf6;--purple-light:#a78bfa;--purple-glow:rgba(139,92,246,0.18);--purple-gradient:linear-gradient(135deg,#a78bfa,#8b5cf6,#6d28d9);--green:#10b981;--red:#f43f5e;--amber:#f59e0b;--blue:#3b82f6;--sidebar-w:260px;--radius:14px;--radius-sm:10px;--transition:all 0.25s cubic-bezier(0.4,0,0.2,1)}
*{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{font-family:'Inter','Noto Sans Khmer',system-ui,sans-serif;background:var(--bg);color:var(--text);min-height:100vh;display:flex;-webkit-font-smoothing:antialiased;transition:opacity 0.3s ease}
body::before{content:"";position:fixed;inset:0;z-index:-1;background:radial-gradient(ellipse 60% 50% at 15% 10%,rgba(139,92,246,0.10) 0%,transparent 60%),radial-gradient(ellipse 50% 40% at 85% 80%,rgba(59,130,246,0.07) 0%,transparent 50%)}
a{color:inherit;text-decoration:none}
.sidebar{width:var(--sidebar-w);height:100vh;position:fixed;left:0;top:0;background:var(--surface);border-right:1px solid var(--border);display:flex;flex-direction:column;padding:20px 16px;z-index:200;transition:transform .3s ease;overflow-y:auto}
.sb-logo-wrap{display:flex;align-items:center;gap:12px;padding:8px 10px 24px;border-bottom:1px solid var(--border);margin-bottom:20px}
.sb-logo{width:42px;height:42px;border-radius:12px;overflow:hidden;border:1px solid rgba(139,92,246,.4);flex-shrink:0}
.sb-logo img{width:100%;height:100%;object-fit:cover}
.sb-title{font-size:15px;font-weight:800;color:var(--purple-light)}
.sb-sub{font-size:10px;color:var(--text-muted);display:block;margin-top:2px}
.admin-badge{display:inline-block;background:rgba(139,92,246,.15);border:1px solid rgba(139,92,246,.3);color:var(--purple-light);font-size:9px;font-weight:700;letter-spacing:1px;padding:2px 7px;border-radius:20px;text-transform:uppercase;margin-top:4px}
.sb-nav{flex:1;display:flex;flex-direction:column;gap:2px}
.sb-section-label{font-size:9px;font-weight:700;letter-spacing:1.5px;color:var(--text-muted);text-transform:uppercase;padding:14px 10px 6px}
.nav-item{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:var(--radius-sm);font-size:13px;font-weight:500;color:var(--text-muted);cursor:pointer;transition:var(--transition);border:1px solid transparent}
.nav-item:hover{color:var(--text);background:var(--surface-2);border-color:var(--border)}
.nav-item.active{color:var(--purple-light);background:var(--purple-glow);border-color:var(--border);font-weight:600}
.nav-item .badge{margin-left:auto;background:rgba(139,92,246,.2);color:var(--purple-light);font-size:10px;font-weight:700;padding:1px 7px;border-radius:20px}
.nav-item svg{flex-shrink:0}
.sb-bottom{margin-top:auto;padding-top:16px;border-top:1px solid var(--border)}
.sb-user{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:var(--radius-sm);background:var(--surface-2);margin-bottom:8px}
.sb-avatar{width:34px;height:34px;border-radius:50%;background:var(--purple-gradient);display:flex;align-items:center;justify-content:center;font-weight:800;font-size:13px;flex-shrink:0}
.sb-uname{font-size:12px;font-weight:600;color:var(--text-2)}
.sb-uemail{font-size:10px;color:var(--text-muted)}
.logout-btn{width:100%;display:flex;align-items:center;gap:8px;justify-content:center;padding:9px 14px;border-radius:var(--radius-sm);background:rgba(244,63,94,.08);border:1px solid rgba(244,63,94,.2);color:var(--red);font-size:12.5px;font-weight:600;cursor:pointer;transition:var(--transition);font-family:inherit}
.logout-btn:hover{background:rgba(244,63,94,.15)}
.main{margin-left:var(--sidebar-w);flex:1;min-height:100vh;padding:28px 28px 60px}
.page-header{margin-bottom:28px}
.page-title{font-size:24px;font-weight:800;color:var(--text);display:flex;align-items:center;gap:10px}
.page-title .dot{width:8px;height:8px;border-radius:50%;background:var(--green);box-shadow:0 0 8px var(--green);animation:pulse 2s infinite;flex-shrink:0}
.page-sub{font-size:13px;color:var(--text-muted);margin-top:4px}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.4}}
.stats-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:16px;margin-bottom:24px}
.stat-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:20px;position:relative;overflow:hidden;transition:var(--transition)}
.stat-card:hover{border-color:var(--border-2);transform:translateY(-2px)}
.stat-card::before{content:"";position:absolute;top:0;left:0;right:0;height:3px}
.stat-card.purple::before{background:var(--purple-gradient)}
.stat-card.green::before{background:linear-gradient(90deg,#10b981,#34d399)}
.stat-card.amber::before{background:linear-gradient(90deg,#f59e0b,#fbbf24)}
.stat-card.blue::before{background:linear-gradient(90deg,#3b82f6,#60a5fa)}
.stat-card.red::before{background:linear-gradient(90deg,#f43f5e,#fb7185)}
.stat-card.gold::before{background:linear-gradient(90deg,#d4af37,#fde047)}
.sc-icon{font-size:22px;margin-bottom:12px}
.sc-val{font-size:28px;font-weight:900;color:var(--text);line-height:1;margin-bottom:4px}
.sc-label{font-size:12px;color:var(--text-muted);font-weight:500}
.panel{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;margin-bottom:20px}
.panel-header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid var(--border)}
.panel-title{font-size:14px;font-weight:700;color:var(--text)}
.panel-body-pad{padding:20px}
.pill{display:inline-flex;align-items:center;padding:2px 10px;border-radius:20px;font-size:11px;font-weight:700}
.pill.completed{background:rgba(16,185,129,.15);color:var(--green)}
.pill.pending{background:rgba(245,158,11,.15);color:var(--amber)}
.pill.failed{background:rgba(244,63,94,.1);color:var(--red)}
.pill.processing{background:rgba(59,130,246,.15);color:var(--blue)}
.table-wrap{overflow-x:auto}
table{width:100%;border-collapse:collapse}
thead th{text-align:left;font-size:11px;font-weight:700;letter-spacing:.5px;color:var(--text-muted);text-transform:uppercase;padding:10px 16px;border-bottom:1px solid var(--border);background:rgba(255,255,255,.01);white-space:nowrap}
tbody tr{border-bottom:1px solid rgba(255,255,255,.04);transition:var(--transition)}
tbody tr:hover{background:rgba(139,92,246,.04)}
tbody tr:last-child{border-bottom:none}
td{padding:11px 16px;font-size:13px;color:var(--text-2);vertical-align:middle}
td.mono{font-family:monospace;font-size:12px;color:var(--text-muted)}
.user-link{cursor:pointer;color:var(--purple-light);font-weight:600}
.user-link:hover{text-decoration:underline}
.filter-bar{display:flex;gap:10px;align-items:center;padding:14px 20px;border-bottom:1px solid var(--border);flex-wrap:wrap}
.search-wrap{flex:1;min-width:200px;display:flex;align-items:center;gap:8px;background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius-sm);padding:8px 14px}
.search-wrap input{background:transparent;border:none;outline:none;font-size:13px;color:var(--text);flex:1;font-family:inherit;width:100%}
.search-wrap input::placeholder{color:var(--text-muted)}
.filter-btn{padding:8px 16px;border-radius:var(--radius-sm);background:var(--purple-glow);border:1px solid var(--border);color:var(--purple-light);font-size:12px;font-weight:600;cursor:pointer;transition:var(--transition);font-family:inherit}
.filter-btn:hover{background:rgba(139,92,246,.25)}
.live-feed{max-height:420px;overflow-y:auto}
.live-item{display:flex;align-items:center;gap:12px;padding:12px 20px;border-bottom:1px solid rgba(255,255,255,.04);animation:slideIn .3s ease;transition:background .2s}
.live-item:hover{background:rgba(139,92,246,.04)}
.live-item:last-child{border-bottom:none}
@keyframes slideIn{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:translateY(0)}}
.live-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}
.live-dot.green{background:var(--green);box-shadow:0 0 6px var(--green)}
.live-dot.amber{background:var(--amber)}
.live-dot.red{background:var(--red)}
.live-dot.blue{background:var(--blue)}
.live-info{flex:1}
.live-title{font-size:13px;font-weight:600;color:var(--text);margin-bottom:2px}
.live-sub{font-size:11px;color:var(--text-muted)}
.live-amount{font-size:13px;font-weight:700;color:var(--green)}
.live-time{font-size:11px;color:var(--text-muted)}
.loading-msg{padding:24px;text-align:center;color:var(--text-muted);font-size:13px}
.buyer-item{display:flex;align-items:center;gap:14px;padding:12px 20px;border-bottom:1px solid rgba(255,255,255,.04);cursor:pointer;transition:var(--transition)}
.buyer-item:hover{background:rgba(139,92,246,.04)}
.buyer-item:last-child{border-bottom:none}
.buyer-rank{width:28px;height:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:800;flex-shrink:0}
.rank-1{background:linear-gradient(135deg,#fde047,#d4af37);color:#000}
.rank-2{background:linear-gradient(135deg,#e2e8f0,#94a3b8);color:#000}
.rank-3{background:linear-gradient(135deg,#fb923c,#d97706);color:#fff}
.rank-n{background:var(--surface-2);color:var(--text-muted)}
.buyer-info{flex:1}
.buyer-name{font-size:13px;font-weight:700;color:var(--text)}
.buyer-email{font-size:11px;color:var(--text-muted)}
.buyer-stats{text-align:right}
.buyer-spent{font-size:14px;font-weight:800;color:var(--purple-light)}
.buyer-orders{font-size:11px;color:var(--text-muted)}
.bar-chart{display:flex;align-items:flex-end;gap:8px;height:120px}
.bar-col{flex:1;display:flex;flex-direction:column;align-items:center;gap:4px;height:100%;justify-content:flex-end}
.bar-fill{width:100%;border-radius:4px 4px 0 0;background:var(--purple-gradient);min-height:4px;transition:height .5s ease}
.bar-label{font-size:9px;color:var(--text-muted);white-space:nowrap}
.bar-val{font-size:9px;color:var(--purple-light);font-weight:700}
.pagination{display:flex;gap:4px;align-items:center;justify-content:center;padding:14px}
.page-btn{padding:5px 12px;border-radius:7px;font-size:12px;font-weight:600;cursor:pointer;border:1px solid var(--border);background:var(--surface-2);color:var(--text-muted);transition:var(--transition);font-family:inherit}
.page-btn:hover{color:var(--text);border-color:var(--purple)}
.page-btn.active{background:var(--purple-glow);color:var(--purple-light);border-color:var(--border)}
.page-btn:disabled{opacity:.4;cursor:not-allowed}
.modal-overlay{position:fixed;inset:0;z-index:1000;background:rgba(0,0,0,.8);backdrop-filter:blur(4px);display:none;align-items:center;justify-content:center}
.modal-overlay.open{display:flex}
.modal-box{background:var(--surface);border:1px solid var(--border-2);border-radius:16px;padding:28px;width:100%;max-width:520px;max-height:85vh;overflow-y:auto;animation:modalIn .2s ease}
@keyframes modalIn{from{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}
.modal-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px}
.modal-title{font-size:16px;font-weight:800;color:var(--text)}
.modal-close{width:30px;height:30px;border-radius:8px;background:rgba(255,255,255,.06);border:1px solid var(--border);color:var(--text-muted);cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;font-family:inherit;z-index:999;}
.modal-close:hover{background:rgba(244,63,94,.1);color:var(--red)}
.field-group{margin-bottom:14px}
.field-label{font-size:11px;font-weight:700;color:var(--text-muted);margin-bottom:5px;display:block}
.field-val{padding:9px 13px;border-radius:var(--radius-sm);background:var(--surface-2);border:1px solid var(--border);font-size:13px;color:var(--text)}
.field-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.action-input{width:100%;padding:9px 13px;border-radius:var(--radius-sm);background:var(--surface-2);border:1px solid var(--border);color:var(--text);font-size:13px;font-family:inherit;outline:none;transition:var(--transition)}
.action-input:focus{border-color:var(--purple)}
.action-input::placeholder{color:var(--text-muted)}
.action-btn{width:100%;padding:10px;border-radius:var(--radius-sm);font-size:13px;font-weight:700;cursor:pointer;border:1px solid;transition:var(--transition);margin-top:7px;font-family:inherit}
.action-btn.green{background:rgba(16,185,129,.12);color:var(--green);border-color:rgba(16,185,129,.3)}
.action-btn.green:hover{background:rgba(16,185,129,.22)}
.action-btn.red{background:rgba(244,63,94,.08);color:var(--red);border-color:rgba(244,63,94,.2)}
.action-btn.red:hover{background:rgba(244,63,94,.18)}
.action-btn.amber{background:rgba(245,158,11,.1);color:var(--amber);border-color:rgba(245,158,11,.25)}
.action-btn.amber:hover{background:rgba(245,158,11,.2)}
.modal-divider{border:none;border-top:1px solid var(--border);margin:16px 0}
.modal-section-title{font-size:11px;font-weight:700;color:var(--text-muted);margin-bottom:8px}
.mini-order-row{display:flex;align-items:center;justify-content:space-between;padding:7px 11px;border-radius:8px;background:var(--surface-2);margin-bottom:4px;font-size:12px;gap:8px}
.mini-service{color:var(--text-2);font-weight:600;flex:1}
.mini-date{color:var(--text-muted);font-size:11px}
.mini-amount{color:var(--green);font-weight:700}
.toast{position:fixed;bottom:24px;right:24px;z-index:9999;padding:12px 20px;border-radius:10px;font-size:13px;font-weight:600;background:var(--surface);border:1px solid var(--border);opacity:0;transform:translateY(10px);pointer-events:none;transition:all .3s ease}
.toast.show{opacity:1;transform:translateY(0);pointer-events:auto}
.toast.ok{border-color:rgba(16,185,129,.4);color:var(--green)}
.toast.err{border-color:rgba(244,63,94,.3);color:var(--red)}
.spinner{display:inline-block;width:14px;height:14px;border:2px solid rgba(139,92,246,.25);border-top-color:var(--purple);border-radius:50%;animation:spin .7s linear infinite;margin-right:6px;vertical-align:middle}
@keyframes spin{to{transform:rotate(360deg)}}
.loading-row td{text-align:center;padding:28px;color:var(--text-muted);font-size:13px}
.menu-toggle{display:none;position:fixed;top:14px;left:14px;z-index:300;width:38px;height:38px;border-radius:10px;background:var(--surface);border:1px solid var(--border);align-items:center;justify-content:center;cursor:pointer;color:var(--text);font-size:20px}
.overlay-bg{display:none;position:fixed;inset:0;z-index:190;background:rgba(0,0,0,.6)}
.overlay-bg.open{display:block}
@media(max-width:768px){.sidebar{transform:translateX(-100%)}.sidebar.open{transform:translateX(0)}.main{margin-left:0;padding:14px 14px 50px;padding-top:60px}.menu-toggle{display:flex}.stats-grid{grid-template-columns:repeat(2,1fr);gap:10px}.field-row{grid-template-columns:1fr}.sc-val{font-size:22px}}
