:root {
    color-scheme: dark;
    font-family: Inter, Segoe UI, Arial, sans-serif;
    background: #0b1019;
    color: #e7eefc
}

* {
    box-sizing: border-box
}

body {
    margin: 0
}

header {
    padding: 22px 6%;
    border-bottom: 1px solid #223049;
    display: flex;
    justify-content: space-between;
    align-items: center
}

.brand {
    font-weight: 800;
    letter-spacing: 2px;
    color: #6ca8ff
}

.brand span {
    font-size: 11px;
    color: #8493ad;
    margin-left: 20px
}

main {
    max-width: 1200px;
    margin: 55px auto;
    padding: 0 24px
}

h1 {
    font-size: clamp(32px, 5vw, 52px);
    letter-spacing: -2px;
    line-height: 1.12
}

h2 {
    margin-top: 38px;
    font-size: 21px
}

p {
    color: #98a7bf;
    line-height: 1.6
}

.eyebrow {
    font-size: 11px;
    letter-spacing: 3px;
    color: #6ca8ff
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin: 30px 0
}

article,
.card {
    background: #121b2b;
    border: 1px solid #25324a;
    border-radius: 12px;
    padding: 24px
}

strong {
    font-size: 36px
}

.devices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px
}

button {
    cursor: pointer;
    background: #225fcb;
    border: 1px solid #3b7ae3;
    border-radius: 7px;
    color: white;
    padding: 12px 18px;
    font: inherit
}

.card {
    text-align: left;
    color: #e7eefc
}

.devices .card b {
    display: block;
    margin: 12px 0;
    font-size: 20px
}

.green {
    color: #50d8a0
}

.red {
    color: #f68181
}

.blue {
    color: #6ca8ff
}

.yellow {
    color: #e9bd65
}

.login {
    max-width: 500px;
    margin: 10vh auto
}

.login h1 {
    font-size: 42px
}

label {
    display: block;
    margin: 20px 0;
    color: #aebbd0
}

input {
    display: block;
    width: 100%;
    padding: 13px;
    margin-top: 8px;
    background: #121b2b;
    border: 1px solid #33445f;
    border-radius: 6px;
    color: white
}

canvas {
    width: 100%;
    height: 220px;
    background: #121b2b;
    border: 1px solid #25324a;
    border-radius: 10px
}

#detail {
    margin: 35px 0;
    padding-top: 10px;
    border-top: 1px solid #25324a
}

progress {
    width: 100%;
    accent-color: #4c8dff
}

button:hover {
    border-color: #8bb8ff
}

button:focus-visible {
    outline: 3px solid #8bb8ff
}

@media(max-width:600px) {
    .stats {
        grid-template-columns: 1fr
    }

    header .brand span {
        display: none
    }

    main {
        margin-top: 30px
    }

    .stats article {
        padding: 18px
    }

    strong {
        font-size: 28px
    }
}

[hidden] { display: none !important; }
.provision { margin: 36px 0 22px; background: linear-gradient(120deg, #14233b, #121b2b 70%); }
.provision h2, .token-panel h2 { margin-top: 8px; }
.provision label, .token-panel label { margin: 16px 0 8px; }
.form-row { display: flex; gap: 12px; align-items: stretch; }
.form-row input { margin: 0; flex: 1; min-width: 0; }
.form-row button { flex-shrink: 0; }
.icon { display: inline-block; margin-right: 8px; font-size: 25px; }
.violet { color: #c4b5fd; }
.token-panel { border-color: #287e69; margin-bottom: 30px; }
#issued-token { font-family: Consolas, monospace; font-size: 14px; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.secondary { background: #1a2940; border-color: #415570; }
.danger { background: #38202b; border-color: #8e4155; color: #ffb5c2; }
button:disabled { cursor: wait; opacity: .6; }
input:focus-visible { outline: 2px solid #8bb8ff; outline-offset: 2px; }
@media(max-width:600px) { .form-row { flex-direction: column; } .provision, .token-panel { padding: 18px; } .actions button { width: 100%; } }

.icon svg { width: 24px; height: 24px; vertical-align: -4px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.devices { display: flex; flex-direction: column; gap: 16px; }
.device-row { width: 100%; padding: 22px; background: linear-gradient(115deg, #152239, #121b2b 70%); transition: border-color .2s, box-shadow .2s; }
.device-row:hover, .device-row.is-selected { border-color: #579bfa; box-shadow: 0 0 0 1px #579bfa22; }
.device-header, .device-title, .device-ip { display: flex; align-items: center; gap: 12px; }
.device-header { justify-content: space-between; flex-wrap: wrap; }
.device-title { flex: 1; flex-wrap: wrap; min-width: 0; }
.devices .device-row b { margin: 0; overflow-wrap: anywhere; }
.device-ip { color: #afc4e4; font-size: 13px; padding: 7px 10px; background: #0b1425; border: 1px solid #2b3c57; border-radius: 7px; overflow-wrap: anywhere; }
.device-ip span { min-width: 0; }
.status-badge { font-size: 11px; letter-spacing: 1px; border: 1px solid currentColor; border-radius: 20px; padding: 6px 10px; }
.device-facts { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1.3fr) minmax(0, 1.1fr) minmax(60px, .5fr) minmax(60px, .5fr); gap: 16px; margin-top: 22px; }
.device-fact { display: flex; align-items: center; gap: 12px; min-width: 0; }
.device-fact > span:last-child { display: grid; gap: 5px; font-size: 14px; overflow-wrap: anywhere; min-width: 0; }
.device-fact small { color: #98a7bf; font-size: 11px; }
.device-last-seen { display: block; margin-top: 20px; color: #98a7bf; font-size: 12px; }
.metric-icon { display: inline-flex; width: 25px; height: 25px; flex-shrink: 0; }
.metric-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.animated-monitor { animation: monitor-glow 3s ease-in-out infinite; }
.animated-network { animation: network-pulse 2.5s ease-in-out infinite; }
@keyframes monitor-glow { 50% { filter: drop-shadow(0 0 5px #6ca8ff99); } }
@keyframes network-pulse { 50% { opacity: .55; transform: translateY(-2px); } }
@media(max-width:760px) { .device-facts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .device-row { padding: 18px; } }
@media(prefers-reduced-motion:reduce) { .animated-monitor, .animated-network { animation: none; } .device-row { transition: none; } }

@media(max-width:600px) {
  .device-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
  .device-title { display: grid; grid-template-columns: 25px minmax(0, 1fr); }
  .device-ip { grid-column: 1 / -1; justify-self: start; max-width: 100%; }
}

.device-version > span:last-child > span { font-family: Consolas, monospace; color: #b9d5ff; }
