/* WordYeah Console v3 - Product-Native Asymmetric 66%/34% Botanical-Lime Bento
 * Strictly font-weight: 400, flat surfaces (box-shadow: none), zero backdrop-filter,
 * zero left colored accent bars, zero Emoji icons.
 */

[hidden] {
  display: none !important;
}

:root {
  --bg-canvas: #f5f6f8;
  --bg-surface: #ffffff;
  --bg-subtle: #f5f6f8;
  --bar-muted: #eceef2;
  --line: rgba(20, 22, 25, 0.07);
  --line-strong: rgba(20, 22, 25, 0.14);
  --ink: #141619;
  --ink-secondary: #5c6370;
  --ink-muted: #8c93a0;
  --cta-bg: #141619;
  --cta-fg: #ffffff;
  --cta-hover: #262a31;
  --lime: #84cc16;
  --lime-hero-start: #8fd41f;
  --lime-hero-end: #6eb50c;
  --lime-deep: #4d7c0f;
  --chartreuse: #d4ef5c;
  --lime-soft: #eef8dc;
  --amber: #f59e42;
  --amber-soft: #fff4e5;
  --amber-deep: #b45309;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --radius-card: 18px;
  --radius-ctrl: 10px;
  --radius-pill: 999px;
  --sidebar-w: 224px;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  --font-mono: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

:root[data-theme="dark"] {
  --bg-canvas: #0e1014;
  --bg-surface: #161920;
  --bg-subtle: #1e222b;
  --bar-muted: #252a35;
  --line: #262b36;
  --line-strong: #343b4a;
  --ink: #f1f3f6;
  --ink-secondary: #9aa2b1;
  --ink-muted: #6c7484;
  --cta-bg: #84cc16;
  --cta-fg: #111318;
  --cta-hover: #9ad83b;
  --lime-hero-start: #689f11;
  --lime-hero-end: #4b7a08;
  --lime-deep: #a3e635;
  --lime-soft: rgba(132, 204, 22, 0.14);
  --amber-soft: rgba(245, 158, 66, 0.15);
  --amber-deep: #fbbf24;
  --danger-soft: rgba(220, 38, 38, 0.15);
  --shield-fg: #f7faf2;
  --shield-fg-muted: rgba(247, 250, 242, 0.8);
  --shield-bar-bg: rgba(14, 16, 20, 0.28);
  --shield-pill-bg: rgba(14, 16, 20, 0.26);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, th, strong, b, button, input, select, textarea, svg text { font-weight: 400; font-family: inherit; }

button {
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  padding: 0;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }

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

.tabular { font-variant-numeric: tabular-nums; }

.mono { font-family: var(--font-mono); }

/* ===== App Shell ===== */
.app-shell { display: flex; min-height: 100vh; width: 100%; background: var(--bg-canvas); }

/* ===== Left Collapsible Pure-White Sidebar ===== */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 18px 14px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: width 180ms ease, flex-basis 180ms ease, padding 180ms ease;
  z-index: 20;
}

.app-shell.is-collapsed .sidebar { width: 68px; flex-basis: 68px; padding: 18px 10px 14px; }

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 18px;
  min-height: 44px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--cta-bg);
  color: var(--cta-fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
}

.brand-cn { font-size: 16px; color: var(--ink); letter-spacing: 0.02em; }

.brand-en { font-size: 11px; color: var(--ink-muted); letter-spacing: 0.08em; }

.app-shell.is-collapsed .brand-text,
.app-shell.is-collapsed .nav-label,
.app-shell.is-collapsed .nav-chevron,
.app-shell.is-collapsed .nav-sub,
.app-shell.is-collapsed .sidebar-license-strip,
.app-shell.is-collapsed .collapse-label { display: none; }

.app-shell.is-collapsed .brand-row { justify-content: center; padding: 4px 0 18px; }

.nav-list { display: flex; flex-direction: column; gap: 3px; }

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  color: var(--ink-secondary);
  font-size: 13.5px;
  text-align: left;
  transition: background 140ms ease, color 140ms ease;
}

.nav-item:hover { background: var(--bg-subtle); color: var(--ink); }

.nav-item.is-active { background: var(--bg-canvas); color: var(--ink); }

.app-shell.is-collapsed .nav-item { justify-content: center; padding: 10px; }

