:root {
    --navy: #172057;
    --navy-dark: #0b123b;
    --yellow: #ffca0a;
    --green: #32b957;
    --ink: #152039;
    --muted: #667085;
    --line: #e4e8f1;
    --surface: #f5f7fb;
    --white: #ffffff;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--surface); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: inherit; text-decoration: none; }
.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.topbar { min-height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 13px; }
.brand img { width: 48px; height: 48px; object-fit: contain; }
.brand span { display: grid; gap: 2px; }
.brand strong { color: var(--navy); font-size: 1rem; letter-spacing: .01em; }
.brand small { color: var(--muted); font-size: .76rem; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: 9px; font: inherit; font-weight: 700; cursor: pointer; }
.button-primary { color: var(--white); background: var(--navy); }
.button-primary:hover { background: var(--navy-dark); }
.button-secondary { color: var(--navy); background: var(--white); border-color: var(--line); }
.hero { min-height: 500px; display: grid; grid-template-columns: 1.4fr .8fr; gap: 70px; align-items: center; padding: 70px 0; border-top: 1px solid var(--line); }
.eyebrow { margin: 0 0 18px; color: #5d6690; font-size: .72rem; font-weight: 800; letter-spacing: .18em; }
.hero h1, .auth-card h1, .dashboard-heading h1 { margin: 0; color: var(--navy-dark); font-size: clamp(2.6rem, 6vw, 5.4rem); line-height: .98; letter-spacing: -.055em; }
.hero h1 span { color: var(--navy); }
.lead { max-width: 700px; margin: 28px 0; color: #4c5872; font-size: 1.15rem; line-height: 1.75; }
.status-row { display: flex; align-items: center; flex-wrap: wrap; gap: 22px; font-size: .88rem; }
.status { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; }
.status i { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 5px rgba(50,185,87,.12); }
.status-ok i { background: var(--green); }
.status-warning i { background: var(--yellow); box-shadow: 0 0 0 5px rgba(255,202,10,.15); }
.muted { color: var(--muted); }
.overview-card { padding: 30px; color: var(--white); background: linear-gradient(145deg, var(--navy), var(--navy-dark)); border-radius: 18px; box-shadow: 0 24px 60px rgba(23,32,87,.18); }
.card-label { margin: 0 0 20px; color: #b9c2ec; font-size: .69rem; font-weight: 800; letter-spacing: .16em; }
.metric { display: flex; justify-content: space-between; gap: 15px; padding: 18px 0; border-top: 1px solid rgba(255,255,255,.13); }
.metric span { color: #dce1fa; }
.metric strong { color: #62dc84; font-size: .82rem; }
.metric .pending { color: var(--yellow); }
.capabilities { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--white); }
.capabilities article { min-height: 220px; padding: 28px; border-right: 1px solid var(--line); }
.capabilities article:last-child { border-right: 0; }
.capabilities .icon { display: inline-grid; place-items: center; width: 38px; height: 38px; margin-bottom: 26px; color: var(--navy); background: #eef0fa; border-radius: 9px; font-size: .75rem; font-weight: 800; }
.capabilities h2 { margin: 0 0 12px; font-size: 1rem; }
.capabilities p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.65; }
footer { display: flex; justify-content: space-between; padding: 38px 0 45px; color: var(--muted); font-size: .78rem; }
.auth-page { display: grid; place-items: center; background: radial-gradient(circle at top, #eef1fb 0, var(--surface) 45%); }
.auth-shell { width: min(440px, calc(100% - 32px)); padding: 45px 0; }
.auth-shell > .brand { margin: 0 0 30px 8px; }
.auth-card { padding: 38px; background: var(--white); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 24px 60px rgba(23,32,87,.1); }
.auth-card h1 { font-size: 2.4rem; }
.auth-card form { display: grid; gap: 18px; margin-top: 30px; }
.auth-card label { display: grid; gap: 8px; color: #34405a; font-size: .85rem; font-weight: 700; }
.auth-card input { width: 100%; min-height: 48px; padding: 0 13px; border: 1px solid #ccd2df; border-radius: 9px; font: inherit; }
.auth-card input:focus { outline: 3px solid rgba(23,32,87,.12); border-color: var(--navy); }
.alert { margin-top: 20px; padding: 12px 14px; color: #8b2531; background: #fff1f2; border: 1px solid #ffd1d6; border-radius: 8px; font-size: .84rem; }
.auth-note { padding: 0 10px; color: var(--muted); font-size: .75rem; text-align: center; line-height: 1.5; }
.install-shell { width: min(520px, calc(100% - 32px)); }
.password-hint { margin: -5px 0 0; color: var(--muted); font-size: .76rem; line-height: 1.5; }
.success-message { margin: 24px 0; padding: 14px; color: #17652d; background: #ecf9f0; border: 1px solid #bfe9ca; border-radius: 9px; line-height: 1.55; }
.full-button { width: 100%; margin-top: 12px; }
.dashboard-shell { padding-bottom: 50px; }
.dashboard-heading { padding: 60px 0 35px; border-top: 1px solid var(--line); }
.dashboard-heading h1 { font-size: 3.2rem; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.stats article { display: grid; gap: 16px; padding: 24px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; }
.stats span { color: var(--muted); font-size: .82rem; }
.stats strong { color: var(--navy); font-size: 2rem; }
.empty-state { margin-top: 18px; padding: 75px 25px; text-align: center; background: var(--white); border: 1px solid var(--line); border-radius: 14px; }
.empty-icon { display: inline-grid; place-items: center; width: 58px; height: 58px; color: var(--navy); background: #eef0fa; border-radius: 15px; font-weight: 900; }
.empty-state h2 { margin: 22px 0 8px; }
.empty-state p { max-width: 560px; margin: 0 auto; color: var(--muted); }
.panel { margin-top: 18px; padding: 24px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.panel h2 { margin: 0 0 6px; font-size: 1.1rem; }
.panel p { margin: 0; }
.panel code { padding: 2px 6px; background: #eef0fa; border-radius: 5px; font-size: .85em; }
.token-box { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 18px; padding: 16px; background: #fffbea; border: 1px solid #ffe58a; border-radius: 10px; }
.token-box code { padding: 8px 12px; color: var(--navy-dark); background: var(--white); font-size: 1.15rem; font-weight: 800; letter-spacing: .06em; user-select: all; }
.table-panel { padding: 0; overflow-x: auto; }
.devices { width: 100%; border-collapse: collapse; font-size: .88rem; }
.devices th { padding: 14px 16px; color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-align: left; text-transform: uppercase; border-bottom: 1px solid var(--line); white-space: nowrap; }
.devices td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.devices tr:last-child td { border-bottom: 0; }
.devices td:first-child { display: grid; gap: 6px; }
.presence { justify-self: start; padding: 2px 8px; border-radius: 999px; font-size: .68rem; font-weight: 800; letter-spacing: .06em; }
.presence-online { color: #126b2e; background: #e3f7e9; }
.presence-offline { color: #5d6478; background: #eceef3; }
.badge { display: inline-block; min-width: 42px; padding: 3px 8px; border-radius: 6px; font-size: .74rem; font-weight: 800; text-align: center; }
.badge-on { color: #126b2e; background: #e3f7e9; }
.badge-off { color: #8b2531; background: #fff1f2; }
.badge-unknown { color: #7a5b00; background: #fff6d6; }

@media (max-width: 820px) {
    .hero { grid-template-columns: 1fr; gap: 30px; padding: 50px 0; }
    .capabilities { grid-template-columns: 1fr 1fr; }
    .capabilities article:nth-child(2) { border-right: 0; }
    .capabilities article { border-bottom: 1px solid var(--line); }
    .stats { grid-template-columns: 1fr; }
    .panel-heading { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 520px) {
    .shell { width: min(100% - 24px, 1180px); }
    .topbar { align-items: flex-start; padding: 18px 0; }
    .topbar .button { padding: 0 12px; font-size: .76rem; }
    .brand img { width: 40px; height: 40px; }
    .hero h1 { font-size: 3rem; }
    .capabilities { grid-template-columns: 1fr; }
    .capabilities article { border-right: 0; }
    footer { flex-direction: column; gap: 7px; }
    .auth-card { padding: 28px 22px; }
}
