@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/inter-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/inter-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/inter-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/inter-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/cormorant-garamond-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/cormorant-garamond-latin-700-normal.woff2) format("woff2"); }
:root {
  --bg: #f5f5f3;
  --card: #ffffff;
  --ink: #16181d;
  --ink-2: #3a3e46;
  --muted: #6b7079;
  --line: #e7e6e2;
  --line-2: #d9d7d1;
  --side: #14161a;
  --side-2: #1d2026;
  --side-ink: #c9ccd2;
  --gold: #a8823a;
  --gold-ink: #7d5f22;
  --gold-soft: #f6f0e3;
  --ok: #1b7a4b;
  --ok-soft: #e7f4ec;
  --warn: #9a5c00;
  --warn-soft: #fcf1de;
  --bad: #b42318;
  --bad-soft: #fdeceb;
  --info: #24589c;
  --info-soft: #e8f0fb;
  --radius: 10px;
  --side-w: 248px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 14.5px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
  font-feature-settings: "cv11", "ss01";
}
a { color: var(--gold-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; font-weight: 600; margin: 0; letter-spacing: -0.02em; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 14px; letter-spacing: -0.01em; }
h3 { font-size: 14px; font-weight: 600; margin: 0 0 8px; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Sidebar */
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: var(--side); color: var(--side-ink);
  display: flex; flex-direction: column; padding: 20px 14px 16px; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 22px; margin-bottom: 10px; border-bottom: 1px solid #ffffff12; color: #fff; }
.brand:hover { text-decoration: none; }
.brand img { width: 48px; height: 48px; object-fit: contain; flex: none; }
.brand b { display: block; font-family: "Cormorant Garamond", Georgia, serif; font-size: 19px; font-weight: 700; letter-spacing: .01em; line-height: 1.15; color: #f3e6c8; }
.brand small { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #8d929b; margin-top: 2px; }
.side nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; color: var(--side-ink); font-weight: 500; font-size: 14px; }
.side nav a .ic { color: #8d929b; }
.side nav a:hover { background: var(--side-2); color: #fff; text-decoration: none; }
.side nav a.on { background: #262a31; color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.side nav a.on .ic { color: #d9b56a; }
.who { margin-top: auto; display: flex; gap: 10px; align-items: center; padding: 14px 8px 0; border-top: 1px solid #ffffff12; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #2b2f37; color: #e8d3a1; display: grid; place-items: center; font-weight: 600; font-size: 13px; }
.who-n { color: #fff; font-size: 13px; font-weight: 500; }
.who-r { color: #8d929b; font-size: 12px; }
.mbar { display: none; }

/* Main */
.main { margin-left: var(--side-w); padding: 28px 36px 56px; max-width: calc(1240px + var(--side-w)); }
.main.bare { margin: 0 auto; max-width: 440px; padding: 7vh 20px 40px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.top .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.bottom, .scrim { display: none; }
.login-brand { text-align: center; margin-bottom: 18px; }
.login-brand img { width: 120px; height: 120px; object-fit: contain; }
.lb-name { font-family: "Cormorant Garamond", Georgia, serif; font-size: 28px; font-weight: 700; color: var(--ink); margin-top: 4px; }
.lb-sub { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.main.bare .top { justify-content: center; margin-bottom: 14px; }
.main.bare .top h1 { font-size: 17px; color: var(--ink-2); }

@media (max-width: 900px) {
  .side { transform: translateX(-100%); transition: transform .2s ease; visibility: hidden; }
  body.menu-open .side { transform: none; visibility: visible; box-shadow: 0 0 40px #0006; }
  body.menu-open .scrim { display: block; position: fixed; inset: 0; background: #0007; z-index: 25; }
  .mbar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 15; background: var(--side); color: #f3e6c8;
    padding: 8px 16px; padding-top: calc(8px + env(safe-area-inset-top));
    font-family: "Cormorant Garamond", Georgia, serif; font-size: 19px; font-weight: 700;
  }
  .mbar img { width: 34px; height: 34px; object-fit: contain; }
  .main { margin: 0; padding: 18px 16px calc(88px + env(safe-area-inset-bottom)); }
  .bottom {
    display: flex; position: fixed; inset: auto 0 0 0; background: var(--card); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 20; box-shadow: 0 -2px 10px rgba(0,0,0,.04);
  }
  .bottom a, .bottom button {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 500;
    color: var(--muted); background: none; border: 0; padding: 4px 0; font-family: inherit;
  }
  .bottom a.on { color: var(--ink); }
  .bottom a.on .ic { color: var(--gold); }
  .bottom a:hover { text-decoration: none; }
  h1 { font-size: 20px; }
}

/* Cards and grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card.narrow { max-width: 440px; margin: 0 auto; }
.grid { display: grid; gap: 14px; }
.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)); }
.grid > .card { margin-bottom: 0; }
.grid.g2.stack > div > .card:last-child { margin-bottom: 0; }
@media (max-width: 900px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .g2.stack { grid-template-columns: 1fr; } .grid.g2.stack > div > .card:last-child { margin-bottom: 16px; } }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: block; color: var(--ink); box-shadow: var(--shadow); }
a.stat:hover { border-color: var(--line-2); text-decoration: none; box-shadow: 0 4px 12px rgba(16,24,40,.08); }
.stat .n { font-size: 26px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat .l { color: var(--muted); font-size: 12.5px; font-weight: 500; margin-top: 2px; }
.stat.alert .n { color: var(--bad); }
.stat.warn .n { color: var(--warn); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .92em; letter-spacing: .01em; }
.sep { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
details summary { cursor: pointer; }

/* Forms */
label { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-2); margin-bottom: 12px; }
label > input, label > select, label > textarea { margin-top: 5px; }
input, select, textarea {
  width: 100%; font: inherit; font-size: 14.5px; color: var(--ink); background: #fff; border: 1px solid var(--line-2);
  border-radius: 8px; padding: 9px 12px; min-height: 42px; transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #9a9ea6; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(168, 130, 58, .18); }
textarea { min-height: 84px; }
input[type=checkbox] { width: 16px; height: 16px; min-height: 0; accent-color: var(--ink); }
.check { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; font-weight: 400; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.inline-form > * { flex: 1 1 160px; margin: 0; }
.inline-form > .btn { flex: 0 0 auto; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border-radius: 8px; border: 1px solid var(--line-2); background: #fff; color: var(--ink);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; box-shadow: 0 1px 2px rgba(16,24,40,.05);
  transition: background .15s, border-color .15s;
}
.btn:hover { background: #fafaf9; border-color: #c9c6be; text-decoration: none; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #2a2e36; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.ghost { background: transparent; box-shadow: none; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: #ecebe7; }
.btn.small { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn.wide { width: 100%; }
.btn.big { min-height: 52px; font-size: 15.5px; white-space: normal; text-align: center; line-height: 1.2; padding: 8px 16px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choice input { display: none; }
.choice label {
  margin: 0; border: 1px solid var(--line-2); border-radius: 8px; padding: 11px 6px; text-align: center; color: var(--ink-2);
  font-weight: 600; font-size: 14px; cursor: pointer; background: #fff;
}
.choice input:checked + label { border-color: var(--ink); background: var(--ink); color: #fff; }

/* Badges */
.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-ink); white-space: nowrap; line-height: 1.6; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.mute { background: #efeeea; color: var(--muted); }
.badge.ch-website { background: var(--info-soft); color: var(--info); }
.badge.ch-instagram { background: #fbe9f1; color: #a12a62; }
.badge.ch-whatsapp { background: var(--ok-soft); color: var(--ok); }
.badge.ch-other { background: #efeeea; color: var(--ink-2); }

/* Flash */
.flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 16px; background: var(--ok-soft); color: var(--ok); font-weight: 500; border: 1px solid #cde9d8; }
.flash.bad { background: var(--bad-soft); color: var(--bad); border-color: #f6cfcc; }
.flash.warn { background: var(--warn-soft); color: var(--warn); border-color: #f2dcb4; }
.flash.info { background: var(--info-soft); color: var(--info); border-color: #cddcf2; }

/* Tables and lists */
.table-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.list { display: flex; flex-direction: column; }
.item { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.item:last-child { border-bottom: 0; }
a.item:hover { text-decoration: none; background: #fafaf8; margin: 0 -18px; padding-left: 18px; padding-right: 18px; }
.item .main-col { flex: 1; min-width: 0; }
.item .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .sub { color: var(--muted); font-size: 12.5px; }
.thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: #f0eee9; border: 1px solid var(--line); flex: none; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 14px; color: var(--muted); font-size: 13px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 16px; padding: 4px; background: #ecebe7; border-radius: 10px; width: fit-content; max-width: 100%; }
.tabs a { padding: 6px 12px; border-radius: 7px; color: var(--ink-2); white-space: nowrap; font-size: 13px; font-weight: 500; }
.tabs a.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.tabs a:hover { text-decoration: none; color: var(--ink); }

/* Scanner */
.scanbox { display: flex; gap: 8px; }
.scanbox input { font-size: 16px; letter-spacing: .02em; }
.scanbox .btn { flex: none; min-height: 42px; }
@media (max-width: 560px) { .scanbox button[type=submit] { display: none; } }
.camera { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; margin-top: 10px; display: none; }
.camera.on { display: block; }
.camera [id^=reader] { width: 100%; }
.camera .close { position: absolute; top: 8px; right: 8px; z-index: 2; }
.result-ok { background: var(--ok-soft); border-color: #b9dfc8; }
.result-bad { background: var(--bad-soft); border-color: #f2c4c0; }
.cart-line { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.qty { display: flex; align-items: center; gap: 4px; }
.qty button { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); font-size: 17px; cursor: pointer; }
.qty span { min-width: 22px; text-align: center; font-weight: 700; }
.bar { height: 8px; background: #ecebe7; border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--gold); border-radius: 99px; }
.hbar { display: grid; grid-template-columns: 110px 1fr 100px; gap: 10px; align-items: center; margin: 9px 0; font-size: 13.5px; }
.hbar .bar { height: 10px; }
pre { font-size: 12.5px; }

/* Tag print sheet */
.sheet { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  width: var(--tag-w, 40mm); height: var(--tag-h, 30mm); border: 1px dashed var(--line-2); background: #fff; color: #000;
  display: flex; align-items: center; gap: 2mm; padding: 1.5mm 2mm; overflow: hidden;
}
.tag .qr { width: var(--tag-qr, 19mm); height: var(--tag-qr, 19mm); flex: none; }
.tag .qr svg { width: 100%; height: 100%; display: block; }
.tag .t { min-width: 0; font-family: Arial, Helvetica, sans-serif; line-height: 1.15; }
.tag .t b { display: block; font-size: 9pt; }
.tag .t span { display: block; font-size: 7pt; overflow: hidden; max-height: 2.4em; }
.tag .t i { display: block; font-style: normal; font-weight: 700; font-size: 9pt; margin-top: 1mm; }
@media print {
  body { background: #fff; }
  .side, .bottom, .top, .flash, .noprint, .mbar, .login-brand { display: none !important; }
  .main { margin: 0; padding: 0; max-width: none; }
  .sheet { gap: 0; display: block; }
  .tag { border: 0; page-break-after: always; break-after: page; }
}
