:root{--brand:#005E6D;--accent:#2EC4B6;--bg:#f4f6f9;--card:#fff;--line:#e3e8ee;--tx:#1b2733;--mut:#6b7a8a;--ok:#16a34a;--warn:#d97706;--err:#dc2626;--r:12px;--side:248px;
--brand-soft:color-mix(in srgb,var(--brand) 9%,#fff);--brand-dark:color-mix(in srgb,var(--brand) 82%,#000)}
*{box-sizing:border-box}html{-webkit-text-size-adjust:100%}
body{margin:0;font:15px/1.5 system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;color:var(--tx);background:var(--bg)}
a{color:var(--brand);text-decoration:none}a:hover{text-decoration:underline}
h1,h2,h3{line-height:1.25;margin:0}code,pre.code{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:.88em}
code{background:#eef2f6;padding:1px 5px;border-radius:4px}pre.code{background:#eef2f6;padding:10px;border-radius:8px;overflow:auto;word-break:break-all;white-space:pre-wrap}
.muted{color:var(--mut)}.small{font-size:13px}.right{text-align:right}.nowrap{white-space:nowrap}.mt{margin-top:16px}.mb{margin-bottom:16px}
.ico{width:20px;height:20px;flex:none}
/* buttons / forms */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:40px;padding:0 16px;border:1px solid var(--line);border-radius:10px;background:#fff;color:var(--tx);font:inherit;font-weight:600;cursor:pointer;text-decoration:none!important;transition:.15s}
.btn:hover{background:#f1f5f9}.btn-primary{background:var(--brand);border-color:var(--brand);color:#fff}.btn-primary:hover{background:var(--brand-dark)}
.btn-danger{color:var(--err);border-color:#f3c4c4}.btn-danger:hover{background:#fef2f2}.btn-sm{min-height:32px;padding:0 10px;font-size:13px;border-radius:8px}.btn-block{width:100%}
.field{display:block;margin-bottom:14px}.field>span{display:block;font-size:13px;font-weight:600;margin-bottom:5px;color:#3b4a5a}
.field small{display:block;margin-top:4px;color:var(--mut);font-size:12px}
input[type=text],input[type=password],input[type=url],input[type=number],input[type=date],input[type=search],input:not([type]),select,textarea{width:100%;min-height:42px;padding:9px 12px;border:1px solid #cdd6df;border-radius:10px;background:#fff;color:var(--tx);font:inherit}
textarea{min-height:90px;resize:vertical}input:focus,select:focus,textarea:focus{outline:0;border-color:var(--brand);box-shadow:0 0 0 3px color-mix(in srgb,var(--brand) 18%,transparent)}
input[type=file]{font:inherit;max-width:100%}.check{display:flex;align-items:center;gap:8px;font-weight:600;margin-bottom:14px}.check input{width:18px;height:18px;accent-color:var(--brand)}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:0 16px}.row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.alert{padding:11px 14px;border-radius:10px;margin-bottom:14px;border:1px solid;font-size:14px}
.alert-success{background:#f0fdf4;border-color:#bbf7d0;color:#166534}.alert-error{background:#fef2f2;border-color:#fecaca;color:#991b1b}.alert-warn{background:#fffbeb;border-color:#fde68a;color:#92400e}.alert-info{background:var(--brand-soft);border-color:#cfe3e6;color:var(--brand-dark)}
/* auth */
.auth-body{min-height:100vh;display:flex;align-items:center;justify-content:center;background:linear-gradient(160deg,var(--brand-soft),#f4f6f9 60%)}
.auth-wrap{width:100%;max-width:400px;padding:20px 16px}.auth-card{background:#fff;border:1px solid var(--line);border-radius:16px;padding:26px;box-shadow:0 10px 30px rgba(15,40,60,.08)}
.auth-brand{display:flex;align-items:center;gap:12px;margin-bottom:20px}.auth-brand small{display:block;color:var(--mut)}.auth-foot{text-align:center;color:var(--mut);font-size:13px;margin-top:16px}
.brand-logo{width:40px;height:40px;border-radius:10px;object-fit:contain;flex:none}.brand-logo.sm{width:30px;height:30px;border-radius:8px}.brand-logo.lg{width:48px;height:48px}
.brand-logo-fallback{display:inline-flex;align-items:center;justify-content:center;background:var(--brand);color:#fff;font-weight:800}
/* admin shell */
.sidebar{position:fixed;inset:0 auto 0 0;width:var(--side);background:#fff;border-right:1px solid var(--line);display:flex;flex-direction:column;z-index:30;transition:transform .2s}
.side-brand{display:flex;align-items:center;gap:10px;padding:18px 16px;color:var(--tx);text-decoration:none!important;border-bottom:1px solid var(--line)}
.side-brand-text strong{display:block;font-size:14px;line-height:1.2}.side-brand-text small{color:var(--mut);font-size:12px}
.side-nav{padding:12px 10px;display:flex;flex-direction:column;gap:3px;flex:1}
.side-nav a{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:10px;color:#3b4a5a;font-weight:600;text-decoration:none!important}
.side-nav a:hover{background:#f1f5f9}.side-nav a.active{background:var(--brand-soft);color:var(--brand)}
.side-foot{padding:12px;border-top:1px solid var(--line)}.side-user{display:flex;align-items:center;gap:8px;padding:4px 6px 10px;font-weight:600}
.avatar{width:30px;height:30px;border-radius:50%;background:var(--brand);color:#fff;display:inline-flex;align-items:center;justify-content:center;font-size:13px}
.side-logout{width:100%;display:flex;align-items:center;gap:10px;padding:9px 12px;border:0;background:none;border-radius:10px;color:var(--mut);font:inherit;font-weight:600;cursor:pointer}.side-logout:hover{background:#fef2f2;color:var(--err)}
.main{margin-left:var(--side);padding:28px 32px 20px;min-height:100vh;max-width:1400px}
.page-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:20px;flex-wrap:wrap}.page-head h1{font-size:24px}
.main-foot{margin-top:36px;color:var(--mut);font-size:12px;text-align:center}
.topbar{display:none}.navtoggle{display:none}.nav-backdrop{display:none}
/* cards / tables */
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--r);padding:20px;margin-bottom:20px;box-shadow:0 1px 2px rgba(15,40,60,.04)}
.card h2{font-size:16px;margin-bottom:14px}.card-flush{padding:0;overflow:hidden}.card-flush h2{padding:18px 20px 0}
.kpis{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:14px;margin-bottom:20px}
.kpi{background:#fff;border:1px solid var(--line);border-radius:var(--r);padding:16px 18px;border-top:3px solid var(--brand)}
.kpi .l{font-size:12px;color:var(--mut);text-transform:uppercase;letter-spacing:.04em;font-weight:700}.kpi .v{font-size:28px;font-weight:800;margin:4px 0 2px}.kpi .s{font-size:12.5px;color:var(--mut)}
.cols{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:20px}.cols .card{margin-bottom:0}
.tbl-wrap{overflow-x:auto}table{width:100%;border-collapse:collapse;font-size:14px}
th{text-align:left;font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:var(--mut);padding:11px 14px;background:#f8fafc;border-bottom:1px solid var(--line);white-space:nowrap}
td{padding:11px 14px;border-bottom:1px solid #eef2f6;vertical-align:middle}tr:last-child td{border-bottom:0}tbody tr:hover td{background:#fafcfd}
.thumb{width:84px;height:34px;object-fit:cover;border-radius:6px;background:#eef2f6;display:block}
.badge{display:inline-block;padding:2px 9px;border-radius:99px;font-size:12px;font-weight:700;background:#eef2f6;color:#475569;white-space:nowrap}
.b-ok{background:#dcfce7;color:#166534}.b-err{background:#fee2e2;color:#991b1b}.b-warn{background:#fef3c7;color:#92400e}.b-brand{background:var(--brand-soft);color:var(--brand)}.b-sp{background:#ede9fe;color:#5b21b6}
.hbars{display:flex;flex-direction:column;gap:11px}.hbar-top{display:flex;justify-content:space-between;gap:10px;font-size:13.5px;margin-bottom:4px}
.hbar-label{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.hbar-val small{color:var(--mut);margin-left:4px}
.hbar-track{height:8px;background:#eef2f6;border-radius:99px;overflow:hidden}.hbar-fill{height:100%;background:linear-gradient(90deg,var(--brand),var(--accent));border-radius:99px}
.vchart{display:flex;align-items:flex-end;gap:6px;height:170px;padding-top:8px}.vcol{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:100%;min-width:0}
.vbars{display:flex;align-items:flex-end;gap:2px;width:100%;height:100%;justify-content:center}.vbar{width:42%;max-width:18px;border-radius:4px 4px 0 0;min-height:2px}
.vbar.i{background:var(--brand)}.vbar.c{background:var(--accent)}.vlab{font-size:10.5px;color:var(--mut);margin-top:5px;white-space:nowrap}
.legend{display:flex;gap:14px;font-size:12.5px;color:var(--mut);margin-bottom:6px}.legend i{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:5px}
.toolbar{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:16px;align-items:center}.toolbar input{max-width:340px}
dl.kv{display:grid;grid-template-columns:160px 1fr;gap:8px 14px;margin:0}dl.kv dt{color:var(--mut);font-size:13px}dl.kv dd{margin:0;word-break:break-all}
.img-prev{max-width:100%;border-radius:10px;border:1px solid var(--line);margin-bottom:10px}
@media(max-width:900px){
 .topbar{display:flex;align-items:center;gap:10px;position:sticky;top:0;z-index:20;height:54px;padding:0 12px;background:#fff;border-bottom:1px solid var(--line)}
 .topbar-menu{display:inline-flex;padding:8px;border-radius:8px;cursor:pointer}.topbar-brand{display:flex;align-items:center;gap:8px;font-weight:700;color:var(--tx)}
 .sidebar{transform:translateX(-100%)}.navtoggle:checked~.sidebar{transform:none;box-shadow:0 0 40px rgba(0,0,0,.2)}
 .navtoggle:checked~.nav-backdrop{display:block;position:fixed;inset:0;background:rgba(15,25,35,.4);z-index:25}
 .main{margin-left:0;padding:18px 14px}.grid2{grid-template-columns:1fr}.page-head h1{font-size:20px}dl.kv{grid-template-columns:1fr}.cols{grid-template-columns:1fr}}
/* ---- end-user /device/ page ---- */
.dev-body{background:linear-gradient(180deg,var(--brand) 0,var(--brand) 190px,var(--bg) 190px);min-height:100vh}
.dev-wrap{max-width:560px;margin:0 auto;padding:16px 14px 40px}
.dev-top{display:flex;align-items:center;justify-content:space-between;color:#fff;padding:6px 2px 18px}
.dev-brand{display:flex;align-items:center;gap:10px;font-weight:800;font-size:18px}.dev-brand .brand-logo{background:#fff;padding:3px}
.lang{display:flex;background:rgba(255,255,255,.18);border-radius:99px;padding:3px}.lang a{color:#fff;padding:5px 12px;border-radius:99px;font-size:13px;font-weight:700;text-decoration:none!important}.lang a.on{background:#fff;color:var(--brand)}
.dev-card{background:#fff;border-radius:18px;padding:20px;margin-bottom:14px;box-shadow:0 6px 24px rgba(15,40,60,.1)}
.dev-card h1{font-size:21px;margin-bottom:4px}.dev-card h2{font-size:17px;margin-bottom:12px}.dev-card p.lead{color:var(--mut);margin:0 0 16px}
.dev-card input,.dev-card select{min-height:50px;font-size:16px;border-radius:12px}
.dev-card .btn{min-height:50px;font-size:16px;border-radius:12px}.dev-card .btn-sm{min-height:40px;font-size:14px;padding:0 14px}
.keyin{letter-spacing:.35em;text-align:center;font-size:22px!important;font-weight:700}
.pl{display:flex;gap:12px;align-items:center;padding:14px 0;border-bottom:1px solid #eef2f6}.pl:last-child{border-bottom:0}
.pl-ic{width:42px;height:42px;border-radius:12px;background:var(--brand-soft);color:var(--brand);display:flex;align-items:center;justify-content:center;font-weight:800;font-size:12px;flex:none}
.pl-main{flex:1;min-width:0}.pl-name{font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pl-sub{font-size:12.5px;color:var(--mut);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pl-act{display:flex;gap:6px;flex:none}
.seg{display:grid;grid-template-columns:1fr 1fr;background:#eef2f6;border-radius:12px;padding:4px;margin-bottom:16px}.seg label{text-align:center;padding:11px 6px;border-radius:9px;font-weight:700;cursor:pointer;color:var(--mut)}
.seg input{position:absolute;opacity:0;pointer-events:none}.seg label:has(input:checked){background:#fff;color:var(--brand);box-shadow:0 1px 4px rgba(0,0,0,.12)}
.dev-meta{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:13px;color:var(--mut);margin-bottom:6px}
.dev-note{font-size:12.5px;color:var(--mut);text-align:center;padding:6px 10px;line-height:1.5}
.dev-foot{display:flex;justify-content:space-between;align-items:center;margin-top:4px}
details.pl-edit{margin-top:10px}details.pl-edit summary{cursor:pointer;color:var(--brand);font-weight:700;list-style:none}
@media(max-width:480px){.kpis{grid-template-columns:1fr 1fr}}
