:root{--bg:#f4f7fb;--card:#fff;--text:#16213e;--muted:#7a879d;--line:#e6ebf2;--blue:#2e6df6;--green:#16b985;--red:#e84a5f;--orange:#ff9f43;--sidebar:#fff;--shadow:0 10px 30px rgba(34,61,98,.08)}
*{box-sizing:border-box}body{margin:0;font-family:Inter,"PingFang SC","Microsoft YaHei",Arial,sans-serif;background:var(--bg);color:var(--text)}a{text-decoration:none;color:inherit}.layout{min-height:100vh;display:grid;grid-template-columns:220px 1fr}.sidebar{background:var(--sidebar);border-right:1px solid var(--line);padding:18px 14px;display:flex;flex-direction:column;position:sticky;top:0;height:100vh}.brand{display:flex;align-items:center;gap:12px;padding:8px 6px 22px}.brand-logo{width:42px;height:42px;border-radius:12px;background:linear-gradient(135deg,#2e6df6,#6ca1ff);color:#fff;display:grid;place-items:center;font-weight:800;box-shadow:0 8px 20px rgba(46,109,246,.25)}.brand strong{display:block;font-size:17px}.brand small{display:block;color:var(--muted);margin-top:3px}.sidebar nav{display:flex;flex-direction:column;gap:6px}.sidebar nav a{padding:12px 14px;border-radius:10px;color:#58667b;font-weight:600}.sidebar nav a:hover,.sidebar nav a.active{background:#eaf1ff;color:var(--blue)}.sidebar-foot{margin-top:auto;border-top:1px solid var(--line);padding:16px 8px;color:var(--muted);display:flex;align-items:center;gap:8px;font-size:13px}.status-dot{width:8px;height:8px;background:var(--green);border-radius:50%;box-shadow:0 0 0 5px rgba(22,185,133,.1)}.main{min-width:0}.topbar{height:88px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 28px;position:sticky;top:0;z-index:5}.topbar h1{font-size:22px;margin:0}.topbar p{margin:6px 0 0;color:var(--muted);font-size:13px}.top-actions{display:flex;gap:12px;align-items:center}.user{font-weight:700}.content{padding:24px}.kpi-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:18px;margin-bottom:18px}.kpi{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:20px;display:flex;gap:16px;align-items:center;box-shadow:var(--shadow)}.kpi-icon{width:50px;height:50px;border-radius:50%;display:grid;place-items:center;font-size:20px}.kpi-icon.blue{background:#e8f0ff;color:var(--blue)}.kpi-icon.mint{background:#e7faf4;color:#18a97b}.kpi-icon.green{background:#e9f9ef;color:#0ea56b}.kpi-icon.orange{background:#fff2e2;color:var(--orange)}.kpi small{color:var(--muted);display:block}.kpi b{display:block;font-size:30px;margin:3px 0}.kpi em{font-style:normal;color:#a0a9b8;font-size:12px}.danger-text{color:var(--red)!important}.grid-main{display:grid;grid-template-columns:1.6fr .9fr;gap:18px}.span-2{grid-column:1/2}.card{background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow);padding:18px;margin-bottom:18px}.card-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:14px}.card-head h2{margin:0;font-size:18px}.card-head p{margin:5px 0 0;color:var(--muted);font-size:13px}.btn{border:1px solid var(--line);background:#fff;border-radius:9px;padding:9px 14px;cursor:pointer;font-weight:650;color:#42516a}.btn.primary{background:var(--blue);border-color:var(--blue);color:#fff}.btn.ghost{background:#fff}.btn.tiny{padding:6px 9px;font-size:12px}.link{color:var(--blue);font-size:13px;font-weight:700}.table-wrap{overflow:auto}table{width:100%;border-collapse:separate;border-spacing:0;font-size:13px}th{background:#f7f9fc;color:#66758c;text-align:left;padding:11px 12px;border-bottom:1px solid var(--line);white-space:nowrap}td{padding:12px;border-bottom:1px solid #eef1f5;vertical-align:middle;white-space:nowrap}td small{display:block;color:var(--muted);margin-top:4px}.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.badge{display:inline-flex;align-items:center;padding:4px 8px;border-radius:999px;font-size:12px;font-weight:700}.badge.ok{background:#e8f8f2;color:#0d9d6c}.badge.off{background:#fdecef;color:#d94d61}.badge.warn{background:#fff1e2;color:#dc7b13}.expire-list{display:flex;flex-direction:column}.expire-item{display:flex;justify-content:space-between;padding:12px 0;border-bottom:1px solid var(--line)}.expire-item:last-child{border:0}.expire-item strong,.expire-item span{display:block}.expire-item span,.expire-item small{font-size:12px;color:var(--muted);margin-top:4px}.expire-item .right{text-align:right}.expire-item .right small{color:var(--red);font-weight:700}.donut{width:170px;height:170px;border-radius:50%;margin:28px auto 18px;background:conic-gradient(var(--green) calc(var(--p)*1%),#e8edf4 0);display:grid;place-items:center;position:relative}.donut:after{content:"";position:absolute;width:112px;height:112px;background:white;border-radius:50%}.donut div{z-index:1;text-align:center}.donut b{display:block;font-size:26px}.donut span{color:var(--muted);font-size:12px}.legend{display:flex;justify-content:center;gap:16px;color:#66758c;font-size:12px}.dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:6px}.green-dot{background:var(--green)}.gray-dot{background:#c8d0dc}.form-grid{display:grid;grid-template-columns:repeat(4,minmax(160px,1fr));gap:14px;align-items:end}.form-grid.single{grid-template-columns:1fr}.form-grid label{display:flex;flex-direction:column;gap:7px;font-size:13px;color:#5e6d83;font-weight:650}.form-grid input,.form-grid select{height:40px;border:1px solid #dbe2ec;border-radius:8px;padding:0 11px;background:#fff;color:#243147;outline:none}.form-grid input:focus,.form-grid select:focus{border-color:#8fb2ff;box-shadow:0 0 0 3px rgba(46,109,246,.08)}.actions{display:flex;gap:6px}.empty{text-align:center;color:var(--muted);padding:24px!important}.alert{padding:10px 12px;border-radius:8px;margin-bottom:12px}.alert.danger{background:#fdecef;color:#c64055}.muted{color:var(--muted);font-size:12px}.login-body{min-height:100vh;display:grid;place-items:center;background:linear-gradient(135deg,#eef4ff,#f8fbff)}.login-card{width:min(420px,92vw);background:#fff;border:1px solid var(--line);border-radius:16px;padding:28px;box-shadow:0 24px 70px rgba(49,77,125,.14)}.login-brand{padding:0 0 22px}.login-card h2{margin:0 0 16px}.login-card .btn{width:100%}
@media(max-width:1100px){.kpi-grid{grid-template-columns:repeat(2,1fr)}.grid-main{grid-template-columns:1fr}.span-2{grid-column:auto}.form-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:720px){.layout{grid-template-columns:1fr}.sidebar{display:none}.topbar{padding:0 16px}.content{padding:14px}.kpi-grid{grid-template-columns:1fr}.form-grid{grid-template-columns:1fr}.topbar h1{font-size:18px}.topbar p{display:none}}

/* v2: multi-admin ownership + cleaner forms */
.user-box{display:flex;flex-direction:column;align-items:flex-end;line-height:1.15}.user-box strong{font-size:14px}.user-box span{font-size:11px;color:var(--muted);margin-top:4px}.alert.success{background:#e8f8f2;color:#0d8b62}.notice{background:#eef4ff;border:1px solid #d8e5ff;color:#49617f;padding:13px 15px;border-radius:10px;margin-bottom:18px}.owner-chip{display:inline-flex;align-items:center;padding:4px 8px;border-radius:999px;background:#eef4ff;color:#3567bd;font-weight:700;font-size:12px}.form-action{display:flex;align-items:flex-end}.full-btn{width:100%}.wide-field{grid-column:span 3}.license-form{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:14px;align-items:end}.license-form .field{display:flex;flex-direction:column;gap:7px;font-size:13px;color:#5e6d83;font-weight:650;min-width:0}.license-form input,.license-form select{width:100%;height:42px;border:1px solid #dbe2ec;border-radius:8px;padding:0 11px;background:#fff;color:#243147;outline:none}.license-form input:focus,.license-form select:focus{border-color:#8fb2ff;box-shadow:0 0 0 3px rgba(46,109,246,.08)}.license-form small{font-size:11px;color:var(--muted);font-weight:500}.license-form .lspan-2{grid-column:span 2}.license-form .lspan-3{grid-column:span 3}.license-form .lspan-4{grid-column:span 4}.license-form .lspan-6{grid-column:span 6}.license-form .lspan-8{grid-column:span 8}.license-form .lspan-10{grid-column:span 10}.license-form .lspan-12{grid-column:span 12}.license-table{min-width:980px}.actions{display:flex;gap:6px;flex-wrap:wrap;align-items:center}.actions form{margin:0}.inline-reset{display:flex;gap:6px;align-items:center}.inline-reset input{height:31px;width:110px;border:1px solid #dbe2ec;border-radius:7px;padding:0 8px}.admin-create-form{grid-template-columns:1.1fr 1.1fr 1.2fr auto}.customer-form{grid-template-columns:repeat(4,minmax(160px,1fr)) auto}.product-form{grid-template-columns:1.1fr 1fr .7fr 1.4fr auto}.product-form .form-action,.customer-form .form-action,.admin-create-form .form-action{height:40px}.product-form .form-action .btn,.customer-form .form-action .btn,.admin-create-form .form-action .btn{height:40px;white-space:nowrap}
@media(max-width:1200px){.license-form .lspan-3{grid-column:span 6}.license-form .lspan-2{grid-column:span 3}.license-form .lspan-10{grid-column:span 9}.product-form,.customer-form,.admin-create-form{grid-template-columns:repeat(2,1fr)}.wide-field{grid-column:span 2}}
@media(max-width:760px){.license-form{grid-template-columns:1fr}.license-form .lspan-2,.license-form .lspan-3,.license-form .lspan-4,.license-form .lspan-6,.license-form .lspan-8,.license-form .lspan-10,.license-form .lspan-12{grid-column:1}.product-form,.customer-form,.admin-create-form{grid-template-columns:1fr}.wide-field{grid-column:auto}.user-box{display:none}}

/* ================================================================
   V3.1 — dashboard visual system. No external CDN or JS dependency.
   ================================================================ */
:root{--bg:#f5f8fd;--text:#192f50;--muted:#8290a8;--line:#e8edf6;--blue:#2673fa;--green:#10a976;--red:#e94f60;--orange:#fa9239;--shadow:0 5px 28px rgba(41,86,153,.045)}
body{font-family:Inter,"PingFang SC","Microsoft YaHei",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:var(--bg);color:var(--text);line-height:1.5}
.ui-icon{display:inline-block;flex:none;width:19px;height:19px;stroke:currentColor;stroke-width:1.85;stroke-linecap:round;stroke-linejoin:round;fill:none;vertical-align:middle}
.layout{grid-template-columns:236px minmax(0,1fr)}
.sidebar{padding:0 13px 20px;box-shadow:none;border-color:#e7edf8;z-index:21;overflow-y:auto}
.brand{padding:24px 9px 26px;gap:11px;min-height:104px}
.brand-logo,.brand-uploaded{width:46px;height:46px;border-radius:13px;flex:none;object-fit:contain;background:linear-gradient(145deg,#1a67ec,#5d9eff);color:white;display:grid;place-items:center;box-shadow:0 9px 17px rgba(40,112,242,.19);font-size:18px;letter-spacing:.5px;font-weight:800}
.brand strong{font-size:15px;color:#0f2648;letter-spacing:.1px;line-height:1.35}.brand small{font-size:11px;color:#93a1b5;margin-top:3px;white-space:nowrap}
.brand-label{min-width:0}.brand-label strong{display:block;max-width:135px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.nav-section-label{padding:6px 14px 9px;color:#a0acc0;font-size:10px;font-weight:800;letter-spacing:1.6px}.nav-section-label-spaced{margin-top:18px;padding-top:15px;border-top:1px solid #edf1f8}
.sidebar nav{gap:4px}.sidebar nav a{min-height:44px;padding:10px 13px;display:flex;align-items:center;gap:13px;border-radius:9px;color:#566a87;font-size:13.5px;transition:background .15s,color .15s}
.sidebar nav a .ui-icon{color:#90a0b8;width:19px;height:19px}
.sidebar nav a:hover{background:#f4f7fc;color:#2d65cb}.sidebar nav a.active{background:#e8f1ff;color:#1766ed;font-weight:750;box-shadow:inset 3px 0 0 #347ef9}
.sidebar nav a.active .ui-icon{color:#2774f5}
.sidebar-foot{margin-top:auto;border-top:1px solid #ecf0f7;padding:19px 13px 6px;gap:11px;font-size:12px}
.sidebar-foot b{display:block;font-size:12px;color:#637590;font-weight:700}.sidebar-foot small{display:block;color:#a2adc0;margin-top:1px}
.main{display:flex;min-width:0;flex-direction:column;min-height:100vh}
.topbar{height:88px;min-height:88px;padding:0 30px;position:sticky;z-index:15;border-bottom:1px solid #e7ecf5;box-shadow:0 2px 15px rgba(48,84,133,.025)}
.topbar-heading{display:flex;align-items:center;gap:14px;min-width:0}.topbar h1{font-size:21px;font-weight:800;letter-spacing:-.45px;color:#172c4d}.topbar p{color:#96a2b6;font-size:12px;margin-top:3px}
.top-actions{gap:13px}.top-shortcut{display:flex;align-items:center;gap:6px;color:#3c70cd;font-size:12px;font-weight:750;padding:9px 13px;border-radius:9px;background:#f2f6fe}.top-shortcut:hover{background:#e8f1ff}.top-shortcut .ui-icon{width:15px;height:15px}.topbar-divider{height:26px;width:1px;background:#e7ebf3;margin:0 1px}
.user-avatar{display:grid;place-items:center;background:#e9f1ff;color:#2970f0;border:1px solid #dce9ff;border-radius:50%;width:37px;height:37px;flex:none;font-size:17px;font-weight:800}.user-box{text-align:left;align-items:flex-start}.user-box strong{font-size:12px;color:#213756}.user-box span{font-size:11px;margin-top:3px}
.btn.logout{padding:8px;border:0;background:transparent;display:grid;place-items:center;color:#98a6bb}.btn.logout:hover{background:#f3f6fc;color:#346eec}.btn.logout .ui-icon{width:18px;height:18px}
.content{width:100%;max-width:1740px;margin:0 auto;padding:24px 30px 46px;flex:1}
.main-footer{padding:18px 30px;border-top:1px solid #e9eef6;text-align:center;color:#a6b1c3;font-size:11px}
.card{padding:20px 22px;border:1px solid #e9edf5;border-radius:14px;box-shadow:var(--shadow);margin-bottom:0;min-width:0}
.card-head{min-height:40px;margin-bottom:19px}.card-head h2{font-size:16px;font-weight:800;color:#1b3050}.card-head p{font-size:12px;color:#9aa7bb;margin-top:4px}
.btn{border-radius:8px;font-size:12px;font-weight:730;padding:10px 14px;display:inline-flex;align-items:center;justify-content:center;gap:6px;transition:background .15s,transform .15s}.btn:hover{transform:translateY(-1px)}.btn.primary{background:#2673f9;border-color:#2673f9;box-shadow:0 5px 12px rgba(39,112,242,.14)}.btn.primary:hover{background:#155fdd}.btn .ui-icon{width:16px;height:16px}
.link{display:inline-flex;align-items:center;gap:2px;white-space:nowrap;color:#567bb7;font-size:12px;font-weight:700}.link:hover{color:#2169e4}.link .ui-icon{width:13px;height:13px}
table{font-size:12.5px}th{padding:13px 14px;background:#f7f9fd;color:#687b99;font-size:11.5px;font-weight:750;border-bottom:1px solid #e9eff8}td{padding:13px 14px;white-space:nowrap;color:#50617b}td strong{color:#223655}tbody tr:hover{background:#fbfdff}tbody tr:last-child td{border-bottom:0}td small{color:#9aa7b9}.muted-time{color:#98a5b8;font-size:11px}.badge{font-size:11px}.badge.neutral{background:#f1f4f8;color:#8b9aaf}.badge.ok{color:#099668;background:#e8f8f1}.badge.ok i{width:6px;height:6px;background:#06a77b;border-radius:50%;margin-right:5px}.badge.warn{color:#ee821b;background:#fff2e5}
.form-grid input,.form-grid select,.license-form input,.license-form select{border-radius:9px;border-color:#e0e8f3;min-height:42px}.form-grid label,.license-form .field{color:#63728d}
.login-card{border-radius:18px;box-shadow:0 16px 55px rgba(28,76,155,.11)}
.overview-intro{display:flex;justify-content:space-between;align-items:center;gap:18px;margin:0 0 22px;flex-wrap:wrap}
.overview-eyebrow{color:#5287e0;letter-spacing:1.05px;font-size:10px;font-weight:800;margin-bottom:7px;display:flex;align-items:center;gap:9px}.overview-eyebrow span{background:#a5c9ff;width:17px;height:1px}
.overview-intro h2{margin:0;font-size:23px;letter-spacing:-.5px;font-weight:800;color:#152b4d}.overview-intro p{color:#93a1b8;font-size:12px;margin:5px 0 0}.overview-actions{display:flex;align-items:center;gap:9px}.secondary-action{border-color:#e1eafa;background:#fff;color:#4f6e9c}
.kpi-grid{gap:16px;margin-bottom:17px}.kpi{border-radius:14px;padding:23px 19px;min-height:137px;align-items:flex-start;gap:14px;position:relative;overflow:hidden;box-shadow:var(--shadow)}
.kpi-icon{width:58px;height:58px;border-radius:50%;flex:none}.kpi-icon .ui-icon{width:28px;height:28px;stroke-width:2}.kpi-icon.blue{background:#eaf2ff;color:#2e79ff}.kpi-icon.mint{background:#e3f8f1;color:#09ad86}.kpi-icon.green{background:#e6f9eb;color:#11a75a}.kpi-icon.orange{background:#fff1e2;color:#f28d2f}
.kpi-body{padding-top:2px}.kpi small{font-size:12px;font-weight:650;color:#657796}.kpi b{font-size:33px;line-height:1.1;letter-spacing:-.8px;margin:7px 0 6px;color:#1c3151}.kpi em{font-size:11px;color:#a0adc2}.kpi .text-green{color:#08a66e}.kpi .danger-text{color:#e34d5d!important}.kpi-corner{position:absolute;right:17px;bottom:15px;color:#dbe5f5;transform:rotate(-40deg)}.kpi-corner .ui-icon{width:18px;height:18px}
.dashboard-primary{display:grid;grid-template-columns:minmax(0,1.9fr) minmax(295px,.98fr);gap:17px;margin-bottom:17px}.dashboard-primary .card{min-height:345px}
.card-products .table-wrap{margin:0 -5px}.product-ident{display:flex;align-items:center;gap:10px;min-width:160px}.product-ident strong{display:block;max-width:185px;overflow:hidden;text-overflow:ellipsis}.product-ident small{display:block;margin-top:2px}.product-logo,.product-fallback{height:34px;width:34px;border-radius:8px;flex:none;object-fit:cover}.product-fallback{display:grid;place-items:center;color:#2c77ed;background:#eaf2ff}.product-fallback .ui-icon{width:19px;height:19px}.product-fallback.tone-1{background:#e9e7ff;color:#7566e3}.product-fallback.tone-2{background:#e8f8f3;color:#09ae7b}.product-fallback.tone-3{background:#fff0e6;color:#e58b3a}.product-fallback.tone-4{background:#fceafe;color:#be5dd2}.card-bottom{border-top:1px solid #edf1f7;margin-top:10px;padding-top:14px;text-align:center}
.expire-item{display:flex;align-items:center;gap:11px;padding:11px 0;border-color:#eef1f6}.expire-icon{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:#eaf2ff;color:#598de5;flex:none}.expire-icon .ui-icon{height:16px;width:16px}.expire-detail{flex:1;min-width:0}.expire-detail strong{display:block;color:#2d3d57;font-size:12px}.expire-detail span{font-size:11px;color:#96a4b8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.expire-days{text-align:right;min-width:50px}.expire-days small{display:block;color:#96a2b6;font-size:11px}.expire-days b{display:block;font-size:12px;color:#e5545c}
.dashboard-empty{min-height:190px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;color:#a2aec0;text-align:center}.dashboard-empty .ui-icon{width:32px;height:32px;color:#bdccdf;margin-bottom:6px}.dashboard-empty strong{color:#7c8ca6;font-weight:750;font-size:12px}.dashboard-empty span{font-size:11px;color:#a6b4c5}.empty-expire{min-height:235px}
.dashboard-analytics{display:grid;grid-template-columns:minmax(0,1.22fr) minmax(0,1fr) minmax(280px,.95fr);gap:17px;margin-bottom:17px}.dashboard-analytics .card{min-height:300px}.soft-tag{display:inline-block;padding:6px 12px;color:#6784ae;background:#f3f6fb;border:1px solid #e9eff8;border-radius:8px;font-size:11px}
.chart-area{display:flex;gap:9px;height:190px;margin:14px 4px 9px 0}.chart-grid{display:flex;flex-direction:column;justify-content:space-between;text-align:right;color:#aab6c8;font-size:10px;width:23px;padding-bottom:19px}.bars{min-width:0;flex:1;display:flex;align-items:stretch;justify-content:space-around;gap:9px;background:repeating-linear-gradient(to top,transparent 0,transparent calc(50% - 1px),#eef2f8 50%,transparent calc(50% + 1px));border-bottom:1px solid #e5ebf6}
.bar-item{display:flex;flex:1;max-width:60px;min-width:16px;flex-direction:column;align-items:center;justify-content:flex-end;gap:6px;text-align:center;position:relative}.bar-value{font-size:10px;color:#547399;font-weight:700}.bar-track{width:100%;height:132px;display:flex;align-items:flex-end;justify-content:center}.bar-fill{background:linear-gradient(180deg,#65a4ff,#2a72f5);border-radius:5px 5px 0 0;width:80%;min-height:3px;transition:height .3s}.bar-fill.is-empty{background:#e4ecf8}.bar-item small{font-size:10px;color:#899bb6;padding-bottom:3px}.chart-note{font-size:10.5px;color:#9ca9bd;display:flex;align-items:center;gap:6px;margin-top:10px}.chart-note .ui-icon{width:13px;height:13px;color:#72a4ef}.chart-note strong{color:#4772b8}
.breakdown-layout{display:flex;align-items:center;justify-content:center;gap:21px;margin:33px auto 20px;flex-wrap:wrap}.product-donut{width:160px;height:160px;min-width:160px;display:grid;place-items:center;border-radius:50%;position:relative}.product-donut:before{content:'';position:absolute;inset:30px;background:#fff;border-radius:50%}.product-donut div{position:relative;z-index:1;text-align:center}.product-donut b{font-size:26px;color:#192d4a;display:block}.product-donut small{font-size:11px;color:#9ba9bd;display:block}.breakdown-legend{min-width:118px;flex:1}.breakdown-legend>div{display:flex;align-items:center;gap:7px;margin:8px 0;font-size:11px;color:#506788}.breakdown-legend strong{margin-left:auto;font-weight:750;color:#31476b}.legend-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:150px}.legend-marker{width:8px;height:8px;border-radius:50%;flex:none}.no-breakdown{color:#a3aec0!important}
.activity-list{display:flex;flex-direction:column}.activity-item{padding:10px 0;display:flex;gap:9px;align-items:center;border-bottom:1px solid #edf1f6}.activity-item:last-child{border:0}.activity-icon{width:27px;height:27px;display:grid;place-items:center;border-radius:50%;flex:none}.activity-icon .ui-icon{width:14px;height:14px}.activity-icon.success{background:#e7f9f2;color:#0eaa79}.activity-icon.failure{background:#fff0f2;color:#e9606d}.activity-item>div{min-width:0;flex:1}.activity-item strong{display:block;font-size:11px;color:#293d5e;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.activity-item div span{font-size:10px;color:#a2afc1;white-space:nowrap}.activity-item>small{font-size:9px;color:#a4b0c0;white-space:nowrap}.activity-empty{min-height:215px}
.admin-overview{margin-bottom:0}.admin-overview summary{display:flex;align-items:center;justify-content:space-between;gap:12px;cursor:pointer;list-style:none}.admin-overview summary::-webkit-details-marker{display:none}.admin-overview summary>span{display:flex;align-items:center;gap:9px;flex-wrap:wrap}.admin-overview summary .ui-icon{color:#7190c0}.admin-overview summary strong{font-size:14px;color:#253c60}.admin-overview summary small{font-size:11px;color:#98a6ba;margin-left:3px}.admin-overview .table-wrap{margin-top:18px}
.mobile-menu{display:none;background:#fff;border:1px solid #e7eef9;border-radius:8px;color:#5a76a2;width:38px;height:38px;align-items:center;justify-content:center}.nav-overlay{display:none}
@media(max-width:1380px){.dashboard-analytics{grid-template-columns:minmax(0,1.1fr) minmax(0,1fr)}.analytics-activity{grid-column:1/-1;min-height:auto!important}.activity-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 15px}.overview-intro h2{font-size:21px}}
@media(max-width:1100px){.dashboard-primary{grid-template-columns:1fr}.dashboard-primary .card{min-height:auto}.dashboard-analytics{grid-template-columns:repeat(2,minmax(0,1fr))}.kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:820px){.layout{grid-template-columns:1fr}.sidebar{position:fixed;left:0;top:0;bottom:0;height:100vh;width:248px;transform:translateX(-101%);transition:transform .2s;box-shadow:8px 0 25px rgba(24,61,112,.08);display:flex}.nav-open .sidebar{transform:translateX(0)}.nav-overlay{position:fixed;inset:0;background:rgba(25,43,68,.25);z-index:20;display:none}.nav-open .nav-overlay{display:block}.mobile-menu{display:inline-flex}.topbar{padding:0 18px;height:74px;min-height:74px}.topbar h1{font-size:17px}.top-shortcut{display:none}.content{padding:18px}.main-footer{padding:18px}.dashboard-primary{grid-template-columns:1fr}.dashboard-analytics{grid-template-columns:1fr}.analytics-activity{grid-column:auto}.activity-list{display:flex}}
@media(max-width:540px){.kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.kpi{padding:13px 10px;gap:8px;min-height:105px}.kpi-icon{height:35px;width:35px}.kpi-icon .ui-icon{width:18px;height:18px}.kpi b{font-size:24px}.kpi small{font-size:10px}.kpi em{font-size:9px}.kpi-corner{display:none}.card{padding:15px}.card-head{align-items:flex-start}.card-head h2{font-size:14px}.card-head p{font-size:10px}.card-head .btn{font-size:10px;padding:8px}.overview-actions{width:100%}.user-box{display:none}.topbar-heading p{display:none}.brand{padding-top:22px}.topbar-divider{display:none}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important;animation:none!important}}

.nav-overlay[hidden]{display:none!important}

/* V3.2: full-width brand artwork + per-admin editable persistent avatar */
.sidebar .brand:has(.brand-wide-image){height:106px;min-height:106px;display:flex;align-items:center;justify-content:center;padding:10px 0 12px;margin:0;text-decoration:none}
.brand-wide-image{display:block;width:100%;height:82px;max-width:210px;object-fit:contain;object-position:center;background:transparent;flex:none;border-radius:0;box-shadow:none}
.admin-avatar-form{position:relative;display:flex;align-items:center;justify-content:center;width:40px;height:40px;flex:none;margin:0;cursor:pointer;border-radius:50%;overflow:hidden;transition:box-shadow .15s ease}
.admin-avatar-form:hover,.admin-avatar-form:focus-within{box-shadow:0 0 0 3px rgba(38,115,250,.19)}
.admin-avatar-form .user-avatar{width:40px;height:40px;overflow:hidden;flex:none}
.admin-avatar-form .user-avatar img{width:100%;height:100%;object-fit:cover;display:block}
.avatar-file-picker{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;z-index:3;font-size:0}
.avatar-edit-hint{position:absolute;inset:auto 0 0;z-index:2;display:flex;align-items:center;justify-content:center;height:17px;background:rgba(18,43,81,.65);color:white;opacity:0;pointer-events:none;transition:opacity .15s ease}
.avatar-edit-hint .ui-icon{width:12px;height:12px}
.admin-avatar-form:hover .avatar-edit-hint,.admin-avatar-form:focus-within .avatar-edit-hint{opacity:1}
.avatar-fallback-submit{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.site-logo-preview{width:210px;height:84px;border:1px dashed #cbd7e9;border-radius:9px;display:flex;align-items:center;justify-content:center;margin:12px 0 18px;padding:5px;color:#8a97aa;font-size:12px;background:#fff}
.site-logo-preview img{display:block;width:100%;height:100%;object-fit:contain}
.logo-upload-controls{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.logo-upload-controls input{min-width:0;max-width:100%;font-size:13px}
@media(max-width:820px){.sidebar .brand:has(.brand-wide-image){height:100px;min-height:100px}.brand-wide-image{max-width:205px;height:78px}}


/* V3.3: actionable dashboard KPIs */
.kpi-link{color:inherit;text-decoration:none;cursor:pointer;transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}
.kpi-link:hover{transform:translateY(-3px);border-color:#bcd4ff;box-shadow:0 14px 32px rgba(45,92,164,.12)}
.kpi-link:focus-visible{outline:3px solid #4b88f6;outline-offset:3px}
.kpi-link:hover .kpi-corner{color:#367df4;transform:translate(2px,-2px) rotate(-40deg)}
.kpi-corner{transition:transform .18s ease,color .18s ease}
#license-list{scroll-margin-top:105px}
.license-filters{display:flex;flex-wrap:wrap;gap:8px;margin:-2px 0 16px}
.filter-chip{display:inline-flex;align-items:center;padding:7px 13px;font-size:12px;font-weight:700;color:#6780a7;border:1px solid #e0e8f4;border-radius:999px;background:#fff}
.filter-chip:hover,.filter-chip:focus-visible{color:#2168df;border-color:#93b8ff}
.filter-chip.selected{background:#eaf2ff;color:#2468d5;border-color:#a9c7ff}
.extend-open:disabled{opacity:.45;cursor:not-allowed}
/* Native modal, focus stays inside while visible. */
.extend-dialog{border:1px solid #e5ecf6;border-radius:16px;padding:0;width:min(440px,calc(100vw - 28px));max-height:calc(100vh - 40px);color:#1d3050;box-shadow:0 30px 90px rgba(17,38,74,.23)}
.extend-dialog::backdrop{background:rgba(17,35,64,.50)}
.extend-form{padding:22px 24px 24px}
.extend-dialog-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:14px}
.extend-dialog-head h2{font-size:19px;font-weight:800;margin:0}
.extend-close{border:0;background:transparent;color:#7b8da8;font-size:26px;line-height:1;cursor:pointer;padding:2px 8px;border-radius:8px}
.extend-close:hover,.extend-close:focus-visible{background:#f2f5fb;color:#224d99}
.extend-license-info{padding:11px 12px;background:#f4f7fc;border-radius:9px;color:#637796;font-size:12px;line-height:1.6;overflow-wrap:anywhere;margin:0 0 18px}
.extend-days-label{display:block;font-size:13px;font-weight:750;color:#485a76;margin-bottom:7px}
.extend-form #extend-days{display:block;width:100%;border:1px solid #cbdaf1;border-radius:9px;height:44px;padding:0 12px;color:#1c3050;font-size:17px}
.extend-form #extend-days:focus-visible{outline:3px solid #bfd6ff;border-color:#357cfa}
.extend-hint{font-size:12px;line-height:1.65;color:#8391a8;margin:9px 0 20px}
.extend-dialog-actions{display:flex;gap:10px;justify-content:flex-end}
.extend-dialog-actions .btn{min-width:106px}
@media(max-width:500px){.extend-form{padding:18px}.extend-dialog-actions .btn{flex:1}}


/* V3.3: customer avatars on dashboard, authorization list and customer list */
.client-avatar{width:36px;height:36px;flex:none;display:grid;place-items:center;position:relative;overflow:hidden;border-radius:50%;background:#e9f2ff;color:#497dbf;border:1px solid #dce8fa;font-size:14px;font-weight:800;line-height:1}
.client-avatar-fallback{position:relative;z-index:0;display:grid;place-items:center;width:100%;height:100%}
.client-avatar img{position:absolute;inset:0;z-index:1;display:block;width:100%;height:100%;object-fit:cover;background:#fff}
.client-avatar.unbound{background:#f2f5fa;color:#9cabc0}
.client-avatar.unbound .ui-icon{width:18px;height:18px}
.client-avatar-sm{width:30px;height:30px;font-size:12px}
.activity-customer-avatar{width:29px;height:29px;font-size:12px}
.client-name-cell{display:inline-flex;align-items:center;gap:9px;vertical-align:middle;min-width:0}
.client-name-cell>span:last-child{min-width:0}
.client-name-cell small{display:block;margin-top:2px}


/* V3.4: inline customer avatar upload and customer edit modal */
.customer-table .client-name-cell{min-width:120px}
.customer-avatar-form{display:inline-flex;align-items:center;justify-content:center;margin:0;flex:none}
.customer-avatar-trigger{position:relative;display:inline-grid;place-items:center;width:36px;height:36px;border-radius:50%;cursor:pointer}
.customer-avatar-trigger .client-avatar{width:36px;height:36px;font-size:13px;pointer-events:none}
.customer-avatar-picker{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;z-index:3;font-size:0}
.customer-avatar-trigger:hover,.customer-avatar-trigger:focus-within{box-shadow:0 0 0 3px rgba(39,113,247,.22)}
.customer-avatar-camera{position:absolute;bottom:-2px;right:-2px;display:grid;place-items:center;border-radius:50%;background:#2673f9;color:#fff;width:15px;height:15px;font-size:9px;z-index:2;pointer-events:none;border:1px solid white;line-height:1}
.customer-edit-dialog{width:min(520px,calc(100vw - 28px))}
.customer-edit-fields{display:flex;flex-direction:column;gap:13px;margin-bottom:23px}
.customer-edit-fields label{display:flex;flex-direction:column;gap:7px;color:#4e6283;font-size:13px;font-weight:700}
.customer-edit-fields input,.customer-edit-fields textarea{font:inherit;width:100%;border:1px solid #cbdaf1;border-radius:9px;padding:10px 12px;color:#1c3050;background:#fff}
.customer-edit-fields input{min-height:43px}
.customer-edit-fields textarea{min-height:100px;resize:vertical;line-height:1.5}
.customer-edit-fields input:focus-visible,.customer-edit-fields textarea:focus-visible{outline:3px solid #bfd6ff;border-color:#367cf9}
.customer-edit-fields label span{color:#df536b}
.customer-table th:last-child,.customer-table td:last-child{text-align:right}
@media(max-width:500px){.customer-edit-dialog .extend-form{padding:18px}.customer-edit-dialog .extend-dialog-actions{gap:8px}}


/* V3.5 product and customer management */
.product-name-cell{display:inline-flex;align-items:center;gap:10px;min-width:0;max-width:380px}
.product-name-cell > span:last-child{min-width:0;white-space:normal;overflow-wrap:anywhere}
.product-name-cell strong{display:block}
.product-name-cell small{display:block;white-space:normal;line-height:1.5;max-width:300px}
.product-logo-form{display:inline-flex;margin:0;flex:none}
.product-logo-trigger{position:relative;display:grid;place-items:center;width:42px;height:42px;cursor:pointer;border-radius:10px}
.product-logo-image{display:grid;place-items:center;overflow:hidden;flex:none;width:40px;height:40px;border-radius:9px;background:#edf3ff;color:#3976e6}
.product-logo-image img{width:100%;height:100%;object-fit:contain}
.product-logo-image .ui-icon{width:21px;height:21px}
.product-logo-picker{position:absolute;inset:0;width:100%;height:100%;opacity:0;z-index:3;cursor:pointer;font-size:0}
.product-logo-trigger:hover,.product-logo-trigger:focus-within{box-shadow:0 0 0 3px #d4e3ff}
.product-logo-camera{position:absolute;bottom:-3px;right:-3px;border:1px solid white;color:#fff;background:#347dfa;border-radius:50%;font-size:9px;line-height:1;display:grid;place-items:center;width:16px;height:16px;pointer-events:none}
.product-row-actions{gap:7px;flex-wrap:nowrap}.product-table{min-width:970px}
.btn.danger-outline{border-color:#f7cad1;color:#d83b59;background:#fff}.btn.danger-outline:hover{background:#fff1f4}
.btn.danger-solid{border-color:#e84762;color:#fff;background:#e84762}.btn.danger-solid:hover{background:#d63250}
.delete-warning{background:#fff2f3;color:#a9324c;border:1px solid #ffced6;border-radius:9px;line-height:1.75;padding:12px;font-size:13px;white-space:pre-line;margin:0 0 16px}
.confirm-label{display:block;font-size:13px;font-weight:700;color:#485a76;margin-bottom:7px}
.product-delete-dialog input,.customer-delete-dialog input{display:block;width:100%;height:44px;border:1px solid #cbdaf1;border-radius:9px;padding:0 12px;margin-bottom:20px;font:inherit;color:#1d3050}
.product-delete-dialog input:focus-visible,.customer-delete-dialog input:focus-visible{outline:3px solid #bfd6ff}
.customer-table td:last-child{white-space:nowrap}.customer-table td:last-child .btn{margin-left:6px}
.kpi-link{position:relative;pointer-events:auto!important}.kpi-link::after{content:'';position:absolute;inset:0;z-index:1;border-radius:inherit}
.kpi-link:focus-visible{outline:3px solid #367cf9;outline-offset:2px}

/* V3.6: full-width uploaded brand on login, no adjacent title or subtitles */
.login-brand-wide{height:88px;display:flex;align-items:center;justify-content:center;width:100%;margin:0 0 18px;overflow:hidden}
.login-logo-wide{width:100%;max-width:350px;height:88px;display:block;object-fit:contain;object-position:center;background:transparent;border:0;box-shadow:none;border-radius:0}
.login-fallback-brand{font-size:20px;font-weight:800;color:#15356a;text-align:center}
@media(max-width:450px){.login-brand-wide,.login-logo-wide{height:76px}}

/* V3.6.1: focused visual adjustments */
.login-card .login-heading{text-align:center;}
.license-table .actions{display:flex;flex-wrap:nowrap;align-items:center;gap:6px;}
.license-table .actions form{display:inline-flex;flex:0 0 auto;margin:0;}
.license-table .actions .btn.tiny{flex:0 0 auto;min-width:44px;white-space:nowrap;text-align:center;}
.license-table th:last-child,.license-table td:last-child{min-width:176px;}
