/* SILO 6 admin: theme tokens and components per THEME.md. Plain CSS, no build step. */
@font-face { font-family: 'DM Sans'; font-weight: 400; font-style: normal; font-display: swap; src: url('fonts/dm-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-weight: 500; font-style: normal; font-display: swap; src: url('fonts/dm-sans-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-weight: 600; font-style: normal; font-display: swap; src: url('fonts/dm-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-weight: 700; font-style: normal; font-display: swap; src: url('fonts/dm-sans-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 400; font-style: normal; font-display: swap; src: url('fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 500; font-style: normal; font-display: swap; src: url('fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 600; font-style: normal; font-display: swap; src: url('fonts/ibm-plex-mono-latin-600-normal.woff2') format('woff2'); }

:root {
  --font-sans: 'DM Sans', Inter, Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --bg-app: #07101b;
  --bg-sidebar: #080f1c;
  --bg-topbar: #091321;
  --bg-workspace: #0b1727;
  --bg-panel: #0d192a;
  --bg-card: #0e1a2c;
  --bg-input: #101e30;
  --bg-secondary: #15243a;
  --bg-nav-active: #17273b;
  --border-default: #203149;
  --border-input: #2a3c55;
  --border-secondary: #2b405d;
  --border-nav-active: #2a4260;
  --text-primary: #e7eef9;
  --text-heading: #f0f5fc;
  --text-secondary: #91a1b6;
  --text-muted: #7890ab;
  --text-button-secondary: #b9cbe0;
  --action-bg: #587ba8;
  --action-border: #7494bb;
  --action-hover: #304c6d;
  --focus: #8aa7cf;
  --link: #a6c1e2;
  --radius-control: 7px;
  --radius-card: 9px;
  --sidebar-width: 238px;
  --topbar-height: 66px;
  color: var(--text-primary);
  background: var(--bg-app);
  font-family: var(--font-sans);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; font-size: 14px; background: var(--bg-app); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:disabled { opacity: .55; cursor: not-allowed; }
:is(button, a, input, textarea, select, summary):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
::selection { background: #355577; color: #fff; }
h1, h2, p { margin: 0; }
code { font-family: var(--font-mono); font-size: .9em; background: #192b41; border-radius: 3px; padding: 1px 4px; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-muted); }
.icon { flex: none; }

/* shell */
.shell { display: flex; min-height: 100vh; }
.main-region { flex: 1; min-width: 0; }
.sidebar {
  width: var(--sidebar-width); flex: none; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 6px;
  padding: 25px 14px 18px; background: var(--bg-sidebar); border-right: 1px solid var(--border-default);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 6px 22px; }
.brand-tile {
  width: 34px; height: 34px; border-radius: 8px; flex: none;
  display: grid; place-items: center; background: #17283c; border: 1px solid #446286; color: var(--text-heading);
}
.brand-text { display: flex; flex-direction: column; gap: 3px; }
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: .12em; color: var(--text-heading); }
.brand-sub { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .2em; color: var(--text-muted); }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-section { font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; color: var(--text-muted); padding: 0 12px 8px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 11px 12px; border-radius: 7px; border: 1px solid transparent; background: transparent;
  font-size: 13px; font-weight: 600; color: #91a1b7; text-align: left;
  transition: background-color .15s, color .15s;
}
.nav-item:hover { background: #142237; color: #d9e5f6; }
.nav-item.is-active { background: var(--bg-nav-active); border-color: var(--border-nav-active); color: var(--text-heading); }
.logout { margin-top: auto; }
.topbar {
  height: var(--topbar-height); display: flex; align-items: center; padding: 0 39px;
  background: var(--bg-topbar); border-bottom: 1px solid var(--border-default);
}
.crumb { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.crumb-sep { margin: 0 6px; color: #3a5070; }
.content { max-width: 1540px; margin: 0 auto; padding: 38px 39px 80px; }

/* page heading */
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 31px; }
.eyebrow { font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; }
.page-heading h1 { font-size: 30px; font-weight: 600; line-height: 1.16; letter-spacing: -.035em; color: var(--text-heading); }
.subtitle { margin-top: 8px; color: var(--text-secondary); }

/* panels */
.panel { background: var(--bg-panel); border: 1px solid var(--border-default); border-radius: var(--radius-card); padding: 22px; }
.panel-settings { padding: 26px; display: flex; flex-direction: column; gap: 18px; }
.panel-settings h2 { font-size: 17px; font-weight: 600; color: var(--text-heading); }
.panel-flush { padding: 0; overflow: hidden; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }

/* forms */
.form { display: flex; flex-direction: column; gap: 17px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field-inline { flex-direction: row; align-items: center; gap: 10px; }
.label { font-size: 12px; font-weight: 600; color: var(--text-button-secondary); display: flex; align-items: center; gap: 8px; }
.hint { font-size: 12px; color: var(--text-muted); }
.input {
  width: 100%; padding: 10px 12px; font-size: 12px; color: var(--text-primary);
  background: var(--bg-input); border: 1px solid var(--border-input); border-radius: 7px;
}
.input::placeholder { color: #566a85; }
select.input { width: auto; min-width: 180px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-secondary); }
.check-block { align-items: flex-start; }
.check-block span { display: flex; flex-direction: column; gap: 3px; color: var(--text-primary); }
input[type='checkbox'] { accent-color: #7196c1; margin: 2px 0 0; }
.form-actions { display: flex; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 19px; flex-wrap: wrap; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 14px; border-radius: 7px; border: 1px solid; font-size: 12px; font-weight: 700;
}
.btn-primary { background: var(--action-bg); border-color: var(--action-border); color: #fff; }
.btn-primary:hover { background: var(--action-hover); }
.btn-secondary { background: var(--bg-secondary); border-color: var(--border-secondary); color: var(--text-button-secondary); }
.btn-secondary:hover { background: #203651; }
.link { color: var(--link); text-decoration: underline; }

/* badges */
.badge {
  display: inline-block; font-family: var(--font-mono); font-size: 12px; font-weight: 400;
  text-transform: uppercase; letter-spacing: .02em; padding: 4px 7px; border-radius: 4px; border: 1px solid;
}
.badge-neutral { background: #19283a; border-color: #314358; color: #9aacc0; }
.badge-success { background: #17352d; border-color: #345a4b; color: #8bcca9; }
.badge-warning { background: #3b3124; border-color: #66543a; color: #d6b780; }
.badge-danger { background: #3b282f; border-color: #644248; color: #d69a9f; }

/* notices */
.notice {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 7px;
  border: 1px solid; margin-bottom: 17px; font-size: 13px;
}
.notice .icon { margin-top: 1px; }
.notice-error { background: #37242b; border-color: #794951; color: #e5aeb3; }
.notice-info { background: #193248; border-color: #355876; color: #c7deef; }
.notice-success { background: #1b342b; border-color: #416d5a; color: #bfe4cb; }

/* empty state */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 238px; padding: 25px; text-align: center;
  background: #0d1929; border: 1px dashed #30445e; border-radius: 9px;
}
.empty-icon { width: 50px; height: 50px; border-radius: 11px; display: grid; place-items: center; background: #17283d; color: var(--text-secondary); }
.empty-state h2 { font-size: 16px; font-weight: 600; color: var(--text-heading); }
.empty-state p { max-width: 380px; color: var(--text-secondary); }

/* activity rows */
.row { padding: 18px 20px; border-bottom: 1px solid var(--border-default); }
.row:last-child { border-bottom: 0; }
.row-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-head .mono { font-size: 12px; }
.row-time { margin-left: auto; }
.row-title { margin-top: 10px; font-size: 13px; color: var(--text-primary); overflow-wrap: anywhere; }
.disclosure { margin-top: 10px; }
.disclosure summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--link); width: max-content; }
.code {
  margin: 10px 0 0; padding: 13px; overflow-x: auto; font-family: var(--font-mono); font-size: 12px;
  background: var(--bg-topbar); border: 1px solid #2a405a; border-radius: 7px; color: #cbd9e9;
}
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 19px; }

/* devices */
.page-heading { gap: 16px; }
.btn-danger { background: #3b282f; border-color: #644248; color: #e5aeb3; }
.btn-danger:hover { background: #4a2f38; }
.pair-panel { margin-bottom: 19px; display: flex; flex-direction: column; gap: 8px; }
.pair-code { font-size: 30px; font-weight: 600; letter-spacing: .12em; color: var(--text-heading); }
.device-name { margin-top: 0; font-weight: 600; color: var(--text-heading); }
.device-meta { margin-top: 8px; font-size: 12px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.inline-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.inline-form .input { width: 260px; max-width: 100%; }

/* health */
.group-title { margin: 22px 0 10px; font-size: 13px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .04em; }
.health-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 13px 20px; }
.health-row .badge { min-width: 92px; text-align: center; }
.health-label { font-size: 13px; color: var(--text-primary); }
.health-detail { margin-left: auto; font-size: 12px; overflow-wrap: anywhere; }

/* sign-in */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-card { width: min(400px, 100%); padding: 28px; display: flex; flex-direction: column; gap: 18px; background: var(--bg-workspace); }
.auth-brand { padding: 0; }
.auth-title { font-size: 22px; font-weight: 600; color: var(--text-heading); letter-spacing: -.02em; }
.auth-card .notice { margin-bottom: 0; }

/* responsive */
@media (max-width: 1150px) { .content { padding-left: 28px; padding-right: 28px; } }
@media (max-width: 800px) {
  .sidebar { width: 66px; padding: 25px 8px 18px; }
  .brand { justify-content: center; padding: 0 0 22px; }
  .brand-text, .nav-label, .nav-section { display: none; }
  .nav-item { justify-content: center; padding: 11px 0; }
  .topbar { padding: 0 20px; }
  .content { padding: 25px 20px 60px; }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .sidebar { width: 53px; padding-left: 6px; padding-right: 6px; }
  .page-heading h1 { font-size: 24px; }
  .row-time { margin-left: 0; }
  select.input { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
