:root {
  color-scheme: light; --bg: #ffffff; --card: #ffffff; --ink: #18181b; --soft: #5f6368; --line: #e4e4e7; --fill: #f6f6f7;
  --strong: #111113; --on-strong: #ffffff; --link: #1d5fa8; --blue: #2563eb; --slate: #5b6b7d; --green: #15803d; --red: #d12020;
  --meter: #22a06b; --warn: #80530c; --warn-bg: #fff3e0; --ok-bg: #e2f5ea; --info-bg: #eaf3fe; --info: #24507a;
  --danger: #a22e2e; --danger-bg: #fff1f0;
  font-family: system-ui, sans-serif; color: var(--ink); background: var(--bg);
}
:root[data-theme="dark"] {
  color-scheme: dark; --bg: #101114; --card: #17191d; --ink: #f1f2f4; --soft: #a5abb3; --line: #2c3037; --fill: #202329;
  --strong: #f1f2f4; --on-strong: #111113; --link: #8abcf5; --blue: #7aa7ff; --slate: #a9b6c5; --green: #62cf92; --red: #ff8f8a;
  --meter: #35b67d; --warn: #efc278; --warn-bg: #33291a; --ok-bg: #17321f; --info-bg: #17293d; --info: #b5d5f7;
  --danger: #ff9e98; --danger-bg: #3a1f1f;
}
* { box-sizing: border-box; }
body { margin: 0; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.topbar { border-bottom: 1px solid var(--line); background: var(--bg); }
.topbar-inner { max-width: 1240px; margin: auto; padding: 14px 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.brand { display: block; padding: 6px 10px; margin-left: -10px; border-radius: 10px; line-height: 0; }
.brand img { display: block; width: 250px; max-width: 100%; height: auto; }
:root[data-theme="dark"] .brand { margin-left: 0; background: #ffffff; }
.icon svg, .kpi svg { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.actions, .navigation { display: flex; align-items: center; gap: 6px; }
.navigation { gap: 18px; margin-right: 12px; }
.navigation a, .menu a { color: var(--ink); text-decoration: none; font-size: 15px; } .navigation a:hover, .menu a:hover { text-decoration: underline; }
.icon { display: inline-flex; padding: 9px; border: 0; border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; list-style: none; }
.icon:hover { background: var(--fill); } .icon svg { width: 20px; height: 20px; stroke: currentColor; }
.popover { position: relative; border: 0; padding: 0; } .popover > summary { list-style: none; } .popover > summary::-webkit-details-marker { display: none; }
.popover-box { position: absolute; right: 0; top: calc(100% + 8px); z-index: 5; width: 270px; max-width: calc(100vw - 32px); margin: 0; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: 0 10px 30px #0003; }
.menu { width: 190px; display: grid; gap: 12px; } .menu .only-narrow { display: none; }
.container { max-width: 1100px; margin: auto; padding: 30px 24px; } .container.wide { max-width: 1240px; }
.heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.heading p { margin: 2px 0 0; }
.eyebrow { color: var(--soft); font-size: 13px; font-weight: 600; }
h1 { margin: 0; font-size: 25px; line-height: 1.25; overflow-wrap: anywhere; } h2 { margin: 0 0 16px; font-size: 18px; } p { color: var(--soft); line-height: 1.5; }
.counts, .info, .notice { border-radius: 10px; padding: 13px 16px; }
.counts { background: var(--fill); color: var(--soft); } .counts strong { color: var(--ink); margin-left: 12px; }
.info { background: var(--info-bg); color: var(--info); } .notice { background: var(--ok-bg); color: var(--green); } .notice[role="alert"] { background: var(--warn-bg); color: var(--warn); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 20px; margin-top: 24px; }
.card, .auth-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.auth-card { max-width: 440px; margin: 50px auto; }
.stack { display: grid; gap: 14px; } .inline { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; color: inherit; background: var(--card); }
button, .button { display: inline-block; padding: 10px 18px; border: 0; border-radius: 99px; background: var(--strong); color: var(--on-strong); cursor: pointer; font: inherit; font-weight: 600; text-decoration: none; }
button:hover, .button:hover { opacity: .86; } button:disabled { opacity: .6; cursor: wait; }
.link-button { background: transparent; color: var(--ink); padding: 0; font-size: 15px; font-weight: 400; }
.secondary { background: var(--fill); color: var(--ink); }
.danger { background: var(--danger-bg); color: var(--danger); margin-top: 12px; }
.list { margin-top: 20px; } .list h2 span { color: var(--soft); font-size: 14px; }
details { border-top: 1px solid var(--line); padding: 16px 0; } details.card { border: 1px solid var(--line); padding: 16px 20px; margin-bottom: 16px; }
summary { cursor: pointer; font-weight: 650; } summary small { display: block; margin: 5px 0 0 18px; font-weight: 400; }
details form { margin-top: 14px; } .menu form { margin: 0; } small { color: var(--soft); font-size: 13px; }
footer { color: var(--soft); text-align: center; padding: 20px; font-size: 13px; }
.status-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; color: var(--soft); font-size: 14px; } .status-toolbar button { padding: 7px 14px; }
.foot-status { margin-top: 20px; }
.device-status { display: inline-block; margin-left: 8px; padding: 3px 9px; border-radius: 12px; background: var(--fill); color: var(--soft); font-size: 13px; white-space: nowrap; }
.device-status[data-status="online"] { background: var(--ok-bg); color: var(--green); } .device-status[data-status="offline"] { background: var(--warn-bg); color: var(--warn); }
.server-config label { margin: 12px 0; } .server-config input { background: var(--fill); }
.audit-event { display: grid; gap: 5px; border-top: 1px solid var(--line); padding: 15px 0; } .audit-event span { color: var(--soft); font-size: 14px; }
.record-summary { white-space: pre-wrap; overflow-wrap: anywhere; }
.pagination { display: flex; gap: 16px; align-items: center; margin-top: 20px; font-size: 14px; }
[hidden] { display: none !important; }
.inventory { display: grid; grid-template-columns: minmax(100px, 160px) 1fr; gap: 8px; overflow-wrap: anywhere; } .inventory dt { font-weight: 650; } .inventory dd { margin: 0; }
main a:not(.button):not(.tile):not(.kpi):not(.enter):not(.alert-chip) { color: var(--link); } .connect-link { font-weight: 650; }
.block { display: block; } .alert-text { color: var(--warn); }
.check { display: flex; align-items: center; gap: 10px; } .check input { width: auto; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { padding: 15px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--soft); text-decoration: none; }
.kpi svg { display: block; width: 20px; height: 20px; stroke: currentColor; } .kpi strong { display: block; margin-top: 6px; font-size: 25px; line-height: 1.25; } .kpi span { color: var(--soft); font-size: 14px; }
.kpi.blue { color: var(--blue); } .kpi.slate { color: var(--slate); } .kpi.green { color: var(--green); } .kpi.red { color: var(--red); }
a.kpi:hover, .tile:hover { background: var(--fill); }
.pill { border-radius: 99px; padding: 12px 18px; margin-bottom: 16px; }
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 14px; }
.client-card { padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); min-width: 0; }
.client-head { display: flex; align-items: center; gap: 12px; min-width: 0; } .client-head > div { flex: 1; min-width: 0; }
.client-card .client-head { padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.client-head h2 { margin: 0; font-size: 17px; overflow-wrap: anywhere; }
.avatar { display: grid; place-items: center; width: 46px; height: 46px; flex: none; border-radius: 12px; color: #fff; font-size: 21px; font-weight: 700; background: #52525b; }
.avatar-0 { background: #475569; } .avatar-1 { background: #2563eb; } .avatar-2 { background: #15803d; } .avatar-3 { background: #7c4fb0; }
.avatar-4 { background: #0369a1; } .avatar-5 { background: #92600c; } .avatar-6 { background: #be185d; } .avatar-7 { background: #0f766e; }
.alert-chip { padding: 4px 10px; border-radius: 99px; background: var(--warn-bg); color: var(--warn); font-size: 13px; text-decoration: none; white-space: nowrap; } .alert-chip:hover { text-decoration: underline; }
.client-row { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; } .client-row.small { font-size: 14px; color: var(--soft); }
.meter { height: 6px; margin: 11px 0; border-radius: 6px; overflow: hidden; background: var(--line); } .meter i { display: block; width: 0; height: 100%; background: var(--meter); }
.dot { display: inline-block; width: 9px; height: 9px; margin-right: 7px; border-radius: 50%; } .dot.on { background: var(--meter); } .dot.off { background: var(--red); }
.enter { display: block; margin-top: 15px; padding: 10px; border-radius: 10px; background: var(--fill); color: var(--ink); text-align: center; text-decoration: none; font-weight: 600; font-size: 15px; } .enter:hover { background: var(--line); }

.clients-back { display: inline-block; margin-bottom: 12px; text-decoration: none; }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 6px 0 16px; }
main .tabs a:not(.button) { padding: 10px 13px; color: var(--soft); text-decoration: none; white-space: nowrap; border-bottom: 3px solid transparent; }
main .tabs a[aria-current]:not(.button) { color: var(--ink); border-color: var(--strong); font-weight: 650; }
.clients-main h2 { margin: 26px 0 10px; } .clients-main .status-toolbar { margin-bottom: 16px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.tile { padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--soft); text-decoration: none; font-size: 14px; } .tile strong { display: block; color: var(--ink); font-size: 24px; }
.table-box { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.table-box table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table-box th, .table-box td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.table-box th { color: var(--soft); font-size: 13px; white-space: nowrap; } .table-box tr:last-child td { border-bottom: 0; }
.table-box td small { display: block; } .table-box .device-status { margin-left: 0; }
@media (max-width: 820px) {
  .navigation { display: none; } .menu .only-narrow { display: block; } .topbar-inner, .container { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 560px) { .brand img { width: 190px; } .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .popover-box:not(.menu) { right: auto; left: 0; } }
.environment { margin: 0; padding: 8px 16px; background: #ffd966; color: #332600; text-align: center; font-size: 14px; font-weight: 600; }
