/* ==========================================================================
   L'essences — sistema de diseño
   Tema principal «Negro y dorado» (:root) y tema claro opcional ([data-theme="light"]).
   Los componentes usan solo variables: cambiar de tema no cambia la estructura.
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg: #0a0a0b;
  --bg-glow: rgba(201, 164, 92, 0.06);
  --surface: #141417;
  --surface-2: #1b1b1f;
  --surface-3: #242429;
  --elevated: #17171a;
  --ink: #f2f0ec;
  --ink-2: #c9c6bf;
  --muted: #8d8a84;
  --line: #25252a;
  --line-strong: #34343b;

  --side: #050505;
  --side-hover: #121214;
  --side-line: #1c1c1f;
  --side-ink: #d9d5cc;
  --side-muted: #6f6c66;

  --gold: #c9a45c;
  --gold-2: #e5c888;
  --gold-deep: #9b793b;
  --gold-soft: rgba(201, 164, 92, 0.12);
  --gold-line: rgba(201, 164, 92, 0.32);
  --on-gold: #15130f;

  --green: #52c48e;
  --green-soft: rgba(82, 196, 142, 0.12);
  --red: #ff6072;
  --red-strong: #d62f47;
  --red-soft: rgba(255, 96, 114, 0.12);
  --amber: #e9b44f;
  --amber-soft: rgba(233, 180, 79, 0.12);
  --slate: #b9c0cc;
  --slate-soft: rgba(185, 192, 204, 0.12);

  --radius: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 12px 32px rgba(0, 0, 0, 0.35);
  --shadow-gold: 0 8px 24px rgba(201, 164, 92, 0.22);
  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  --side-w: 264px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f3ef;
  --bg-glow: rgba(201, 164, 92, 0.08);
  --surface: #ffffff;
  --surface-2: #f7f6f2;
  --surface-3: #eeece6;
  --elevated: #ffffff;
  --ink: #17161a;
  --ink-2: #3d3b38;
  --muted: #77736b;
  --line: #e7e4dc;
  --line-strong: #d6d2c8;
  --side: #0c0c0d;
  --side-hover: #18181b;
  --side-line: #222226;
  --green: #1f8a57;
  --green-soft: #e3f4ea;
  --red: #c8283e;
  --red-soft: #fbe7ea;
  --amber: #a86b0d;
  --amber-soft: #fbf0d9;
  --slate: #4a5568;
  --slate-soft: #eceff4;
  --gold-soft: #f5ecda;
  --gold: #b48d42;
  --gold-2: #d4b06a;
  --gold-deep: #8a6a2f;
  --gold-line: rgba(180, 141, 66, 0.4);
  --shadow: 0 1px 2px rgba(20, 18, 12, 0.05), 0 6px 20px rgba(20, 18, 12, 0.06);
}

/* ─── Base ───────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--ink);
  background: radial-gradient(1100px 520px at 75% -12%, var(--bg-glow), transparent 60%), var(--bg);
  background-attachment: fixed; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
svg { flex: none; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::selection { background: var(--gold-soft); }

/* ─── Estructura ─────────────────────────────────────────────────────────── */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--side); color: var(--side-ink); border-right: 1px solid var(--side-line);
}
.brand { display: block; padding: 16px 30px 14px; border-bottom: 1px solid var(--side-line); }
.brand img { display: block; width: 100%; max-width: 138px; height: auto; margin: 0 auto; }