.nav-icon { width: 17px; height: 17px; flex-shrink: 0; color: inherit; }

.nav-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav-chevron { width: 14px; height: 14px; color: var(--ink-muted); transition: transform 160ms ease; }

.nav-group.is-open .nav-chevron { transform: rotate(180deg); }

.nav-sub { display: none; flex-direction: column; gap: 2px; padding: 3px 0 4px 31px; }

.nav-group.is-open .nav-sub { display: flex; }

.nav-sub-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink-secondary);
  text-align: left;
}

.nav-sub-item:hover { background: var(--bg-subtle); color: var(--ink); }

.nav-sub-item.is-active { background: var(--bg-canvas); color: var(--ink); }

.nav-badge {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  color: var(--ink-secondary);
}

.nav-divider { height: 1px; background: var(--line); margin: 12px 4px; }

.sidebar-spacer { flex: 1; }

.sidebar-license-strip {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11.5px;
}

.sidebar-license-text { color: var(--ink-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-license-link { color: var(--lime-deep); font-size: 11.5px; white-space: nowrap; flex-shrink: 0; }

.sidebar-license-link:hover { text-decoration: underline; }

.collapse-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  margin-top: 8px;
  border-radius: 10px;
  color: var(--ink-muted);
  font-size: 13px;
}

.collapse-btn:hover { background: var(--bg-subtle); color: var(--ink); }

.app-shell.is-collapsed .collapse-btn { justify-content: center; }

.app-shell.is-collapsed .collapse-icon { transform: rotate(180deg); }

/* ===== Main Workspace & Top Bar ===== */
.workspace {
  flex: 1;
  min-width: 0;
  padding: 20px 30px 44px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.mobile-menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 360px;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 0 12px;
  height: 38px;
  gap: 8px;
}

.search-box:focus-within { border-color: var(--line-strong); }

.search-icon { width: 15px; height: 15px; color: var(--ink-muted); flex-shrink: 0; }

.search-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  outline: none;
}

.search-input::placeholder { color: var(--ink-muted); }

.search-kbd {
  font-size: 11px;
  color: var(--ink-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
  flex-shrink: 0;
}

.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-secondary);
  position: relative;
}

.icon-btn:hover { border-color: var(--line-strong); color: var(--ink); }

.icon-dot {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 3px 12px 3px 4px;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--lime-soft);
  color: var(--lime-deep);
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.user-meta { display: flex; flex-direction: column; line-height: 1.2; }

.user-name { font-size: 12.5px; color: var(--ink); }

.user-sub { font-size: 10.5px; color: var(--ink-muted); }

