:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --text: #111827;
  --muted: #64748b;
  --line: #e5e7eb;
  --blue: #2563eb;
  --teal: #0f766e;
  --orange: #ea580c;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #b45309;
  --ink: #0f172a;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, .28);
  --accent-ring: rgba(37, 99, 235, .16);
  --sidebar-bg: #0f172a;
  --hero-start: rgba(15, 23, 42, .96);
  --hero-end: rgba(17, 24, 39, .92);
  --hero-muted: #a7f3d0;
}

* { box-sizing: border-box; }

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
}

body[data-instance="arma"] {
  --accent: #0f766e;
  --accent-strong: #115e59;
  --accent-soft: rgba(15, 118, 110, .30);
  --accent-ring: rgba(15, 118, 110, .16);
  --sidebar-bg: #10201f;
  --hero-start: rgba(6, 45, 43, .97);
  --hero-end: rgba(20, 83, 45, .92);
  --hero-muted: #fcd34d;
}

button, input, select {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, var(--accent-ring), rgba(234, 88, 12, 0.08)),
    #f7f8fb;
  padding: 32px;
}

.login-layout {
  width: min(1080px, 100%);
  min-height: 640px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr);
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, .10);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(15, 23, 42, .14);
}

.login-hero {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: 42px;
  color: #f8fafc;
  background:
    linear-gradient(140deg, var(--hero-start), var(--hero-end)),
    #111827;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-brand strong,
.login-brand span {
  display: block;
}

.login-brand span {
  margin-top: 2px;
  color: var(--hero-muted);
  font-size: 12px;
}

.login-copy {
  max-width: 560px;
}

.login-copy h1 {
  margin: 10px 0 14px;
  color: white;
  font-size: 50px;
  line-height: 1.02;
}

.login-copy p {
  margin: 0;
  max-width: 520px;
  color: #cbd5e1;
  font-size: 16px;
  line-height: 1.7;
}

.login-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.login-metrics div {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 10px;
  padding: 13px;
  background: rgba(255, 255, 255, .06);
}

.login-metrics span {
  display: block;
  color: #94a3b8;
  font-size: 12px;
}

.login-metrics strong {
  display: block;
  margin-top: 5px;
  color: white;
  font-size: 15px;
}

.login-card-shell {
  display: grid;
  align-items: center;
  padding: 42px;
}

.login-panel {
  width: 100%;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, .10);
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

.login-panel-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.login-panel h2 {
  margin: 6px 0 0;
  font-size: 25px;
  line-height: 1.2;
}

.login-panel p {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.login-panel label {
  display: grid;
  gap: 8px;
  margin: 28px 0 14px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.login-panel input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.login-panel input:focus,
.toolbar select:focus,
.search-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: #f1f5f9;
  color: var(--accent);
  outline: none;
}

.eye-icon {
  position: relative;
  width: 22px;
  height: 15px;
}

.eye-icon::before {
  content: "";
  position: absolute;
  inset: 1px 0;
  border: 1.8px solid currentColor;
  border-radius: 999px 999px 999px 999px / 780px 780px 780px 780px;
  transform: rotate(-8deg);
}

.eye-icon::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.password-toggle.visible .eye-icon {
  width: 23px;
}

.password-toggle.visible .eye-icon::before {
  opacity: .82;
}

.password-toggle.visible .eye-icon::after {
  top: -1px;
  left: 10px;
  width: 2px;
  height: 18px;
  border-radius: 2px;
  background: currentColor;
  transform: rotate(43deg);
}

.login-panel button[type="submit"],
.toolbar button,
.logout {
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  padding: 0 14px;
  font-weight: 700;
}

.login-panel button[type="submit"] {
  width: 100%;
  height: 48px;
  background: #111827;
  transition: transform .16s ease, background .16s ease;
}

.login-panel button[type="submit"]:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.login-panel button[type="submit"]:disabled {
  cursor: wait;
  opacity: .72;
  transform: none;
}

.form-error {
  min-height: 20px;
  margin-top: 12px !important;
  color: var(--red) !important;
}

.lang-switch {
  display: inline-grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
}

.lang-switch button {
  min-width: 38px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.lang-switch button.active {
  background: #111827;
  color: white;
}

.lang-switch.compact {
  align-self: end;
  height: 38px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--sidebar-bg);
  color: white;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 14px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--accent);
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 2px;
  color: #94a3b8;
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 6px;
  align-content: start;
  min-height: 0;
  overflow: auto;
}

.nav button,
.logout {
  width: 100%;
  text-align: left;
  color: #cbd5e1;
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
}

.nav button.active,
.nav button:hover {
  color: white;
  background: var(--accent-soft);
}

.logout {
  border: 1px solid rgba(255,255,255,.12);
  text-align: center;
}

.sidebar-bottom {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.mode-switch {
  width: 100%;
  display: grid;
  gap: 4px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
  background: rgba(255,255,255,.04);
  color: white;
  padding: 12px;
  text-align: left;
}

.mode-switch:hover,
.mode-switch.active {
  border-color: rgba(255,255,255,.24);
  background: var(--accent-soft);
}

.mode-switch span,
.mode-switch small {
  display: block;
  color: #94a3b8;
  font-size: 11px;
}

.mode-switch strong {
  display: block;
  color: #fff;
  font-size: 15px;
}

body[data-workspace="playbook"] .dashboard-toolbar-control,
body[data-workspace="playbook"] .health-bar {
  display: none;
}

.content {
  min-width: 0;
  padding: 24px 28px 48px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}

.topbar h1 {
  margin: 0 0 6px;
  font-size: 25px;
}

.topbar p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}

.toolbar label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.toolbar select {
  min-width: 150px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 0 10px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.card .label {
  color: var(--muted);
  font-size: 12px;
}

.card .value {
  margin-top: 7px;
  font-size: 24px;
  font-weight: 800;
}

.card .sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.health-bar {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 16px;
  margin: -4px 0 16px;
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 8px;
  background: #fff;
  padding: 13px 14px;
}

.health-bar[hidden] {
  display: none;
}

.health-bar.ok {
  border-left-color: var(--green);
  background: #f0fdf4;
}

.health-bar.pending {
  border-left-color: var(--blue);
  background: #eff6ff;
}

.health-bar.warning {
  border-left-color: var(--amber);
  background: #fffbeb;
}

.health-bar.delayed,
.health-bar.error {
  border-left-color: var(--red);
  background: #fef2f2;
}

.health-main {
  display: flex;
  gap: 10px;
  min-width: 260px;
}

.health-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--muted);
}