.nav { flex: 1; overflow-y: auto; padding: 8px 14px 14px; scrollbar-width: thin; scrollbar-color: var(--side-line) transparent; display: grid; align-content: start; gap: 2px; }
.nav-section {
  margin: 14px 12px 4px; font-size: 10px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--side-muted);
}
.nav-group { display: grid; gap: 2px; }
.nav-group-head {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); cursor: pointer; list-style: none;
  font-size: 13.5px; font-weight: 600; color: var(--side-ink); user-select: none; transition: background 0.15s, color 0.15s;
}
.nav-group-head::-webkit-details-marker { display: none; }
.nav-group-head svg { width: 18px; height: 18px; color: var(--side-muted); flex: none; }
.nav-group-head span { flex: 1; }
.nav-group-head svg:last-child { width: 16px; height: 16px; transition: transform 0.2s; }
.nav-group[open] > .nav-group-head svg:last-child { transform: rotate(180deg); }
.nav-group[open] > .nav-group-head, .nav-group-head:hover { color: #fff; background: var(--side-hover); }
.nav-group[open] > .nav-group-head svg:first-child { color: var(--gold); }
.nav-group-items { display: grid; gap: 2px; margin: 2px 0 6px 14px; padding-left: 10px; border-left: 1px solid var(--side-line); }
.nav-group-items .nav-link { padding: 8px 10px; font-size: 13px; }
.nav-group-items .nav-link.active::before { left: -12px; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 500; color: var(--side-ink); transition: background 0.15s, color 0.15s;
}
.nav-link svg { width: 18px; height: 18px; color: var(--side-muted); transition: color 0.15s; }
.nav-link:hover { background: var(--side-hover); color: #fff; }
.nav-link:hover svg { color: var(--gold-2); }
.nav-link.active { background: linear-gradient(90deg, rgba(201, 164, 92, 0.18), rgba(201, 164, 92, 0.04)); color: var(--gold-2); font-weight: 600; }
.nav-link.active svg { color: var(--gold); }
.nav-link.active::before {
  content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold);
}

.sidebar-foot { display: flex; align-items: center; gap: 8px; margin: 0 14px; padding: 10px 0 6px; border-top: 1px solid var(--side-line); }
.me { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); }
.me:hover, .me.active { background: var(--side-hover); }
.me-text { min-width: 0; display: grid; }
.me-text b { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { font-size: 11px; color: var(--side-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-version { padding: 0 24px 12px; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--side-muted); }
.sidebar .icon-btn { color: var(--side-muted); border-color: var(--side-line); }
.sidebar .icon-btn:hover { color: var(--gold-2); border-color: var(--gold-line); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px; min-height: 76px; padding: 14px 32px;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.page-title { min-width: 0; }
.topbar h1 {
  font-family: var(--serif); font-weight: 600; font-size: 30px; line-height: 1.1; letter-spacing: 0.01em; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar .subtitle { font-size: 12px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar-search { width: 300px; }
.topbar-search input {
  height: 40px; padding: 0 14px 0 38px; border-radius: 999px; font-size: 13px;
  background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238d8a84' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 13px center / 16px;
}
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--line-strong); background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--ink-2);
}
.chip svg { width: 16px; height: 16px; color: var(--gold); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.cash-pill.is-open { color: var(--green); border-color: color-mix(in srgb, var(--green) 40%, transparent); background: var(--green-soft); }
.cash-pill.is-closed { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); background: var(--red-soft); }
.branch-switch label {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 6px 0 12px; border-radius: 999px;
  border: 1px solid var(--gold-line); background: var(--gold-soft);
}
.branch-switch svg { width: 16px; height: 16px; color: var(--gold); }
.branch-switch select {
  width: auto; height: 34px; padding: 0 28px 0 4px; border: 0; background-color: transparent; color: var(--gold-2);
  font-weight: 700; font-size: 12.5px; letter-spacing: 0.02em; cursor: pointer;
}
html[data-theme="light"] .branch-switch select { color: var(--gold-deep); }
.branch-switch select:focus { outline: none; }
.branch-switch option { color: var(--ink); background: var(--surface); }

.icon-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid var(--line-strong); background: transparent; color: var(--ink-2); transition: color 0.15s, border-color 0.15s;
}
.icon-btn:hover { color: var(--gold); border-color: var(--gold-line); }
.icon-btn svg { width: 18px; height: 18px; }
.menu-toggle { display: none; }
.theme-toggle .sun { display: block; }
.theme-toggle .moon { display: none; }
html[data-theme="light"] .theme-toggle .sun { display: none; }
html[data-theme="light"] .theme-toggle .moon { display: block; }

.content { width: 100%; max-width: 1480px; padding: 28px 32px 64px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }

/* ─── Tarjetas y títulos ─────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { font-size: 15px; font-weight: 600; letter-spacing: 0; color: var(--ink); }
.eyebrow { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; color: var(--gold); }
.strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; font-size: 12px; }
.section-title { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.section-title h3 { font-family: var(--serif); font-size: 24px; font-weight: 600; }
.section-title .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); align-self: center; }
.section-title .muted { font-size: 12px; }

.hero {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 30px 32px; border-radius: var(--radius);
  background: linear-gradient(120deg, var(--surface) 0%, var(--surface) 45%, color-mix(in srgb, var(--gold) 14%, var(--surface)) 100%);
  border: 1px solid var(--gold-line); box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -80px; top: -120px; width: 340px; height: 340px; border-radius: 50%;
  border: 1px solid var(--gold-line); box-shadow: 0 0 0 30px var(--gold-soft); opacity: 0.5; pointer-events: none;
}
.hero-title { font-family: var(--serif); font-size: 42px; font-weight: 600; line-height: 1.05; margin: 8px 0 6px; }
.hero p { font-size: 13px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.hello { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.hello h2 { font-family: var(--serif); font-size: 30px; font-weight: 600; margin: 4px 0; }

.banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px; border-radius: var(--radius);
  background: linear-gradient(120deg, var(--surface), color-mix(in srgb, var(--gold) 16%, var(--surface)));
  border: 1px solid var(--gold-line); color: var(--ink);
}
.banner h2 { font-family: var(--serif); font-size: 26px; font-weight: 600; margin: 4px 0; display: flex; align-items: center; gap: 10px; }
.banner h2 svg { width: 22px; height: 22px; color: var(--gold); }
.banner p { font-size: 12px; color: var(--ink-2); }

/* ─── Etiquetas ──────────────────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 4px 10px; white-space: nowrap;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  background: var(--green-soft); color: var(--green);
}
.pill.gold { background: var(--gold-soft); color: var(--gold-2); }
html[data-theme="light"] .pill.gold { color: var(--gold-deep); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.gray { background: var(--surface-3); color: var(--ink-2); }
.pill.navy { background: var(--slate-soft); color: var(--slate); }
.pill-active { display: inline-block; font-size: 10px; font-weight: 700; color: var(--gold); }

/* ─── Botones ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border: 1px solid transparent; border-radius: var(--radius-sm); font-family: inherit; font-weight: 600; font-size: 13px;
  letter-spacing: 0.01em; cursor: pointer; white-space: nowrap; background: var(--surface-3); color: var(--ink);
  transition: filter 0.15s, transform 0.05s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }
.btn-primary, .btn-gold, .btn-green {
  background: linear-gradient(135deg, var(--gold-2), var(--gold) 55%, var(--gold-deep)); color: var(--on-gold); box-shadow: var(--shadow-gold);
}
.btn-red { background: linear-gradient(135deg, #e5455b, var(--red-strong)); color: #fff; box-shadow: 0 8px 22px rgba(214, 47, 71, 0.25); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--gold-line); color: var(--gold); filter: none; }
.btn.danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.btn.danger:hover { background: var(--red-soft); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; border-radius: 8px; }
.btn-lg { height: 46px; padding: 0 20px; font-size: 14px; }
.btn-block { width: 100%; }

/* ─── Formularios ────────────────────────────────────────────────────────── */
.field { display: grid; gap: 7px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
input, select, textarea {
  width: 100%; font-family: inherit; font-size: 14px; color: var(--ink); background-color: var(--surface-2);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 10px 12px; min-height: 42px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; accent-color: var(--gold); }
input[type="file"] { padding: 8px; }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.field .hint { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted); font-size: 11.5px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; color: var(--ink-2); text-transform: none; letter-spacing: 0; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 46px; }
.pw-toggle {
  position: absolute; top: 50%; right: 5px; transform: translateY(-50%); width: 34px; height: 34px; display: grid; place-items: center;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer;
}
.pw-toggle:hover, .pw-toggle[aria-pressed="true"] { color: var(--gold); background: var(--gold-soft); }
.pw-toggle svg { width: 19px; height: 19px; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; align-items: start; }
.form-grid > .field, .grid > .field { align-content: start; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-all { grid-column: 1 / -1; }
.photo-row { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.photo-row .field { flex: 1 1 220px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

.filters { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; padding: 18px 20px; }
.filters > label { flex: 1 1 180px; }
.filters > div, .filters > button { flex: 0 0 auto; }
.filters .btn { height: 42px; }
.filters [style*="height:44px"] { height: 42px !important; }

/* ─── Pestañas ───────────────────────────────────────────────────────────── */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
@media (max-width: 560px) { .column small, .column .val { font-size: 8.5px; } .columns { gap: 3px !important; } .column:nth-child(even) small { visibility: hidden; } }
@media (max-width: 900px) { .tabs { flex-wrap: nowrap; overflow-x: auto; min-width: 0; max-width: 100%; } }
.tab {
  flex: none; padding: 9px 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.tab:hover { color: var(--ink); background: var(--surface-2); }
.tab.active { color: #1a1408; background: linear-gradient(135deg, var(--gold-2), var(--gold)); box-shadow: 0 4px 14px rgba(201, 164, 92, 0.25); }

input[type="file"] { padding: 7px; cursor: pointer; }
input[type="file"]::file-selector-button {
  margin-right: 12px; padding: 7px 14px; border: 1px solid var(--gold-line); border-radius: 8px; cursor: pointer;
  background: var(--gold-soft); color: var(--gold-2); font: 600 12.5px var(--font);
}
input[type="file"]::file-selector-button:hover { border-color: var(--gold); }

/* ─── Indicadores ────────────────────────────────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.kpi { position: relative; padding: 18px 18px 16px; overflow: hidden; display: block; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--gold), transparent); opacity: 0.7; }
.kpi .eyebrow { color: var(--muted); letter-spacing: 0.12em; }
.kpi .value { font-size: clamp(19px, 1.7vw, 26px); white-space: nowrap; font-weight: 700; margin: 10px 0 4px; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.kpi .foot { font-size: 11.5px; color: var(--muted); }
.kpi.good .value { color: var(--green); }
.kpi.warn .value { color: var(--amber); }
.kpi.bad .value { color: var(--red); }
a.kpi:hover { border-color: var(--gold-line); }

.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.live { display: block; }
.live-title { display: flex; align-items: center; gap: 12px; padding: 18px 20px 6px; }
.live-title .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); }
.live-body { padding: 14px 20px 20px; }

.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 96px 1fr 88px; gap: 12px; align-items: center; font-size: 12.5px; }
.bar-track { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--gold-deep), var(--gold-2)); border-radius: 999px; }
.columns { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 12px; }
.column { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.column .stick { width: 100%; max-width: 40px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #6a6a72, #3a3a41); min-height: 3px; }
html[data-theme="light"] .column .stick { background: linear-gradient(180deg, #4a4a52, #2a2a30); }
.column .stick.profit { background: linear-gradient(180deg, var(--gold-2), var(--gold-deep)); }
.column small, .column .val { white-space: nowrap; }
.column small { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.column .val { font-size: 10.5px; font-weight: 700; color: var(--ink-2); }

.list { display: grid; }
.list-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.list-item:last-child { border-bottom: 0; }
.list-item .title { font-weight: 600; color: var(--ink); }
.list-item .sub { font-size: 11.5px; color: var(--muted); }
a.list-item:hover .title { color: var(--gold); }
.empty { padding: 28px 12px; text-align: center; color: var(--muted); font-size: 13px; }

/* ─── Tablas ─────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; white-space: nowrap;
  color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.table td.cell-main { min-width: 220px; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--ink-2); }
.table td b, .table a b { color: var(--ink); font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background 0.12s; }
.table tbody tr:hover { background: color-mix(in srgb, var(--gold) 5%, transparent); }
.table a:hover b { color: var(--gold); }
.table .right, .table th.right { text-align: right; }
.table td.num, .table td.right { white-space: nowrap; }
.table tfoot td { font-weight: 700; background: var(--surface-2); color: var(--ink); }
.voided td { color: var(--muted); text-decoration: line-through; }
.voided td:last-child, .voided td .pill { text-decoration: none; }
tr.group-row td {
  background: linear-gradient(90deg, var(--gold-soft), transparent 70%); color: var(--gold); font-weight: 700; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.14em; padding: 9px 16px;
}
.pagination { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 14px 18px; font-size: 12.5px; border-top: 1px solid var(--line); }

/* ─── Mensajes ───────────────────────────────────────────────────────────── */
.flashes { display: grid; gap: 8px; }
.flash { padding: 13px 16px 13px 18px; border-radius: var(--radius-sm); font-weight: 500; font-size: 13.5px; border: 1px solid; border-left-width: 4px; }
.flash.ok { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 45%, transparent); color: var(--ink); }
.flash.warn { background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 45%, transparent); color: var(--ink); }
.flash.error { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 45%, transparent); color: var(--ink); }
.flash a { text-decoration: underline; }

/* ─── Productos ──────────────────────────────────────────────────────────── */
.product-hero { display: grid; grid-template-columns: 220px 1fr; gap: 24px; }
.product-hero h2 { font-family: var(--serif); font-weight: 600; font-size: 32px !important; letter-spacing: 0; }
.product-img {
  aspect-ratio: 1; border-radius: var(--radius-md); overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(160deg, color-mix(in srgb, var(--gold) 14%, var(--surface-2)), var(--surface-2));
  color: var(--gold); font-family: var(--serif); font-size: 52px; border: 1px solid var(--line);
}
.product-img img { width: 100%; height: 100%; object-fit: contain; background: var(--surface-2); }
.specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.spec { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.spec .eyebrow { margin-bottom: 6px; color: var(--muted); }
.spec b { font-size: 16px; color: var(--ink); }
.ref { display: inline-block; margin-top: 10px; padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 600; background: var(--gold-soft); color: var(--gold); }
.branch-stock { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; padding: 16px 22px 20px; }
.branch-stock .spec.current { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; text-transform: none; letter-spacing: 0; }
.choice-row label { cursor: pointer; }
.choice-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice-row span {
  display: inline-block; min-width: 68px; padding: 10px 14px; text-align: center; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink); font-size: 13px; font-weight: 600;
}
.choice-row input:checked + span { border-color: var(--gold); background: var(--gold-soft); color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.choice-row input:focus-visible + span { box-shadow: 0 0 0 3px var(--gold-soft); }
.choice-row input:disabled + span { opacity: 0.35; cursor: not-allowed; text-decoration: line-through; }
.presentation-tag, .cart-line .presentation { font-size: 11.5px; color: var(--gold); font-weight: 600; }
.img-preview { display: flex; flex-wrap: wrap; gap: 8px; }
.img-preview img { width: 84px; height: 84px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.gallery-item { margin: 0; border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; background: var(--surface-2); }
.gallery-item.main { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.gallery-item img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--surface-2); }
.gallery-item figcaption { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 10px; }
.gallery-item figcaption form { display: inline; }
.thumb { display: block; width: 46px; height: 46px; border-radius: var(--radius-sm); object-fit: cover; border: 1px solid var(--line); background: var(--surface-2); }
.thumb.empty { display: grid; place-items: center; font-family: var(--serif); font-size: 20px; color: var(--gold); background: var(--gold-soft); border-color: var(--gold-line); }
.thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.thumbs img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; }
.thumbs img.active { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; white-space: nowrap; }
.table td.cell-email { overflow-wrap: anywhere; min-width: 150px; }
.table-compact th, .table-compact td { padding-left: 10px; padding-right: 10px; }
.row-actions form { display: inline; }
.role-help { display: grid; gap: 10px; font-size: 12.5px; color: var(--ink-2); border-top: 1px solid var(--line); }
.role-help .pill { min-width: 104px; justify-content: center; margin-right: 8px; }

/* ─── Punto de venta ─────────────────────────────────────────────────────── */
.pos { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(360px, 1fr); gap: 18px; align-items: start; }
.pos-search { position: relative; }
.pos-search input { height: 52px; font-size: 16px; padding: 0 16px; }
.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-top: 14px; }
.result {
  display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; align-items: center; text-align: left; padding: 10px;
  border-radius: var(--radius-md); cursor: pointer; font-family: inherit; color: var(--ink);
  border: 1px solid var(--line); background: var(--surface-2); transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.result:hover { border-color: var(--gold); box-shadow: var(--shadow-gold); transform: translateY(-1px); }
.result:disabled { cursor: not-allowed; transform: none; box-shadow: none; border-color: var(--line); }
.result:disabled .result-img, .result:disabled .name, .result:disabled .price { opacity: 0.55; }
.result .result-img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.result .result-img.empty { display: grid; place-items: center; font-family: var(--serif); font-size: 26px; color: var(--gold); background: var(--gold-soft); border-color: var(--gold-line); }
.result-body { display: grid; gap: 3px; min-width: 0; }
.result .name { font-weight: 700; font-size: 12.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.result .meta { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 3px; min-width: 0; }
.result .price { font-weight: 700; font-size: 13.5px; color: var(--gold); white-space: nowrap; }
.cart { position: sticky; top: 96px; }
.cart-lines { max-height: 42vh; overflow-y: auto; }
.cart-line { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.cart-line .name { font-weight: 600; font-size: 13px; }
.cart-line .controls { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.cart-line input { width: 64px; min-height: 32px; padding: 5px 8px; font-size: 13px; }
.cart-line .disc { width: 88px; }
.qty-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink); cursor: pointer; font-weight: 700; }
.qty-btn:hover { border-color: var(--gold); color: var(--gold); }
.totals { padding: 16px 20px; display: grid; gap: 8px; font-size: 13.5px; }
.totals .row { display: flex; justify-content: space-between; align-items: center; }
.totals .grand { font-family: var(--serif); font-size: 30px; font-weight: 600; color: var(--gold); border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.methods label { cursor: pointer; }
.methods input { display: none; }
.methods span {
  display: block; text-align: center; padding: 11px 4px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  font-weight: 600; font-size: 12px; color: var(--ink-2); text-transform: none; letter-spacing: 0;
}
.methods input:checked + span { background: var(--gold-soft); color: var(--gold); border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.dropdown { position: absolute; left: 0; right: 0; top: 100%; z-index: 10; margin-top: 4px; background: var(--elevated); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow); max-height: 260px; overflow-y: auto; }
.dropdown button { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; background: none; font-family: inherit; font-size: 13px; color: var(--ink); cursor: pointer; }
.dropdown button:hover { background: var(--surface-3); }

/* ─── Punto de venta: flujo guiado ───────────────────────────────────────── */
kbd {
  display: inline-grid; place-items: center; min-width: 26px; height: 20px; padding: 0 5px; border-radius: 5px; flex: none;
  font: 700 10px var(--font); color: var(--muted); background: var(--surface-3); border: 1px solid var(--line-strong);
}
.link-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; cursor: pointer;
  font: 600 12.5px var(--font); color: var(--gold); justify-self: start;
}
.link-btn svg { width: 15px; height: 15px; }
.link-btn:hover { color: var(--gold-2); text-decoration: underline; }
.link-btn.small { font-size: 11.5px; }
.small { font-size: 11.5px; }
.pos-closed { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: 16px 20px; border-color: var(--gold-line); background: linear-gradient(90deg, var(--gold-soft), var(--surface)); }
.pos-closed-text { display: flex; align-items: center; gap: 14px; }
.pos-closed-text svg { width: 26px; height: 26px; color: var(--gold); flex: none; }
.pos-closed-text div { display: grid; gap: 2px; }
.pos-closed-form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.pos-closed-form .field { min-width: 200px; }
.pos-products { padding: 20px; display: grid; gap: 14px; align-content: start; }
.pos-step { display: flex; align-items: center; gap: 12px; }
.pos-step > div { display: grid; gap: 1px; }
.pos-step b { font-size: 14.5px; color: var(--ink); }
.pos-step small { font-size: 12px; color: var(--muted); }
.step-n {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-weight: 800; font-size: 13px; color: #1a1408; background: linear-gradient(135deg, var(--gold-2), var(--gold));
}
.pos-search { position: relative; display: flex; align-items: center; }
.pos-search svg { position: absolute; left: 16px; width: 20px; height: 20px; color: var(--gold); pointer-events: none; }
.pos-search input { height: 54px; font-size: 16px; padding: 0 56px 0 48px; border-color: var(--gold-line); }
.pos-search kbd { position: absolute; right: 14px; }
.results { margin-top: 0; }
.pill.green { background: var(--green-soft); color: var(--green); }
.cart .card-head { padding: 14px 18px; }
.cart-lines { max-height: 38vh; }
.cart-line { grid-template-columns: minmax(0, 1fr) auto; padding: 12px 18px; transition: background 0.4s; }
.cart-line.added { background: var(--gold-soft); }
.cart-main { min-width: 0; }
.cart-line .name { line-height: 1.3; }
.cart-line .controls { flex-wrap: wrap; }
.cart-line input[data-act=qty] { width: 54px; text-align: center; }
.cart-side { display: grid; justify-items: end; align-content: space-between; gap: 8px; }
.cart-side b { font-size: 14px; color: var(--ink); white-space: nowrap; }
.line-del { width: 28px; height: 28px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; font-size: 13px; }
.line-del:hover { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); background: var(--red-soft); }
.line-disc { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.line-disc input { width: 80px !important; }
.cart-empty { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 30px 20px; color: var(--muted); font-size: 12.5px; }
.cart-empty b { color: var(--ink-2); font-size: 13.5px; }
.cart .totals { padding: 14px 18px; border-top: 1px solid var(--line); }
.cart .totals .grand { margin-top: 0; }
.discount-box { display: grid; grid-template-columns: 1fr 120px; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.discount-box input { text-align: right; padding: 7px 10px; min-height: 36px; }
.pay { display: grid; gap: 14px; padding: 16px 18px 18px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.methods span { padding: 12px 4px; font-size: 12.5px; background: var(--surface); }
.cash-box { display: grid; gap: 10px; }
.quick-cash { display: flex; flex-wrap: wrap; gap: 6px; }
.quick-cash button {
  flex: 1 1 60px; padding: 8px 6px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer;
  font: 700 12px var(--font); color: var(--ink-2);
}
.quick-cash button:hover { border-color: var(--gold); color: var(--gold); }
.change-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.change-row b { font-size: 20px; color: var(--ink); }
.change-row.positive { border-color: color-mix(in srgb, var(--green) 45%, transparent); }
.change-row.positive b { color: var(--green); }
.change-row.short b { color: var(--red); font-size: 15px; }
.customer-box { display: grid; gap: 8px; padding-top: 12px; border-top: 1px dashed var(--line-strong); }
.customer-chosen { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; }
.customer-chosen span { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.customer-chosen svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.customer-chosen b { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.customer-pick, .customer-new { display: grid; gap: 8px; }
.customer-new { padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); }
.pay-btn { justify-content: space-between; height: 54px; font-size: 16px; }
.pay-btn kbd { background: rgba(0, 0, 0, 0.15); border-color: rgba(0, 0, 0, 0.2); color: inherit; }
.pay-btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.choice-row.big span { min-width: 76px; padding: 13px 16px; font-size: 14px; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper input { text-align: center; }
.stepper .qty-btn { width: 42px; height: 42px; flex: none; }
.done-box { width: min(440px, 100%); padding: 32px 26px 24px; text-align: center; display: grid; gap: 8px; justify-items: center; }
.done-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--green-soft); color: var(--green); margin-bottom: 6px; }
.done-icon svg { width: 34px; height: 34px; stroke-width: 2.4; }
.done-box .eyebrow { color: var(--green); }
.done-box h2 { font-family: var(--serif); font-size: 30px; font-weight: 600; }
.done-total { font-size: 26px; font-weight: 800; color: var(--gold); }
.done-change { font-size: 17px; font-weight: 700; padding: 8px 16px; border-radius: 999px; background: var(--green-soft); color: var(--green); }
.done-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 14px 0 6px; }
.done-actions svg { width: 16px; height: 16px; }

.mobile-cartbar { display: none; }
@media (max-width: 1060px) {
  kbd { display: none; }
  .mobile-cartbar {
    position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 14px 18px; border: 0; border-radius: 14px; cursor: pointer; font: 600 13px var(--font); color: #1a1408;
    background: linear-gradient(135deg, var(--gold-2), var(--gold)); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  }
  .mobile-cartbar.hidden { display: none; }
  .mobile-cartbar b { font-size: 16px; }
  .pos { padding-bottom: 70px; }
}

/* ─── Listado de ventas ─────────────────────────────────────────────────── */
.sales-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sales-top .tabs { flex: 1 1 320px; min-width: 0; }
.sales-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 14px; align-items: center; }
.sales-search .pos-search input { height: 46px; font-size: 14px; padding-right: 16px; }
.sales-search > .btn { height: 46px; }
.more-filters { grid-column: 1 / -1; }
.more-filters summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--gold); padding: 2px 4px; width: max-content; }
.more-filters .filters { padding: 14px 4px 4px; }
.method-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.5px; }
.method-chips .chip { display: inline-flex; gap: 8px; align-items: center; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font-size: 12.5px; }
.method-chips .chip b { color: var(--ink); }
.method-chips .chip:hover, .method-chips .chip.active { border-color: var(--gold); color: var(--gold); }
.sales-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .sales-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.sale-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; padding: 20px 22px; }
.sale-head-main { display: grid; gap: 6px; }
.sale-total { font-size: 34px; font-weight: 800; color: var(--gold); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.sale-total.is-void { color: var(--muted); text-decoration: line-through; }
.sale-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ink-2); }
.sale-meta span { display: inline-flex; align-items: center; gap: 6px; }
.sale-meta svg { width: 15px; height: 15px; color: var(--muted); }
.sale-actions { display: flex; flex-wrap: wrap; gap: 8px; }
tr.row-link { cursor: pointer; }
tr.row-link:hover td { background: var(--surface-2); }
.sale-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 900px) { .sale-grid { grid-template-columns: minmax(0, 1fr); } }

