/* ATLAS V6 — Shell Layout + Component Overrides
   AppShell, Topbar, Sidebar, Panel, Badge, Chip, Button, Table patterns.
   Extracted from atlas-v6-mockup/index.html. Load AFTER v6-tokens.css. */

/* === APP SHELL === */
.app, .frame {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* === SIDEBAR === */
.sidebar, [class*="rail"] {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--nav, #141b22), #0f151b);
  color: var(--nav-text, #edf4fb);
  border-right: 1px solid rgba(255,255,255,.08);
  overflow: hidden auto;
}

/* Brand mark */
.mark, [class*="brand-mark"] {
  background: linear-gradient(145deg, #0e8d84, #284f94 54%, #d6a340);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.24), 0 14px 28px rgba(0,0,0,.24);
  color: #fff;
}

/* Nav items — larger, more breathing room */
[class*="rail-item"], .nav-item {
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 750;
  color: var(--nav-text);
}

[class*="rail-item"]:hover, .nav-item:hover,
[class*="rail-item"]:focus-visible, .nav-item:focus-visible {
  outline: 2px solid rgba(204,156,67,.35);
  outline-offset: 1px;
  background: rgba(255,255,255,.06);
}

[class*="rail-item"].active, .nav-item.active {
  background: rgba(255,255,255,.1);
  box-shadow: inset 3px 0 0 var(--gold, #c18a25);
}

/* Nav group headings */
[class*="rail-group"] > [class*="header"], .nav-heading {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--nav-muted, #9fb0bf);
  padding: 0 6px;
  margin-bottom: 8px;
  margin-top: 18px;
}

/* Nav sub-state token (e.g. LIVE / SRC / SYNC) */
.nav-state {
  font: 700 11px var(--font-mono);
  color: #e4bd67;
}

/* Sidebar footer card */
.side-card {
  margin-top: auto;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--nav-text);
}

/* === TOPBAR === */
.topbar, [class*="status-bar"] {
  height: var(--topbar-height, 76px);
  display: grid;
  grid-template-columns: minmax(320px, 580px) 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,253,248,.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

/* Topbar status chips */
.chip, [class*="qs-chip"] {
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 750;
  font-size: 13px;
  box-shadow: 0 1px 0 rgba(255,255,255,.7);
  white-space: nowrap;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--teal);
  box-shadow: 0 0 0 3px rgba(15,133,124,.13);
}

/* === PANELS / CARDS === */
.panel, [class*="-card"], [class*="-panel"] {
  background: rgba(255,253,248,.94);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--soft-shadow);
}

/* Dark feature panel (operating-graph / recommendation surfaces) */
.panel.dark {
  background: linear-gradient(145deg, #121d27, #172832);
  color: #eff6fb;
  border-color: rgba(255,255,255,.12);
  box-shadow: 0 26px 54px rgba(16,23,34,.22);
}

/* Panel headers */
[class*="panel-h"], [class*="-header"]:not(.nav-heading) {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.panel.dark .panel-h { border-color: rgba(255,255,255,.1); }

/* Panel header titles */
[class*="panel-h"] h3, [class*="panel-h"] [class*="-title"] {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  margin: 0;
}

/* === TYPOGRAPHY === */
h1, h2 {
  font-family: var(--font-display);
  font-weight: 850;
  letter-spacing: 0;
}

h2 { font-size: 32px; line-height: 1.08; }
h3 { font-size: 18px; line-height: 1.2; }
h4 { font-size: 15px; line-height: 1.3; }

.lede, .page-description {
  font-size: 16px;
  color: #526175;
  max-width: 820px;
  margin-top: 8px;
}

/* Page headings */
.page-head, [class*="view-header"] {
  margin-bottom: 14px;
}

.eyebrow, [class*="-eyebrow"] {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #536174;
  margin-bottom: 5px;
}

/* === BADGES / STATUS CHIPS === */
.badge, [class*="-badge"], [class*="status-"] {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
  color: #5e3d03;
  background: #fbecd0;
  border: none;
}

.badge.teal, [class*="status-good"] { color: #07534d; background: #d8f2ee; }
.badge.blue, [class*="status-info"] { color: #17468e; background: #e0e9fb; }
.badge.rose, [class*="status-bad"]  { color: #9c1844; background: #fde1ea; }
.badge.green, [class*="status-live"] { color: #17623a; background: #dff2e7; }

/* === SEARCH BAR === */
.search, #global-search, [type="search"] {
  height: 44px;
  border: 1px solid var(--line);
  background: #f0eee8;
  border-radius: 8px;
  padding: 0 14px;
  font-size: 15px;
  color: var(--ink);
  outline: none;
}

.search input {
  border: 0;
  background: transparent;
  outline: 0;
  width: 100%;
  color: var(--ink);
  font-size: 15px;
}

.search:focus, .search:focus-within, [type="search"]:focus {
  border-color: var(--gold);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(193,138,37,.15);
}

/* === BUTTONS === */
.primary-btn, [class*="btn-primary"] {
  height: 42px;
  border-radius: 8px;
  background: linear-gradient(180deg, #d7a13a, #bd8420);
  color: #201505;
  border: 1px solid #b67c19;
  font-weight: 800;
  padding: 0 16px;
  box-shadow: var(--soft-shadow);
}

.secondary-btn, [class*="btn-secondary"] {
  height: 42px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  font-weight: 750;
  padding: 0 16px;
  box-shadow: var(--soft-shadow);
}

.icon-btn {
  height: 42px;
  width: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  font-weight: 800;
  box-shadow: var(--soft-shadow);
}

/* === TABLES === */
table { border-collapse: collapse; width: 100%; }
th {
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
td {
  font-size: 15px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
tr:hover td { background: rgba(193,138,37,.04); }

/* === NUMBERED MARKERS (brief/decision rows) === */
.num {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--teal);
  color: #fff;
  font-weight: 850;
}

/* === METRIC TILES === */
.metric small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.metric strong {
  margin-top: 4px;
  display: block;
  font: 850 30px var(--font-display);
  color: var(--ink);
}
.metric span { color: var(--muted); font-size: 13px; }