.health-bar.ok .health-dot { background: var(--green); }
.health-bar.pending .health-dot { background: var(--blue); }
.health-bar.warning .health-dot { background: var(--amber); }
.health-bar.delayed .health-dot,
.health-bar.error .health-dot { background: var(--red); }

.health-title {
  font-size: 14px;
  font-weight: 800;
}

.health-main p {
  margin: 4px 0 0;
  max-width: 680px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.health-items {
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 8px;
}

.health-item {
  min-width: 106px;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
  padding: 8px 10px;
}

.health-item span,
.health-item strong {
  display: block;
}

.health-item span {
  color: var(--muted);
  font-size: 11px;
}

.health-item strong {
  margin-top: 3px;
  font-size: 12px;
  font-weight: 800;
}

.health-item.ok strong {
  color: var(--green);
}

.health-item.bad strong {
  color: var(--red);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}

.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 14px;
  overflow: hidden;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 0;
}

.panel h2 {
  margin: 0;
  font-size: 17px;
}

.playbook-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 22px;
}

.playbook-hero h2 {
  max-width: 920px;
  margin: 8px 0 8px;
  font-size: 30px;
  line-height: 1.2;
}

.playbook-hero p:last-child {
  max-width: 820px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.playbook-version-card,
.playbook-outline-card {
  display: grid;
  gap: 6px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fafc;
  padding: 14px;
}

.playbook-version-card span,
.playbook-outline-card span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.playbook-version-card strong,
.playbook-outline-card strong {
  font-size: 26px;
}

.playbook-version-card small,
.playbook-outline-card small {
  color: var(--muted);
  line-height: 1.45;
}

.playbook-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 248px;
  gap: 16px;
  align-items: start;
}