/* ─── Vista previa del dueño ────────────────────────────────────────────── */
.preview-bar, .preview-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px 18px; flex-wrap: wrap; padding: 14px 18px;
  border: 1px solid var(--gold-line); border-radius: var(--radius); background: linear-gradient(90deg, var(--gold-soft), var(--surface));
}
.preview-bar > div:first-child { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.preview-bar svg { width: 20px; height: 20px; color: var(--gold); flex: none; }
.preview-card > div:first-child { display: grid; gap: 3px; }
.preview-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.preview-actions form { display: inline; }

.grid-input { width: 76px; min-height: 36px; padding: 6px 8px; text-align: right; font-variant-numeric: tabular-nums; }
.grid-input.changed { border-color: var(--gold); background: var(--gold-soft); color: var(--gold-2); font-weight: 700; }
#bottle-grid-form .card-head { flex-wrap: wrap; }
#bottle-grid-form .row-actions { flex-wrap: wrap; }
.bottle-grid th:first-child, .bottle-grid td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.bottle-grid thead th:first-child, .bottle-grid tfoot td:first-child { background: var(--surface-2); }
.grid-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); }

.branch-picker { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px; font-size: 13px; color: var(--ink-2); }
.branch-picker > span { font-weight: 600; }
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.seg form { display: inline; }
.seg button { border: 0; background: none; cursor: pointer; padding: 7px 18px; border-radius: 999px; font: 700 13px var(--font); color: var(--muted); }
.seg button:hover { color: var(--ink); }
.seg button.active { color: #1a1408; background: linear-gradient(135deg, var(--gold-2), var(--gold)); }

.maint-card { display: grid; gap: 12px; max-width: 640px; }
.maint-state { display: inline-flex; align-items: center; gap: 10px; font-size: 16px; }
.maint-state .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.maint-state.on .dot { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.maint-card form { margin-top: 6px; }
.maint-banner { padding: 10px 16px; border-radius: var(--radius-sm); background: var(--red-soft); color: var(--red); font-weight: 700; font-size: 13px; }

/* ─── ¿Cómo van las tiendas? ────────────────────────────────────────────── */
.stores { padding: 20px 22px 22px; border: 1px solid var(--gold-line); }
.stores-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.stores-head .eyebrow { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.stores-head h3 { font-family: var(--serif); font-size: 26px; font-weight: 600; margin-top: 4px; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px transparent; } }
.stores-total { display: grid; justify-items: end; }
.stores-total span { font-size: 10.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.stores-total b { font-size: 28px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.stores-total small { color: var(--muted); font-size: 12px; }
.stores-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.store { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--radius-md); border: 1px solid var(--line); background: var(--surface-2); }
.store header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.store header b { font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; }
.store-total { font-size: 28px; font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; }
html[data-theme="light"] .store-total, html[data-theme="light"] .store-sellers small, html[data-theme="light"] .store footer a { color: var(--gold-deep); }
.store-split { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.store-split div { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: center; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); }
.store-split svg { width: 16px; height: 16px; color: var(--gold); grid-row: span 2; }
.store-split span { font-size: 11px; color: var(--muted); }
.store-split b { font-size: 14px; font-variant-numeric: tabular-nums; }
.store-sellers { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.store-sellers li { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 9px 12px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); }
.store-sellers li > div { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; align-items: center; }
.store-sellers svg { width: 15px; height: 15px; color: var(--muted); grid-row: span 2; }
.store-sellers b { font-size: 13px; }
.store-sellers small { font-size: 11.5px; color: var(--gold); font-weight: 600; }
.store-empty { color: var(--muted); font-size: 12.5px; padding: 6px 0; }
.store footer { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.store footer a { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold); }
.store footer a:hover { text-decoration: underline; }

/* ─── Ventanas ───────────────────────────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, 0.65); backdrop-filter: blur(4px); }
.modal-box { width: min(580px, 100%); max-height: 92vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--gold-line); border-radius: var(--radius); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
.modal-box .card-head { position: sticky; top: 0; z-index: 1; background: var(--surface); }
.modal-box .card-head h3 { font-family: var(--serif); font-size: 22px; font-weight: 600; }

/* ─── Avatares ───────────────────────────────────────────────────────────── */
.avatar {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 10px; display: grid; place-items: center; flex: none;
  font-weight: 700; font-size: 22px; color: var(--gold-2); background: linear-gradient(135deg, #1e1e22, #2c2c32);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--gold);
}
img.avatar { display: block; object-fit: cover; padding: 0; }
.avatar.lg { width: 104px; height: 104px; font-size: 34px; margin: 0; }
.avatar.sm { width: 38px; height: 38px; font-size: 13px; margin: 0; }
.sidebar .avatar { box-shadow: 0 0 0 2px var(--side), 0 0 0 3px var(--gold); }

/* ─── Inicio de sesión ───────────────────────────────────────────────────── */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: #000; }
.login-art { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 56px; color: #d9cfbb; background: #000; }
.login-art::after {
  content: ""; position: absolute; width: 560px; height: 560px; right: -180px; bottom: -180px; border-radius: 50%;
  border: 1px solid rgba(201, 164, 92, 0.35); box-shadow: 0 0 0 44px rgba(201, 164, 92, 0.05), 0 0 0 100px rgba(201, 164, 92, 0.03);
}
.login-logo-img { position: relative; z-index: 1; display: block; width: min(440px, 100%); height: auto; }
.login-tag { margin-top: 16px; font-size: 12px; letter-spacing: 0.32em; text-transform: uppercase; color: var(--gold); }
.login-panel { display: grid; place-items: center; padding: 32px 20px; background: radial-gradient(700px 420px at 50% 0%, var(--bg-glow), transparent 70%), var(--bg); }
.login-card { width: min(410px, 100%); padding: 36px 32px; border-color: var(--gold-line); }
.login-card h1 { font-family: var(--serif); font-size: 34px; font-weight: 600; margin-bottom: 4px; }

/* ─── Comprobante (siempre claro para imprimir) ──────────────────────────── */
.receipt { width: 320px; margin: 20px auto; padding: 22px 18px; font-size: 12px; background: #fff; color: #111; border: 1px solid #e5e5e5; }
.receipt h1 { font-family: var(--serif); font-size: 30px; text-align: center; font-weight: 600; color: #111; }
.receipt h1 span { color: #9b793b; }
.receipt .muted { color: #666; }
.receipt .center { text-align: center; }
.receipt hr { border: 0; border-top: 1px dashed #999; margin: 10px 0; }
.receipt table { width: 100%; font-size: 12px; border-collapse: collapse; }
.receipt td { padding: 2px 0; vertical-align: top; }

/* ─── Adaptable ──────────────────────────────────────────────────────────── */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pos { grid-template-columns: minmax(0, 1fr); }
  .cart { position: static; }
  .topbar-search { width: 220px; }
}
@media (max-width: 1060px) {
  .topbar-search { display: none; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 60; width: 280px; transform: translateX(-100%); transition: transform 0.2s; }
  body.menu-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.55); }
  .menu-toggle { display: inline-grid; }
  .topbar { flex-wrap: wrap; gap: 10px 12px; padding: 12px 16px; min-height: 0; }
  .topbar h1 { font-size: 22px; }
  .topbar .subtitle { display: none; }
  .page-title { flex: 1; }
  .topbar-tools { margin-left: 0; width: 100%; flex-wrap: wrap; }
  .content { padding: 16px 16px 48px; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .hero { flex-direction: column; align-items: flex-start; padding: 22px; }
  .hero-title { font-size: 34px; }
  .banner, .hello { flex-direction: column; align-items: flex-start; }
  .login-page { grid-template-columns: 1fr; }
  .login-art { padding: 32px 24px; min-height: 200px; }
  .login-logo-img { width: min(300px, 100%); }
  .product-hero { grid-template-columns: 1fr; }
  .product-img { max-width: 240px; }
  .form-grid .span-2 { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .kpis, .kpis[style] { grid-template-columns: 1fr 1fr !important; }
  .filters > div { flex: 1 1 100%; flex-wrap: wrap; }
  .kpi .value { font-size: 20px; }
  .bar-row { grid-template-columns: 76px 1fr 76px; }
  .methods { grid-template-columns: repeat(2, 1fr); }
  .chip, .branch-switch label { height: 36px; }
  .theme-toggle { margin-left: auto; }
}
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .app { display: block; }
  body { background: #fff; color: #111; }
  .receipt { border: 0; margin: 0 auto; }
}
.bottle-grid tbody tr:hover td:first-child { background: var(--surface-2); }
.grid-input.wide { width: 120px; }
.raw-form { display: grid; gap: 18px; }
.sticky-save { position: sticky; bottom: 12px; z-index: 5; box-shadow: var(--shadow); }
.formula { display: flex; justify-content: space-between; align-items: center; gap: 14px 20px; flex-wrap: wrap; padding: 16px 20px;
  border-color: var(--gold-line); background: linear-gradient(90deg, var(--gold-soft), var(--surface)); }
.formula > div:first-child { display: grid; gap: 3px; }
.formula b { font-size: 15px; color: var(--ink); }
.prep-calc { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--gold-soft); color: var(--ink-2); font-weight: 600; font-size: 13px; }
.prep-calc.short { background: var(--red-soft); color: var(--red); }
.steps-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.step-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow); }
.step-card > div { flex: 1; display: grid; gap: 2px; }
.step-card b { font-size: 14.5px; }
.step-card small { color: var(--muted); font-size: 12.5px; }
.seg-block { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border-radius: 14px; }
.seg-block label { cursor: pointer; }
.seg-block input { position: absolute; opacity: 0; pointer-events: none; }
.seg-block span { display: block; text-align: center; padding: 9px 10px; border-radius: 10px; font-weight: 700; font-size: 13px; color: var(--muted); }
.seg-block input:checked + span { color: #1a1408; background: linear-gradient(135deg, var(--gold-2), var(--gold)); }
.seg-block input:focus-visible + span { outline: 2px solid var(--gold); }

/* ==========================================================================
   Refresco minimalista: menos bordes y mayúsculas, más aire, acentos dorados vivos.
   ========================================================================== */
html[data-theme="light"] {
  --bg: #faf8f4;
  --bg-glow: rgba(201, 164, 92, 0.12);
  --surface: #ffffff;
  --surface-2: #faf8f4;
  --surface-3: #f2efe8;
  --line: #efebe3;
  --line-strong: #e2ddd2;
  --muted: #8a857b;
  --shadow: 0 1px 2px rgba(24, 20, 12, 0.04), 0 10px 30px rgba(24, 20, 12, 0.05);
  --shadow-gold: 0 8px 20px rgba(180, 141, 66, 0.25);
}
:root { --radius: 20px; --radius-md: 16px; --radius-sm: 12px; }
body { background:
  radial-gradient(900px 420px at 100% -10%, var(--bg-glow), transparent 60%),
  radial-gradient(700px 380px at -10% 110%, color-mix(in srgb, var(--bg-glow) 60%, transparent), transparent 60%), var(--bg);
  background-attachment: fixed; }

/* Encabezado: más ligero */
.topbar { border-bottom-color: transparent; background: color-mix(in srgb, var(--bg) 78%, transparent); }
.topbar h1 { font-size: 32px; }
.content { gap: 22px; }

/* Tarjetas: sin líneas duras, con aire */
.card { border-color: var(--line); transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s; }
.card-head { border-bottom: 0; padding: 20px 24px 8px; }
.card-head h2, .card-head h3 { font-size: 16.5px; font-weight: 700; letter-spacing: -0.01em; }
.card-pad { padding: 20px 24px; }
a.card:hover, a.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow), 0 14px 34px rgba(180, 141, 66, 0.12); }

/* Etiquetas en frase (no en mayúsculas) */
.field { font-size: 12.5px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink-2); }
.field .hint { font-size: 11.5px; }
input, select, textarea { background-color: var(--surface); border-color: var(--line-strong); border-radius: 12px; min-height: 44px; }
html[data-theme="light"] input, html[data-theme="light"] select, html[data-theme="light"] textarea { background-color: #fff; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--gold) 45%, var(--line-strong)); }
.eyebrow { letter-spacing: 0.1em; }

/* Tablas limpias: encabezado sin franja, filas con aire */
.table th { background: transparent; font-size: 11px; letter-spacing: 0.06em; color: var(--muted); padding: 12px 18px;
  border-bottom: 1px solid var(--line); }
.table td { padding: 15px 18px; border-bottom-color: var(--line); }
.table tbody tr:hover { background: color-mix(in srgb, var(--gold) 6%, transparent); }
.table tfoot td { background: transparent; border-top: 1px solid var(--line-strong); }
.bottle-grid th:first-child, .bottle-grid td:first-child { background: var(--surface); }

/* Botones: redondeados y con vida */
.btn { border-radius: 12px; transition: filter 0.15s, transform 0.12s, border-color 0.15s, color 0.15s, box-shadow 0.2s, background 0.15s; }
.btn-primary:hover, .btn-gold:hover, .btn-green:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(180, 141, 66, 0.32); }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--gold-soft); border-color: var(--gold-line); color: var(--gold-deep); }
.btn-sm { border-radius: 10px; }

/* Indicadores: sin línea superior, número protagonista */
.kpi { padding: 20px 20px 18px; }
.kpi::before { display: none; }
.kpi .eyebrow { color: var(--muted); letter-spacing: 0.06em; text-transform: none; font-size: 12px; font-weight: 600; }
.kpi .value { font-size: clamp(22px, 1.9vw, 30px); margin: 8px 0 2px; }
.kpi::after { content: ""; position: absolute; right: 18px; top: 18px; width: 8px; height: 8px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-2), var(--gold)); box-shadow: 0 0 0 4px var(--gold-soft); }
.kpi.good::after { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.kpi.warn::after { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }
.kpi.bad::after { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }

/* Pastillas más suaves */
.pill { letter-spacing: 0.02em; text-transform: none; font-size: 11.5px; font-weight: 600; padding: 4px 11px; }

/* Portada de inicio */
.hero { border-radius: var(--radius); }

/* Ventanas: entrada suave */
.modal:not(.hidden) .modal-box { animation: pop-in 0.18s ease-out; }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal { background: rgba(12, 10, 6, 0.45); }
.modal-box { border-color: var(--line); border-radius: 22px; }
.modal-box .card-head { padding: 22px 24px 10px; }

/* Aparición suave del contenido */
.content > * { animation: rise 0.28s ease-out both; }
.content > *:nth-child(2) { animation-delay: 0.03s; }
.content > *:nth-child(3) { animation-delay: 0.06s; }
.content > *:nth-child(4) { animation-delay: 0.09s; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .content > *, .modal-box { animation: none !important; } }

/* Menú lateral: grupo activo con acento dorado */
.nav-group-items .nav-link.active { background: linear-gradient(90deg, rgba(201, 164, 92, 0.2), rgba(201, 164, 92, 0.03)); }
.branch-switch select, html[data-theme="light"] .branch-switch select { background-color: transparent; border: 0; min-height: 0; }

/* Íconos de métodos de pago */
.pay-ico { display: inline-flex; width: 20px; height: 20px; flex: none; border-radius: 6px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
.pay-ico svg { width: 100%; height: 100%; display: block; }
.pay-method { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.methods label > span { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.methods .pay-ico { width: 28px; height: 28px; padding: 0; border: 0; background: none; border-radius: 8px; }
.methods input:checked + span .pay-ico { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--gold); }
.chip .pay-method { font-size: inherit; }
.chip .pay-ico { width: 16px; height: 16px; border-radius: 5px; }


/* Comprobantes de pago (capturas) */
.proof-wrap { display: grid; gap: 14px; }
.proof-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.proof { margin: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface-2); }
.proof img { display: block; width: 100%; height: 200px; object-fit: cover; object-position: top; }
.proof figcaption { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 8px 6px 10px; }
.proof figcaption form { margin: 0; }
.proof-drop { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1.5px dashed var(--line-strong);
  border-radius: 14px; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.proof-drop:hover, .proof-drop:focus-within { border-color: var(--gold); background: var(--gold-soft); }
.proof-drop > svg { width: 22px; height: 22px; color: var(--gold); flex: none; }
.proof-drop span { display: grid; gap: 2px; }
.proof-drop small { color: var(--muted); font-size: 12px; }
.proof-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.proof-pos { display: grid; gap: 8px; }
.proof-thumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.proof-thumbs img { width: 48px; height: 64px; object-fit: cover; object-position: top; border-radius: 8px; border: 1px solid var(--line); }
.pill .pay-ico { width: 14px; height: 14px; }
.proof-ok { display: inline-flex; color: var(--green); vertical-align: middle; }
.proof-ok svg { width: 15px; height: 15px; }
.sales-table .pill.amber { margin-top: 4px; font-size: 10.5px; padding: 2px 8px; }

/* Importar desde Excel */
.import-steps { display: grid; gap: 16px; }
.import-step { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; }
.import-step > div { display: grid; gap: 6px; justify-items: start; }
.import-step small { color: var(--muted); font-size: 12.5px; }
.import-step .proof-drop, .import-step .choice-row { width: 100%; }
.import-step .choice-row small { font-weight: 400; color: var(--muted); }

/* Generar venta: una sola ventana (tabla de perfumes arriba, cobro abajo) */
.gv { max-width: 1180px; margin: 0 auto; }
.gv-card { padding: 0; overflow: visible; }
.gv-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 14px; }
.gv-head h2 { font-family: var(--serif); font-size: 26px; font-weight: 600; margin: 0; }
.gv-table { padding: 6px 24px 8px; }
.gv-row { display: grid; grid-template-columns: minmax(190px, 2fr) 96px 76px 92px minmax(150px, 1.4fr) 70px 84px 88px 64px;
  gap: 10px; align-items: center; }
.gv-th { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted); }
.gv-th .r { text-align: right; }
.gv-line { padding: 10px 0; border-bottom: 1px solid var(--line); }
.gv-line.bad { background: var(--red-soft); box-shadow: -24px 0 0 var(--red-soft), 24px 0 0 var(--red-soft); }
.gv-line select, .gv-line input { width: 100%; min-height: 38px; padding: 6px 10px; font-size: 13.5px; border-radius: 10px; }
.gv-line select:disabled, .gv-line input:disabled { opacity: 0.45; }
.gv-line [data-f=qty] { text-align: center; padding: 6px 4px; }
.gv-line .gv-cell:nth-child(8) { text-align: right; font-size: 14px; }
.gv-na { color: var(--muted); padding-left: 10px; }
.gv-pick { position: relative; }
.gv-pick .dropdown { min-width: 320px; max-height: 300px; z-index: 20; }
.gv-results button { display: grid; gap: 2px; padding: 9px 12px; }
.gv-results button[disabled] { opacity: 0.5; cursor: not-allowed; }
.gv-results .r-name { font-weight: 700; font-size: 13px; }
.gv-results .r-meta { font-size: 11.5px; color: var(--muted); }
.gv-results .r-empty { padding: 12px; color: var(--muted); font-size: 13px; }
.gv-name { display: grid; gap: 1px; text-align: left; border: 0; background: none; padding: 0; font: inherit; color: var(--ink); cursor: pointer; min-width: 0; }
.gv-name b { font-size: 13.5px; line-height: 1.25; }
.gv-name small { font-size: 11.5px; color: var(--muted); }
.gv-name small.bad { color: var(--red); font-weight: 600; }
.gv-name:hover b { color: var(--gold); }
.gv-acts { display: flex; justify-content: flex-end; gap: 2px; }
.mghost { width: 30px; height: 30px; min-height: 0; border-color: transparent; background: none; color: var(--muted); font-size: 15px; }
.mghost:hover { color: var(--gold); border-color: var(--line); }
.gv-add { display: inline-flex; align-items: center; gap: 6px; margin: 12px 0 8px; padding: 6px 0; border: 0; background: none;
  color: var(--gold); font: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer; }
.gv-add svg { width: 15px; height: 15px; }
.gv-add:hover { text-decoration: underline; }
.gv-foot { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; padding: 18px 24px 22px; border-top: 1px solid var(--line);
  background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.gv-pay { display: grid; gap: 12px; align-content: start; }
.gv-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.gv-methods { display: flex; flex-wrap: wrap; gap: 6px; }
.gv-methods label { cursor: pointer; }
.gv-methods input { display: none; }
.gv-methods label > span { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 7px; border: 1px solid var(--line-strong);
  border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.gv-methods .pay-ico { width: 20px; height: 20px; }
.gv-methods input:checked + span { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); color: var(--ink); }
.gv-cash { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.gv-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.gv-inline input { width: 110px; min-height: 36px; padding: 6px 10px; }
.gv-change { font-size: 13px; color: var(--muted); }
.gv-change b { color: var(--ink); font-size: 15px; margin-left: 4px; }
.gv-cash .quick-cash button { min-height: 32px; }
.gv-attach { position: relative; display: inline-flex; align-items: center; gap: 8px; color: var(--gold); font-weight: 600; font-size: 13px; cursor: pointer; }
.gv-attach svg { width: 18px; height: 18px; }
.gv-attach input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.gv-extra { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.gv-extra .customer-box { flex: 1; min-width: 240px; border: 0; padding: 0; }
.gv-total { display: grid; gap: 8px; align-content: start; }
.gv-total-row { display: flex; justify-content: space-between; align-items: baseline; }
.gv-total-row span { font-family: var(--serif); font-size: 22px; }
.gv-total-row b { font-family: var(--serif); font-size: 34px; color: var(--gold); }
.gv-total #cart-clear { justify-self: center; font-size: 12.5px; color: var(--muted); }
@media (max-width: 1100px) {
  .gv-th { display: none; }
  .gv-row.gv-line { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 10px; }
  .gv-line .gv-cell:first-child { grid-column: 1 / -2; }
  .gv-line .gv-acts { grid-column: -2 / -1; grid-row: 1; }
  .gv-line .gv-cell[data-label="Frasco"] { grid-column: span 2; }
  .gv-line .gv-cell:not(:first-child)::before { content: attr(data-label); display: block; margin-bottom: 3px; font-size: 10px; font-weight: 700;
    letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
  .gv-line .gv-cell:nth-child(8) { align-self: end; }
  .gv-foot { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .gv-head, .gv-table, .gv-foot { padding-left: 14px; padding-right: 14px; }
  .gv-row.gv-line { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gv-line .gv-cell[data-label="Frasco"] { grid-column: auto; }
  .gv-line .gv-cell[data-label="Subtotal"] { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: baseline; text-align: left; }
  .gv-line .gv-cell[data-label="Subtotal"]::before { margin: 0; }
  .gv-pick .dropdown { min-width: 0; }
}

/* Capa minimalista para todo el sistema: superficies planas, bordes finos y sin adornos */
.card { box-shadow: none; }
.card:hover { box-shadow: none; transform: none; }
.kpi::after { display: none; }
.btn-gold { background: var(--gold); background-image: none; box-shadow: none; color: #1a1408; border-color: var(--gold); }
.btn-gold:hover:not(:disabled) { filter: brightness(0.95); box-shadow: none; transform: none; }
.btn-primary { box-shadow: none; }
.btn { box-shadow: none; }
.tabs { box-shadow: none; }
.tab.active { background: var(--ink); background-image: none; color: #fff; box-shadow: none; }
html[data-theme="dark"] .tab.active { background: var(--gold); color: #111; }
.pill { font-weight: 600; }
.modal-box { box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18); }
.content > * { animation: none; }
.btn-primary { background: var(--gold); background-image: none; color: #1a1408; border-color: var(--gold); }
.btn-primary:hover:not(:disabled) { filter: brightness(0.95); transform: none; }
.hero { box-shadow: none; }
.gv-price { display: block; padding: 0 4px; font-size: 14px; font-weight: 600; color: var(--ink); }

/* Ventas: período, meta, cuadre del día y vistas */
.sales-kpis { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.sales-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sales-top .tab svg { width: 14px; height: 14px; vertical-align: -2px; }
.range-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 14px 18px; }
.range-bar .range-title { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; align-self: center; }
.range-bar .range-title svg { width: 18px; height: 18px; color: var(--gold); }
.range-bar .field { min-width: 160px; }
.delta { font-weight: 700; }
.delta.up { color: var(--green); }
.delta.down { color: var(--red); }
.goal-card { display: grid; gap: 10px; padding: 16px 20px; }
.goal-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.goal-value b { font-size: 22px; }
.goal-pct { font-size: 22px; color: var(--ink); }
.meter { height: 10px; border-radius: 999px; background: var(--gold-soft); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: var(--chart-bar); transition: width 0.4s; }
.goal-card.reached .meter > span { background: var(--green); }
.goal-card .small svg { width: 14px; height: 14px; vertical-align: -2px; color: var(--green); }
.goal-hint { margin: -4px 0 0; display: flex; align-items: center; gap: 6px; }
.goal-hint svg { width: 14px; height: 14px; color: var(--gold); }
.close-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.close-grid > div { display: grid; gap: 4px; align-content: start; padding: 14px 20px; }
.close-grid > div + div { border-left: 1px solid var(--line); }
.close-grid b { font-size: 20px; }
.close-methods { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: 12.5px; }
.close-cash { background: var(--gold-soft); }
@media (max-width: 760px) {
  .close-grid { grid-template-columns: 1fr; }
  .close-grid > div + div { border-left: 0; border-top: 1px solid var(--line); }
}
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); justify-self: start; width: fit-content; max-width: 100%; }
.seg a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.seg a span { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.seg a.on { background: var(--ink); color: #fff; }
.seg a.on span { color: rgba(255, 255, 255, 0.7); }
html[data-theme="dark"] .seg a.on { background: var(--gold); color: #111; }

/* Gráfico de ventas por día: una sola serie (barras finas desde la base, extremo redondeado de 4px) */
:root { --chart-bar: #a88136; }
html[data-theme="dark"] { --chart-bar: #b08a3c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --chart-bar: #b08a3c; } }
.day-chart { position: relative; height: 220px; padding: 0 0 22px 56px; }
.dc-grid { position: absolute; inset: 0 0 22px 56px; }
.dc-line { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.dc-line span { position: absolute; right: calc(100% + 8px); top: -8px; font-size: 11px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.dc-bars { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 100%; }
.dc-slot { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; position: relative; }
.dc-bar { width: 100%; max-width: 24px; min-height: 0; border: 0; padding: 0; background: var(--chart-bar); border-radius: 4px 4px 0 0; cursor: default; }
.dc-bar.empty { background: transparent; }
.dc-slot:hover .dc-bar:not(.empty), .dc-bar:focus-visible { filter: brightness(1.15); outline: none; }
.dc-bar:focus-visible { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.dc-x { position: absolute; bottom: -20px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.dc-tip { position: absolute; z-index: 5; display: grid; gap: 1px; padding: 7px 10px; border-radius: 10px; background: var(--ink); color: #fff;
  font-size: 12px; pointer-events: none; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); white-space: nowrap; }
.dc-tip b { font-size: 14px; }
.dc-tip span { color: rgba(255, 255, 255, 0.75); }
html[data-theme="dark"] .dc-tip { background: #f3f1ec; color: #111; }
html[data-theme="dark"] .dc-tip span { color: #555; }
tr.muted td { color: var(--muted); }
.goal-pct { white-space: nowrap; }
/* Captura obligatoria en pagos que no son en efectivo */
.gv-proof { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 12px; border: 1.5px dashed var(--line-strong); border-radius: 12px; }
.gv-proof .proof-thumbs { flex-basis: 100%; }
.gv-proof.missing { border-color: var(--red); background: var(--red-soft); }
.gv-proof.missing .gv-attach { color: var(--red); }
.gv-proof #proof-clear { font-size: 12.5px; color: var(--muted); }
.proof-thumbs:empty { display: none; }
/* Meta del mes de la tienda */
.goal-card .eyebrow { display: inline-flex; align-items: center; gap: 6px; }
.goal-card .eyebrow svg { width: 14px; height: 14px; color: var(--gold); }
.goal-side { display: flex; align-items: center; gap: 12px; }
.goal-side .btn svg { width: 14px; height: 14px; }
.goal-foot { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.goal-foot b { color: var(--ink); }
.goal-ok { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-weight: 600; }
.goal-warn { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; font-size: 13px;
  background: var(--amber-soft); border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent); color: var(--ink); }
.goal-warn svg { flex: none; width: 18px; height: 18px; color: var(--amber); margin-top: 1px; }
.goal-card.warn .meter > span { background: var(--amber); }
.goal-history summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--ink-2); width: fit-content; }
.goal-history ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.goal-history li { display: grid; grid-template-columns: 110px minmax(60px, 1fr) auto auto; align-items: center; gap: 12px; font-size: 12.5px; }
.gh-bar { height: 6px; border-radius: 999px; background: var(--gold-soft); overflow: hidden; }
.gh-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--amber); }
.gh-bar > span.ok { background: var(--green); }
.gh-val { white-space: nowrap; }
@media (max-width: 620px) {
  .goal-head { flex-wrap: wrap; align-items: center; }
  .goal-history li { grid-template-columns: 1fr auto; row-gap: 4px; }
  .goal-history .gh-bar { grid-column: 1 / -1; order: 3; }
}
.linkish { border: 0; background: none; padding: 0; font: inherit; color: var(--gold); font-weight: 600; cursor: pointer; text-decoration: underline; }
.pos-goal-warn { margin-bottom: 12px; }
/* ¿Qué hay disponible? (solo consulta) */
.avail-prices { margin-left: auto; }
.avail-prices .sep { margin: 0 6px; color: var(--line-strong); }
.avail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.avail-card { display: grid; gap: 10px; padding: 14px 16px; }
.avail-card.empty { opacity: 0.6; }
.avail-name { font-weight: 700; }
.avail-sizes { display: flex; flex-wrap: wrap; gap: 6px; }
.avail-sizes span { padding: 4px 10px; border-radius: 999px; background: var(--gold-soft); font-size: 12.5px; }
.avail-sizes span.zero { background: transparent; border: 1px dashed var(--line-strong); color: var(--muted); }
@media (max-width: 760px) { .avail-prices { margin-left: 0; flex-basis: 100%; } }
/* Comprobante por WhatsApp */
.btn-wa { background: #1f9d55; border-color: #1f9d55; color: #fff; }
.btn-wa:hover { background: #188a49; border-color: #188a49; color: #fff; }
.btn-wa svg, .btn svg.wa { width: 16px; height: 16px; }
.done-wa { display: flex; gap: 8px; width: 100%; margin-top: 10px; }
.done-wa input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; }
.wa-body { display: grid; gap: 12px; }
.wa-preview { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--gold-soft); font: 12.5px/1.5 var(--sans, inherit); white-space: pre-wrap; max-height: 280px; overflow: auto; }
@media (max-width: 480px) { .done-wa { flex-direction: column; } }
/* Pedidos de anulación o corrección */
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 800; line-height: 1; }
.nav-group-head .nav-badge + svg { margin-left: 6px; }
.req-list { display: grid; gap: 12px; }
.req-card { display: grid; gap: 10px; padding: 16px 18px; }
.req-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; align-items: baseline; }
.req-top h3 { font-size: 16px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.req-reason { padding: 10px 12px; border-left: 3px solid var(--gold); background: var(--gold-soft); border-radius: 0 10px 10px 0; font-size: 13.5px; }
.req-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.req-actions input { flex: 1; min-width: 180px; height: 36px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; }
.req-banner { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.req-banner .req-actions { flex-basis: 100%; }
.req-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.req-kinds label { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 12px; cursor: pointer; font-size: 13px; }
.req-kinds label:has(input:checked) { border-color: var(--gold); background: var(--gold-soft); }
.req-kinds b { display: block; }
@media (max-width: 520px) { .req-kinds { grid-template-columns: 1fr; } }
.req-alert { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.req-alert svg { width: 18px; height: 18px; color: var(--amber); }
.req-alert > b { margin-left: auto; }
.my-reqs ul { list-style: none; margin: 0; padding: 4px 20px 14px; display: grid; gap: 8px; }
.my-reqs li { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 13px; }
/* Turno de cada vendedora */
.shift-card .card-head h3 { display: inline-flex; align-items: center; gap: 8px; }
.shift-card .card-head h3 svg { width: 18px; height: 18px; color: var(--gold); }
.shift-recap { display: grid; gap: 6px; padding: 12px 14px; border-radius: 12px; background: var(--gold-soft); font-size: 13.5px; }
.shift-recap > div { display: flex; justify-content: space-between; gap: 12px; }
.shift-recap .grand { padding-top: 6px; border-top: 1px solid var(--line); font-weight: 700; }
/* Separaciones */
.res-card.late { border-color: color-mix(in srgb, var(--red) 45%, transparent); }
.res-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13.5px; }
.res-money { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 13.5px; }
.res-balance b { color: var(--gold); font-size: 16px; }
.res-deliver .gv-methods { display: flex; flex-wrap: wrap; gap: 6px; }
.gv-reserve { display: grid; gap: 8px; padding: 10px 12px; border: 1.5px dashed var(--gold); border-radius: 12px; background: var(--gold-soft); }
.gv-reserve .gv-inline input[type=date] { width: auto; }
.gv-reserve-sum { font-size: 12.5px; }
.shift-card .card-head { flex-wrap: wrap; gap: 10px; }
.shift-card .card-head h3 { display: flex; }
.done-wa { flex-wrap: wrap; justify-content: center; }
.done-wa .wa-alt { flex-basis: 100%; font-size: 12.5px; }
.wa-doc { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--gold-soft); }
.wa-doc > svg { width: 28px; height: 28px; color: var(--red); flex: none; }
.wa-doc > div { display: grid; gap: 2px; flex: 1; min-width: 0; }
/* Devoluciones y cambios */
.ret-list { display: grid; gap: 8px; }
.ret-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.ret-row > span:first-child { display: grid; gap: 2px; min-width: 0; }
.ret-qty { display: flex; align-items: center; gap: 8px; font-size: 12.5px; white-space: nowrap; }
.ret-qty input { width: 64px; height: 36px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; }
.card-head h3 svg { width: 16px; height: 16px; vertical-align: -2px; color: var(--gold); }
/* Panel de inventario */
.inv-kpis .kpi { text-decoration: none; color: inherit; }
.inv-kpis .value small { font-size: 14px; color: var(--muted); font-weight: 600; }
.section-title h3 svg { width: 18px; height: 18px; color: var(--amber); vertical-align: -3px; }
.inv-alerts { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; align-items: start; }
.inv-list { list-style: none; margin: 0; padding: 4px 18px 14px; display: grid; gap: 2px; max-height: 360px; overflow: auto; }
.inv-list li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.inv-list li:last-child { border-bottom: 0; }
.inv-list a { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-list .num { font-weight: 700; }
.inv-list .num.warn { color: var(--amber); }
.inv-list .num.bad { color: var(--red); }
@media (max-width: 420px) { .inv-alerts { grid-template-columns: 1fr; } }
.inv-kpis { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.inv-kpis .value { font-size: 26px; overflow-wrap: anywhere; }
.inv-kpis { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }
@media (max-width: 520px) { .inv-kpis .value { font-size: 21px; } }
/* Inventario real */
.real-intro { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.real-intro > div:first-child { display: grid; gap: 2px; max-width: 720px; }
.real-form { display: grid; gap: 16px; }
.real-bar { position: sticky; top: 70px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; }
.real-filter { flex: 1; min-width: 200px; height: 38px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; }
.real-form .card-head h3 svg { width: 16px; height: 16px; color: var(--gold); vertical-align: -2px; }
.real-form .grid-input { width: 90px; }
/* Menú de clic derecho / mantener presionado (eliminar desde Inventario) */
.ctx-menu { position: fixed; z-index: 1000; min-width: 220px; max-width: 300px; padding: 6px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--line-strong); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25); display: grid; gap: 2px; }
.ctx-title { padding: 6px 10px 8px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx-menu button { text-align: left; padding: 9px 10px; border: 0; border-radius: 8px; background: none; font: inherit; font-weight: 600; cursor: pointer; color: var(--ink); }
.ctx-menu button:hover, .ctx-menu button:focus-visible { background: var(--surface-3); outline: none; }
.ctx-menu .ctx-danger { color: var(--red); }
[data-delete-url] { -webkit-touch-callout: none; }
/* Kárdex */
.kardex .card-head h3 svg { width: 16px; height: 16px; color: var(--gold); vertical-align: -2px; }
.kardex-filter select { height: 36px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; max-width: 260px; }
.kardex-table td { vertical-align: top; }
.kx-out { color: var(--red); }
.kx-in { color: var(--green); }
.kardex-pages { display: flex; justify-content: center; align-items: center; gap: 12px; border-top: 1px solid var(--line); }
.inv-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Inicio · vendido del mes */
.month-board { margin-bottom: 16px; }
.month-mine { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; padding: 8px 10px; margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; }
.month-mine span { font-size: 12px; color: var(--muted); }
.month-mine b { font-size: 16px; }
.month-mine small { color: var(--muted); }
.month-top { margin: 4px 0 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13px; }
.month-top li { display: list-item; }
.month-top li > span { display: inline; }
.month-top li b.num { float: right; margin-left: 8px; white-space: nowrap; }
.month-bottle { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; margin-top: 4px; }

/* Nueva compra · fotos opcionales */
.purchase-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.purchase-thumbs:empty { display: none; }
.purchase-thumbs figure { position: relative; margin: 0; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.purchase-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.purchase-thumbs .icon-btn { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; min-height: 0; background: var(--card, #fff); }

/* Esencias · damas / hombre */
.table tr.group-row td { background: var(--gold-soft); color: var(--ink, inherit); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; padding-top: 10px; padding-bottom: 10px; }
.table select.grp-select { display: inline-block; width: auto; min-width: 0; height: 26px; min-height: 26px; margin: 0 0 0 8px;
  padding: 0 24px 0 8px; font-size: 11px; line-height: 1; border-radius: 999px; vertical-align: middle; background-position: right 6px center; }

/* Esencias · damas / hombre */
.table tr.group-row td { background: var(--gold-soft); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; padding-top: 10px; padding-bottom: 10px; }
.table select.grp-select { display: inline-block; width: auto; min-width: 0; height: 26px; min-height: 26px; margin: 0 0 0 8px;
  padding: 0 24px 0 8px; font-size: 11px; line-height: 1; border-radius: 999px; vertical-align: middle; background-position: right 6px center; }

/* Limpiar datos de prueba (dueño) */
.cleanup-report { border-color: var(--gold); }
.cleanup-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; }
.cleanup-list { margin: 0; padding-left: 18px; display: grid; gap: 3px; font-size: 13px; max-height: 260px; overflow: auto; }
.cleanup-confirm { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.cleanup-confirm .field { max-width: 260px; }
.cleanup-table { max-height: 420px; overflow: auto; }
@media (max-width: 700px) { .cleanup-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.btn-danger { background: var(--red-strong, var(--red)); color: #fff; border-color: transparent; }
.btn-danger:hover { filter: brightness(.92); }

/* Esencias: bloqueado hasta pulsar «Modificar» */
.raw-form:not(.editing) .edit-only { display: none !important; }
.raw-form.editing .view-only { display: none !important; }
.raw-form.editing .table { box-shadow: inset 0 0 0 2px var(--gold-soft); }
.edit-bar { display: grid; gap: 10px; }
.edit-bar .field { max-width: 560px; }
.edit-bar-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Venta: precio especial (dueño y administrador) */
.gv-price { display: grid; gap: 6px; width: 100%; padding: 8px 10px; border: 1px dashed var(--gold); border-radius: 10px; }
.gv-price .gv-price-reason input { width: 100%; }
.price-note { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--gold-soft); font-size: 12px; font-weight: 700; }
.price-note svg { width: 14px; height: 14px; }

/* Inventario → Perfumes: barra simple con Preparar / Importar */
.perfume-bar { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; padding: 16px; }
.perfume-bar .perfume-search { flex: 1 1 260px; }
.perfume-bar .btn { height: 44px; }
.perfume-bar .perfume-actions { margin-left: auto; }
.gv-price .gv-inline { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.gv-price .gv-price-reason input { flex: 1; min-width: 0; }
.gv-price #price-clear { justify-self: start; }
.gv-box { margin-top: 6px; width: 100%; }

/* Caja general con turnos */
.turn-start { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-color: var(--gold); }
.turn-start svg, .day-close svg { width: 16px; height: 16px; vertical-align: -3px; }
.day-close { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); }

/* Vista previa de fotos en grande */
.lightbox { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 16px; background: rgba(0, 0, 0, 0.85); }
.lightbox.hidden { display: none; }
.lightbox img { max-width: min(900px, 100%); max-height: calc(100vh - 110px); object-fit: contain; border-radius: 10px; background: #fff; }
.lightbox-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: min(900px, 100%); color: #fff; }
.lightbox-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.purchase-thumbs img, .proof-thumbs img { cursor: zoom-in; }
.purchase-thumbs .thumbs-hint { align-self: center; }

/* Mensaje del dueño en pantalla */
.msg-screen { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(4px); }
.msg-screen.hidden { display: none; }
.msg-box { width: min(480px, 100%); display: grid; gap: 14px; padding: 24px; background: var(--surface); border: 1px solid var(--gold-line);
  border-radius: var(--radius); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
.msg-body { margin: 0; font-size: 18px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.turns-board { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.turns-store { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; }
.turns-store h4 { margin: 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.turn-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.turn-row .who { display: grid; gap: 2px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: var(--muted); }
.dot.on { background: var(--green); }
.dot.off { background: var(--red); }
.msg-people { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); padding-top: 6px; }
.msg-people .choice { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.msg-people .choice:has(input:checked) { border-color: var(--gold); background: var(--gold-soft); }
.turn-group { display: grid; gap: 6px; padding-top: 4px; }
.turn-group-title { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.turn-row .bad { color: var(--red); font-weight: 600; }
.turn-alert { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; font-size: 12.5px;
  background: var(--red-soft, rgba(255, 96, 114, .12)); color: var(--red); }
.turn-alert svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.turns-store-name { display: inline-flex; align-items: center; gap: 8px; }
.turns-store-name svg { width: 18px; height: 18px; color: var(--gold); }
.turns-store { align-content: start; }
.price-table .grid-input { width: 92px; text-align: right; }
.price-table .grid-input.special { border-color: var(--gold); background: var(--gold-soft); font-weight: 700; }
.bottle-name { display: flex; align-items: center; gap: 8px; }
.bottle-thumb { width: 36px; height: 36px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.gv-bottle-img { width: 28px; height: 28px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); flex: none; }