/* ===== Buttons & Controls ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  white-space: nowrap;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.btn-primary { background: var(--cta-bg); color: var(--cta-fg); }

.btn-primary:hover { background: var(--cta-hover); }

.btn-surface { background: var(--bg-surface); border: 1px solid var(--line); color: var(--ink); }

.btn-surface:hover { border-color: var(--line-strong); background: var(--bg-subtle); }

.btn-ghost { color: var(--ink-secondary); padding: 0 8px; }

.btn-ghost:hover { color: var(--ink); background: var(--bg-subtle); }

.btn-danger { background: var(--danger); color: #ffffff; }

.btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; }

.segmented {
  display: inline-flex;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 2px;
  width: fit-content;
  gap: 2px;
}

.segmented-item {
  height: 26px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  color: var(--ink-secondary);
  white-space: nowrap;
}

.segmented-item.is-active { background: var(--bg-surface); color: var(--ink); border: 1px solid var(--line); }

.select,
.input,
.textarea {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-ctrl);
  color: var(--ink);
  font-size: 13px;
  padding: 8px 11px;
  outline: none;
}

.select-compact {
  appearance: none;
  -webkit-appearance: none;
  width: auto;
  min-width: 104px;
  height: 30px;
  padding: 0 26px 0 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  background-color: var(--bg-subtle);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238c93a0' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  cursor: pointer;
}

.select:focus,
.input:focus,
.textarea:focus { border-color: var(--line-strong); }

.textarea { min-height: 92px; resize: vertical; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  background: var(--bg-subtle);
  color: var(--ink-secondary);
  white-space: nowrap;
}

.pill-lime { background: var(--lime-soft); color: var(--lime-deep); }

.pill-amber { background: var(--amber-soft); color: var(--amber-deep); }

.pill-danger { background: var(--danger-soft); color: var(--danger); }

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  flex-shrink: 0;
}

.status-dot.is-amber { background: var(--amber); }

.status-dot.is-muted { background: var(--ink-muted); }

.status-dot.is-danger { background: var(--danger); }

/* ===== Bento Card Primitives ===== */
.bento-card {
  min-width: 0;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 22px 26px;
  box-shadow: none;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.card-title { margin: 0; font-size: 15px; color: var(--ink); line-height: 1.35; }

.card-sub { margin: 3px 0 0; font-size: 12px; color: var(--ink-muted); }

.card-meta { font-size: 12px; color: var(--ink-muted); white-space: nowrap; }

.link-action {
  align-self: flex-start;
  font-size: 12.5px;
  color: var(--ink-secondary);
  background: transparent;
  padding: 0;
  white-space: nowrap;
  transition: color 140ms ease;
}

.link-action:hover { color: var(--ink); }

.stack-16 { display: flex; flex-direction: column; gap: 20px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }

/* ===== v5 Calm & Airy Full-Width Bento ===== */
.overview-bento { display: flex; flex-direction: column; gap: 20px; }

/* ===== Row 1 (Full-Width 通栏): Spacious Hero Chart (~72%) + 3 Calm Metrics (~28%) ===== */
.hero-unified-card { padding: 0; display: grid; grid-template-columns: minmax(0, 7.2fr) minmax(248px, 2.8fr); overflow: hidden; }

.hero-chart-pane { padding: 24px 28px 22px; display: flex; flex-direction: column; min-width: 0; }

.hero-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.hero-stat-block { display: flex; align-items: baseline; gap: 9px; min-width: 0; }

.hero-num { font-size: 31px; line-height: 1.1; color: var(--ink); letter-spacing: -0.02em; }

.hero-num-sub { font-size: 12.5px; color: var(--ink-muted); white-space: nowrap; }

.chart-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.chart-legend {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--ink-secondary);
  margin-right: 4px;
}

.legend-item { display: inline-flex; align-items: center; gap: 5px; }

.legend-dot { width: 7px; height: 7px; border-radius: 50%; }

.stacked-chart-wrap {
  position: relative;
  height: 196px;
  flex: 1;
  min-height: 190px;
  padding-left: 40px;
  padding-bottom: 22px;
}

.stacked-grid {
  position: absolute;
  inset: 6px 0 22px 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.grid-line { border-top: 1px dashed var(--line); position: relative; }

.grid-label {
  position: absolute;
  left: 0;
  top: -8px;
  font-size: 11px;
  color: var(--ink-muted);
  width: 30px;
  text-align: right;
}

.bars-area {
  position: relative;
  height: 100%;
  display: grid;
  gap: 8px;
  align-items: end;
  z-index: 2;
}

.bar-col {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  cursor: pointer;
}

.bar-stack {
  width: 100%;
  max-width: 44px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
}

.bar-seg { width: 100%; border-radius: 5px; background: var(--bar-muted); transition: background 140ms ease, height 220ms ease; }

.bar-col.is-active .bar-seg-block,
.bar-col:hover .bar-seg-block { background: var(--amber); }

.bar-col.is-active .bar-seg-pass,
.bar-col:hover .bar-seg-pass { background: var(--lime); }

.bar-col.is-active .bar-seg-auto,
.bar-col:hover .bar-seg-auto { background: var(--chartreuse); }

.bar-day { font-size: 11px; color: var(--ink-muted); white-space: nowrap; }

.bar-col.is-active .bar-day { color: var(--ink); }

.chart-popover {
  position: absolute;
  top: 6px;
  width: 178px;
  background: var(--bg-surface);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 9px 11px;
  z-index: 6;
  pointer-events: none;
  box-shadow: none;
}

.popover-date {
  font-size: 11.5px;
  color: var(--ink);
  margin-bottom: 5px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.popover-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--ink-secondary);
  padding: 1.5px 0;
}

.popover-val { color: var(--ink); }

.posture-strip {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--ink-secondary);
}

.posture-item { display: inline-flex; align-items: center; gap: 6px; }

