/* LUMEN Platform — admin. Quiet on purpose: the data is the content. */
:root {
  --paper: #f4f1ec; --card: #ffffff; --ink: #1a1816; --muted: #5a5449; --line: #ddd4c4;
  --accent: #8a6d36; --ok: #2f6b45; --warn: #9a6a00; --err: #a23b2a; --info: #2d5b8a;
  --display: 'Bodoni Moda', Georgia, serif; --ui: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r: 6px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.6 var(--ui); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--ui); font-weight: 600; line-height: 1.25; margin: 0 0 .6em; letter-spacing: -.005em; }
h1 { font-size: 1.85rem; font-weight: 650; letter-spacing: -.01em; } h2 { font-size: 1.25rem; } h3 { font-size: 1.08rem; }
small, .muted { color: var(--muted); }
small { font-size: 14px; }
code { font-size: .92em; background: #efe9de; padding: 1px 5px; border-radius: 4px; }

.env-banner { background: #f6d365; color: #000; text-align: center; font: 600 14px/1.4 var(--ui); padding: 6px 12px; letter-spacing: .02em; }
.env-banner.prod { background: #1d1b18; color: #fff; }
.env-banner.closed { background: #a23b2a; color: #fff; }
.env-banner a { color: inherit; }
.role-card { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; }
.shop-state { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); display: inline-block; }
.dot.off { background: var(--err); }

/* top + shell */
.top { display: flex; align-items: center; gap: 16px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--card); position: sticky; top: 0; z-index: 5; }
.wordmark { font-family: var(--display); letter-spacing: .3em; text-transform: uppercase; font-size: 15px; text-decoration: none; white-space: nowrap; }
.search { margin-left: auto; flex: 0 1 320px; }
.search input { width: 100%; }
.menu-btn { display: none; margin-left: auto; min-height: 40px; padding: 6px 14px; border: 1px solid #cfc4b1; border-radius: var(--r); background: transparent; cursor: pointer; }
.shell { display: grid; grid-template-columns: 230px 1fr; min-height: calc(100vh - 56px); }
.side { border-right: 1px solid var(--line); padding: 16px 10px; display: flex; flex-direction: column; gap: 2px; }
.side > a { font-size: 16px; font-weight: 500; padding: 10px 14px; border-radius: var(--r); text-decoration: none; display: flex; align-items: center; justify-content: space-between; min-height: 40px; }
.side > a:hover { background: #efe9de; }
.side > a[aria-current] { background: var(--ink); color: #fff; }
.count { background: var(--accent); color: #fff; border-radius: 10px; font-size: 13px; font-weight: 600; padding: 0 8px; line-height: 21px; }
.side-foot { margin-top: auto; padding: 16px 12px 0; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.main { padding: 28px 32px 60px; min-width: 0; max-width: 1360px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .menu-btn { display: inline-flex; }
  .side { display: none; border-right: 0; border-bottom: 1px solid var(--line); }
  body.nav-open .side { display: flex; }
  .search { display: none; }
  .main { padding: 18px 14px 60px; }
}

/* page head */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.head h1 { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* cards & grid */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; margin-bottom: 16px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3, .split { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .g2, .g4 { grid-template-columns: 1fr; } }

.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.stat b { display: block; font: 600 1.75rem/1.2 var(--ui); margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat small { display: block; font-size: 14px; }
.stat.link { text-decoration: none; }
.stat.link:hover { border-color: var(--ink); }

/* tables */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 16px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); white-space: nowrap; background: #faf8f4; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #faf6ef; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td a.row-link { font-weight: 600; text-decoration: none; }
td a.row-link:hover { text-decoration: underline; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
table.plain td, table.plain th { padding: 6px 0; }

/* badges */
.badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 13px; font-weight: 600; background: #ece6da; white-space: nowrap; }
.status-new { background: #fde9b8; } .status-confirmed { background: #dbe8f6; color: var(--info); }
.status-dispatched { background: #e3dcf3; color: #54418a; } .status-delivered { background: #dcefe2; color: var(--ok); }
.status-cancelled, .status-returned { background: #f3dcd7; color: var(--err); }
.payment-paid { background: #dcefe2; color: var(--ok); } .payment-unpaid { background: #f6ead0; color: var(--warn); } .payment-refunded { background: #f3dcd7; color: var(--err); }
.tag { display: inline-block; font-size: 13px; padding: 1px 8px; border: 1px solid var(--line); border-radius: 10px; margin: 0 3px 3px 0; text-decoration: none; }

/* forms */
input, select, textarea, button { font: inherit; color: inherit; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #bfb39f; border-radius: var(--r); background: #fff; min-height: 44px; font-size: 16px;
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { min-height: 80px; resize: vertical; }
label { display: grid; gap: 6px; font-weight: 600; font-size: 15px; }
label small { font-weight: 400; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
label.check input { width: 18px; height: 18px; }
.stack { display: grid; gap: 14px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 16px; }
.filters label { gap: 6px; }
.filters > * { flex: 1 1 140px; max-width: 220px; }
.filters .grow { flex: 2 1 220px; max-width: 360px; }
.field-err { color: var(--err); font-size: 14px; font-weight: 500; }
.has-err input, .has-err select { border-color: var(--err); }

.btn, button.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 9px 18px; font-size: 15px; border-radius: var(--r);
  background: var(--ink); color: #fff; border: 1px solid var(--ink); text-decoration: none; cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn:hover { background: #3a362f; }
.btn.ghost { background: transparent; color: var(--ink); border-color: #cfc4b1; }
.btn.ghost:hover { background: #efe9de; }
.btn.danger { background: var(--err); border-color: var(--err); }
.btn.small { min-height: 36px; padding: 5px 12px; font-size: 14px; }
button.link { background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; text-align: left; }
.inline { display: inline; }

.flash { padding: 10px 14px; border-radius: var(--r); background: #dcefe2; color: var(--ok); margin: 0 0 16px; }
.flash.err { background: #f3dcd7; color: var(--err); }
.ok { color: var(--ok); } .warn { color: var(--warn); } .err { color: var(--err); }
.notice { padding: 10px 14px; border-radius: var(--r); background: #f6ead0; margin-bottom: 16px; }

dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline .kind-note { background: #fbf5e8; margin: 0 -8px; padding: 8px; border-radius: 4px; }
.timeline small { display: block; }

.pager { display: flex; gap: 16px; align-items: center; justify-content: center; margin: 10px 0 20px; }

/* bars (dashboard) */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding-top: 8px; }
.bars span { flex: 1; background: var(--accent); border-radius: 2px 2px 0 0; min-height: 2px; position: relative; }
.bars span:hover { background: var(--ink); }
.bars-axis { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 4px; }

/* public pages */
body.public { display: block; }
.narrow { max-width: 480px; margin: 48px auto; padding: 0 16px; }
.narrow .wordmark { display: block; text-align: center; margin-bottom: 24px; }
.narrow h1 { text-align: center; }

/* invoice / print */
@media print {
  .top, .side, .env-banner, .no-print { display: none !important; }
  body { background: #fff; }
  .shell { display: block; }
}
