/* =========================================================
   YOKOOL ADMIN — Stylesheet
   Inherits design tokens from Yokool main site,
   adapted for utility-dense admin views.
   ========================================================= */

:root {
  --brand:        #DC143B;
  --brand-soft:   #FFF5F7;
  --brand-line:   rgba(220, 20, 59, 0.18);
  --brand-glow:   rgba(220, 20, 59, 0.08);

  --bg-base:      #FFFFFF;
  --bg-surface:   #FAFAFA;
  --bg-deep:      #0A0A0A;
  --bg-mute:      #F4F4F4;

  --text-primary:   #0A0A0A;
  --text-secondary: #555555;
  --text-tertiary:  #888888;
  --text-faint:     #BBBBBB;

  --border-subtle: #F0F0F0;
  --border-medium: #E0E0E0;
  --border-strong: #C0C0C0;

  --status-new-bg:        #F0F0F0;
  --status-new-text:      #555555;
  --status-new-dot:       #888888;
  --status-processing-bg: #FFF4E5;
  --status-processing-text:#995900;
  --status-processing-dot:#D97706;
  --status-shipping-bg:   #E5F1FF;
  --status-shipping-text: #0050B3;
  --status-shipping-dot:  #2563EB;
  --status-delivered-bg:  #E6F7EB;
  --status-delivered-text:#0F7438;
  --status-delivered-dot: #16A34A;
  --status-cancelled-bg:  #FEE7E7;
  --status-cancelled-text:#A30000;
  --status-cancelled-dot: #DC2626;
  --status-contacted-bg:  #E5F1FF;
  --status-contacted-text:#0050B3;
  --status-contacted-dot: #2563EB;
  --status-quoted-bg:     #FFF4E5;
  --status-quoted-text:   #995900;
  --status-quoted-dot:    #D97706;
  --status-deal-bg:       #E6F7EB;
  --status-deal-text:     #0F7438;
  --status-deal-dot:      #16A34A;
  --status-lost-bg:       #FEE7E7;
  --status-lost-text:     #A30000;
  --status-lost-dot:      #DC2626;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 36px rgba(0,0,0,0.08);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body:    'Be Vietnam Pro', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  --sidebar-width: 240px;
  --topbar-height: 64px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-surface);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* =========================================================
   AUTH PAGES (login.html, setup.html)
   ========================================================= */

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 0%, var(--brand-glow), transparent 50%),
    radial-gradient(circle at 80% 100%, var(--brand-glow), transparent 50%),
    var(--bg-base);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  padding: 48px 40px;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.auth-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 48px;
  height: 3px;
  background: var(--brand);
}

.auth-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  color: var(--brand);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.auth-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 32px;
}

.auth-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.auth-subtitle {
  color: var(--text-secondary);
  margin: 0 0 32px;
  font-size: 14px;
}

.auth-field { margin-bottom: 16px; }
.auth-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.auth-field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-medium);
  background: var(--bg-base);
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  border-radius: 0;
}
.auth-field input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-line);
}

.auth-error {
  background: var(--status-cancelled-bg);
  color: var(--status-cancelled-text);
  padding: 12px 14px;
  border-left: 3px solid var(--status-cancelled-dot);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}
.auth-error.is-visible { display: block; }

.auth-submit {
  width: 100%;
  padding: 14px;
  background: var(--brand);
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s var(--ease);
}
.auth-submit:hover { background: #B30E2F; }
.auth-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.auth-helper {
  margin-top: 24px;
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: center;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

/* =========================================================
   APP SHELL (index.html)
   ========================================================= */

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: var(--topbar-height) 1fr;
  grid-template-areas:
    "sidebar topbar"
    "sidebar main";
  min-height: 100vh;
}

.topbar {
  grid-area: topbar;
  background: var(--bg-base);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.topbar-user-name { font-weight: 600; }
.topbar-user-email { color: var(--text-tertiary); font-family: var(--font-mono); font-size: 11px; }

.topbar-logout {
  background: transparent;
  border: 1px solid var(--border-medium);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.2s var(--ease);
}
.topbar-logout:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.sidebar {
  grid-area: sidebar;
  background: var(--bg-deep);
  color: #fff;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  padding: 0 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 20px;
}
.sidebar-brand-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--brand);
}
.sidebar-brand-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
}

