:root {
  --ink: #111;
  --paper: #f2efe9;
  --panel: #fff;
  --muted: #6f6a62;
  --line: #d8d3ca;
  --orange: #c9470e;
  --gold: #c89b3c;
  --green: #26734d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.auth-body { display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 10%, #56301f, transparent 30%), #111; }
.auth-shell { width: min(100%, 480px); }
.auth-card { padding: 42px; background: #f8f5ef; border-top: 6px solid var(--orange); box-shadow: 0 25px 90px #0008; }
.admin-brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.admin-brand span { display: grid; place-items: center; width: 44px; height: 44px; background: var(--orange); color: #fff; font-weight: 900; }
.admin-brand strong { font-size: 19px; letter-spacing: -.03em; }
.kicker { margin: 26px 0 7px; color: var(--orange); font-size: 10px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
.auth-card h1 { margin-bottom: 12px; font-size: 40px; line-height: .95; }
.auth-card > p:not(.kicker, .alert) { color: var(--muted); line-height: 1.55; }
.auth-card form, .security-form { display: grid; gap: 15px; margin-top: 28px; }
label { display: grid; gap: 7px; color: #4f4b45; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 0; background: #fff; color: var(--ink); }
input, select { height: 46px; padding: 0 13px; }
textarea { min-height: 76px; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid #f28a55; outline-offset: 2px; }
.auth-card form button, .action { min-height: 46px; padding: 10px 17px; border: 0; background: var(--ink); color: #fff; font-weight: 900; cursor: pointer; }
.action.primary, .auth-card form button { background: var(--orange); }
.alert { padding: 12px 14px; border-left: 4px solid var(--orange); background: #f6ddd2; color: #72270a; font-size: 13px; }
.admin-layout { min-height: 100vh; display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 24px 18px; background: #121212; color: #fff; }
.sidebar .admin-brand { padding: 0 8px; color: #fff; }
.signed-in { margin: 24px 8px; color: #999; font-size: 11px; line-height: 1.5; }
.signed-in b { color: #fff; }
.sidebar nav { display: grid; gap: 5px; }
.nav-item { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 13px 14px; border: 0; background: transparent; color: #aaa; text-align: left; font-weight: 800; cursor: pointer; }
.nav-item:hover, .nav-item.active { background: #29231f; color: #fff; box-shadow: inset 3px 0 var(--orange); }
.nav-item span { min-width: 24px; padding: 2px 7px; border-radius: 20px; background: var(--orange); color: #fff; font-size: 10px; text-align: center; }
.logout-form { margin-top: auto; }
.logout-form button { width: 100%; padding: 12px; border: 1px solid #444; background: transparent; color: #aaa; cursor: pointer; }
.dashboard { min-width: 0; padding: 32px clamp(20px, 4vw, 58px) 60px; }
.dashboard-header { display: flex; justify-content: space-between; align-items: end; gap: 24px; padding-bottom: 25px; border-bottom: 1px solid var(--line); }
.dashboard-header .kicker, .section-heading .kicker, .panel-heading .kicker { margin-top: 0; }
.dashboard-header h1 { margin: 0; font-size: clamp(34px, 5vw, 58px); letter-spacing: -.05em; }
.dashboard-header a { color: var(--orange); font-size: 12px; font-weight: 900; }
#notice { min-height: 22px; margin: 16px 0; color: var(--green); font-size: 13px; font-weight: 800; }
#notice.error { color: #a52f13; }
.view { display: none; }
.view.active { display: block; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stat-grid article { min-height: 135px; padding: 22px; border-top: 4px solid var(--orange); background: var(--panel); box-shadow: 0 6px 24px #372b1c0c; }
.stat-grid small { display: block; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.stat-grid strong { display: block; margin-top: 18px; font-size: 42px; line-height: 1; }
.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.panel { padding: 25px; background: var(--panel); border: 1px solid var(--line); }
.panel-heading, .section-heading { display: flex; justify-content: space-between; align-items: start; gap: 20px; }
.panel-heading h2, .section-heading h2 { margin: 0; font-size: 27px; letter-spacing: -.035em; }
.status-dot { padding: 6px 10px; background: #e7e1d8; color: var(--muted); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.status-dot.good { background: #d9eee3; color: var(--green); }
.health-list { display: grid; margin: 25px 0; }
.health-list div { display: flex; justify-content: space-between; gap: 20px; padding: 12px 0; border-bottom: 1px solid #eeeae3; }
.health-list dt { color: var(--muted); font-size: 12px; }
.health-list dd { margin: 0; font-size: 12px; font-weight: 800; text-align: right; }
.section-heading { margin-bottom: 22px; }
.section-heading > p { width: min(420px, 48%); color: var(--muted); font-size: 13px; line-height: 1.5; }
.record-toolbar { display: grid; grid-template-columns: 1fr 220px; gap: 12px; margin-bottom: 14px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); background: #fff; }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th { padding: 13px 15px; background: #1a1a1a; color: #fff; font-size: 10px; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
td { padding: 14px 15px; border-bottom: 1px solid #e8e4dc; vertical-align: top; font-size: 12px; }
.record-identity { display: grid; grid-template-columns: 56px 1fr; gap: 11px; min-width: 205px; }
.record-identity img { width: 56px; height: 72px; object-fit: cover; object-position: top; background: #222; }
.record-identity strong { display: block; margin-bottom: 6px; font-size: 13px; }
.record-identity small, .source-detail small { display: block; color: var(--muted); line-height: 1.5; }
.record-state { display: inline-block; margin-bottom: 8px; padding: 3px 7px; color: #fff; background: var(--orange); font-size: 9px; font-weight: 900; text-transform: uppercase; }
.record-state.released { background: #8b712f; }
.record-state.hidden { background: #5e5a54; }
.record-note { min-width: 220px; }
.record-actions { display: grid; gap: 8px; min-width: 115px; }
.record-actions button { min-height: 35px; border: 1px solid var(--ink); background: var(--ink); color: #fff; font-size: 10px; font-weight: 900; cursor: pointer; }
.record-actions .restore { border-color: var(--green); background: var(--green); }
.admin-pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 18px; }
.admin-pager button { min-height: 43px; border: 1px solid var(--ink); background: #fff; font-weight: 800; cursor: pointer; }
.admin-pager button:last-child { justify-self: end; }
.admin-pager button:disabled { opacity: .45; cursor: not-allowed; }
.admin-pager span { min-width: 130px; color: var(--muted); font-size: 11px; font-weight: 900; text-align: center; text-transform: uppercase; }
.correction-list, .activity-list { display: grid; gap: 10px; }
.correction-card, .activity-item { padding: 17px 19px; border: 1px solid var(--line); background: #fff; }
.correction-card.resolved { opacity: .65; }
.correction-head { display: flex; justify-content: space-between; gap: 18px; }
.correction-head strong { font-size: 14px; }
.correction-head span { color: var(--muted); font-size: 11px; }
.correction-meta { margin: 7px 0 14px; color: var(--orange); font-size: 11px; font-weight: 800; }
.correction-message { white-space: pre-wrap; color: #4f4a43; font-size: 13px; line-height: 1.55; }
.correction-card button { padding: 8px 12px; border: 1px solid var(--ink); background: transparent; font-size: 10px; font-weight: 900; cursor: pointer; }
.activity-item { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "action time" "details details" "who who"; gap: 5px 15px; align-items: baseline; }
.activity-item strong { grid-area: action; }
.activity-item time { grid-area: time; white-space: nowrap; }
.activity-item > span:first-of-type { grid-area: details; }
.activity-item .activity-who { grid-area: who; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; color: inherit; font-size: 11px; font-weight: 600; }
.activity-who small { color: #999; font-family: ui-monospace, Menlo, monospace; font-size: 10px; font-weight: 400; }
.activity-item strong { font-size: 11px; text-transform: uppercase; }
.activity-item span { color: var(--muted); font-size: 12px; }
.activity-item time { color: #999; font-size: 10px; }
.security-form { max-width: 620px; padding: 25px; border: 1px solid var(--line); background: #fff; }
.loading-block { color: var(--muted); }
@media (max-width: 980px) {
  .admin-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .sidebar nav { grid-template-columns: repeat(5, minmax(120px, 1fr)); overflow-x: auto; }
  .logout-form { margin-top: 18px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .panel-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .auth-card { padding: 28px 22px; }
  .dashboard { padding: 22px 14px 45px; }
  .dashboard-header, .section-heading { align-items: start; flex-direction: column; }
  .section-heading > p { width: 100%; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat-grid article { min-height: 110px; padding: 16px; }
  .stat-grid strong { font-size: 32px; }
  .record-toolbar { grid-template-columns: 1fr; }
  .activity-item { gap: 5px 10px; }
  .admin-pager { grid-template-columns: 1fr 1fr; }
  .admin-pager span { grid-column: 1 / -1; grid-row: 1; }
}