.hero-kpi-pane {
  border-left: 1px solid var(--line);
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.side-kpi-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.side-kpi-item:last-child { padding-bottom: 0; border-bottom: 0; }

.side-kpi-label { font-size: 12.5px; color: var(--ink-secondary); }

.side-kpi-val { font-size: 28px; line-height: 1.15; color: var(--ink); letter-spacing: -0.02em; }

.side-kpi-sub {
  font-size: 12px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Row 2 (Full-Width 通栏): Quota + Calm Experience Card ===== */
.l2-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: stretch; }

.quota-card { display: flex; flex-direction: column; justify-content: space-between; }

.quota-track {
  width: 100%;
  height: 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  overflow: hidden;
  margin: 6px 0 14px;
}

.quota-fill { height: 100%; border-radius: var(--radius-pill); background: var(--lime); transition: width 240ms ease; }

.quota-foot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--ink-secondary);
}

.experience-card { display: flex; flex-direction: column; justify-content: center; }

.experience-body {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.experience-copy { display: flex; flex-direction: column; gap: 8px; max-width: 390px; }

.experience-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink-secondary);
}

.pow-stepped-chart {
  display: grid;
  grid-template-columns: repeat(4, 18px);
  gap: 5px;
  align-items: end;
  height: 76px;
  flex-shrink: 0;
}

.step-col {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  height: 100%;
}

.step-block { width: 18px; height: 11px; border-radius: 3px; background: var(--bar-muted); }

/* ===== Row 3 (Full-Width 通栏): 3 Spacious Pure-White Security Diagnostic Cards ===== */
.l3-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.08fr);
  gap: 20px;
  align-items: stretch;
}

/* ===== Row 4 (Full-Width 通栏): Spacious Recent Events + Connected Sites ===== */
.l4-row {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}

.diag-card { display: flex; flex-direction: column; }

.stat-big { font-size: 24px; line-height: 1.15; color: var(--ink); margin-bottom: 8px; }

.segment-bar { display: flex; height: 9px; gap: 3px; margin-bottom: 14px; }

.segment-piece { border-radius: 4px; height: 100%; }

.reason-list { display: flex; flex-direction: column; gap: 9px; flex: 1; }

.reason-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 12.5px;
}

.reason-left {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reason-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

.reason-pct { color: var(--ink-secondary); flex-shrink: 0; }

/* 16-Segment Radial Arc Gauge */
.health-card { justify-content: space-between; }

.gauge-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 2px 0;
}

.gauge-svg { width: 100%; max-width: 224px; height: auto; display: block; }

.card-foot-line {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--ink-muted);
  text-align: center;
}

/* Edge Nodes & Capabilities (Image 0 Style: Subtle Circular Icon + Slim Lime Bar) */
.eco-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
  flex: 1;
  justify-content: space-between;
}

.eco-row { display: flex; align-items: center; gap: 10px; }

.eco-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  color: var(--ink-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.eco-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }

.eco-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  font-size: 12.5px;
}

.eco-name { color: var(--ink); white-space: nowrap; }

.eco-host {
  font-size: 11px;
  color: var(--ink-muted);
  white-space: nowrap;
  line-height: 1.3;
  margin-bottom: 3px;
}

.eco-val { color: var(--ink-secondary); font-size: 11.5px; flex-shrink: 0; }

.eco-bar-track {
  width: 100%;
  height: 5px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  overflow: hidden;
}

.eco-bar-fill { height: 100%; border-radius: var(--radius-pill); background: var(--lime); }

/* Card 4: Recent Security Events + Switchable Connected Sites (Pure-White Card) */
.feed-card { display: flex; flex-direction: column; }

.feed-list { display: flex; flex-direction: column; gap: 7px; flex: 1; }

.feed-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}

.feed-row:last-child { padding-bottom: 0; border-bottom: 0; }

.feed-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.feed-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--lime-soft);
  color: var(--lime-deep);
}

.feed-icon.is-warn { background: var(--amber-soft); color: var(--amber-deep); }

.feed-icon.is-danger { background: rgba(220, 38, 38, 0.1); color: var(--danger); }

.feed-text { min-width: 0; }