.playbook-document {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.playbook-section {
  scroll-margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.playbook-section-header {
  padding: 16px 18px 0;
}

.playbook-section-header span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.playbook-section-header h2 {
  margin: 5px 0 0;
  font-size: 22px;
}

.playbook-lead {
  margin: 0;
  padding: 12px 18px 0;
  color: #334155;
  line-height: 1.7;
}

.playbook-outline {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.playbook-outline h3 {
  margin: 0;
  font-size: 14px;
}

.playbook-outline nav {
  display: grid;
  gap: 4px;
}

.playbook-outline a {
  border-radius: 7px;
  color: #475569;
  padding: 7px 8px;
  font-size: 13px;
}

.playbook-outline a:hover,
.playbook-outline a.active {
  background: #eff6ff;
  color: var(--accent);
}

.playbook-role-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 10px;
  padding: 14px 18px;
}

.playbook-role {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 12px;
}

.playbook-role h3 {
  margin: 0 0 7px;
  font-size: 14px;
}

.playbook-role p {
  margin: 0;
  color: #334155;
  font-size: 12px;
  line-height: 1.6;
}

.playbook-role small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.playbook-changelog {
  margin: 14px 18px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 14px;
}

.playbook-changelog div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.playbook-changelog strong {
  font-size: 18px;
}

.playbook-changelog span {
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
}

.playbook-changelog p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.playbook-section .guide-grid,
.playbook-section .guide-engine-grid,
.playbook-section .guide-rewrite-list {
  padding: 14px 18px 18px;
}

.playbook-section .guide-metrics {
  padding: 14px 18px 0;
  margin-bottom: 12px;
}

.playbook-section > .guide-list {
  margin: 14px 18px 18px;
}

.playbook-section > .guide-example {
  margin: 14px 18px 18px;
}

.playbook-section .table-wrap {
  margin: 0 18px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.guide-hero {
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(37, 99, 235, .08), rgba(15, 118, 110, .06)), white;
  padding: 20px;
}

body[data-instance="arma"] .guide-hero {
  background: linear-gradient(135deg, rgba(15, 118, 110, .10), rgba(180, 83, 9, .07)), white;
}

.guide-hero h2 {
  max-width: 920px;
  margin: 8px 0 8px;
  font-size: 28px;
  line-height: 1.22;
}

.guide-hero p:last-child {
  max-width: 820px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.guide-section {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  overflow: hidden;
}

.guide-grid,
.guide-engine-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}

.guide-engine-grid {
  grid-template-columns: repeat(4, minmax(230px, 1fr));
  align-items: stretch;
}

.guide-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.guide-card,
.guide-rewrite {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.guide-card h3,
.guide-rewrite h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.guide-card h4 {
  margin: 12px 0 7px;
  color: #334155;
  font-size: 12px;
  text-transform: uppercase;
}

.guide-card p,
.guide-rewrite p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.guide-card-top {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}

.guide-card-top span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.guide-card-top strong {
  font-size: 16px;
}

.guide-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.guide-pills span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  padding: 5px 8px;
  color: #334155;
  font-size: 12px;
}

.guide-list {
  margin: 0;
  padding: 0 0 0 18px;
  color: #334155;
  line-height: 1.65;
}

.guide-list li + li {
  margin-top: 5px;
}

.guide-example {
  margin: 0;
  white-space: pre-wrap;
  overflow: auto;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fafc;
  color: #111827;
  padding: 10px;
  font-size: 12px;
  line-height: 1.55;
}

.guide-rewrite-list {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.guide-rewrite {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(180px, .55fr) minmax(0, 1.2fr);
  gap: 12px;
}

.owner-guide-card {
  display: grid;
  gap: 12px;
}

.guide-owner-stat {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.guide-owner-stat span,
.guide-owner-stat small {
  display: block;
}

.guide-owner-stat span {
  font-size: 18px;
  font-weight: 800;
}

.guide-owner-stat small {
  margin-top: -6px;
  color: var(--muted);
  font-size: 11px;
}

.guide-metrics {
  grid-template-columns: repeat(9, minmax(100px, 1fr));
  margin: 0 0 12px;
}

.panel-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.chart {
  padding: 10px 10px 12px;
}

.axis {
  fill: #64748b;
  font-size: 11px;
}

.grid-line {
  stroke: #e5e7eb;
}

.legend-text {
  fill: #475569;
  font-size: 12px;
}

.hover-target {
  cursor: crosshair;
  pointer-events: all;
}

.chart-tooltip {
  position: fixed;
  display: none;
  max-width: 340px;
  background: #111827;
  color: white;
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.55;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .26);
  z-index: 30;
  pointer-events: none;
}

.table-wrap {
  overflow: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 14px;
}

table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 1;
  color: #334155;
}

th.sortable {
  padding: 0;
}

.sort-button {
  display: flex;
  width: 100%;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 9px 10px;
  text-align: left;
  font-weight: 800;
}

.sort-button:hover {
  background: #eef2ff;
}

.sort-button:focus-visible {
  outline: 2px solid rgba(37, 99, 235, .45);
  outline-offset: -2px;
}

.sort-indicator {
  position: relative;
  width: 9px;
  height: 13px;
  flex: 0 0 auto;
  opacity: .55;
}

.sort-indicator::before,
.sort-indicator::after {
  content: "";
  position: absolute;
  left: 1px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
}

.sort-indicator::before {
  top: 0;
  border-bottom: 5px solid #64748b;
}

.sort-indicator::after {
  bottom: 0;
  border-top: 5px solid #64748b;
}

th.sorted .sort-indicator {
  opacity: 1;
}

th.sorted.asc .sort-indicator::after {
  opacity: .22;
}

th.sorted.desc .sort-indicator::before {
  opacity: .22;
}

td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.strong {
  font-weight: 800;
}

.pos {
  color: var(--green);
  font-weight: 700;
}

.neg {
  color: var(--red);
  font-weight: 700;
}

.muted {
  color: var(--muted);
}

.issue {
  max-width: 360px;
  white-space: normal;
}

.notice {
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #fed7aa;
  background: #fff7ed;
  color: #9a3412;
  margin-bottom: 14px;
}

.notice.error {
  border-color: #fecaca;
  background: #fef2f2;
  color: var(--red);
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.mini {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: white;
}

.mini span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.mini strong {
  display: block;
  margin-top: 5px;
  font-size: 20px;
}

.search-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.search-row input {
  width: min(420px, 100%);
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
}

a {
  color: var(--accent);
  text-decoration: none;
}

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .nav { grid-template-columns: repeat(3, 1fr); }
  .sidebar-bottom { margin-top: 0; }
  .topbar { flex-direction: column; }
  .health-bar { flex-direction: column; }
  .health-items { justify-content: flex-start; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .playbook-hero { grid-template-columns: 1fr; }
  .playbook-layout { grid-template-columns: 1fr; }
  .playbook-outline { position: static; }
  .playbook-role-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide-metrics { grid-template-columns: repeat(3, 1fr); }
  .guide-engine-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide-rewrite { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .login-layout { grid-template-columns: 1fr; min-height: 0; }
  .login-copy h1 { font-size: 42px; }
}

@media (max-width: 760px) {
  .login-page { padding: 16px; }
  .login-hero, .login-card-shell { padding: 24px; }
  .login-copy h1 { font-size: 32px; }
  .login-metrics { grid-template-columns: 1fr; }
  .content { padding: 18px 14px 40px; }
  .cards, .kpi-row { grid-template-columns: 1fr 1fr; }
  .playbook-hero { padding: 18px; }
  .playbook-hero h2 { font-size: 23px; }
  .playbook-role-grid { grid-template-columns: 1fr; }
  .guide-metrics,
  .guide-grid,
  .guide-grid.compact,
  .guide-engine-grid {
    grid-template-columns: 1fr;
  }
  .guide-hero h2 { font-size: 22px; }
  .health-items { display: grid; grid-template-columns: 1fr 1fr; }
  .nav { grid-template-columns: 1fr 1fr; }
}
