/* ADM-2 (#40): the console's one stylesheet. Plain CSS, no component library. */
:root {
  --fg: #1d232b;
  --muted: #5d6875;
  --bg: #ffffff;
  --panel: #f6f8fa;
  --line: #d9dee4;
  --accent: #143d42;
  --accent-fg: #ffffff;
  --warn: #f7b240;
  --error-bg: #fde8e8;
  --error-fg: #8a1c1c;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  color: var(--fg);
  background: var(--bg);
}

body { margin: 0; }
a { color: var(--accent); }
h1 { font-size: 1.5rem; margin: 0 0 16px; }
h2 { font-size: 1.1rem; margin: 0 0 8px; }
code { background: var(--panel); padding: 1px 4px; border-radius: 3px; }
.muted { color: var(--muted); }

.shell { display: grid; grid-template-columns: 200px 1fr; grid-template-rows: auto 1fr; min-height: 100vh; }
.topbar { grid-column: 1 / -1; display: flex; gap: 12px; align-items: center; padding: 10px 16px; background: var(--accent); color: var(--accent-fg); }
.topbar .brand { color: var(--accent-fg); font-weight: 600; text-decoration: none; margin-right: auto; }
.topbar .brand .muted { color: #b9cdd0; font-weight: 400; }
.topbar .user { font-size: 0.9rem; }
.env { font-size: 0.75rem; text-transform: uppercase; padding: 2px 8px; border-radius: 10px; background: #2c5a60; }
.env--prod { background: var(--warn); color: #1d232b; font-weight: 600; }
.sidebar { display: flex; flex-direction: column; padding: 12px 0; border-right: 1px solid var(--line); background: var(--panel); }
.sidebar .nav { padding: 8px 16px; text-decoration: none; color: var(--fg); }
.sidebar .nav.active { background: #e3eaed; font-weight: 600; border-left: 3px solid var(--accent); padding-left: 13px; }
.content { padding: 20px 24px; max-width: 1200px; }

.card { border: 1px solid var(--line); border-radius: 6px; padding: 16px; margin-bottom: 16px; }
.button { border: 1px solid var(--line); background: var(--bg); padding: 6px 12px; border-radius: 4px; cursor: pointer; font: inherit; color: var(--fg); text-decoration: none; }
.button:disabled { opacity: 0.5; cursor: default; }
.button--quiet { background: transparent; color: var(--accent-fg); border-color: #4d7479; }

.state { padding: 16px; color: var(--muted); }
.state--page { max-width: 640px; margin: 48px auto; }
.state--error { background: var(--error-bg); color: var(--error-fg); border-radius: 6px; }
.state--empty { border: 1px dashed var(--line); border-radius: 6px; }
.spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.error { color: var(--error-fg); }

.pager { display: flex; gap: 12px; align-items: center; margin-top: 12px; }
table.grid { border-collapse: collapse; width: 100%; }
table.grid th, table.grid td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.grid th { background: var(--panel); font-weight: 600; }

#blazor-error-ui:not([hidden]) { position: fixed; bottom: 0; left: 0; right: 0; padding: 12px 16px; background: var(--error-bg); }

@media (max-width: 720px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
}

/* ADM-3 (#41) */
.heading { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.heading h1 { margin: 0 auto 0 0; }
.button--primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.badge { display: inline-block; font-size: 0.8rem; padding: 1px 8px; border-radius: 10px; background: #e5e9ed; }
.badge--good { background: #d9f2e1; color: #1b5e30; }
.badge--bad { background: var(--error-bg); color: var(--error-fg); }
.badge--busy { background: #e2ecfb; color: #234b8a; }
.badge--warn { background: #fdf0d6; color: #7a4d00; }
.num { text-align: right; }
.state--ok { background: #e8f6ec; color: #1b5e30; border-radius: 6px; margin-bottom: 12px; }
.form fieldset { border: 1px solid var(--line); border-radius: 6px; margin: 0 0 16px; padding: 12px 16px; }
.form legend { font-weight: 600; padding: 0 4px; }
.form label { display: block; margin: 8px 0; }
.form label input:not([type=checkbox]), .form label select, .form label textarea { display: block; width: 100%; max-width: 640px; margin-top: 4px; padding: 6px 8px; font: inherit; border: 1px solid var(--line); border-radius: 4px; box-sizing: border-box; }
.form label.check { display: flex; gap: 8px; align-items: center; }
.validation-message, .validation-errors { color: var(--error-fg); }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }

/* ADM-4 (#42) */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filters input, .note { padding: 6px 8px; font: inherit; border: 1px solid var(--line); border-radius: 4px; }
.review { display: grid; grid-template-columns: 300px 1fr; gap: 16px; outline: none; }
.review:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.review__list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 6px; max-height: 75vh; overflow-y: auto; }
.review__list li { padding: 8px 12px; border-bottom: 1px solid var(--line); cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.review__list li.selected { background: #e3eaed; border-left: 3px solid var(--accent); }
.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.card--suggested { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.thumb { max-width: 120px; max-height: 120px; object-fit: contain; float: right; margin-left: 8px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.keys kbd { border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; font-size: 0.85em; }
.row-actions { white-space: nowrap; }
pre { white-space: pre-wrap; font-size: 0.85em; background: var(--panel); padding: 8px; border-radius: 4px; }
@media (max-width: 900px) { .review { grid-template-columns: 1fr; } }

/* ADM-5 (#43) */
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 1px 8px; margin: 2px; font-size: 0.85rem; }
.chip__x { border: 0; background: transparent; cursor: pointer; color: var(--muted); padding: 0 2px; }
.inline-forms { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.row--warn td { background: #fffaf0; }
.filters select { padding: 6px 8px; font: inherit; border: 1px solid var(--line); border-radius: 4px; }

/* ADM-6 (#44) */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { border: 1px solid var(--line); border-radius: 6px; padding: 12px 16px; display: flex; flex-direction: column; gap: 4px; }
.tile strong { font-size: 1.8rem; }
.tile span { color: var(--muted); }
.tile--good { border-left: 4px solid #2f8f4e; }
.tile--warn { border-left: 4px solid var(--warn); }
.tile--bad { border-left: 4px solid #c43c3c; }
.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; }
