:root {
    color-scheme: dark;
    --bg: #090b0d;
    --surface: #12161a;
    --surface-2: #181e23;
    --line: #2d363d;
    --text: #f5f7f8;
    --muted: #97a4ac;
    --cyan: #45d5e8;
    --amber: #ffbd45;
    --green: #56d98b;
    --coral: #ff6d5b;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--text); background: var(--bg); font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: 0; }
button, input, select { font: inherit; letter-spacing: 0; }
[hidden] { display: none !important; }
.admin-topbar { min-height: 74px; padding: 0 max(28px, calc((100% - 1280px) / 2)); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.admin-brand { display: flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; font-weight: 850; }
.admin-brand img { width: 45px; height: 45px; object-fit: contain; }
.admin-brand small { display: block; color: var(--cyan); font-size: 9px; }
nav { display: flex; align-items: center; gap: 18px; }
nav a, .quiet { color: var(--muted); background: none; border: 0; text-decoration: none; cursor: pointer; }
nav a:hover, .quiet:hover { color: var(--text); }
.admin-shell { width: min(1280px, calc(100% - 48px)); margin: 0 auto; padding: 44px 0 70px; }
.page-title, .panel-title, .list-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.page-title { margin-bottom: 32px; }
.page-title h1 { margin: 2px 0 7px; font-size: 36px; }
.page-title span, .panel-title span { color: var(--muted); font-size: 13px; }
.section-label { margin: 0; color: var(--cyan); font-size: 11px; font-weight: 850; }
.online-dot { display: flex; align-items: center; gap: 9px; color: var(--green); font-size: 13px; font-weight: 700; }
.online-dot i { width: 9px; height: 9px; border-radius: 50%; background: var(--green); }
.panel { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.assign-panel { margin-bottom: 42px; padding: 24px; border-top: 3px solid var(--cyan); }
.activity-panel { margin-bottom: 32px; padding: 22px 24px; }
.activity-list { display: grid; gap: 1px; background: var(--line); }
.activity-row { display: flex; align-items: center; gap: 16px; padding: 10px 12px; background: var(--surface); font-size: 13px; }
.activity-row > span:first-child { flex: 1; min-width: 0; }
.activity-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.activity-action { color: var(--muted); font-size: 11px; }
.activity-row button { padding: 6px 10px; border: 1px solid var(--coral); border-radius: 4px; color: var(--coral); background: transparent; cursor: pointer; }
.panel-title { margin-bottom: 20px; }
.panel-title h2, .list-heading h2 { margin: 3px 0 0; font-size: 22px; }
.assign-form { display: grid; grid-template-columns: 1fr 0.85fr 0.8fr 1.35fr 0.9fr 0.9fr auto; gap: 12px; align-items: end; }
label { display: block; color: #dce2e5; font-size: 12px; font-weight: 750; }
input, select { width: 100%; height: 44px; margin-top: 7px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; outline: none; color: var(--text); background: #0d1114; }
input:focus, select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(69, 213, 232, 0.12); }
.source-url { grid-column: span 3; }
.assign-form > button { height: 44px; padding: 0 16px; border: 0; border-radius: 6px; color: #061014; background: var(--cyan); cursor: pointer; font-weight: 850; white-space: nowrap; }
.assign-form > button span { margin-left: 15px; font-size: 20px; }
.list-heading { margin-bottom: 17px; }
.list-heading input { max-width: 310px; margin: 0; }
.device-list { display: grid; gap: 10px; }
.device-row { min-height: 94px; padding: 17px 18px; border: 1px solid var(--line); border-radius: 7px; display: grid; grid-template-columns: 230px 145px minmax(220px, 1fr) auto; gap: 22px; align-items: center; background: var(--surface); }
.device-mac-row { display: flex; align-items: center; gap: 8px; }
.device-mac { color: var(--text); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 17px; font-weight: 800; text-decoration: none; }
.device-mac:hover, .device-mac:focus { color: var(--cyan); outline: none; }
.copy-mac { height: 28px; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: var(--surface-2); cursor: pointer; font-size: 10px; font-weight: 800; }
.copy-mac:hover, .copy-mac:focus, .copy-mac.copied { color: var(--green); border-color: #35684a; outline: none; }
.device-main span, .device-row small { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; }
.status { display: inline-block; padding: 5px 7px; border: 1px solid var(--line); border-radius: 4px; color: var(--amber); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.status.active { color: var(--green); border-color: #35684a; }
.status.blocked { color: var(--coral); border-color: #78433d; }
.profiles { display: flex; flex-wrap: wrap; gap: 7px; }
.profile-pill { min-height: 43px; padding: 4px 4px 4px 10px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: var(--surface-2); }
.profile-pill small { display: block; margin-top: 2px; font-size: 10px; font-weight: 400; }
.profile-pill.selected { color: var(--text); border-color: var(--cyan); }
.profile-pill button { width: 24px; height: 24px; border: 0; color: var(--muted); background: transparent; cursor: pointer; font-size: 18px; }
.device-actions { display: flex; gap: 7px; }
.device-actions button { height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px; color: var(--text); background: var(--surface-2); cursor: pointer; font-size: 11px; font-weight: 750; }
.device-actions .good { color: var(--green); }
.device-actions .danger { color: var(--coral); }
.alert { margin-bottom: 20px; padding: 13px 15px; border: 1px solid #35684a; border-radius: 6px; color: var(--green); background: var(--surface); }
.alert.error { border-color: #78433d; color: var(--coral); }
.empty { padding: 45px; border: 1px dashed var(--line); border-radius: 7px; color: var(--muted); text-align: center; }
.muted { color: var(--muted); font-size: 12px; }
.login-page { display: grid; place-items: center; }
.login-shell { width: min(920px, calc(100% - 32px)); min-height: 520px; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.login-brand, .login-form { padding: 52px; display: flex; flex-direction: column; justify-content: center; }
.login-brand { border-right: 1px solid var(--line); background: #0c1013; }
.login-brand img { width: 130px; height: 100px; object-fit: contain; object-position: left center; }
.login-brand p { margin: 18px 0 7px; color: var(--cyan); font-size: 11px; font-weight: 850; }
.login-brand h1 { margin: 0 0 15px; font-size: 34px; line-height: 1.1; }
.login-brand span { color: var(--muted); line-height: 1.6; }
.login-form h2 { margin: 5px 0 24px; font-size: 26px; }
.login-form label { margin-bottom: 17px; }
.login-form input { height: 50px; }
.login-form button { width: 100%; height: 52px; margin-top: 4px; padding: 0 15px; border: 0; border-radius: 6px; display: flex; justify-content: space-between; align-items: center; color: #061014; background: var(--cyan); cursor: pointer; font-weight: 850; }
@media (max-width: 1050px) { .assign-form { grid-template-columns: 1fr 1fr 1fr; } .device-row { grid-template-columns: 1fr 140px; } .profiles, .device-actions { grid-column: span 2; } }
@media (max-width: 700px) { .admin-shell { width: calc(100% - 28px); padding-top: 28px; } .page-title, .panel-title, .list-heading { align-items: flex-start; flex-direction: column; } .assign-form { grid-template-columns: 1fr; } .list-heading input { max-width: none; } .device-row { grid-template-columns: 1fr; } .profiles, .device-actions { grid-column: auto; } .login-shell { grid-template-columns: 1fr; } .login-brand { padding: 30px; border-right: 0; border-bottom: 1px solid var(--line); } .login-form { padding: 30px; } }
.reseller-grid { display: grid; grid-template-columns: 1.2fr 1.2fr 1.5fr 0.7fr auto; align-items: end; gap: 12px; }
.reseller-grid input[type="file"] { padding: 9px; }
.reseller-grid button, .reseller-row button, .reseller-actions button { min-height: 44px; padding: 0 16px; border: 1px solid var(--cyan); border-radius: 6px; color: var(--text); background: var(--surface-2); cursor: pointer; font-weight: 750; }
.reseller-grid button:hover, .reseller-row button:hover, .reseller-actions button:hover { background: #17404b; }
.reseller-list { display: grid; gap: 1px; background: var(--line); }
.reseller-row { display: flex; align-items: center; gap: 16px; padding: 12px; background: var(--surface); }
.reseller-row > div:first-child { flex: 1; }
.reseller-row small { display: block; color: var(--muted); margin-top: 4px; }
.reseller-row form { display: flex; gap: 8px; align-items: center; }
.reseller-row input { width: 155px; margin: 0; }
.reseller-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.reseller-actions input { margin-top: 7px; }
.api-token { display: block; padding: 12px; margin: 10px 0; overflow-wrap: anywhere; background: #0d1114; border: 1px solid var(--green); color: var(--green); }
@media (max-width: 1050px) { .reseller-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .reseller-row { flex-wrap: wrap; } }
@media (max-width: 700px) { .reseller-grid { grid-template-columns: 1fr; } .reseller-row { align-items: stretch; flex-direction: column; } .reseller-row form { flex-wrap: wrap; } }
