:root {
  color-scheme: light;
  --ink: #15171d;
  --muted: #68707f;
  --line: #e5e7eb;
  --paper: #ffffff;
  --soft: #f6f7f9;
  --black: #111827;
  --blue: #2563eb;
  --green: #059669;
  --pink: #db2777;
  --violet: #7c3aed;
  --yellow: #f59e0b;
  --shadow: 0 18px 48px rgba(17, 24, 39, 0.08);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", ui-sans-serif, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: #ffffff;
}

a {
  color: inherit;
}

.admin-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 56px;
}

.admin-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0 14px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease;
}

.admin-header.scrolled {
  border-bottom-color: var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  color: #ffffff;
  background: var(--black);
  font-weight: 900;
}

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

.brand strong {
  font-size: 16px;
  line-height: 1.2;
}

.brand small,
.admin-hero p,
.auth-note small,
.section-heading p:not(.eyebrow),
.tool-card p,
.tool-card em,
.app-row em,
.app-row small,
.admin-panels li {
  color: var(--muted);
}

.brand small {
  font-size: 12px;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.admin-nav a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  background: var(--paper);
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.admin-nav a:hover {
  border-color: #bfdbfe;
  background: #eff6ff;
  transform: translateY(-1px);
}

.admin-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 20px;
  align-items: stretch;
  margin-top: 20px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: 32px;
  line-height: 1.12;
}

.admin-hero p {
  max-width: 640px;
  margin-bottom: 0;
  font-size: 15px;
  line-height: 1.7;
}

