:root {
  color-scheme: dark;
  --ink: #090b0d;
  --panel: #121518;
  --panel-2: #191d21;
  --line: rgba(255, 255, 255, 0.11);
  --text: #f1f1ed;
  --muted: #989c9f;
  --copper: #c68b55;
  --danger: #ff5b45;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--ink); }
body { margin: 0; min-width: 320px; background: var(--ink); color: var(--text); }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.dashboard-shell { width: min(1600px, 100%); min-height: 100vh; margin: auto; padding: 32px clamp(18px, 4vw, 56px) 64px; }
.dashboard-header { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
h1, h2 { margin: 0; font-weight: 620; letter-spacing: -0.035em; }
h1 { margin-top: 9px; font-size: clamp(2.4rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
.eyebrow { margin: 0; color: var(--copper); font: 500 0.69rem/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.15em; text-transform: uppercase; }
.muted { color: var(--muted); }

.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; border: 1px solid var(--line); padding: 10px 18px; background: transparent; color: var(--text); font-weight: 650; }
.button:hover, .button:focus-visible { border-color: var(--copper); outline: none; }
.button-primary { border-color: var(--copper); background: var(--copper); color: #111; }
.button-primary:hover, .button-primary:focus-visible { background: #db9d64; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 28px; }
.stat { min-height: 112px; border: 1px solid var(--line); padding: 20px; background: var(--panel); color: var(--text); text-align: left; }
.stat:hover, .stat:focus-visible, .stat.active { border-color: rgba(198, 139, 85, 0.7); outline: none; }
.stat span { color: var(--muted); font: 500 0.69rem ui-monospace, monospace; letter-spacing: 0.13em; text-transform: uppercase; }
.stat strong { display: block; margin-top: 10px; font-size: 2rem; }

.filters { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(180px, 250px) 180px auto; gap: 10px; margin-top: 28px; border: 1px solid var(--line); padding: 14px; background: var(--panel); }
input, select { min-height: 46px; border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 0; padding: 10px 13px; background: var(--ink); color: var(--text); }
input:focus, select:focus { border-color: var(--copper); outline: none; }

.table-frame { margin-top: 18px; overflow-x: auto; border: 1px solid var(--line); }
table { width: 100%; min-width: 1000px; border-collapse: collapse; font-size: 0.88rem; }
th, td { padding: 17px 18px; text-align: left; vertical-align: top; }
th { background: var(--panel); color: var(--muted); font: 500 0.66rem ui-monospace, monospace; letter-spacing: 0.12em; text-transform: uppercase; }
tbody tr { border-top: 1px solid var(--line); }
tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
td strong, td span { display: block; }
.source-label, .view-button { color: var(--copper); }
.cell-muted { margin-top: 4px; color: var(--muted); }
.view-button { border: 0; padding: 2px; background: none; }
.view-button:hover { text-decoration: underline; }
.status-pill { display: inline-block; color: var(--text); font: 500 0.68rem ui-monospace, monospace; letter-spacing: 0.11em; text-transform: uppercase; }
.empty { margin: 0; padding: 45px; color: var(--muted); text-align: center; }

.modal { position: fixed; z-index: 100; inset: 0; display: flex; justify-content: flex-end; background: rgba(0, 0, 0, 0.72); }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: transparent; }
.detail-panel { position: relative; z-index: 1; width: min(680px, 100%); height: 100%; overflow-y: auto; border-left: 1px solid var(--line); padding: 42px clamp(24px, 5vw, 52px); background: var(--panel); }
.close { float: right; border: 0; padding: 3px; background: transparent; color: var(--muted); }
.detail-panel h2 { clear: both; margin-top: 12px; }
.detail-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin: 28px 0 0; border-block: 1px solid var(--line); padding: 26px 0; }
.detail-fields div { min-width: 0; }
.detail-fields dt { color: var(--muted); font: 500 0.66rem ui-monospace, monospace; letter-spacing: 0.12em; text-transform: uppercase; }
.detail-fields dd { margin: 7px 0 0; overflow-wrap: anywhere; line-height: 1.5; }
.detail-fields a { color: var(--copper); }
.message { margin-top: 28px; }
.message #detail-message { white-space: pre-wrap; line-height: 1.75; }
.status-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 38px; }
.status-actions button.active { border-color: var(--copper); background: var(--copper); color: #111; }

.login-page { display: grid; min-height: 100vh; place-items: center; padding: 20px; }
.login-shell { width: min(440px, 100%); }
.login-card { border: 1px solid var(--line); padding: clamp(27px, 6vw, 42px); background: var(--panel); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4); }
.login-card h1 { font-size: clamp(2.2rem, 8vw, 3rem); }
.login-card > .muted { margin: 16px 0 0; line-height: 1.6; }
.login-form { display: grid; gap: 18px; margin-top: 32px; }
.login-form label { color: var(--muted); font: 500 0.69rem ui-monospace, monospace; letter-spacing: 0.11em; text-transform: uppercase; }
.login-form input { width: 100%; margin-top: 8px; color: var(--text); font: 400 1rem Inter, sans-serif; letter-spacing: normal; text-transform: none; }
.alert { margin: 0; border: 1px solid rgba(255, 91, 69, 0.45); padding: 12px; color: var(--danger); font-size: 0.86rem; line-height: 1.5; }

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .filters { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .dashboard-header { align-items: start; }
  .stats, .filters, .detail-fields { grid-template-columns: 1fr; }
  .filters .button { width: 100%; }
}

