:root {
  --ink: #14201e;
  --forest: #123b35;
  --gold: #d6aa57;
  --paper: #f3f0e9;
  --white: #fffefa;
  --muted: #68726f;
  --line: #deded7;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.admin-shell { display: grid; min-height: 100vh; grid-template-columns: 270px 1fr; }

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  padding: 30px 24px;
  flex-direction: column;
  color: rgba(255, 255, 255, 0.7);
  background: #102a26;
}

.brand { display: flex; align-items: center; gap: 12px; color: var(--white); }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; color: #102a26; background: var(--gold); border-radius: 50%; font-family: Georgia, serif; font-weight: 700; }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1.1; }
.brand strong { letter-spacing: .16em; }
.brand small { margin-top: 5px; color: rgba(255, 255, 255, .45); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }

.sidebar nav { display: flex; margin-top: 70px; flex-direction: column; gap: 8px; }
.sidebar nav a { display: flex; padding: 11px 13px; align-items: center; gap: 14px; border-radius: 7px; font-size: 14px; }
.sidebar nav a:hover, .sidebar nav a.is-active { color: var(--white); background: rgba(255, 255, 255, .08); }
.sidebar nav span { color: rgba(255, 255, 255, .32); font-size: 10px; }

.sidebar-note { display: flex; margin-top: auto; padding: 16px; align-items: flex-start; gap: 10px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); border-radius: 8px; }
.status-dot { width: 8px; height: 8px; margin-top: 6px; flex: 0 0 auto; background: var(--gold); border-radius: 50%; }
.sidebar-note div { display: flex; flex-direction: column; }
.sidebar-note strong { color: var(--white); font-size: 12px; }
.sidebar-note small { margin-top: 3px; color: rgba(255, 255, 255, .42); font-size: 10px; }