.feed-title {
  font-size: 12.5px;
  color: var(--ink);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed-sub {
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.feed-badge { font-size: 12px; color: var(--ink); white-space: nowrap; }

.feed-time { font-size: 10.5px; color: var(--ink-muted); white-space: nowrap; }

.site-matrix-list { display: flex; flex-direction: column; gap: 8px; flex: 1; }

.site-row-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--bg-subtle);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.site-row-card:hover { border-color: var(--line-strong); background: var(--bg-surface); }

.site-row-card.is-selected { border-color: var(--lime); background: var(--lime-soft); }

.site-row-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.site-row-info { min-width: 0; display: flex; flex-direction: column; gap: 1px; }

.site-row-domain {
  font-size: 12.5px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-row-meta { font-size: 11px; color: var(--ink-muted); white-space: nowrap; }

.site-inline-acts { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; }

.site-mini-btn {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--bg-surface);
  color: var(--ink-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 140ms ease, color 140ms ease;
}

.site-mini-btn:hover { border-color: var(--line-strong); color: var(--ink); }

.site-mini-btn.is-paused { border-color: var(--amber); background: var(--amber-soft); color: var(--amber-deep); }

/* ===== Sub-Views, Tables, Code, Settings ===== */
.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.view-title { margin: 0; font-size: 18px; color: var(--ink); }

.view-sub { margin: 3px 0 0; font-size: 12.5px; color: var(--ink-muted); }

.table-wrap { width: 100%; overflow-x: auto; }

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }

.data-table th {
  text-align: left;
  font-size: 12px;
  color: var(--ink-muted);
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.data-table td { padding: 12px; border-bottom: 1px solid var(--line); color: var(--ink); vertical-align: middle; }

.data-table tr:last-child td { border-bottom: 0; }

.code-card { background: var(--bg-subtle); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-secondary);
}

.code-pre {
  margin: 0;
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink);
  overflow-x: auto;
  white-space: pre;
}

.field { margin-bottom: 14px; }

.field-label { display: block; font-size: 12.5px; color: var(--ink-secondary); margin-bottom: 6px; }

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.setting-row:last-child { border-bottom: 0; padding-bottom: 0; }

.setting-name { font-size: 13.5px; color: var(--ink); }

.setting-desc { font-size: 12px; color: var(--ink-muted); margin-top: 2px; }

.switch {
  width: 40px;
  height: 22px;
  border-radius: var(--radius-pill);
  background: var(--bar-muted);
  position: relative;
  flex-shrink: 0;
  transition: background 160ms ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-surface);
  transition: transform 160ms ease;
}

.switch[aria-checked="true"] { background: var(--lime); }

.switch[aria-checked="true"]::after { transform: translateX(18px); }

/* ===== Empty State ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 44px 20px;
  gap: 8px;
}

.empty-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  color: var(--ink-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.empty-title { margin: 0; font-size: 15.5px; color: var(--ink); }

.empty-desc { margin: 0; max-width: 440px; font-size: 13px; color: var(--ink-muted); }

/* ===== Slide-Over Drawer & Toast ===== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(14, 16, 20, 0.36);
  z-index: 50;
  display: flex;
  justify-content: flex-end;
}

.drawer-panel {
  width: 100%;
  max-width: 460px;
  height: 100%;
  background: var(--bg-surface);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.drawer-title { margin: 0; font-size: 15px; color: var(--ink); }

.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px; }

.drawer-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 24px;
  background: var(--cta-bg);
  color: var(--cta-fg);
  padding: 9px 15px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  z-index: 60;
}

/* ===== Responsive Breakpoints ===== */
@media (max-width: 1120px) {
  .l3-row,
  .l4-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .sidebar {
    position: fixed;
    left: -240px;
    top: 0;
    bottom: 0;
    transition: left 180ms ease;
  }
  .app-shell.is-mobile-open .sidebar {
    left: 0;
  }
  .mobile-menu-btn {
    display: inline-flex;
  }
  .workspace {
    padding: 12px 14px 28px;
  }
  .hero-unified-card,
  .l2-row,
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .hero-kpi-pane {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .topbar {
    flex-wrap: wrap;
    gap: 10px;
  }
  .topbar-left {
    width: 100%;
  }
  .search-box {
    max-width: none;
  }
  .topbar-right {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  .chart-controls {
    width: 100%;
  }
  .select-compact {
    flex: 1;
    min-width: 0;
  }
  .user-meta,
  .search-kbd {
    display: none;
  }
  .user-pill {
    padding: 3px;
  }
}
