:root {
  color-scheme: light;
  --navy: #08142a;
  --navy-soft: #102243;
  --ink: #16233b;
  --muted: #68758b;
  --line: #e4e8ef;
  --surface: #ffffff;
  --canvas: #f5f7fa;
  --gold: #b68c4a;
  --gold-soft: #f6eddf;
  --green: #28795c;
  --green-soft: #e5f3ed;
  --amber: #9b6d28;
  --amber-soft: #fff4dc;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.shell { min-height: 100vh; }
.topbar { align-items: center; background: var(--navy); color: white; display: flex; justify-content: space-between; padding: 22px max(24px, calc((100vw - 1240px) / 2)); }
.brand, .topbar-meta, .user-chip { align-items: center; display: flex; gap: 12px; }
.brand-mark { align-items: center; background: var(--gold); border-radius: 10px; color: var(--navy); display: flex; font-size: 13px; font-weight: 800; height: 38px; justify-content: center; letter-spacing: .06em; width: 38px; }
.eyebrow { color: var(--gold); font-size: 10px; font-weight: 800; letter-spacing: .16em; margin: 0 0 7px; text-transform: uppercase; }
.topbar .eyebrow { color: #d9bb87; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 18px; letter-spacing: -.02em; margin: 0; }
h2 { color: var(--navy); font-size: clamp(29px, 4vw, 44px); letter-spacing: -.05em; margin: 0 0 10px; }
h3 { color: var(--navy); font-size: 18px; letter-spacing: -.025em; margin: 0; }
.topbar-meta { font-size: 12px; }
.mode-chip, .user-chip { border: 1px solid rgba(255,255,255,.16); border-radius: 999px; padding: 8px 11px; }
.mode-chip { color: #f0d7a6; }
.status-dot { background: #6fd2a6; border-radius: 50%; height: 7px; width: 7px; }
.content { margin: 0 auto; max-width: 1240px; padding: 58px 24px 88px; }
.hero { align-items: end; display: flex; justify-content: space-between; margin-bottom: 34px; }
.hero-copy, .muted { color: var(--muted); font-size: 14px; line-height: 1.6; }
.hero-copy { margin-bottom: 0; max-width: 520px; }
.notice { background: var(--amber-soft); border: 1px solid #efd9a7; border-radius: 12px; color: #704f1d; font-size: 13px; line-height: 1.5; margin-bottom: 22px; padding: 13px 16px; }
.metrics { display: grid; gap: 14px; grid-template-columns: repeat(4, 1fr); margin-bottom: 28px; }
.metric { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.metric-label { color: var(--muted); font-size: 12px; }
.metric-value { color: var(--navy); display: block; font-size: 27px; font-weight: 750; letter-spacing: -.05em; margin-top: 12px; }
.action-grid { display: grid; gap: 18px; grid-template-columns: repeat(2, 1fr); margin-bottom: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.action-card { padding: 25px; }
.card-heading, .section-heading { align-items: start; display: flex; justify-content: space-between; }
.card-heading { margin-bottom: 12px; }
.card-heading .muted { margin-bottom: 22px; }
.card-icon { align-items: center; background: var(--gold-soft); border-radius: 10px; color: var(--gold); display: flex; font-size: 20px; height: 38px; justify-content: center; width: 38px; }
label { color: var(--ink); display: block; font-size: 12px; font-weight: 700; margin-top: 15px; }
input, select { background: #fbfcfd; border: 1px solid #dce2eb; border-radius: 9px; color: var(--ink); display: block; margin-top: 7px; min-height: 42px; outline: none; padding: 10px 12px; width: 100%; }
input:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(182,140,74,.12); }
.field-row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.field-row-wide { grid-template-columns: repeat(2, 1fr); }
.optional, .summary-hint { color: var(--muted); font-size: 11px; font-weight: 500; }
.check-row { align-items: center; display: flex; gap: 8px; font-weight: 600; }
.check-row input { margin: 0; min-height: 16px; width: 16px; }
.button { border: 0; border-radius: 9px; font-size: 12px; font-weight: 800; min-height: 42px; padding: 0 17px; transition: transform .15s ease, box-shadow .15s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--navy); box-shadow: 0 7px 18px rgba(8,20,42,.12); color: white; margin-top: 22px; width: 100%; }
.button-secondary { background: white; border: 1px solid #cfd7e3; color: var(--navy); }
.button-small { background: white; border: 1px solid #d8dfe8; color: var(--navy); min-height: 32px; padding: 0 10px; }
.button-danger { color: #9d4c43; }
.catalog-card { margin-bottom: 18px; padding: 0 25px; }
summary { align-items: center; cursor: pointer; display: flex; justify-content: space-between; list-style: none; padding: 19px 0; }
summary::-webkit-details-marker { display: none; }
summary strong { display: block; font-size: 14px; }
.catalog-form { border-top: 1px solid var(--line); padding: 5px 0 25px; }
.catalog-form .button { margin-top: 20px; }
.table-card { padding: 24px; }
.table-card h3 { margin-bottom: 20px; }
.count-label { color: var(--muted); font-size: 11px; padding-top: 3px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; min-width: 620px; width: 100%; }
th { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .1em; padding: 0 12px 12px; text-align: left; text-transform: uppercase; }
td { border-top: 1px solid var(--line); font-size: 12px; padding: 15px 12px; vertical-align: middle; }
td:first-child, th:first-child { padding-left: 0; }
td:last-child, th:last-child { padding-right: 0; text-align: right; }
.primary-cell { color: var(--navy); font-weight: 750; }
.secondary-cell { color: var(--muted); font-size: 11px; margin-top: 4px; }
.code { background: #f1f4f8; border-radius: 5px; color: var(--navy-soft); display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; padding: 4px 6px; }
.status { border-radius: 999px; display: inline-block; font-size: 10px; font-weight: 800; padding: 5px 8px; text-transform: capitalize; }
.status-active, .status-approved, .status-complete { background: var(--green-soft); color: var(--green); }
.status-pending, .status-processing_transaction, .status-waiting_payment { background: var(--amber-soft); color: var(--amber); }
.status-archived, .status-cancelled, .status-refunded, .status-unknown { background: #eef1f5; color: #657188; }
.actions { display: flex; gap: 7px; justify-content: end; }
.empty { color: var(--muted); font-size: 13px; padding: 22px 0 4px; }
.split-section { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; margin-top: 18px; }
.toast { background: var(--navy); border-radius: 10px; bottom: 24px; box-shadow: 0 10px 30px rgba(8,20,42,.2); color: white; font-size: 13px; left: 50%; opacity: 0; padding: 12px 16px; pointer-events: none; position: fixed; transform: translate(-50%, 12px); transition: opacity .2s ease, transform .2s ease; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 820px) {
  .topbar { align-items: flex-start; gap: 18px; }
  .topbar-meta { align-items: flex-end; flex-direction: column; gap: 7px; }
  .content { padding-top: 38px; }
  .hero { align-items: flex-start; flex-direction: column; gap: 20px; }
  .metrics, .action-grid, .split-section { grid-template-columns: 1fr 1fr; }
  .action-grid { align-items: start; }
}
@media (max-width: 560px) {
  .topbar { padding: 17px; }
  .content { padding: 32px 15px 60px; }
  .metrics, .action-grid, .split-section, .field-row, .field-row-wide { grid-template-columns: 1fr; }
  .metric-value { font-size: 23px; }
  .action-card, .table-card { padding: 19px; }
  .catalog-card { padding: 0 19px; }
  .summary-hint { display: none; }
}