.admin-main { min-width: 0; }
.topbar { display: flex; min-height: 84px; padding: 0 42px; align-items: center; justify-content: space-between; background: var(--white); border-bottom: 1px solid var(--line); }
.topbar p { margin: 0 0 3px; color: var(--muted); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.topbar strong { font-size: 14px; }
.preview-badge { padding: 8px 12px; color: #765719; background: #f7e8c4; border-radius: 999px; font-size: 11px; font-weight: 700; }
.sign-out { padding: 8px 14px; color: var(--forest); background: transparent; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }

.admin-main main { padding: 48px 42px 70px; }
.dashboard-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.eyebrow { margin: 0 0 10px; color: #8b6a2f; font-size: 10px; font-weight: 750; letter-spacing: .15em; text-transform: uppercase; }
.dashboard-heading h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(46px, 6vw, 70px); font-weight: 400; letter-spacing: -.04em; line-height: 1; }
.dashboard-heading > div > p:last-child { max-width: 650px; margin: 18px 0 0; color: var(--muted); }
.dashboard-heading button { min-height: 44px; padding: 0 19px; color: rgba(255, 255, 255, .55); background: var(--forest); border: 0; border-radius: 6px; }

.metrics { display: grid; margin-top: 46px; grid-template-columns: repeat(4, 1fr); background: var(--white); border: 1px solid var(--line); }
.metrics article { display: flex; min-height: 180px; padding: 25px; flex-direction: column; border-right: 1px solid var(--line); }
.metrics article:last-child { border-right: 0; }
.metrics span { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.metrics strong { margin-top: 20px; font-family: Georgia, serif; font-size: 52px; font-weight: 400; line-height: 1; }
.metrics small { margin-top: auto; color: var(--muted); }

.work-grid { display: grid; margin-top: 24px; grid-template-columns: minmax(0, 1.5fr) minmax(290px, .55fr); gap: 24px; }
.panel { background: var(--white); border: 1px solid var(--line); }
.action-panel > header { display: flex; padding: 26px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.panel h2 { margin: 0; font-family: Georgia, serif; font-size: 28px; font-weight: 400; }
.action-panel > header > span { color: var(--muted); font-size: 12px; }
.action-row { display: grid; padding: 23px 26px; align-items: start; grid-template-columns: 34px 1fr auto; gap: 15px; border-bottom: 1px solid var(--line); }
.action-row:last-child { border-bottom: 0; }
.action-number { display: grid; width: 28px; height: 28px; place-items: center; color: #765719; background: #f7e8c4; border-radius: 50%; font-family: Georgia, serif; }
.action-row strong { font-size: 14px; }
.action-row p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.action-status { max-width: 130px; color: #765719; font-size: 10px; font-weight: 750; text-align: right; text-transform: uppercase; }

.environment-panel { padding: 28px; color: var(--white); background: var(--forest); border-color: var(--forest); }
.environment-panel .eyebrow { color: #e8c77f; }
.environment-panel dl { margin: 30px 0; }
.environment-panel dl div { display: flex; padding: 13px 0; justify-content: space-between; border-bottom: 1px solid rgba(255, 255, 255, .14); font-size: 12px; }
.environment-panel dt { color: rgba(255, 255, 255, .55); }
.environment-panel dd { margin: 0; }
.lock-note { margin: 28px 0 0; padding: 16px; color: rgba(255, 255, 255, .62); background: rgba(0, 0, 0, .12); font-size: 12px; }

.content-heading, .editor-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.content-heading h1, .editor-heading h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(48px, 6vw, 70px); font-weight: 400; letter-spacing: -.04em; line-height: 1; }
.content-heading > div > p:last-child, .editor-heading > div > p:last-child { max-width: 670px; margin: 17px 0 0; color: var(--muted); }
.primary-action, .secondary-action { display: inline-flex; min-height: 44px; padding: 0 19px; align-items: center; justify-content: center; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 750; }
.primary-action { color: var(--white); background: var(--forest); border: 1px solid var(--forest); }
.secondary-action { color: var(--forest); background: var(--white); border: 1px solid #bfc8c4; }
.notice { margin-top: 26px; padding: 14px 17px; border: 1px solid; border-radius: 6px; font-size: 13px; }
.notice--success { color: #285c45; background: #e9f5ed; border-color: #b6d9c1; }
.notice--error { color: #842d29; background: #fff0ef; border-color: #ebbfbc; }

.content-panel { margin-top: 34px; background: var(--white); border: 1px solid var(--line); }
.content-panel__header { display: flex; min-height: 100px; padding: 24px 28px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.content-panel__header > div { display: flex; align-items: baseline; gap: 10px; }
.content-panel__header strong { font-family: Georgia, serif; font-size: 36px; font-weight: 400; }
.content-panel__header span, .content-panel__header p { color: var(--muted); font-size: 12px; }
.content-panel__header p { margin: 0; }
.content-table-wrap { overflow-x: auto; }
.content-table { width: 100%; border-collapse: collapse; }
.content-table th { padding: 14px 24px; color: var(--muted); background: #faf9f5; font-size: 10px; letter-spacing: .1em; text-align: left; text-transform: uppercase; }
.content-table td { padding: 20px 24px; border-top: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
.content-table tbody tr:hover { background: #fbfaf6; }
.content-table td:first-child { display: flex; flex-direction: column; }
.content-table td:first-child span { margin-top: 4px; color: var(--muted); font-family: ui-monospace, "Cascadia Code", monospace; font-size: 11px; }
.content-table td time { color: var(--muted); }
.content-table td:last-child { text-align: right; }
.content-table td:last-child a { color: var(--forest); font-weight: 750; }
.status-pill { display: inline-flex; padding: 6px 10px; align-items: center; border-radius: 999px; font-size: 10px; font-weight: 750; text-transform: uppercase; }
.status-pill--draft { color: #765719; background: #f7e8c4; }
.status-pill--published { color: #285c45; background: #e2f1e7; }
.status-pill--archived { color: #666; background: #ececea; }
.status-pill--review { color: #7a4b05; background: #fff0c9; }
.empty-state { padding: 80px 30px; text-align: center; }
.empty-state h2 { margin: 0; font-family: Georgia, serif; font-size: 34px; font-weight: 400; }
.empty-state p { color: var(--muted); }

.back-link { display: inline-flex; margin-bottom: 34px; align-items: center; gap: 9px; color: var(--forest); font-size: 12px; font-weight: 750; }
.editor-actions { display: flex; align-items: center; gap: 10px; }
.editor-actions form { margin: 0; }
.editor-grid { display: grid; margin-top: 34px; align-items: start; grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; }
.editor-grid > .validation-summary { grid-column: 1 / -1; }
.editor-main, .editor-sidebar > section { padding: 30px; background: var(--white); border: 1px solid var(--line); }
.editor-sidebar { display: flex; flex-direction: column; gap: 18px; }
.editor-sidebar section h2 { margin: 0 0 22px; font-family: Georgia, serif; font-size: 24px; font-weight: 400; }
.field-group { display: flex; margin-bottom: 28px; flex-direction: column; }
.field-group:last-child { margin-bottom: 0; }
.field-group label, .editor-sidebar label { margin-bottom: 8px; font-size: 12px; font-weight: 750; }
.field-group input, .field-group textarea, .field-group select, .editor-sidebar input, .editor-sidebar textarea, .editor-sidebar select { width: 100%; padding: 12px 13px; color: var(--ink); background: var(--white); border: 1px solid #cfd2cc; border-radius: 5px; font: inherit; resize: vertical; }
.field-group input:focus, .field-group textarea:focus, .field-group select:focus, .editor-sidebar input:focus, .editor-sidebar textarea:focus, .editor-sidebar select:focus { border-color: var(--forest); outline: 3px solid rgba(18, 59, 53, .1); }
.field-group > span, .editor-sidebar section > span { margin-top: 5px; color: #a12e29; font-size: 12px; }
.field-group small, .editor-sidebar small { margin-top: 7px; color: var(--muted); font-size: 11px; }
.field-group--body textarea { min-height: 430px; line-height: 1.7; }
.slug-field { display: flex; align-items: center; border: 1px solid #cfd2cc; border-radius: 5px; }
.slug-field > span { padding-left: 12px; color: var(--muted); font-family: ui-monospace, monospace; }
.slug-field input { border: 0; }
.danger-zone { border-color: #e7c2bf !important; }
.danger-zone h2 { color: #842d29; }
.danger-zone p { margin: 0; color: var(--muted); font-size: 12px; }
.review-zone { border-color: #e5c77d !important; background: #fffaf0 !important; }
.review-zone p { color: var(--muted); font-size: 12px; line-height: 1.6; }
.review-approval-form, .import-confirmation { display: flex; margin-top: 18px; padding: 22px 26px; align-items: center; justify-content: space-between; gap: 24px; background: #fffaf0; border: 1px solid #e5c77d; }
.review-approval-form div { display: flex; flex-direction: column; gap: 5px; }
.review-approval-form span, .import-confirmation p { color: var(--muted); font-size: 12px; }
.import-confirmation h2 { margin: 0 0 5px; font-family: Georgia, serif; font-size: 24px; font-weight: 400; }
.import-confirmation p { margin: 0; }
.media-layout { display: grid; margin-top: 34px; grid-template-columns: 340px minmax(0, 1fr); gap: 24px; align-items: start; }
.upload-panel { padding: 30px; background: var(--white); border: 1px solid var(--line); }
.upload-panel h2 { margin: 0 0 24px; font-family: Georgia, serif; font-size: 30px; font-weight: 400; }
.media-library { margin-top: 0; }
.media-grid { display: grid; padding: 24px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; }
.media-card { overflow: hidden; background: #f7f6f1; border: 1px solid var(--line); border-radius: 7px; }
.media-card > a { display: block; aspect-ratio: 4 / 3; background: #e5e8e2; }
.media-card img { width: 100%; height: 100%; object-fit: cover; }
.media-card > div { display: flex; padding: 14px; flex-direction: column; gap: 5px; }
.media-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.media-card span, .media-card small { color: var(--muted); font-size: 11px; }
.archive-form { margin-top: 16px; text-align: right; }
.archive-form button { padding: 9px 13px; color: #842d29; background: transparent; border: 1px solid #d9aaa6; border-radius: 5px; cursor: pointer; font-size: 12px; font-weight: 750; }

.auth-body { min-height: 100vh; color: var(--ink); background: var(--white); }
.auth-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(420px, .85fr) minmax(440px, 1.15fr); }
.auth-brand-panel { display: flex; padding: clamp(32px, 5vw, 72px); flex-direction: column; justify-content: space-between; color: rgba(255, 255, 255, .68); background: #102a26; }
.auth-brand-panel h1 { margin: 0; color: var(--white); font-family: Georgia, serif; font-size: clamp(52px, 6vw, 78px); font-weight: 400; letter-spacing: -.045em; line-height: 1.02; }
.auth-brand-panel > div > p:last-child { max-width: 560px; margin-top: 30px; font-size: 17px; }
.auth-brand-panel > small { color: rgba(255, 255, 255, .35); letter-spacing: .08em; text-transform: uppercase; }
.auth-form-panel { display: grid; padding: 40px; place-items: center; }
.auth-form-wrap { width: min(100%, 460px); }
.auth-form-wrap h2 { margin: 0; font-family: Georgia, serif; font-size: 48px; font-weight: 400; letter-spacing: -.035em; }
.auth-form-wrap > p:not(.eyebrow):not(.auth-help) { margin: 14px 0 36px; color: var(--muted); }
.auth-form-wrap form { display: flex; flex-direction: column; }
.auth-form-wrap label { margin: 18px 0 7px; font-size: 12px; font-weight: 750; }
.auth-form-wrap input { width: 100%; height: 52px; padding: 0 14px; color: var(--ink); background: var(--white); border: 1px solid #cfd2cc; border-radius: 5px; font: inherit; }
.auth-form-wrap input:focus { border-color: var(--forest); outline: 3px solid rgba(18, 59, 53, .12); }
.auth-form-wrap form > span { margin-top: 5px; color: #a12e29; font-size: 12px; }
.auth-form-wrap form button { min-height: 52px; margin-top: 26px; color: var(--white); background: var(--forest); border: 0; border-radius: 5px; cursor: pointer; font-weight: 750; }
.auth-form-wrap form button:hover { background: #0d2f2a; }
.validation-summary { margin-bottom: 8px; color: #8a2622; background: #fff0ef; border-radius: 5px; font-size: 13px; }
.validation-summary:empty { display: none; }
.validation-summary ul { margin: 0; padding: 12px 14px 12px 30px; }
.auth-help { margin: 24px 0 0; color: var(--muted); font-size: 12px; }
.auth-back { display: inline-flex; margin-top: 24px; color: var(--forest); font-size: 13px; font-weight: 750; }
.code-input { font-family: ui-monospace, "Cascadia Code", monospace !important; font-size: 24px !important; letter-spacing: .22em; text-align: center; }

@media (max-width: 1050px) {
  .admin-shell { grid-template-columns: 86px 1fr; }
  .sidebar { padding-inline: 18px; }
  .brand > span:last-child, .sidebar nav a { font-size: 0; }
  .sidebar nav a { justify-content: center; }
  .sidebar nav span { font-size: 11px; }
  .sidebar-note div { display: none; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metrics article:nth-child(2) { border-right: 0; }
  .metrics article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .editor-grid, .media-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .admin-shell { display: block; }
  .sidebar { position: static; display: none; }
  .topbar { padding-inline: 20px; }
  .topbar strong { display: none; }
  .admin-main main { padding: 34px 20px 60px; }
  .dashboard-heading { align-items: flex-start; flex-direction: column; }
  .content-heading, .editor-heading { align-items: flex-start; flex-direction: column; }
  .editor-actions { width: 100%; }
  .editor-actions .primary-action, .editor-actions form, .editor-actions form button { flex: 1; }
  .metrics, .work-grid { grid-template-columns: 1fr; }
  .metrics article { border-right: 0; border-bottom: 1px solid var(--line); }
  .action-row { grid-template-columns: 34px 1fr; }
  .action-status { grid-column: 2; max-width: none; text-align: left; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand-panel { min-height: 380px; }
  .auth-brand-panel > div > p:last-child, .auth-brand-panel > small { display: none; }
  .auth-form-panel { padding: 64px 24px; }
  .content-panel__header { align-items: flex-start; flex-direction: column; gap: 10px; }
  .content-table th:nth-child(3), .content-table td:nth-child(3) { display: none; }
}
