:root{font-family:Inter,"Microsoft YaHei",system-ui,sans-serif;color:#182235;background:#f4f7fb;font-synthesis:none}*{box-sizing:border-box}body{margin:0;background:#f4f7fb}button,input,textarea,select{font:inherit}button,.button{border:0;border-radius:8px;padding:10px 16px;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;transition:.16s ease}.hidden{display:none!important}.primary{background:#1769e0;color:#fff}.primary:hover{background:#0f5bc8}.secondary{background:#eef3fa;color:#31445f}.secondary:hover{background:#e2eaf5}.danger{background:#c63c3c;color:#fff}.wide{width:100%}.error{color:#c33;margin-top:12px}.muted{color:#718096;font-size:13px}.brand-mark{display:grid;place-items:center;width:38px;height:38px;border-radius:10px;background:linear-gradient(145deg,#2f80ed,#1257ba);color:#fff;font-size:21px;font-weight:800;box-shadow:0 7px 18px #1769e044}.brand,.login-brand{display:flex;gap:11px;align-items:center}.brand b,.login-brand b{display:block;font-size:17px}.brand small,.login-brand small{display:block;color:#93a8c8;margin-top:2px}

.login-page{min-height:100vh;background:radial-gradient(circle at 18% 20%,#234b7d 0,#142d50 36%,#0d1f38 100%);display:grid;place-items:center;padding:80px 20px;position:relative}.login-brand{position:absolute;top:30px;left:4vw;color:#fff}.login-card{width:min(430px,94vw);background:#fff;padding:36px;border-radius:18px;box-shadow:0 24px 70px #06142666}.login-card h1{margin:0 0 8px}.login-card>p{color:#718096;margin:0 0 26px}.login-card label,.form-grid label{font-size:13px;font-weight:600;color:#42526a}.login-card input,.form-grid input,.form-grid textarea,.command-grid input,.command-grid select,.command-grid textarea,.search{width:100%;margin:7px 0 16px;padding:11px 12px;border:1px solid #d4ddea;border-radius:8px;background:#fff;outline:none}.login-card input:focus,.form-grid input:focus,.form-grid textarea:focus,.command-grid input:focus,.command-grid textarea:focus,.search:focus{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61a}

.app-shell{min-height:100vh}.sidebar{position:fixed;left:0;top:0;bottom:0;width:236px;background:#122a49;color:#fff;padding:20px 14px;display:flex;flex-direction:column;z-index:40}.brand{padding:2px 9px 24px}.sidebar nav{flex:1}.nav-caption{font-size:11px;letter-spacing:.12em;color:#7088aa;padding:20px 13px 7px}.nav-item{width:100%;justify-content:flex-start;gap:12px;background:transparent;color:#c3d1e4;margin:3px 0;padding:10px 12px}.nav-item span{display:grid;place-items:center;width:25px;height:25px;border-radius:7px;background:#ffffff12;color:#aecdff;font-size:12px}.nav-item:hover{background:#ffffff0c;color:#fff}.nav-item.active{background:#1769e0;color:#fff;box-shadow:0 6px 16px #061b3877}.nav-item.active span{background:#fff;color:#1769e0}.sidebar-foot{border-top:1px solid #ffffff12;padding:17px 10px 0;display:grid;grid-template-columns:1fr auto;align-items:center}.sidebar-foot small{grid-column:1;color:#7890b2}.sidebar-foot b{grid-column:1}.sidebar-foot button{grid-column:2;grid-row:1/3;background:transparent;color:#b8c8de;padding:6px}.workspace{margin-left:236px;min-height:100vh}.topbar{height:84px;background:#fff;border-bottom:1px solid #e5eaf1;display:flex;align-items:center;justify-content:space-between;padding:0 32px;position:sticky;top:0;z-index:30}.topbar h1{font-size:22px;margin:0}.topbar p{font-size:13px;color:#75839a;margin:4px 0 0}.top-actions,.toolbar{display:flex;align-items:center;gap:10px}.menu-toggle{display:none;background:transparent;color:#27364e;font-size:22px;padding:7px}.topbar-title{display:flex;align-items:center;gap:8px}main{padding:26px 30px 50px;max-width:1680px;margin:auto}

.stats{display:grid;grid-template-columns:repeat(6,1fr);gap:14px}.stats-3{grid-template-columns:repeat(3,1fr)}.stat-card,.panel{background:#fff;border:1px solid #e8edf4;border-radius:12px;box-shadow:0 5px 18px #2439540b}.stat-card{padding:19px 20px;position:relative;overflow:hidden}.stat-card:after{content:"";position:absolute;width:48px;height:48px;border-radius:50%;background:#1769e00d;right:-12px;top:-12px}.stat-card b{font-size:25px;display:block;white-space:nowrap}.stat-card span{color:#718096;font-size:13px;margin-top:5px;display:block}.stat-card.green b,.detail-kpi.green b{color:#109664}.dashboard-grid{display:grid;grid-template-columns:2fr 1fr;gap:18px;margin-top:18px}.panel{padding:20px;margin-bottom:18px}.panel.span-2{min-width:0}.panel-title{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:16px}.panel-title h2{font-size:17px;margin:0}.panel-title p{color:#7b899f;font-size:12px;margin:4px 0 0}.link-button,.text-action{background:none;color:#1769e0;padding:5px}.search{margin:0;width:280px}.table-wrap{overflow:auto}table{border-collapse:collapse;width:100%;min-width:680px}th,td{text-align:left;padding:12px 11px;border-bottom:1px solid #edf1f6;font-size:13px;vertical-align:middle}th{color:#637188;font-weight:600;background:#fafbfd;white-space:nowrap}tbody tr{transition:.12s}tbody tr:hover{background:#f7faff}tbody tr[onclick]{cursor:pointer}.badge{display:inline-flex;align-items:center;gap:6px;padding:4px 9px;border-radius:20px;white-space:nowrap}.badge i{width:6px;height:6px;border-radius:50%;background:currentColor}.badge.on{background:#dcf7e9;color:#07814c}.badge.off{background:#edf1f5;color:#687386}.truncate{max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.table-action{background:#edf4ff;color:#1769e0;padding:6px 10px}.text-action{display:block;padding:0;font-weight:700}.text-action+small{color:#8290a4;display:block;margin-top:2px}code{white-space:pre-wrap;word-break:break-all;font-family:"Cascadia Mono",Consolas,monospace;color:#34445d}.empty{text-align:center!important;color:#8a97aa!important;padding:35px!important}.notice{background:#fff8e8;border:1px solid #f7df9c;color:#795c16;border-radius:8px;padding:11px 13px;font-size:13px;margin-bottom:15px}

.event-list{display:flex;flex-direction:column}.event-item{display:grid;grid-template-columns:14px 1fr auto;gap:11px;align-items:start;padding:13px 4px;border-bottom:1px solid #edf1f6}.event-item:last-child{border-bottom:0}.event-dot{width:9px;height:9px;border-radius:50%;background:#8aa0ba;margin-top:5px}.event-dot.online{background:#13a268}.event-dot.offline{background:#8b98a9}.event-dot.registered{background:#1769e0}.event-dot.updated{background:#b7780b}.event-dot.error{background:#d34b4b}.event-item b{font-size:13px}.event-item p{font-size:12px;color:#6f7e93;margin:3px 0 0}.event-item time{font-size:11px;color:#8d99aa;white-space:nowrap}.event-list.compact .event-item{grid-template-columns:12px 1fr}.event-list.compact time{grid-column:2}.event-device{display:flex;flex-wrap:wrap;gap:6px 12px;margin-top:7px}.event-device span{font-size:11px;color:#64748b;background:#f1f5f9;border-radius:5px;padding:3px 6px}.event-list.compact .event-device span:last-child{display:none}.pagination{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:16px;color:#718096;font-size:12px}.pagination>div{display:flex;align-items:center;gap:8px}.pagination button{background:#eef3fa;color:#33455f;padding:7px 11px}.pagination button:disabled{opacity:.45;cursor:not-allowed}.pagination b{min-width:55px;text-align:center;color:#40506a}

.modal-open{overflow:hidden}.modal{position:fixed;inset:0;background:#0b182b99;z-index:100;display:flex;justify-content:center;align-items:flex-start;padding:4vh 24px;overflow:auto}.modal-card{width:min(1180px,96vw);background:#fff;border-radius:16px;box-shadow:0 30px 90px #0a152b66;padding:24px;min-height:420px}.modal-card.small-modal{width:min(760px,96vw);min-height:0}.add-form{margin-top:24px}.modal-head{display:flex;justify-content:space-between;align-items:start}.modal-head h2{margin:0}.modal-head p{color:#738096;font-size:13px;margin:5px 0 0}.icon-button{background:#eef2f7;color:#4b5a70;width:36px;height:36px;border-radius:50%;font-size:25px;padding:0}.detail-kpis{display:grid;grid-template-columns:repeat(6,1fr);gap:10px;margin:20px 0}.detail-kpi{background:#f7f9fc;border:1px solid #edf1f6;border-radius:9px;padding:12px;min-width:0}.detail-kpi span{font-size:11px;color:#7c8a9e;display:block}.detail-kpi b{font-size:15px;display:block;margin-top:5px;overflow-wrap:anywhere}.tabs{display:flex;gap:4px;border-bottom:1px solid #e7ecf3;margin-bottom:20px}.tabs button{background:transparent;color:#66748a;border-radius:0;padding:11px 15px;border-bottom:2px solid transparent}.tabs button.active{color:#1769e0;border-color:#1769e0;font-weight:700}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 18px}.form-grid .full{grid-column:1/-1}.form-grid textarea{min-height:92px;resize:vertical}.form-actions,.section-actions{display:flex;justify-content:flex-end;align-items:center;gap:10px}.section-actions{justify-content:space-between}.button{font-size:13px}.command-grid{display:grid;grid-template-columns:150px 250px 1fr auto;gap:10px;align-items:start}.command-grid input,.command-grid select,.command-grid textarea{margin:0}.command-grid textarea{min-height:44px;height:44px;resize:vertical}.toast{position:fixed;right:28px;bottom:28px;background:#1769e0;color:#fff;padding:13px 18px;border-radius:9px;box-shadow:0 12px 35px #10284d55;z-index:200}.error-toast{background:#c43d3d}

@media(max-width:1150px){.stats{grid-template-columns:repeat(3,1fr)}.dashboard-grid{grid-template-columns:1fr}.detail-kpis{grid-template-columns:repeat(3,1fr)}.command-grid{grid-template-columns:1fr 1fr}.command-grid textarea{grid-column:1/-1}.command-grid .danger{justify-self:end}}
@media(max-width:800px){.sidebar{transform:translateX(-100%);transition:.2s}.sidebar.open{transform:translateX(0);box-shadow:10px 0 35px #0e1d3566}.workspace{margin-left:0}.menu-toggle{display:inline-flex}.topbar{height:auto;min-height:78px;padding:12px 15px}.top-actions .secondary{display:none}main{padding:16px 12px 35px}.stats{grid-template-columns:repeat(2,1fr)}.stats-3{grid-template-columns:1fr}.toolbar{width:100%;align-items:stretch}.search{width:100%}.panel-title{align-items:flex-start;flex-direction:column}.detail-kpis{grid-template-columns:repeat(2,1fr)}.form-grid{grid-template-columns:1fr}.form-grid .full{grid-column:auto}.modal{padding:12px}.modal-card{padding:17px}.tabs{overflow:auto}.tabs button{white-space:nowrap}.command-grid{grid-template-columns:1fr}.command-grid textarea{grid-column:auto}.topbar-title p{display:none}}

.form-grid select{width:100%;margin:7px 0 16px;padding:11px 12px;border:1px solid #d4ddea;border-radius:8px;background:#fff;outline:none}.form-grid select:focus{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61a}.export-form{margin-top:24px}.export-modal-card{width:min(620px,96vw)!important}.export-summary{background:#f4f7fb;border:1px solid #e5ebf3;border-radius:8px;color:#65758b;font-size:13px;padding:12px 14px;margin:-1px 0 20px}

.command-preset-panel{display:grid;grid-template-columns:260px 1fr;gap:12px;align-items:stretch;margin-bottom:14px}.command-preset-panel label{font-size:12px;font-weight:700;color:#506077}.command-preset-panel select{display:block;width:100%;margin-top:6px;padding:10px 12px;border:1px solid #d4ddea;border-radius:8px;background:#fff;outline:none}.command-help{display:flex;flex-direction:column;justify-content:center;gap:5px;background:#f3f7fd;border:1px solid #dfe9f7;border-radius:9px;padding:11px 14px;color:#53657d}.command-help b{font-size:13px;color:#274669}.command-help span{font-size:12px;line-height:1.55}.command-help.risk{background:#fff5f2;border-color:#f2cbc1}.command-help.risk b{color:#b23d2c}@media(max-width:800px){.command-preset-panel{grid-template-columns:1fr}}

.section-subtitle{display:flex;justify-content:space-between;align-items:center;margin:24px 0 10px}.section-subtitle b{display:block;font-size:14px}.section-subtitle span{display:block;color:#8290a4;font-size:12px;margin-top:3px}.command-status{display:inline-flex;padding:3px 8px;border-radius:12px;background:#eef2f7;color:#5f6d80;white-space:nowrap}.command-status.sent{background:#e7f0ff;color:#1769e0}.command-status.responded{background:#dcf7e9;color:#07814c}.command-status.failed{background:#fde8e5;color:#b43b2e}

.device-form-actions .form-actions-spacer{flex:1}.delete-modal-card{width:min(560px,96vw)!important}.danger-notice{margin:22px 0 18px;padding:14px 16px;border:1px solid #f1c3bd;border-radius:9px;background:#fff4f2;color:#8f3026;font-size:13px;line-height:1.7}.danger-notice code{color:#8f3026;font-weight:700}.delete-confirm-label{display:block;font-size:13px;font-weight:600;color:#42526a}.delete-confirm-label input{display:block;width:100%;margin:7px 0 20px;padding:11px 12px;border:1px solid #d4ddea;border-radius:8px;outline:none}.delete-confirm-label input:focus{border-color:#c63c3c;box-shadow:0 0 0 3px #c63c3c1a}.danger:disabled{opacity:.45;cursor:not-allowed}

.location-cell{min-width:245px;display:grid;gap:3px;line-height:1.35}.location-cell>span{color:#243954;white-space:nowrap}.location-cell small{color:#718096;max-width:360px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.location-empty{color:#718096}.location-estimate{background:#f4f8ff;border:1px solid #dbe9fb;border-radius:9px;padding:12px 14px;margin:0 0 16px;display:grid;gap:5px;color:#42526a;font-size:13px}.location-estimate b{color:#1769e0}.location-estimate small{color:#718096}
.coordinate-copy{background:#edf4ff;color:#1769e0;border-radius:5px;padding:2px 7px;font-size:11px;line-height:1.5}.coordinate-copy:hover{background:#dbeaff}.location-actions{display:flex;gap:6px;flex-wrap:wrap;margin-top:3px}