.auth-note {
  display: grid;
  gap: 6px;
  align-content: center;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 18px;
  background: linear-gradient(135deg, #eff6ff 0%, #f0f4ff 100%);
}

.auth-note span,
.tool-status {
  width: fit-content;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 900;
}

.auth-note span {
  color: #1d4ed8;
  background: #dbeafe;
}

.auth-note strong {
  font-size: 18px;
}

.admin-section {
  margin-top: 36px;
}

.section-heading {
  margin-bottom: 16px;
}

.section-heading h2 {
  margin-bottom: 6px;
}

.section-heading p:not(.eyebrow) {
  margin-bottom: 0;
  font-size: 14px;
  line-height: 1.62;
}

.inventory-section {
  border-top: 1px solid var(--line);
  padding-top: 32px;
}

.inventory-insights {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

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

.metric-card,
.analysis-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 12px 34px rgba(17, 24, 39, 0.05);
}

.metric-card {
  min-height: 96px;
  display: grid;
  align-content: space-between;
  padding: 14px;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 38px rgba(17, 24, 39, 0.09);
}

.metric-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.metric-card strong {
  display: block;
  margin-top: 5px;
  font-size: 28px;
  line-height: 1.05;
}

.metric-card small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

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

.analysis-panel {
  min-height: 226px;
  padding: 16px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.panel-heading h3 {
  margin-bottom: 0;
  font-size: 14px;
  line-height: 1.25;
}

.panel-heading span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-align: right;
}

.bar-list {
  display: grid;
  gap: 9px;
}

.bar-row {
  display: grid;
  gap: 5px;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #374151;
  font-size: 12px;
  font-weight: 900;
}

.bar-track {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: #eef2f7;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #38bdf8);
}

.narrative-panel {
  background: linear-gradient(135deg, #111827 0%, #1e293b 100%);
  color: #ffffff;
  border-color: #1e293b;
}

.narrative-panel .panel-heading span,
.trend-list li {
  color: rgba(255, 255, 255, 0.72);
}

.trend-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 18px;
}

.trend-list li {
  font-size: 13px;
  line-height: 1.55;
}

.inventory-controls {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, auto);
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

.filter-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.filter-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.search-box {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.search-box input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  color: var(--ink);
  background: var(--paper);
  font: inherit;
  font-size: 14px;
  outline: none;
}

.search-box input:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.28);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.filter-chip {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 13px;
  color: var(--ink);
  background: var(--paper);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.filter-chip:hover {
  border-color: #c7d2fe;
  background: #f8faff;
}

.filter-chip.active {
  border-color: #93c5fd;
  color: #1d4ed8;
  background: #eff6ff;
}

.filter-chips.generated {
  justify-content: flex-start;
}

.stage-board {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.stage-board-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.stage-board-heading h3 {
  margin: 0;
  font-size: 16px;
}

.stage-board-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.stage-columns {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  min-width: 0;
}

.stage-column {
  min-width: 150px;
  display: grid;
  gap: 8px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: #fbfcfe;
  border-top: 3px solid var(--line);
}

.stage-column:nth-child(1) { border-top-color: #94a3b8; }
.stage-column:nth-child(2) { border-top-color: #f59e0b; }
.stage-column:nth-child(3) { border-top-color: #f97316; }
.stage-column:nth-child(4) { border-top-color: #059669; }
.stage-column:nth-child(5) { border-top-color: #2563eb; }
.stage-column:nth-child(6) { border-top-color: #7c3aed; }

.stage-column-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 8px;
  align-items: center;
}

.stage-column-heading span {
  grid-column: 1 / -1;
  width: fit-content;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 10px;
  font-weight: 950;
}

.stage-column:nth-child(1) .stage-column-heading span { color: #475569; background: #f1f5f9; }
.stage-column:nth-child(2) .stage-column-heading span { color: #92400e; background: #fef3c7; }
.stage-column:nth-child(3) .stage-column-heading span { color: #9a3412; background: #ffedd5; }
.stage-column:nth-child(4) .stage-column-heading span { color: #065f46; background: #d1fae5; }
.stage-column:nth-child(5) .stage-column-heading span { color: #1d4ed8; background: #dbeafe; }
.stage-column:nth-child(6) .stage-column-heading span { color: #5b21b6; background: #ede9fe; }

.stage-column-heading strong {
  min-width: 0;
  font-size: 13px;
  line-height: 1.25;
}

.stage-column-heading em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 950;
}

.stage-column p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.42;
}

.stage-card-list {
  display: grid;
  gap: 6px;
}

.stage-card {
  min-width: 0;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  color: inherit;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.stage-card:hover {
  border-color: #bfdbfe;
  background: #f8faff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

.stage-card.selected {
  border-color: #93c5fd;
  background: #eff6ff;
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.14);
}

.stage-card strong,
.stage-card span,
.stage-card small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.stage-card strong {
  font-size: 12px;
  line-height: 1.25;
}

.stage-card span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.stage-card small,
.stage-empty,
.stage-more {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.stage-empty,
.stage-more {
  display: block;
  border: 1px dashed #d1d5db;
  border-radius: 8px;
  padding: 8px;
  background: #ffffff;
}

.ledger-workbench {
  display: grid;
  gap: 12px;
}

.ledger-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, auto);
  gap: 10px;
  align-items: end;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.ledger-view-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ledger-view {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--paper);
  font: inherit;
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.ledger-view:hover {
  border-color: #c7d2fe;
  background: #f8faff;
}

.ledger-view.active {
  border-color: #93c5fd;
  color: #1d4ed8;
  background: #eff6ff;
}

.sort-box {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.sort-box select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 34px 0 10px;
  color: var(--ink);
  background: var(--paper);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
}

.ledger-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 340px);
  gap: 12px;
  align-items: start;
}

.ledger-main {
  min-width: 0;
}

.ledger-queue {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.queue-tile {
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  color: inherit;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.queue-tile strong,
.queue-tile span,
.queue-tile small {
  display: block;
}

.queue-tile strong {
  font-size: 22px;
  line-height: 1;
}

.queue-tile span {
  margin-top: 5px;
  font-size: 12px;
  font-weight: 950;
}

.queue-tile small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.queue-tile:hover {
  border-color: #bfdbfe;
  background: #f8faff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}

.queue-tile.active {
  border-color: #93c5fd;
  background: #eff6ff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.inventory-summary {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.inventory-list {
  display: grid;
  gap: 8px;
}

.empty-state {
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  background: #f8fafc;
  font-size: 13px;
  font-weight: 850;
  text-align: center;
}

.inventory-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.8fr);
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  background: var(--paper);
  box-shadow: 0 1px 3px rgba(17, 24, 39, 0.04);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.inventory-row:hover {
  border-color: #bfdbfe;
  background: #fbfdff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(17, 24, 39, 0.08);
}

.inventory-row.selected {
  border-color: #93c5fd;
  background: #f8faff;
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.12);
}

.inventory-title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.inventory-title strong {
  font-size: 16px;
}

.inventory-title span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  color: #1d4ed8;
  background: #dbeafe;
  font-size: 11px;
  font-weight: 950;
}

.inventory-classification {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 9px;
}

.inventory-classification span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  color: #1d4ed8;
  background: #eff6ff;
  font-size: 11px;
  font-weight: 900;
}

.inventory-main p {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.62;
}

.inventory-tags,
.inventory-links,
.inventory-data-stores {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.inventory-tags span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  color: #374151;
  background: var(--soft);
  font-size: 11px;
  font-weight: 850;
}

.inventory-meta {
  display: grid;
  gap: 8px;
  align-content: start;
}

.inventory-meta small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.inventory-meta code {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  color: #374151;
  background: #f9fafb;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.inventory-links a,
.inventory-link-note {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  background: #ffffff;
}

.inventory-links a:hover {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.inventory-link-note {
  color: var(--muted);
  background: var(--soft);
}

.inventory-data-stores {
  padding-top: 2px;
}

.data-store,
.data-store-empty {
  min-width: 0;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  padding: 5px 8px;
  color: #1f2937;
  background: #f8fbff;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 850;
}

.data-store strong,
.data-store span,
.data-store em {
  overflow-wrap: anywhere;
}

.data-store strong {
  color: #1d4ed8;
}

.data-store em {
  color: var(--muted);
  font-style: normal;
}

.data-store-empty {
  color: var(--muted);
  background: var(--soft);
  border-color: var(--line);
}

.ledger-inspector {
  position: sticky;
  top: 70px;
  display: grid;
  gap: 14px;
  border: 1px solid #c7d2fe;
  border-radius: 12px;
  padding: 18px;
  background: linear-gradient(180deg, #fafbff 0%, #ffffff 100%);
  box-shadow: 0 12px 34px rgba(17, 24, 39, 0.06), 0 0 0 1px rgba(99, 102, 241, 0.04);
}

.inspector-header {
  display: grid;
  gap: 7px;
}

.inspector-header strong {
  font-size: 18px;
  line-height: 1.25;
}

.inspector-header p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.inspector-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.inspector-status span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  color: #1d4ed8;
  background: #eff6ff;
  font-size: 11px;
  font-weight: 900;
}

.inspector-section {
  display: grid;
  gap: 7px;
}

.inspector-section h3 {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
}

.inspector-links,
.inspector-data,
.inspector-actions {
  display: grid;
  gap: 6px;
}

.inspector-links a,
.inspector-actions span {
  min-height: 34px;
  display: grid;
  align-content: center;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  background: #ffffff;
}

.inspector-links a:hover {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.inspector-links a span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.inspector-data-row {
  display: grid;
  gap: 3px;
  border-left: 3px solid #bfdbfe;
  padding: 3px 0 4px 8px;
}

.inspector-data-row strong {
  font-size: 12px;
}

.inspector-data-row span,
.inspector-data-row em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.35;
}

.inspector-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.ledger-inspector code {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  color: #374151;
  background: #f9fafb;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

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

.tool-grid.compact .tool-card {
  min-height: 220px;
}

.tool-card {
  min-height: 260px;
  display: grid;
  align-content: start;
  gap: 11px;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  color: inherit;
  text-decoration: none;
  background: var(--paper);
  box-shadow: var(--shadow);
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.tool-card:hover {
  transform: translateY(-2px);
  border-color: #bfdbfe;
  box-shadow: 0 22px 58px rgba(17, 24, 39, 0.12);
}

.tool-card.primary {
  border-color: #bfdbfe;
}

.tool-card.muted-card {
  border-color: var(--line);
  box-shadow: none;
  background: #fafafa;
}

.tool-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #ffffff;
  background: var(--pink);
  font-weight: 950;
}

.tool-icon.green {
  background: var(--green);
}

.tool-icon.blue {
  background: var(--blue);
}

.tool-icon.pink {
  background: var(--pink);
}

.tool-icon.violet {
  background: var(--violet);
}

.tool-icon.yellow {
  background: var(--yellow);
}

.tool-status {
  position: absolute;
  top: 18px;
  right: 18px;
  color: #1d4ed8;
  background: #dbeafe;
}

.tool-status.muted {
  color: var(--muted);
  background: var(--soft);
}

.tool-card strong {
  display: block;
  margin-top: 10px;
  font-size: 21px;
  line-height: 1.24;
}

.tool-card p {
  margin-bottom: 0;
  font-size: 14px;
  line-height: 1.72;
}

.tool-card em {
  margin-top: 4px;
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.card-actions {
  display: grid;
  gap: 8px;
  margin-top: 2px;
}

.card-actions a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  background: #ffffff;
  transition: background 150ms ease, border-color 150ms ease;
}

.card-actions a:hover {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.app-table {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.app-row {
  min-height: 72px;
  display: grid;
  grid-template-columns: 44px minmax(150px, 1fr) minmax(180px, 1.1fr) minmax(100px, auto);
  gap: 12px;
  align-items: center;
  border-radius: 8px;
  padding: 10px;
  text-decoration: none;
  transition: background 150ms ease, transform 150ms ease;
}

.app-row:hover {
  background: var(--soft);
  transform: translateY(-1px);
}

.app-row.featured {
  background: #fff7ed;
}

.app-row.child-row {
  margin-left: 24px;
  border-left: 3px solid #f9a8d4;
  background: #fff1f7;
}

.app-row.app-row-disabled {
  color: var(--muted);
  background: #fafafa;
}

.app-row.app-row-disabled:hover {
  transform: none;
}

.row-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: var(--pink);
  font-size: 13px;
  font-weight: 950;
}

.row-mark.green {
  background: var(--green);
}

.row-mark.blue {
  background: var(--blue);
}

.row-mark.violet {
  background: var(--violet);
}

.row-mark.yellow {
  background: var(--yellow);
}

.row-mark.pink {
  background: var(--pink);
}

.app-row strong {
  font-size: 15px;
}

.app-row em {
  font-size: 13px;
  font-style: normal;
  line-height: 1.45;
}

.app-row small {
  justify-self: end;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--soft);
  font-size: 12px;
  font-weight: 900;
}

.compact-table {
  max-width: 760px;
}

.muted-section {
  border-top: 1px solid var(--line);
  padding-top: 32px;
}

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

.reference-list a {
  min-height: 58px;
  display: grid;
  gap: 4px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 14px;
  text-decoration: none;
  background: #fafafa;
  transition: background 150ms ease, transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.reference-list a:hover {
  background: #f8faff;
  border-color: #bfdbfe;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.06);
}

.reference-list strong {
  font-size: 14px;
}

.reference-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.admin-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.admin-panels > div {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  background: var(--soft);
}

h2 {
  margin-bottom: 10px;
  font-size: 18px;
}

ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.admin-panels a {
  color: var(--blue);
  font-weight: 850;
  text-decoration: none;
}

.admin-panels a:hover {
  text-decoration: underline;
}

@media (max-width: 820px) {
  .admin-header,
  .admin-hero,
  .metric-grid,
  .analysis-grid,
  .inventory-controls,
  .filter-groups,
  .ledger-toolbar,
  .ledger-layout,
  .ledger-queue,
  .inventory-row,
  .tool-grid,
  .app-row,
  .reference-list,
  .admin-panels {
    grid-template-columns: 1fr;
  }

  .admin-header {
    display: grid;
    align-items: start;
  }

  .admin-nav {
    justify-content: flex-start;
  }

  .filter-chips {
    justify-content: flex-start;
  }

  .stage-columns {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }

  .stage-board-heading {
    display: grid;
    align-items: start;
  }

  .ledger-inspector {
    position: static;
  }

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

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

@media (max-width: 520px) {
  .admin-shell {
    width: min(100% - 20px, 1120px);
    padding-top: 0;
  }

  .admin-header {
    gap: 10px;
    padding: 10px 0;
  }

  .admin-hero,
  .tool-card,
  .admin-panels > div {
    padding: 14px;
  }

  .admin-nav {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding-bottom: 2px;
  }

  .admin-nav a {
    flex: 0 0 auto;
    justify-content: center;
    white-space: nowrap;
    font-size: 11px;
    min-height: 30px;
    padding: 0 10px;
  }

  h1 {
    font-size: 27px;
  }

  .tool-status {
    position: static;
  }

  .app-row small {
    justify-self: start;
  }

  .stage-columns {
    grid-template-columns: repeat(6, minmax(140px, 1fr));
  }

  .filter-groups {
    gap: 14px;
  }
}
