:root{
 --bg:#0E1416;
 --panel:#151D20;
 --panel-2:#1B2427;
 --line:#263033;
 --text:#E7EEEE;
 --text-dim:#8AA0A3;
 --teal:#2FD8B8;
 --teal-dim:#1B7A69;
 --amber:#F5B94E;
 --red:#F0654E;
 --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
 --mono: "SF Mono", "IBM Plex Mono", Consolas, monospace;
}
*{box-sizing:border-box;}
body{
 margin:0; background:var(--bg); color:var(--text);
 font-family:var(--font); -webkit-font-smoothing:antialiased;
}
.app{max-width:480px; margin:0 auto; min-height:100vh; display:flex; flex-direction:column;}

/* Top bar */
.topbar{
 display:flex; align-items:center; gap:10px;
 padding:16px 18px; border-bottom:1px solid var(--line);
 position:sticky; top:0; background:var(--bg); z-index:5;
}
.topbar .mark{
 width:30px; height:30px; border-radius:7px;
 background:linear-gradient(160deg, var(--teal), var(--teal-dim));
 display:flex; align-items:center; justify-content:center;
 font-weight:700; font-size:13px; color:#062420; flex:none;
}
.topbar .titles{flex:1; min-width:0;}
.topbar .titles h1{font-size:15px; margin:0; font-weight:600; letter-spacing:.1px;}
.topbar .titles p{margin:1px 0 0; font-size:12px; color:var(--text-dim); overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.refresh{
 font-size:11px; color:var(--text-dim); text-align:right; flex:none; line-height:1.3;
}
.refresh b{color:var(--teal); font-weight:600; display:block; font-size:11px;}

/* Status banner */
.banner{
 margin:14px 18px 0; padding:13px 14px; border-radius:10px;
 display:flex; align-items:center; gap:10px;
}
.banner.error{
 background:rgba(240,101,78,.12); border:1px solid rgba(240,101,78,.35);
}
.banner.success{
 background:rgba(47,216,184,.1); border:1px solid rgba(47,216,184,.3);
}
.banner .dot{width:8px; height:8px; border-radius:50%; flex:none;}
.banner.error .dot{background:var(--red); box-shadow:0 0 0 4px rgba(240,101,78,.18);}
.banner.success .dot{background:var(--teal); box-shadow:0 0 0 4px rgba(47,216,184,.18);}
.banner .msg{flex:1; min-width:0;}
.banner .msg .t{font-size:13px; font-weight:600; margin:0;}
.banner.error .msg .t{color:var(--red);}
.banner.success .msg .t{color:var(--teal);}
.banner .msg .s{font-size:11.5px; color:var(--text-dim); margin:2px 0 0;}
.banner button{
 flex:none; border:none;
 font-size:12px; font-weight:600; padding:7px 12px; border-radius:7px; cursor:pointer;
}
.banner.error button{background:var(--red); color:#2A0A05;}
.banner.success button{background:var(--teal); color:#062420;}

/* Stat grid */
.stats{display:grid; grid-template-columns:1fr 1fr; gap:10px; padding:16px 18px 4px;}
.stat{
 background:var(--panel); border:1px solid var(--line); border-radius:12px;
 padding:14px 14px 12px; position:relative; overflow:hidden;
}
.stat::before{
 content:""; position:absolute; left:0; top:0; bottom:0; width:3px;
}
.stat.online::before{background:var(--teal);}
.stat.users::before{background:#6E9BFF;}
.stat.voucher::before{background:var(--amber);}
.stat.hotspot::before{background:var(--text-dim);}
.stat .label{font-size:12px; color:var(--text-dim); margin:0 0 6px;}
.stat .num{font-size:28px; font-weight:700; font-family:var(--mono); line-height:1; letter-spacing:-.5px;}
.stat .sub{font-size:11px; color:var(--text-dim); margin:6px 0 0;}

/* Section */
.section{padding:20px 18px 4px;}
.section h2{font-size:13px; font-weight:600; margin:0 0 12px; color:var(--text);}

/* Voucher card */
.voucher-card{
 background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:16px;
}
.vc-row{display:flex; align-items:baseline; justify-content:space-between; margin-bottom:10px;}
.vc-row .k{font-size:12.5px; color:var(--text-dim);}
.vc-row .v{font-size:13px; font-family:var(--mono); font-weight:600;}
.bar{height:8px; border-radius:5px; background:var(--panel-2); overflow:hidden; display:flex; margin-top:4px;}
.bar span{height:100%; display:block;}
.bar .used{background:var(--amber);}
.bar .expired{background:var(--red);}
.bar .free{background:var(--teal-dim);}
.legend{display:flex; gap:14px; margin-top:10px; flex-wrap:wrap;}
.legend .li{display:flex; align-items:center; gap:6px; font-size:11px; color:var(--text-dim);}
.legend i{width:8px; height:8px; border-radius:2px; display:inline-block;}

/* System info */
.sys-grid{
 display:grid; grid-template-columns:1fr 1fr; gap:8px;
}
.sys-item{
 background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:12px;
}
.sys-item .sk{font-size:11px; color:var(--text-dim); margin:0 0 4px;}
.sys-item .sv{font-size:13px; font-weight:600; font-family:var(--mono);}
.sys-bar{height:4px; border-radius:3px; background:var(--panel-2); overflow:hidden; margin-top:6px;}
.sys-bar span{height:100%; display:block; border-radius:3px;}

/* Active users list */
.user-list{display:flex; flex-direction:column; gap:0;}
.user-item{
 display:flex; align-items:center; gap:10px; padding:12px 0;
 border-bottom:1px solid var(--line);
}
.user-item:last-child{border-bottom:none;}
.u-av{
 width:34px; height:34px; border-radius:8px; display:flex;
 align-items:center; justify-content:center; font-weight:700;
 font-size:13px; flex:none;
}
.u-av.on{background:rgba(47,216,184,.15); color:var(--teal);}
.u-av.off{background:var(--panel-2); color:var(--text-dim);}
.u-body{flex:1; min-width:0;}
.u-name{font-size:13px; font-weight:600; display:flex; align-items:center; gap:5px;}
.u-meta{font-size:11px; color:var(--text-dim); margin-top:2px; display:flex; gap:8px; flex-wrap:wrap;}
.u-actions{display:flex; gap:4px; flex:none;}
.u-btn{
 width:30px; height:30px; border-radius:7px; border:1px solid var(--line);
 background:var(--panel); color:var(--text-dim); cursor:pointer;
 display:flex; align-items:center; justify-content:center; font-size:12px;
}
.u-btn:hover{background:var(--panel-2);}

/* Nav grid */
.nav{padding:20px 18px 24px;}
.nav h2{font-size:13px; font-weight:600; margin:0 0 10px;}
.navgrid{display:grid; grid-template-columns:1fr 1fr; gap:8px;}
.navitem{
 display:flex; align-items:center; gap:9px; padding:11px 12px;
 background:var(--panel); border:1px solid var(--line); border-radius:10px;
 font-size:12.5px; color:var(--text); text-decoration:none;
 transition: all 0.15s;
}
.navitem:hover{background:var(--panel-2);}
.navitem.active{background:rgba(47,216,184,.1); border-color:var(--teal-dim); color:var(--teal);}
.navitem .ic{font-size:14px; flex:none;}

/* Bottom nav */
.bottom-nav{
 margin-top:auto; display:flex; border-top:1px solid var(--line);
 background:var(--panel); position:sticky; bottom:0;
}
.bottom-nav a{
 flex:1; text-align:center; padding:10px 4px 12px; text-decoration:none;
 color:var(--text-dim); font-size:10.5px; display:flex; flex-direction:column;
 align-items:center; gap:4px;
}
.bottom-nav a.active{color:var(--teal);}
.bottom-nav .ic{font-size:17px;}

/* Forms */
.form-card{
 background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:16px;
 margin:14px 18px 0;
}
.form-card h3{font-size:13px; font-weight:600; margin:0 0 14px; display:flex; align-items:center; gap:6px;}
.form-group{margin-bottom:12px;}
.form-group label{display:block; font-size:11.5px; color:var(--text-dim); margin-bottom:5px; font-weight:600;}
.form-group input,.form-group select{
 width:100%; padding:10px 12px; background:var(--panel-2); border:1px solid var(--line);
 border-radius:8px; font-size:13px; color:var(--text); font-family:var(--font);
 transition:border-color 0.2s;
}
.form-group input:focus,.form-group select:focus{outline:none; border-color:var(--teal);}
.form-row{display:grid; grid-template-columns:1fr 1fr; gap:10px;}
.btn-submit{
 width:100%; padding:12px; border-radius:8px; border:none;
 font-size:13px; font-weight:700; cursor:pointer; font-family:var(--font);
 color:#062420; background:linear-gradient(160deg, var(--teal), var(--teal-dim));
 transition:opacity 0.2s;
}
.btn-submit:hover{opacity:0.9;}

/* Filter pills */
.pills{display:flex; gap:6px; flex-wrap:wrap; padding:0 18px; margin:12px 0;}
.pill{
 padding:6px 12px; border-radius:7px; font-size:11px; font-weight:600;
 text-decoration:none; background:var(--panel); color:var(--text-dim);
 border:1px solid var(--line); transition:all 0.15s;
}
.pill.active{background:rgba(47,216,184,.1); border-color:var(--teal-dim); color:var(--teal);}

/* Voucher row */
.v-row{
 display:flex; align-items:center; padding:12px 0;
 border-bottom:1px solid var(--line); gap:10px;
}
.v-row:last-child{border-bottom:none;}
.v-code{
 font-family:var(--mono); font-size:13px; font-weight:600;
 letter-spacing:1px; min-width:85px; flex:none;
}
.v-info{flex:1; min-width:0;}
.v-detail{font-size:11px; color:var(--text-dim);}
.v-status{
 padding:3px 8px; border-radius:5px; font-size:10px; font-weight:700;
 text-transform:uppercase; flex:none;
}
.v-status.unused{background:rgba(47,216,184,.15); color:var(--teal);}
.v-status.used{background:rgba(245,185,78,.15); color:var(--amber);}
.v-status.expired{background:var(--panel-2); color:var(--text-dim);}

/* Alert */
.alert{
 margin:14px 18px 0; padding:12px 14px; border-radius:10px;
 font-size:12.5px; font-weight:500;
}
.alert.success{background:rgba(47,216,184,.1); border:1px solid rgba(47,216,184,.3); color:var(--teal);}
.alert.danger{background:rgba(240,101,78,.12); border:1px solid rgba(240,101,78,.35); color:var(--red);}

/* Badge */
.badge{
 display:inline-flex; padding:3px 8px; border-radius:5px;
 font-size:10px; font-weight:700; text-transform:uppercase;
}
.badge.teal{background:rgba(47,216,184,.15); color:var(--teal);}
.badge.amber{background:rgba(245,185,78,.15); color:var(--amber);}
.badge.red{background:rgba(240,101,78,.15); color:var(--red);}
.badge.dim{background:var(--panel-2); color:var(--text-dim);}

/* Pulse */
.pulse{
 display:inline-block; width:7px; height:7px; border-radius:50%;
 background:var(--teal); animation:pulse 2s infinite;
}
@keyframes pulse{
 0%{box-shadow:0 0 0 0 rgba(47,216,184,.4);}
 70%{box-shadow:0 0 0 6px rgba(47,216,184,0);}
 100%{box-shadow:0 0 0 0 rgba(47,216,184,0);}
}

/* Section card (for lists) */
.sec-card{
 background:var(--panel); border:1px solid var(--line); border-radius:12px;
 margin:14px 18px 0; overflow:hidden;
}
.sec-hdr{
 padding:12px 14px; border-bottom:1px solid var(--line);
 display:flex; align-items:center; justify-content:space-between;
}
.sec-hdr h3{font-size:13px; font-weight:600; margin:0; display:flex; align-items:center; gap:6px;}
.sec-body{padding:4px 14px 10px;}

/* Info grid */
.info-grid{display:grid; grid-template-columns:1fr 1fr; gap:8px;}
.info-item{padding:10px 12px; background:var(--panel-2); border-radius:8px;}
.info-k{font-size:10.5px; color:var(--text-dim); text-transform:uppercase; letter-spacing:.5px; font-weight:600;}
.info-v{font-size:13px; font-weight:600; margin-top:2px;}

/* Print */
@media print{
 .topbar,.bottom-nav,.banner,.u-btn,.btn-submit{display:none!important}
 .app{max-width:100%}
 body{background:#fff; color:#000}
 .stat,.voucher-card,.sec-card,.form-card{break-inside:avoid; border:1px solid #ccc}
}

/* Desktop */
@media(min-width:769px){
 .app{max-width:520px}
}
