/* Tailwind default palette as variables – no Tailwind build involved. */
:root {
  --slate-50: #f8fafc; --slate-100: #f1f5f9; --slate-200: #e2e8f0; --slate-300: #cbd5e1;
  --slate-400: #94a3b8; --slate-600: #475569; --slate-700: #334155; --slate-800: #1e293b; --slate-900: #0f172a;
  --indigo-50: #eef2ff; --indigo-200: #c7d2fe; --indigo-600: #4f46e5; --indigo-700: #4338ca; --indigo-900: #312e81;
  --green-50: #f0fdf4; --green-100: #dcfce7; --green-200: #bbf7d0; --green-800: #166534; --green-900: #14532d;
  --amber-50: #fffbeb; --amber-100: #fef3c7; --amber-200: #fde68a; --amber-800: #92400e; --amber-900: #78350f;
  --red-50: #fef2f2; --red-100: #fee2e2; --red-200: #fecaca; --red-800: #991b1b; --red-900: #7f1d1d;
  --blue-50: #eff6ff; --blue-100: #dbeafe; --blue-200: #bfdbfe; --blue-800: #1e40af; --blue-900: #1e3a8a;
  --radius: 10px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--slate-900); background: var(--slate-50); }
a { color: var(--indigo-700); }
a:hover { color: var(--indigo-900); }
h1 { margin: 0; font-size: 24px; }
h2 { margin: 0; font-size: 16px; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 12px; }

/* Layout */
.layout { display: flex; flex-wrap: wrap; min-height: 100vh; }
.sidebar { flex: 1 1 240px; max-width: 100%; background: var(--slate-900); color: var(--slate-200); padding: 20px 16px; display: flex; flex-direction: column; gap: 24px; }
.view { flex: 999 1 560px; min-width: 0; padding: 32px; display: flex; flex-direction: column; gap: 24px; outline: none; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.muted { color: var(--slate-600); }
.small { font-size: 12px; }
.strong { font-weight: 600; text-decoration: none; }

/* Sidebar */
.sidebar__brand { display: flex; flex-direction: column; }
.sidebar__title { font-weight: 700; font-size: 16px; color: #fff; }
.sidebar__subtitle, .muted-on-dark { font-size: 12px; color: var(--slate-400); }
.sidebar__nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar__link { display: flex; justify-content: space-between; padding: 10px 12px; border-radius: 6px; color: var(--slate-300); text-decoration: none; }
.sidebar__link:hover { background: var(--slate-800); color: #fff; }
.sidebar__link[aria-current="page"] { background: var(--slate-800); color: #fff; font-weight: 600; }
.sidebar__link--disabled { color: var(--slate-400); cursor: default; }
.sidebar__link--disabled:hover { background: none; color: var(--slate-400); }
.sidebar__link small { font-size: 11px; }
.sidebar__connection { margin-top: auto; padding: 12px; border-radius: 8px; background: var(--slate-800); display: flex; flex-direction: column; gap: 6px; font-size: 12px; word-break: break-all; }
.key--set { color: #86efac; }
.key--missing { color: #fca5a5; }

/* Page header */
.page-header { display: flex; flex-direction: column; gap: 8px; }
.page-header__row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; }
.page-header__titles { display: flex; flex-direction: column; gap: 4px; }
.page-header__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.breadcrumb { font-size: 13px; color: var(--slate-600); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; border: 1px solid transparent; }
.btn--primary { background: var(--indigo-600); color: #fff; }
.btn--primary:hover { background: var(--indigo-700); color: #fff; }
.btn--secondary { background: #fff; color: var(--slate-900); border-color: var(--slate-300); }
.btn--secondary:hover { background: var(--slate-100); color: var(--slate-900); }
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn:focus-visible, .chip:focus-visible, .tab:focus-visible { outline: 2px solid var(--indigo-600); outline-offset: 2px; }

/* Cards & tiles */
.card { background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius); padding: 20px 24px; }
.card--flush { padding: 0; }
.card__footer { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; padding: 12px 16px; border-top: 1px solid var(--slate-200); color: var(--slate-600); font-size: 13px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: var(--radius); border: 1px solid var(--slate-200); background: #fff; }
.tile__label { font-size: 13px; font-weight: 600; color: var(--slate-600); }
.tile__value { font-size: 28px; font-weight: 700; }

/* Tones shared by badges, tiles and status cards */
.badge--success, .tile--success, .status-card--success { background: var(--green-100); color: var(--green-800); border-color: var(--green-200); }
.badge--pending, .tile--pending, .status-card--pending { background: var(--amber-100); color: var(--amber-800); border-color: var(--amber-200); }
.badge--danger, .tile--danger, .status-card--danger { background: var(--red-100); color: var(--red-800); border-color: var(--red-200); }
.badge--progress, .badge--info, .tile--progress, .tile--info, .status-card--progress, .status-card--info { background: var(--blue-100); color: var(--blue-800); border-color: var(--blue-200); }
.badge--neutral, .tile--neutral, .status-card--neutral { background: var(--slate-100); color: var(--slate-700); border-color: var(--slate-300); }
.tile--success .tile__label, .tile--pending .tile__label, .tile--danger .tile__label { color: inherit; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; border: 1px solid; font-size: 13px; font-weight: 600; white-space: nowrap; }
.reason { margin-top: 4px; font-size: 12px; color: var(--slate-600); }
.status-card { display: flex; flex-direction: column; gap: 8px; padding: 20px; border-radius: var(--radius); border: 1px solid; }
.status-card__field { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; font-family: var(--mono); }
.status-card__value { font-size: 22px; font-weight: 700; }

/* Filters */
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--slate-200); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--slate-200); background: #fff; color: var(--slate-700); font: inherit; cursor: pointer; }
.chip[aria-pressed="true"] { border-color: var(--indigo-600); background: var(--indigo-50); color: var(--indigo-900); font-weight: 600; }
.search { display: flex; align-items: center; gap: 8px; color: var(--slate-600); }
.search input { min-height: 36px; width: 220px; padding: 0 10px; border: 1px solid var(--slate-300); border-radius: 6px; font: inherit; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; }

/* Table */
.table-wrap { overflow-x: auto; }
.table { width: 100%; min-width: 760px; border-collapse: collapse; }
.table th { padding: 10px 16px; text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--slate-600); }
.table td { padding: 14px 16px; border-top: 1px solid var(--slate-100); vertical-align: top; }
.row--changed { background: var(--indigo-50); }
.change-note { font-size: 12px; font-weight: 600; color: var(--indigo-900); }
.empty { padding: 24px 16px; color: var(--slate-600); }

/* Definitions */
.definitions { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px 24px; }
.definitions dt { font-size: 12px; color: var(--slate-600); }
.definitions dd { margin: 2px 0 0; word-break: break-word; }

@media (max-width: 720px) {
  .view { padding: 20px 16px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
