:root {
  --navy: #082c3d;
  --ink: #102337;
  --muted: #6a7b8d;
  --line: #dce5eb;
  --surface: #ffffff;
  --canvas: #f3f7f8;
  --teal: #0fae9f;
  --teal-dark: #07867f;
  --mint: #dff6f1;
  --danger: #bd4e55;
  --shadow: 0 22px 60px rgba(8, 44, 61, .12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 32px; background: var(--navy); }
.auth-card { width: min(100%, 470px); padding: 48px; border: 1px solid rgba(255,255,255,.16); border-radius: 10px; background: rgba(255,255,255,.98); box-shadow: var(--shadow); }
.brand-lockup { display: inline-flex; align-items: center; gap: 12px; color: var(--navy); text-decoration: none; }
.brand-lockup strong { display: block; letter-spacing: .14em; font-size: 15px; }
.brand-lockup small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: var(--teal); color: white; font-weight: 900; font-size: 22px; }
.auth-card > .brand-lockup { margin-bottom: 66px; }
.eyebrow, .page-kicker, .sidebar-label { margin: 0 0 14px; color: var(--teal-dark); font-weight: 800; letter-spacing: .16em; font-size: 11px; }
.auth-card h1, .page-heading h1 { margin: 0; color: var(--navy); letter-spacing: -.04em; line-height: .98; font-size: clamp(34px, 5vw, 54px); }
.lead { margin: 16px 0 32px; color: var(--muted); line-height: 1.6; }
.stack-form { display: grid; gap: 18px; }
label { display: grid; gap: 8px; color: var(--ink); font-weight: 700; font-size: 13px; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 5px; padding: 13px 14px; color: var(--ink); background: #fbfdfe; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15,174,159,.12); }
textarea { resize: vertical; min-height: 96px; }
.primary-button, .outline-button, .quiet-button, .icon-button { border: 0; border-radius: 4px; padding: 13px 17px; font-weight: 800; transition: transform .18s ease, background .18s ease; }
.primary-button { background: var(--teal); color: white; }
.primary-button:hover { background: var(--teal-dark); transform: translateY(-1px); }
.primary-button span { margin-left: 16px; font-size: 18px; }
.primary-button.compact { padding: 11px 14px; }
.outline-button { border: 1px solid var(--line); background: white; color: var(--navy); }
.outline-button:hover, .quiet-button:hover { border-color: var(--teal); color: var(--teal-dark); }
.quiet-button { padding: 7px 0; background: transparent; color: var(--muted); }
.form-status { min-height: 20px; margin: 0; color: var(--danger); font-size: 13px; line-height: 1.4; }
.form-status.success { color: var(--teal-dark); }
.auth-card .form-status { margin-top: 17px; }
.auth-card .quiet-button { margin-top: 18px; }

.admin-shell { min-height: 100vh; }
.admin-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 34px; border-bottom: 1px solid var(--line); background: white; }
.header-actions { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 13px; }
.admin-layout { display: grid; grid-template-columns: 245px minmax(0, 1fr); min-height: calc(100vh - 79px); }
.admin-sidebar { display: flex; flex-direction: column; padding: 34px 20px; background: var(--navy); }
.sidebar-label { color: #81e9dc; padding: 0 12px; }
.admin-nav { display: grid; gap: 5px; }
.nav-item { padding: 13px 12px; border: 0; border-radius: 4px; background: transparent; color: #b9cbd4; text-align: left; font-weight: 700; }
.nav-item:hover, .nav-item.is-active { background: rgba(255,255,255,.1); color: white; }
.sidebar-link { margin-top: auto; padding: 18px 12px 0; border-top: 1px solid rgba(255,255,255,.14); color: #b9cbd4; text-decoration: none; font-size: 13px; }
.sidebar-link span { float: right; color: #81e9dc; }
.admin-content { width: min(1180px, 100%); padding: 42px clamp(22px, 4vw, 64px) 80px; }
.admin-content > .page-kicker { color: var(--teal-dark); }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 22px; margin-bottom: 30px; }
.page-heading p:not(.page-kicker) { margin: 15px 0 0; color: var(--muted); }
.view-panel { display: none; }
.view-panel.is-visible { display: block; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 18px; }
.stat-card, .surface-card, .table-card, .editor-card { border: 1px solid var(--line); border-radius: 7px; background: var(--surface); box-shadow: 0 8px 30px rgba(8,44,61,.04); }
.stat-card { padding: 24px; }
.stat-card span, .stat-card small { display: block; color: var(--muted); font-size: 13px; }
.stat-card strong { display: block; margin: 14px 0 8px; color: var(--navy); letter-spacing: -.04em; font-size: 42px; }
.overview-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; }
.surface-card { padding: 26px; }
.card-heading, .table-toolbar, .editor-heading, .editor-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.card-heading h2, .table-toolbar h2, .editor-heading h2 { margin: 0; color: var(--navy); font-size: 20px; }
.status-pill, .live-dot { color: var(--teal-dark); font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.overview-copy { color: var(--muted); line-height: 1.7; }
.public-preview { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 26px; padding: 18px; border: 1px solid var(--line); color: var(--navy); text-decoration: none; }
.public-preview strong { color: var(--teal-dark); font-size: 13px; }
.editor-card { margin: 0 0 18px; padding: 26px; }
.editor-heading { align-items: start; margin-bottom: 24px; }
.icon-button { padding: 0; background: transparent; color: var(--muted); font-size: 28px; line-height: 1; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.wide { grid-column: 1 / -1; }
.toggle-label { display: flex; align-items: center; align-self: end; gap: 10px; min-height: 44px; }
.toggle-label input { width: 18px; height: 18px; accent-color: var(--teal); }
.file-field small { color: var(--muted); font-weight: 500; }
.editor-footer { align-items: center; margin-top: 24px; }
.editor-footer .form-status { margin-right: auto; }
.table-card { overflow: hidden; }
.table-toolbar { padding: 20px 22px; border-bottom: 1px solid var(--line); }
.table-toolbar select { width: auto; min-width: 160px; padding: 9px 12px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 16px 22px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; font-size: 13px; }
th { color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
td strong { color: var(--navy); }
td small { display: block; margin-top: 4px; color: var(--muted); }
.row-actions { display: flex; justify-content: end; gap: 12px; }
.table-action { border: 0; background: transparent; color: var(--teal-dark); font-weight: 800; }
.table-action.danger { color: var(--danger); }
.state-select { min-width: 125px; padding: 8px 10px; }
.empty-table { padding: 28px 22px; margin: 0; color: var(--muted); text-align: center; }
.global-status { position: fixed; right: 22px; bottom: 22px; max-width: 360px; padding: 12px 15px; border-radius: 4px; background: var(--navy); color: white; box-shadow: var(--shadow); opacity: 0; transform: translateY(8px); pointer-events: none; transition: .2s ease; }
.global-status.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 880px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { padding: 16px 20px; }
  .admin-nav { display: flex; overflow-x: auto; }
  .nav-item { white-space: nowrap; }
  .sidebar-link { display: none; }
  .overview-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .auth-screen { padding: 16px; }
  .auth-card { padding: 28px 22px; }
  .auth-card > .brand-lockup { margin-bottom: 48px; }
  .admin-header { align-items: start; padding: 16px 20px; }
  .header-actions { flex-direction: column; align-items: end; gap: 7px; }
  .admin-content { padding: 30px 16px 64px; }
  .page-heading { align-items: start; flex-direction: column; }
  .stats-grid, .form-grid { grid-template-columns: 1fr; }
  .wide { grid-column: auto; }
  .editor-footer { flex-wrap: wrap; }
  .editor-footer .form-status { width: 100%; }
}