.sidebar-nav { display: flex; flex-direction: column; padding: 0 12px; gap: 2px; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s var(--ease);
  border-left: 2px solid transparent;
}
.sidebar-link:hover { color: #fff; background: rgba(255,255,255,0.04); }
.sidebar-link.is-active {
  color: #fff;
  background: rgba(220,20,59,0.12);
  border-left-color: var(--brand);
  font-weight: 600;
}
.sidebar-link-icon { font-size: 16px; opacity: 0.9; }

.sidebar-footer {
  margin-top: auto;
  padding: 16px 24px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.3);
}

.main {
  grid-area: main;
  padding: 32px;
  overflow-x: auto;
  max-width: 100%;
}

/* =========================================================
   PAGE HEADER
   ========================================================= */

.page-header {
  margin-bottom: 28px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}
.page-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand);
  font-weight: 500;
  margin-bottom: 6px;
}
.page-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 32px;
  letter-spacing: -0.025em;
  line-height: 1;
  margin: 0;
}
.page-description {
  color: var(--text-secondary);
  margin: 8px 0 0;
  max-width: 600px;
}

/* =========================================================
   STAT CARDS
   ========================================================= */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
  position: relative;
  overflow: hidden;
}
.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand-line);
}
.stat-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 24px;
  height: 2px;
  background: var(--brand);
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.stat-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 32px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.stat-value-sub {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}
.stat-value-currency {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  margin-left: 4px;
}

/* =========================================================
   TOOLBAR (filters above tables)
   ========================================================= */

.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: center;
}

.filter-chip {
  padding: 7px 14px;
  background: var(--bg-base);
  border: 1px solid var(--border-medium);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.2s var(--ease);
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
  cursor: pointer;
}
.filter-chip:hover { border-color: var(--brand); color: var(--brand); }
.filter-chip.is-active {
  background: var(--text-primary);
  color: #fff;
  border-color: var(--text-primary);
}
.filter-chip-count {
  margin-left: 6px;
  opacity: 0.7;
}

.toolbar-search {
  flex: 1;
  min-width: 200px;
  padding: 8px 14px;
  border: 1px solid var(--border-medium);
  font-size: 13px;
  background: var(--bg-base);
  outline: none;
  transition: border-color 0.2s var(--ease);
}
.toolbar-search:focus { border-color: var(--brand); }

.toolbar-action {
  padding: 8px 16px;
  background: var(--text-primary);
  color: #fff;
  border: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.toolbar-action:hover { background: #333; }
.toolbar-action.is-brand { background: var(--brand); }
.toolbar-action.is-brand:hover { background: #B30E2F; }

/* =========================================================
   TABLE
   ========================================================= */

.table-wrap {
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table thead th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  font-weight: 500;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
.data-table tbody tr {
  cursor: pointer;
  transition: background 0.15s var(--ease);
}
.data-table tbody tr:hover { background: var(--bg-mute); }
.data-table tbody tr:last-child td { border-bottom: none; }

.cell-id {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12px;
  color: var(--brand);
  letter-spacing: 0.02em;
}
.cell-strong { font-weight: 600; }
.cell-money {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  text-align: right;
}
.cell-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
}
.cell-muted { color: var(--text-tertiary); font-size: 12px; }

/* =========================================================
   STATUS BADGE
   ========================================================= */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--status-new-bg);
  color: var(--status-new-text);
}
.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--status-new-dot);
  border-radius: 50%;
  flex-shrink: 0;
}
.badge[data-status="new"] { background: var(--status-new-bg); color: var(--status-new-text); }
.badge[data-status="new"]::before { background: var(--status-new-dot); }
.badge[data-status="processing"] { background: var(--status-processing-bg); color: var(--status-processing-text); }
.badge[data-status="processing"]::before { background: var(--status-processing-dot); }
.badge[data-status="shipping"] { background: var(--status-shipping-bg); color: var(--status-shipping-text); }
.badge[data-status="shipping"]::before { background: var(--status-shipping-dot); }
.badge[data-status="delivered"] { background: var(--status-delivered-bg); color: var(--status-delivered-text); }
.badge[data-status="delivered"]::before { background: var(--status-delivered-dot); }
.badge[data-status="cancelled"] { background: var(--status-cancelled-bg); color: var(--status-cancelled-text); }
.badge[data-status="cancelled"]::before { background: var(--status-cancelled-dot); }
.badge[data-status="contacted"] { background: var(--status-contacted-bg); color: var(--status-contacted-text); }
.badge[data-status="contacted"]::before { background: var(--status-contacted-dot); }
.badge[data-status="quoted"] { background: var(--status-quoted-bg); color: var(--status-quoted-text); }
.badge[data-status="quoted"]::before { background: var(--status-quoted-dot); }
.badge[data-status="deal"] { background: var(--status-deal-bg); color: var(--status-deal-text); }
.badge[data-status="deal"]::before { background: var(--status-deal-dot); }
.badge[data-status="lost"] { background: var(--status-lost-bg); color: var(--status-lost-text); }
.badge[data-status="lost"]::before { background: var(--status-lost-dot); }

