:root {
  color-scheme: light;
  --paper: #eef2ee;
  --surface: #fbfcfa;
  --surface-strong: #ffffff;
  --ink: #222b2a;
  --ink-soft: #62706d;
  --ink-faint: #8c9793;
  --line: #dce3de;
  --line-strong: #c5d0c9;
  --rail: #222b2a;
  --rail-soft: #a8b4af;
  --teal: #167463;
  --teal-soft: #e1f1ec;
  --orange: #c85b35;
  --orange-soft: #faece6;
  --yellow: #a8892d;
  --yellow-soft: #f5f0dc;
  --radius: 6px;
  font-family: "Segoe UI", "Noto Sans", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }

body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--paper); }
button, input, select { font: inherit; }
button { color: inherit; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.rail { background: var(--rail); color: #f1f5f2; padding: 22px 14px 18px; display: flex; flex-direction: column; min-height: 100vh; }
.brand { display: flex; gap: 10px; align-items: center; min-height: 36px; padding: 0 10px; color: #f7faf7; font-size: 11px; font-weight: 750; letter-spacing: 1px; text-decoration: none; }
.brand-light { color: #9eaaa5; font-weight: 550; }
.brand-mark { width: 22px; height: 22px; border: 1px solid #69847a; display: flex; gap: 2px; align-items: end; justify-content: center; padding: 4px; border-radius: 5px 5px 2px 2px; }
.brand-mark i { width: 3px; background: #90d4b8; display: block; border-radius: 1px; }
.brand-mark i:nth-child(1) { height: 6px; opacity: .6; }
.brand-mark i:nth-child(2) { height: 10px; }
.brand-mark i:nth-child(3) { height: 7px; opacity: .8; }
.rail-group-label { margin: 48px 10px 11px; font-size: 10px; color: #84918c; text-transform: uppercase; letter-spacing: 1px; }
.nav-item { display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 0 10px; border-radius: 5px; color: #d9e1dc; text-decoration: none; font-size: 13px; }
.nav-item.active { background: #344340; color: #f6fbf7; box-shadow: inset 2px 0 #80c7a9; }
.nav-glyph { width: 16px; color: #9ad4b7; font-size: 16px; text-align: center; }
.nav-count { margin-left: auto; min-width: 24px; text-align: center; color: #aebbb5; font: 11px "Cascadia Code", Consolas, monospace; }
.rail-bottom { margin-top: auto; border-top: 1px solid #3a4642; padding: 16px 8px 0; display: grid; grid-template-columns: 8px auto; align-items: center; gap: 6px 9px; color: #c6d0cb; font-size: 11px; }
.rail-led { width: 7px; height: 7px; background: #77ca9d; border-radius: 50%; box-shadow: 0 0 0 3px #33473e; }
.rail-address { grid-column: 2; color: #85938d; font: 10px "Cascadia Code", Consolas, monospace; }

.main-content { min-width: 0; }
.topbar { height: 62px; padding: 0 38px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; background: rgba(251, 252, 250, .72); }
.breadcrumb { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--ink-soft); }
.breadcrumb strong { color: var(--ink); font-weight: 650; }
.crumb-slash { color: #aab4af; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.secure-label { display: inline-flex; gap: 7px; align-items: center; margin-right: 12px; color: var(--teal); font-size: 11px; }
.secure-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }
.button { min-height: 34px; padding: 0 13px; border: 1px solid transparent; border-radius: var(--radius); cursor: pointer; font-size: 12px; font-weight: 650; transition: background .15s ease, border-color .15s ease, transform .15s ease; }
.button:hover { transform: translateY(-1px); }
.button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(22, 116, 99, .25); outline-offset: 2px; }
.button-dark { background: var(--ink); color: white; }
.button-dark:hover { background: #344340; }
.button-quiet { border-color: var(--line); background: transparent; color: var(--ink-soft); }
.button-quiet:hover, .button-outline:hover { background: #e8eee9; border-color: var(--line-strong); }
.button-outline { border-color: var(--line-strong); background: transparent; color: var(--ink); }
.button-wide { width: 100%; }
.plus-mark { font-size: 18px; line-height: 0; margin-right: 7px; font-weight: 400; vertical-align: -1px; }

.content { max-width: 1420px; margin: 0 auto; padding: 34px 38px 54px; }
.page-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 25px; }
.eyebrow { margin: 0 0 9px; color: var(--teal); font: 10px "Cascadia Code", Consolas, monospace; letter-spacing: .5px; }
.eyebrow span { color: var(--orange); padding: 0 4px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: 27px; line-height: 1.2; font-weight: 720; }
.subheading { margin: 0; color: var(--ink-soft); font-size: 13px; }
.updated-at { color: var(--ink-faint); font: 10px "Cascadia Code", Consolas, monospace; padding-bottom: 4px; }

.metric-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 22px; }
.metric-cell { min-height: 119px; padding: 17px 20px 15px; border-right: 1px solid var(--line); position: relative; }
.metric-cell:last-child { border-right: 0; }
.metric-cell::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 2px; background: var(--line-strong); }
.metric-online::before { background: #4e9f7d; }
.metric-offline::before { background: var(--orange); }
.metric-pending::before { background: #c6a84d; }
.metric-label { display: flex; align-items: center; gap: 7px; color: var(--ink-soft); font-size: 11px; }
.metric-cell strong { display: block; margin: 8px 0 5px; font: 600 28px/1 "Bahnschrift", "Segoe UI", sans-serif; color: var(--ink); }
.metric-foot { color: var(--ink-faint); font-size: 10px; }
.status-pip { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: var(--ink-faint); }
.status-pip.online { background: #32936d; }
.status-pip.offline { background: var(--orange); }
.status-pip.pending { background: #b5973e; }

.registry-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.list-toolbar { min-height: 63px; padding: 13px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.list-title-group { display: flex; align-items: baseline; gap: 10px; }
.list-title-group h2 { margin: 0; font-size: 14px; font-weight: 700; }
.record-count { color: var(--ink-faint); font: 10px "Cascadia Code", Consolas, monospace; }
.filters { display: flex; align-items: center; gap: 8px; }
.search-field { min-height: 32px; display: flex; gap: 8px; align-items: center; width: min(245px, 28vw); padding: 0 9px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-strong); }
.search-icon { width: 12px; height: 12px; border: 1.5px solid #88948f; border-radius: 50%; position: relative; flex: 0 0 auto; }
.search-icon::after { content: ""; position: absolute; width: 5px; height: 1.5px; background: #88948f; right: -4px; bottom: -2px; transform: rotate(45deg); }
.search-field input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 11px; }
.search-field input::placeholder { color: #9aa49f; }
.status-filter { height: 32px; max-width: 150px; padding: 0 24px 0 9px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-strong); color: var(--ink-soft); font-size: 11px; }
.table-scroll { overflow-x: auto; min-height: 220px; }
table { width: 100%; min-width: 740px; border-collapse: collapse; text-align: left; }
thead { background: #f3f6f3; }
th { height: 37px; padding: 0 16px; color: #7b8983; font-size: 10px; font-weight: 650; white-space: nowrap; }
td { height: 57px; padding: 9px 16px; border-top: 1px solid #e8ede9; color: var(--ink-soft); font-size: 11px; white-space: nowrap; }
tbody tr:hover { background: #f7f9f7; }
td:first-child { color: var(--ink); font: 11px "Cascadia Code", Consolas, monospace; }
.device-model { color: var(--ink); font-weight: 600; }
.time-cell { color: #7c8984; font: 10px "Cascadia Code", Consolas, monospace; }
.status-label { display: inline-flex; align-items: center; gap: 7px; font-size: 10px; }
.status-label.online { color: var(--teal); }
.status-label.offline { color: var(--orange); }
.status-label.pending { color: var(--yellow); }
.status-label .status-pip { width: 6px; height: 6px; }
.row-action { width: 28px; height: 28px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--ink-faint); cursor: pointer; font-size: 16px; line-height: 1; }
.row-action:hover { border-color: var(--line); color: var(--ink); background: white; }
.empty-state { min-height: 250px; padding: 42px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.empty-state[hidden] { display: none; }
.empty-signal { height: 31px; display: flex; gap: 4px; align-items: center; margin-bottom: 15px; }
.empty-signal span { width: 4px; border-radius: 3px; background: #92c4ad; }
.empty-signal span:nth-child(1) { height: 10px; opacity: .55; }
.empty-signal span:nth-child(2) { height: 22px; }
.empty-signal span:nth-child(3) { height: 15px; opacity: .8; }
.empty-signal span:nth-child(4) { height: 8px; opacity: .5; }
.empty-state h3 { margin: 0 0 5px; font-size: 13px; }
.empty-state p { margin: 0 0 16px; color: var(--ink-faint); font-size: 11px; }
.list-footer { min-height: 37px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border-top: 1px solid var(--line); color: var(--ink-faint); font-size: 10px; }
.footer-signal { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #5b9e7d; margin-right: 6px; vertical-align: 1px; }
.error-bar { margin-top: 12px; padding: 10px 12px; border: 1px solid #efc8b8; border-radius: 5px; background: var(--orange-soft); color: #863d26; font-size: 11px; }
.error-bar[hidden] { display: none; }
.operations-panel { margin-top: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.operations-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; padding: 18px; border-bottom: 1px solid var(--line); }
.operations-heading h2 { margin: 0 0 4px; font-size: 14px; }
.operations-heading .subheading { font-size: 11px; }
.operation-state { flex: 0 0 auto; padding: 5px 8px; border: 1px solid #e8d9b1; border-radius: 4px; background: var(--yellow-soft); color: #876e21; font-size: 10px; }
.operation-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 16px 18px; }
.operation-button { min-height: 80px; display: grid; grid-template-columns: 24px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 5px; background: #f7f9f7; text-align: left; cursor: pointer; }
.operation-button:hover { border-color: var(--line-strong); background: #eef4ef; }
.operation-button > span { grid-row: 1 / span 2; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--teal-soft); color: var(--teal); font-size: 16px; }
.operation-button strong { color: var(--ink); font-size: 11px; }
.operation-button small { color: var(--ink-faint); font-size: 9px; }
.manual-command { display: grid; grid-template-columns: minmax(0, 1fr) 180px auto; gap: 12px; align-items: end; padding: 15px 18px 18px; border-top: 1px solid var(--line); background: #f5f8f5; }
.manual-command label { display: block; margin-bottom: 4px; color: var(--ink); font-size: 11px; font-weight: 650; }
.manual-command p { margin: 0; color: var(--ink-faint); font-size: 10px; line-height: 1.45; }
.manual-command textarea { width: 100%; min-height: 57px; resize: vertical; border: 1px solid var(--line); border-radius: 5px; padding: 9px; background: #e9eeea; color: var(--ink-faint); font: 10px/1.5 "Cascadia Code", Consolas, monospace; }
.manual-command textarea:disabled { cursor: not-allowed; opacity: .9; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.dialog { width: min(430px, calc(100vw - 28px)); padding: 0; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); box-shadow: 0 22px 70px rgba(21, 37, 31, .22); }
.dialog::backdrop { background: rgba(20, 31, 29, .48); backdrop-filter: blur(2px); }
.dialog-form { padding: 24px; }
.dialog-kicker { color: var(--teal); font: 10px "Cascadia Code", Consolas, monospace; letter-spacing: .6px; margin-bottom: 10px; }
.dialog h2 { margin: 0 0 7px; font-size: 18px; }
.dialog p { margin: 0 0 19px; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.dialog label { display: block; margin: 13px 0 6px; color: var(--ink-soft); font-size: 11px; font-weight: 600; }
.dialog input { width: 100%; height: 37px; border: 1px solid var(--line-strong); border-radius: 5px; padding: 0 10px; background: white; color: var(--ink); font-size: 12px; }
.dialog input::placeholder { color: #a0aaa5; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 19px; }
.dialog-error { min-height: 18px; margin-top: 7px; color: #a44629; font-size: 11px; }
.credential-output { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 180px; overflow: auto; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 5px; background: #f0f4f0; color: #2d4540; font: 10px/1.55 "Cascadia Code", Consolas, monospace; }

@media (max-width: 920px) {
  .app-shell { grid-template-columns: 64px minmax(0, 1fr); }
  .rail { padding-inline: 8px; }
  .brand { justify-content: center; padding: 0; }
  .brand > span:last-child, .rail-group-label, .nav-item > span:not(.nav-glyph), .rail-bottom > span:not(.rail-led) { display: none; }
  .nav-item { justify-content: center; padding: 0; margin-top: 42px; }
  .rail-bottom { display: flex; justify-content: center; padding-inline: 0; }
  .topbar { padding-inline: 24px; }
  .content { padding: 30px 24px 42px; }
}

@media (max-width: 680px) {
  .app-shell { grid-template-columns: 1fr; }
  .rail { min-height: 50px; height: 50px; padding: 0 13px; flex-direction: row; align-items: center; justify-content: space-between; }
  .brand { justify-content: flex-start; }
  .brand > span:last-child { display: inline; font-size: 10px; }
  .rail-group-label, .nav-item { display: none; }
  .rail-bottom { margin: 0; padding: 0; border: 0; display: flex; }
  .rail-bottom > span:not(.rail-led) { display: inline; font-size: 10px; }
  .rail-bottom .rail-address { display: none; }
  .topbar { height: 54px; padding: 0 14px; }
  .secure-label { display: none; }
  .top-actions { gap: 6px; }
  .button { min-height: 32px; padding-inline: 10px; }
  .content { padding: 25px 13px 35px; }
  .page-heading { align-items: start; margin-bottom: 18px; }
  h1 { font-size: 23px; }
  .updated-at { max-width: 110px; text-align: right; font-size: 9px; }
  .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-cell { min-height: 104px; padding: 14px 15px; border-bottom: 1px solid var(--line); }
  .metric-cell:nth-child(2) { border-right: 0; }
  .metric-cell:nth-child(n+3) { border-bottom: 0; }
  .metric-cell strong { font-size: 25px; }
  .metric-foot { font-size: 9px; }
  .list-toolbar { align-items: flex-start; flex-direction: column; padding: 13px; }
  .filters { width: 100%; }
  .search-field { width: 100%; }
  .status-filter { flex: 0 0 118px; }
  .list-footer { padding-inline: 12px; font-size: 9px; }
  .operation-grid { grid-template-columns: 1fr; padding-inline: 13px; }
  .operations-heading { padding: 15px 13px; }
  .manual-command { grid-template-columns: 1fr; padding-inline: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
