/* twotwelve dashboard. Light mode only, per the stack constraints.
   Print rules live in print.css, which the Mac app also loads via WKWebView. */

:root {
  --ink: #1d1d1f;
  --ink-soft: #6e6e73;
  --ink-faint: #86868b;
  --line: #e5e5ea;
  --line-strong: #d1d1d6;
  --surface: #ffffff;
  --canvas: #f5f5f7;
  --accent: #4f46e5;
  --accent-soft: #eef2ff;
  --ok: #34c759;
  --warn: #ff9f0a;
  --crit: #ff3b30;
  --unknown: #aeaeb2;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  background: var(--canvas);
  color: var(--ink);
  line-height: 1.5;
  font-size: 14px;
}

a { color: inherit; text-decoration: none; }

/* ------------------------------------------------------------------ layout */

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: #fafafa;
  border-right: 1px solid var(--line);
  padding: 20px 0;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 18px 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}

/* The mark is the name itself: TWOTWELVE is exactly nine letters, so it tiles a 3x3. */
.logo {
  width: 32px; height: 32px;
  background: var(--accent); color: #fff;
  border-radius: 8px;
  display: grid; grid-template-columns: repeat(3, 1fr); place-items: center;
  font-weight: 700; font-size: 8px; line-height: 1; letter-spacing: -0.02em;
  padding: 3.5px;
}
.brand .name { font-weight: 600; font-size: 15px; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 18px;
  color: var(--ink-soft);
  font-size: 13px;
}
.nav-item:hover { background: #f0f0f2; }
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-right: 2px solid var(--accent);
  font-weight: 500;
}
.nav-item .icon { width: 18px; text-align: center; }
.nav-section {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--unknown); padding: 16px 18px 5px; font-weight: 600;
}
.sidebar-foot {
  margin-top: auto; padding: 14px 18px 0;
  border-top: 1px solid var(--line);
  font-size: 12px; color: var(--ink-faint);
}
.sidebar-foot .who { color: var(--ink); font-weight: 500; }

.main { flex: 1; padding: 26px 30px; min-width: 0; }

.page-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 22px; gap: 16px;
}
.page-head h1 { font-size: 23px; font-weight: 600; }
.page-head .sub { color: var(--ink-faint); font-size: 13px; margin-top: 2px; }

.breadcrumb { font-size: 12px; color: var(--ink-faint); margin-bottom: 6px; }
.breadcrumb a:hover { color: var(--accent); }

/* ------------------------------------------------------------------- stats */

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 16px;
}
.stat .label {
  font-size: 11px; color: var(--ink-faint);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.stat .value { font-size: 27px; font-weight: 700; margin-top: 3px; line-height: 1.1; }
.stat .value.ok { color: var(--ok); }
.stat .value.warn { color: var(--warn); }
.stat .value.crit { color: var(--crit); }
.stat .value.accent { color: var(--accent); }
.stat .sub { font-size: 12px; color: var(--unknown); margin-top: 2px; }

/* ------------------------------------------------------------------ tables */

.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; overflow: hidden; margin-bottom: 20px;
}
.panel-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 16px; border-bottom: 1px solid var(--line);
}
.panel-head h2 { font-size: 14px; font-weight: 600; }
.panel-head .count { font-size: 12px; color: var(--ink-faint); }

table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; padding: 9px 16px;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--ink-faint); font-weight: 600;
  background: #fafafa; border-bottom: 1px solid var(--line);
}
td { padding: 11px 16px; font-size: 13px; border-bottom: 1px solid #f2f2f7; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafafa; }
td.numeric { font-variant-numeric: tabular-nums; }

/* Status is never colour alone: the dot carries a shape and the label carries words,
   so it survives a monochrome printer and colour-blind readers alike. */
.dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 6px; vertical-align: middle;
}
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.crit { background: var(--crit); }
.dot.unknown { background: var(--unknown); }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 500;
}
.badge.ok { background: #e8f8ed; color: #1a7f37; }
.badge.warn { background: #fff3e0; color: #b35c00; }
.badge.crit { background: #ffeaea; color: #d1242f; }
.badge.unknown { background: #f2f2f7; color: var(--ink-faint); }

/* ------------------------------------------------------------------- cards */

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 15px;
}
.card h3 {
  font-size: 11px; color: var(--ink-faint);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 10px; font-weight: 600;
}
.row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 13px; }
.row .k { color: var(--ink-faint); }
.row .v { font-weight: 500; text-align: right; }

.device-head { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 20px; }
.device-icon {
  width: 60px; height: 60px; background: #f2f2f7; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 30px;
  flex-shrink: 0;
}
.device-head h1 { font-size: 20px; font-weight: 600; }
.device-head .sub { font-size: 13px; color: var(--ink-faint); margin-top: 2px; }

.check-group { margin-bottom: 4px; }
.check-group h4 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--ink-faint); padding: 12px 16px 6px; font-weight: 600;
}
.check { display: flex; align-items: baseline; gap: 10px; padding: 8px 16px; border-bottom: 1px solid #f6f6f8; }
.check:last-child { border-bottom: none; }
.check .title { flex: 1; font-size: 13px; }
.check .detail { color: var(--ink-faint); font-size: 12px; flex: 1.4; }

.empty { padding: 30px 16px; text-align: center; color: var(--ink-faint); font-size: 13px; }

.button {
  display: inline-block; padding: 7px 14px; border-radius: 7px;
  font-size: 13px; font-weight: 500; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink-soft);
}
.button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }

.token { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; }

@media (max-width: 900px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .cards { grid-template-columns: 1fr; }
}

/* ----------------------------------------------------------------- banners */

/* The support-access banner is the loudest thing on a tenant's page while a grant is
   live, and deliberately so: a disclosure the reader has to hunt for is not one. */
.banner {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 16px; margin-bottom: 18px; font-size: 13px;
}
.banner-notice { background: #fff8e6; border-color: #f0d9a0; }
.banner ul { margin: 6px 0 0 18px; }
.banner li { margin-top: 2px; }

/* ---------------------------------------------------------- platform admin */

/* Visually distinct from a tenant dashboard on purpose. Confusing "the platform" with
   "a tenant" is the mistake that ends with an operator running a destructive action
   against a customer, so the two must never look alike. */
.platform .sidebar { background: #1c1c22; }
.platform .sidebar .name,
.platform .sidebar .nav-item,
.platform .sidebar .sidebar-foot { color: #e6e6ea; }
.platform .sidebar .nav-item.active { background: #2c2c36; }
.platform .sidebar .logo { background: #6b6bd6; }

.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input[type="text"] { flex: 1; min-width: 180px; }