/* =========================================================
   DETAIL PAGE
   ========================================================= */

.detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  align-items: start;
}

.panel {
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  padding: 28px;
  margin-bottom: 16px;
}
.panel-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  margin: 0 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  font-weight: 500;
  margin-bottom: 12px;
}

.kv-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px 16px;
  font-size: 13px;
}
.kv-key {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  font-weight: 500;
  padding-top: 2px;
}
.kv-val { color: var(--text-primary); word-break: break-word; }
.kv-val.is-muted { color: var(--text-tertiary); font-style: italic; }

.items-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.items-table th, .items-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.items-table th {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  font-weight: 500;
}
.items-table td.is-num { font-family: var(--font-mono); text-align: right; }
.items-table tfoot td {
  border-top: 2px solid var(--text-primary);
  font-weight: 700;
  padding-top: 14px;
}

.field {
  margin-bottom: 14px;
}
.field-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  font-weight: 500;
  margin-bottom: 6px;
}
.field-input,
.field-select,
.field-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-medium);
  background: var(--bg-base);
  font-size: 13px;
  outline: none;
  border-radius: 0;
  transition: border-color 0.2s var(--ease);
}
.field-input:focus,
.field-select:focus,
.field-textarea:focus { border-color: var(--brand); }
.field-textarea {
  resize: vertical;
  min-height: 80px;
  font-family: var(--font-body);
}

.btn {
  padding: 10px 20px;
  border: 1px solid var(--text-primary);
  background: var(--text-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s var(--ease);
}
.btn:hover { background: #333; border-color: #333; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.is-brand { background: var(--brand); border-color: var(--brand); }
.btn.is-brand:hover { background: #B30E2F; border-color: #B30E2F; }
.btn.is-ghost { background: transparent; color: var(--text-primary); }
.btn.is-ghost:hover { background: var(--bg-mute); }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  margin-bottom: 12px;
  letter-spacing: 0.05em;
}
.back-link:hover { color: var(--brand); }

/* =========================================================
   EMPTY / LOADING / RECENT LISTS
   ========================================================= */

.empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13px;
}
.empty-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 8px;
  opacity: 0.3;
}

.loading {
  padding: 48px;
  text-align: center;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
}
.loading::after {
  content: "...";
  animation: dots 1.5s steps(4, end) infinite;
}
@keyframes dots {
  0%, 20% { content: "."; }
  40% { content: ".."; }
  60%, 100% { content: "..."; }
}

.two-col-recent {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.recent-card {
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
}
.recent-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}
.recent-card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
}
.recent-card-link {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
}
.recent-card-link:hover { color: var(--brand); }
.recent-row {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: background 0.15s var(--ease);
  font-size: 12px;
}
.recent-row:hover { background: var(--bg-mute); }
.recent-row:last-child { border-bottom: none; }

/* =========================================================
   TOAST
   ========================================================= */

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text-primary);
  color: #fff;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 500;
  z-index: 200;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s var(--ease);
}
.toast.is-visible { transform: translateY(0); opacity: 1; }
.toast.is-error { background: var(--status-cancelled-dot); }
.toast.is-success { background: var(--status-delivered-dot); }

/* =========================================================
   PAGINATION
   ========================================================= */

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-top: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0.05em;
}
.page-btns { display: flex; gap: 4px; }
.page-btn {
  padding: 6px 12px;
  border: 1px solid var(--border-medium);
  background: var(--bg-base);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}
.page-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-btn.is-current { background: var(--text-primary); color: #fff; border-color: var(--text-primary); }

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .two-col-recent { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-areas: "topbar" "main";
  }
  .sidebar { display: none; }
  .stats-grid { grid-template-columns: 1fr; }
  .main { padding: 20px; }
  .topbar { padding: 0 20px; }
  .topbar-user-email { display: none; }
  .data-table { font-size: 12px; }
  .data-table thead th,
  .data-table tbody td { padding: 10px 12px; }
}

/* ============================================================
   Phase 2A — Content management pages
   ============================================================ */

/* Sidebar divider */
.sidebar-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 12px 24px;
}

/* Form card */
.form-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-grid {
  display: grid;
  gap: 16px;
}
.form-grid--2 { grid-template-columns: repeat(2, 1fr); }
.form-grid--3 { grid-template-columns: repeat(3, 1fr); }

.form-field { display: flex; flex-direction: column; gap: 6px; }

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.form-label .required {
  color: #DC143B;
  margin-left: 2px;
}

.form-input {
  font: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
.form-input:focus {
  outline: none;
  border-color: #DC143B;
  box-shadow: 0 0 0 3px rgba(220, 20, 59, 0.1);
}
.form-input--sm {
  padding: 8px 10px;
  font-size: 13px;
}

textarea.form-input {
  resize: vertical;
  min-height: 60px;
  font-family: inherit;
}

.form-help {
  font-size: 12px;
  color: #6b7280;
  margin: 2px 0 0 0;
}

.form-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  padding: 10px 0;
}
.form-checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
  margin-top: 4px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn-primary { background: #DC143B; color: #fff; }
.btn-primary:hover { background: #b8102f; }

.btn-ghost { background: #fff; color: #374151; border-color: #d1d5db; }
.btn-ghost:hover { background: #f9fafb; border-color: #9ca3af; }

.btn-danger { background: #fff; color: #DC143B; border-color: #DC143B; }
.btn-danger:hover { background: #DC143B; color: #fff; }

.btn-sm { padding: 6px 12px; font-size: 13px; }

.btn-link {
  color: #DC143B;
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
}
.btn-link:hover { text-decoration: underline; }

/* Tables (extension of existing .data-table) */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table thead th {
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  padding: 14px 16px;
  border-bottom: 1px solid #e5e7eb;
}
.table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid #f3f4f6;
}
.table tbody tr:hover { background: #fafafa; }

/* Product thumbnails */
.product-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  background: #f3f4f6;
}
.product-thumb--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 18px;
}

/* Article list cells */
.article-title { font-weight: 500; margin-bottom: 2px; }
.article-slug { font-size: 12px; }

/* Image upload */
.image-upload-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.image-upload-row .form-input { flex: 1; }

.image-preview {
  max-width: 200px;
  max-height: 150px;
  border-radius: 8px;
  margin-top: 8px;
  border: 1px solid #e5e7eb;
}

/* Markdown editor */
.markdown-editor {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}
.markdown-input {
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 13px;
  line-height: 1.5;
  min-height: 500px;
}
.markdown-preview {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px 20px;
  background: #fafafa;
  overflow-y: auto;
  max-height: 600px;
  font-size: 14px;
  line-height: 1.6;
}
.markdown-preview h1, .markdown-preview h2, .markdown-preview h3 {
  margin: 16px 0 8px 0;
  font-weight: 600;
}
.markdown-preview h1 { font-size: 22px; }
.markdown-preview h2 { font-size: 18px; }
.markdown-preview h3 { font-size: 16px; }
.markdown-preview p { margin: 8px 0; }
.markdown-preview ul { padding-left: 22px; }
.markdown-preview a { color: #DC143B; }
.markdown-preview pre {
  background: #1f2937;
  color: #f9fafb;
  padding: 10px 14px;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 12px;
}
.markdown-preview img { max-width: 100%; border-radius: 6px; }

@media (max-width: 900px) {
  .markdown-editor { grid-template-columns: 1fr; }
  .markdown-input  { min-height: 300px; }
}

/* Banner cards */
.banner-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  margin-bottom: 16px;
  overflow: hidden;
}
.banner-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}
.banner-card-header strong {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: #6b7280;
  text-transform: uppercase;
}
.banner-card-body {
  padding: 18px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
}
.banner-card-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.banner-preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  background: #f3f4f6;
}
.banner-preview--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 13px;
}

@media (max-width: 768px) {
  .banner-card-body { grid-template-columns: 1fr; }
  .form-grid--2, .form-grid--3 { grid-template-columns: 1fr; }
}

/* Config page */
.config-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.config-section {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
}
.section-heading {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 4px 0;
  color: #111827;
}
.section-desc {
  font-size: 13px;
  color: #6b7280;
  margin: 0 0 16px 0;
}

/* Page header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 16px;
}
.page-title { font-size: 24px; font-weight: 700; margin: 0; color: #111827; }
.page-subtitle { font-size: 14px; color: #6b7280; margin: 4px 0 0 0; }

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-muted   { background: #f3f4f6; color: #6b7280; }

.text-muted { color: #9ca3af; }

/* Card */
.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}

/* Loading state */
.loading {
  text-align: center;
  color: #9ca3af;
  padding: 40px 0;
  font-size: 14px;
}
