/* VORVEX Direct Client API -- Portal. Same professional dark design language as VORVEX Cloud's own
   Customer Portal (wwwroot/portal/app.css in the VORVEX.Cloud repo), reimplemented standalone here
   since this is a separate PHP codebase -- but the CLIENT's business name is the primary brand
   shown throughout, with VORVEX credited only in a discreet footer. */
:root {
  --bg: #0b1220; --bg-panel: #121b2e; --bg-panel-2: #17223a; --border: #223049;
  --text: #e6ecf5; --text-muted: #93a3bd; --accent: #3b82f6; --accent-dim: #1d4ed8;
  --success: #22c55e; --danger: #ef4444; --warn: #f59e0b; --radius: 10px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  /* Visual redesign pass (Section E of the Balam onboarding brief): a second accent for
     glow/gradient accents, kept clearly SEPARATE from --accent (still the one color every
     interactive control/focus-state uses) so this stays an additive palette, never a swap. */
  --accent-cyan: #22d3ee; --accent-glow: rgba(59,130,246,.35); --bg-deep: #060a14;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 14px; }
a { color: inherit; }
@media (prefers-reduced-motion: reduce) {
  .hero-grid, .login-hero .hero-pulse { animation: none !important; }
}

.login-body { margin: 0; min-height: 100vh; }
/* Two-column shell: left = animated brand hero, right = the exact same login form/card that
   already existed (markup/fields/CSRF/error text untouched -- see login.php). Collapses to a
   single centered card on narrow viewports, same as the original single-column layout. */
.login-shell { display: flex; min-height: 100vh; }
.login-hero {
  flex: 1.1; position: relative; overflow: hidden; display: flex; flex-direction: column;
  justify-content: center; padding: 60px; background: radial-gradient(circle at 30% 20%, #0f1c33 0%, var(--bg-deep) 65%);
  border-right: 1px solid var(--border);
}
.hero-grid {
  position: absolute; inset: -20% -20% -20% -20%; pointer-events: none;
  background-image:
    linear-gradient(rgba(59,130,246,.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,130,246,.14) 1px, transparent 1px);
  background-size: 42px 42px;
  animation: heroGridDrift 26s linear infinite;
  mask-image: radial-gradient(circle at 30% 30%, #000 0%, transparent 70%);
}
@keyframes heroGridDrift { from { background-position: 0 0, 0 0; } to { background-position: 420px 210px, 420px 210px; } }
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .8; }
.login-hero .hero-content { position: relative; z-index: 1; max-width: 460px; }
.login-hero .hero-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 34px; }
.login-hero .hero-brand img { height: 34px; width: auto; }
.login-hero .hero-eyebrow {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent-cyan); border: 1px solid rgba(34,211,238,.35); background: rgba(34,211,238,.08);
  padding: 5px 11px; border-radius: 20px; margin-bottom: 18px;
}
.login-hero h1 { font-size: 30px; line-height: 1.25; margin: 0 0 14px; font-weight: 700; letter-spacing: -.01em; }
.login-hero h1 span { background: linear-gradient(90deg, var(--accent-cyan), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-hero p.tagline { color: var(--text-muted); font-size: 14.5px; line-height: 1.6; margin: 0 0 30px; }
.hero-stats { display: flex; gap: 26px; }
.hero-stats div { display: flex; flex-direction: column; gap: 3px; }
.hero-stats .n { font-size: 19px; font-weight: 700; color: var(--text); }
.hero-stats .l { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }

.login-form-side { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--bg); }
.login-card {
  background: linear-gradient(180deg, var(--bg-panel) 0%, var(--bg-panel-2) 130%);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow), 0 0 0 1px rgba(59,130,246,.06);
  padding: 42px 38px; width: 100%; max-width: 380px;
}
.login-logo { font-weight: 700; font-size: 20px; margin-bottom: 4px; }
.login-logo small { color: var(--text-muted); font-weight: 500; font-size: 12px; display: block; margin-top: 2px; }
.muted { color: var(--text-muted); margin: 0 0 20px; font-size: 13px; }
.login-card label { display: block; font-size: 12px; color: var(--text-muted); margin: 14px 0 6px; }
.login-card input {
  width: 100%; padding: 11px 13px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 14px; transition: border-color .15s ease, box-shadow .15s ease;
}
.login-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.login-card button {
  width: 100%; margin-top: 22px; padding: 12px; background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  color: #fff; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: filter .15s ease, transform .1s ease;
}
.login-card button:hover { filter: brightness(1.1); }
.login-card button:active { transform: translateY(1px); }
.error { color: var(--danger); font-size: 13px; margin-top: 12px; }

@media (max-width: 860px) {
  .login-hero { display: none; }
  .login-shell { min-height: 100vh; }
  .login-form-side { flex: 1; }
}

.shell { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: var(--bg-panel); border-right: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-logo { display: flex; flex-direction: column; padding: 18px 20px; font-weight: 700; font-size: 16px; border-bottom: 1px solid var(--border); }
.sidebar-logo small { color: var(--text-muted); font-weight: 500; font-size: 10px; margin-top: 2px; }
.nav-group { padding: 10px 0; }
.nav-group:last-of-type { flex: 1; }
.nav-group-label { padding: 8px 20px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 20px; color: var(--text-muted); text-decoration: none; font-size: 13.5px; border-left: 3px solid transparent; }
.nav-item:hover { color: var(--text); background: var(--bg-panel-2); }
.nav-item.active { color: var(--text); background: var(--bg-panel-2); border-left-color: var(--accent); }
.nav-item .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); }
.sidebar-footer { padding: 14px 20px; font-size: 10.5px; color: var(--text-muted); border-top: 1px solid var(--border); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; border-bottom: 1px solid var(--border); background: var(--bg-panel); }
.topbar .title { font-size: 16px; font-weight: 600; }
.topbar .right { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--text-muted); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; background: var(--bg-panel-2); border: 1px solid var(--border); }
.status-pill.ok .dot { background: var(--success); } .status-pill.warn .dot { background: var(--warn); } .status-pill.bad .dot { background: var(--danger); }
.status-pill .dot { width: 7px; height: 7px; border-radius: 50%; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-muted); padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 13px; text-decoration: none; }
.btn-ghost:hover { color: var(--text); border-color: var(--accent); }

.content { padding: 24px; flex: 1; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi-card { background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.kpi-card .label { color: var(--text-muted); font-size: 12px; margin-bottom: 8px; }
.kpi-card .value { font-size: 24px; font-weight: 700; }
.panel { background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.panel h2 { font-size: 13px; margin: 0 0 16px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--text-muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 11px; text-transform: uppercase; }
td { padding: 9px 10px; border-bottom: 1px solid var(--border); }
tr:hover td { background: var(--bg-panel-2); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.badge.ok { background: rgba(34,197,94,.15); color: var(--success); }
.badge.bad { background: rgba(239,68,68,.15); color: var(--danger); }
.badge.neutral { background: rgba(147,163,189,.15); color: var(--text-muted); }
.empty-state { text-align: center; padding: 50px 20px; color: var(--text-muted); }

/* ---- Dashboard/portal visual refinement pass -- CSS-only, every existing class kept, same
   markup every page already renders (see MainWindow.xaml.cs-equivalent "no romper compatibilidad"
   rule: this never adds/removes/renames a class other pages depend on). ---- */
.sidebar-logo { position: relative; }
.sidebar-logo::after {
  content: ""; position: absolute; left: 20px; right: 20px; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent), transparent);
}
.topbar { position: relative; }
.status-pill.ok { box-shadow: 0 0 0 1px rgba(34,197,94,.25), 0 0 14px rgba(34,197,94,.18); }
.status-pill.ok .dot { box-shadow: 0 0 6px var(--success); }
.status-pill.bad .dot { box-shadow: 0 0 6px var(--danger); }

.kpi-card { position: relative; overflow: hidden; transition: transform .15s ease, border-color .15s ease; }
.kpi-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent));
}
.kpi-card:hover { transform: translateY(-2px); border-color: rgba(59,130,246,.4); }

.panel { position: relative; }
.panel h2 { display: flex; align-items: center; gap: 8px; }
.panel h2::before { content: ""; width: 3px; height: 12px; background: var(--accent-cyan); border-radius: 2px; display: inline-block; }

/* ---- Master Execution Section 4/18: Ventas' own internal secondary nav (never the global sidebar
   -- "no saturar sidebar global"), plus a lightweight, dependency-free bar-chart component (server-
   rendered inline SVG, no JS charting library, no heavy bundle -- Section 56). Tokens reused, never
   redefined. ---- */
.subnav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.subnav a { color: var(--text-muted); text-decoration: none; font-size: 12.5px; padding: 7px 12px; border-radius: 7px; border: 1px solid transparent; }
.subnav a:hover { color: var(--text); background: var(--bg-panel-2); }
.subnav a.active { color: var(--text); background: var(--bg-panel-2); border-color: var(--accent); }

.filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 18px; font-size: 12.5px; }
.filterbar a { color: var(--text-muted); text-decoration: none; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--border); }
.filterbar a:hover { color: var(--text); border-color: var(--accent); }
.filterbar a.active { color: var(--text); background: rgba(59,130,246,.12); border-color: var(--accent); }

.chart-card { background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 20px; }
.chart-card .chart-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.chart-card .chart-title { font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.chart-card .chart-meta { font-size: 11px; color: var(--text-muted); }
.bar-row { display: flex; align-items: center; gap: 10px; margin: 7px 0; font-size: 12.5px; }
.bar-row .bar-label { width: 130px; flex-shrink: 0; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .bar-track { flex: 1; background: var(--bg); border-radius: 4px; height: 14px; overflow: hidden; }
.bar-row .bar-fill { height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.bar-row:hover .bar-fill { background: #60a5fa; }
.bar-row .bar-value { width: 90px; text-align: right; flex-shrink: 0; font-variant-numeric: tabular-nums; }

.trend-up { color: var(--success); } .trend-down { color: var(--danger); } .trend-flat { color: var(--text-muted); }

.anomaly-card { border-left: 3px solid var(--warn); background: var(--bg-panel); border: 1px solid var(--border); border-left: 3px solid var(--warn); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
.anomaly-card .anomaly-label { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.anomaly-card .anomaly-evidence { color: var(--text-muted); font-size: 12.5px; }
.anomaly-card .anomaly-meta { color: var(--text-muted); font-size: 11px; margin-top: 6px; }
.na-note { color: var(--text-muted); font-size: 11.5px; font-style: italic; margin-top: 8px; }

/* ---- Accessibility pass (Section 26): visually-hidden label text for icon/date-only inputs, and
   respecting a real OS-level reduced-motion preference for the existing kpi-card hover transform. ---- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .kpi-card, .kpi-card:hover { transition: none; transform: none; }
}

/* ---- Execution Order 2, Section 1: safe-degradation "module not initialized" panel -- amber, never
   red/error-styled, since this is an expected, non-broken state (an optional table simply isn't
   migrated on this deployment yet), not a failure. ---- */
.module-pending { border: 1px solid var(--warn); background: rgba(255, 180, 0, 0.08); }
.module-pending h2 { color: var(--warn); font-size: 16px; }

/* ---- Execution Order 2, Section 9: mobile drawer navigation. Desktop (>900px) is completely
   unchanged -- .sidebar keeps its existing static 220px layout, .sidebar-burger stays display:none,
   and .sidebar-scrim stays hidden. Everything below only takes effect under the breakpoint. ---- */
.sidebar-burger { display: none; flex-direction: column; justify-content: center; gap: 4px; width: 36px; height: 32px; padding: 0; margin-right: 12px; background: transparent; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; flex-shrink: 0; }
.sidebar-burger span { display: block; width: 18px; height: 2px; margin: 0 auto; background: var(--text); border-radius: 1px; }
.sidebar-scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 55; }
.sidebar-scrim[hidden] { display: none; }

@media (max-width: 900px) {
  .sidebar-burger { display: flex; }
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; height: 100dvh; z-index: 60;
    /* 2026-10-18: el menú se desliza solo (antes no cabía y no se podía bajar; se movía el cuerpo de la página). */
    overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.35);
  }
  .sidebar.open { transform: translateX(0); }
  body.drawer-open { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
}

/* ---- Administración (usuarios, configuración, connectors, actividad, sistema, mi cuenta) ---- */
.user-chip { display: inline-flex; flex-direction: column; align-items: flex-end; text-decoration: none; color: var(--text); font-size: 13px; line-height: 1.2; padding: 2px 6px; border-radius: 6px; }
.user-chip small { color: var(--text-muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; }
.user-chip:hover { background: var(--bg-panel-2); }
.notice-bar { background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.45); color: #fcd34d; padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; font-size: 13.5px; }
.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; font-size: 13.5px; border: 1px solid; }
.flash.ok { background: rgba(34,197,94,.10); border-color: rgba(34,197,94,.45); color: #86efac; }
.flash.bad { background: rgba(239,68,68,.10); border-color: rgba(239,68,68,.45); color: #fca5a5; }
.flash.warn { background: rgba(245,158,11,.10); border-color: rgba(245,158,11,.45); color: #fcd34d; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.field .hint { font-size: 11.5px; color: var(--text-muted); }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=number], .field select, .field textarea {
  width: 100%; padding: 9px 11px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font: inherit;
}
.field textarea { min-height: 72px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-panel-2); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.danger { color: #fca5a5; border-color: rgba(239,68,68,.45); background: rgba(239,68,68,.08); }
.btn.danger:hover { background: rgba(239,68,68,.18); }
.btn.small { padding: 5px 10px; font-size: 12px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.inline-form { display: inline; margin: 0; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 4px; }
.code-block { background: var(--bg-deep); border: 1px solid var(--border); border-radius: 8px; padding: 12px; font-family: ui-monospace, Consolas, monospace; font-size: 12px; white-space: pre; overflow-x: auto; color: #cbd5e1; }
.kv { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 8px 16px; font-size: 13.5px; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; word-break: break-word; }
details.edit-row > summary { cursor: pointer; list-style: none; }
details.edit-row > summary::-webkit-details-marker { display: none; }
details.edit-row[open] { background: var(--bg-panel-2); border-radius: 8px; padding: 12px; margin-top: 8px; }
.pill-role { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; background: rgba(59,130,246,.15); color: #93c5fd; }
.pill-role.Owner { background: rgba(34,211,238,.15); color: var(--accent-cyan); }
.section-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
@media (max-width: 720px) { .kv { grid-template-columns: 1fr; } .kv dt { margin-top: 6px; } .user-chip small { display: none; } }
@media (max-width: 720px) {
  .topbar { padding: 12px 14px; gap: 10px; }
  .topbar .right { gap: 8px; min-width: 0; }
  .topbar .right .user-chip { display: none; }
  .topbar .status-pill { font-size: 0; padding: 6px; }
  .topbar .status-pill .dot { margin: 0; }
  .main { min-width: 0; }
}

/* ---- Portal legible (2026-10-06): nombres en vez de claves, detalle de ventas/compras/inventario ---- */
.clave { display: inline-block; margin-left: 6px; font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; opacity: .8; }
.cell-main { font-weight: 600; color: var(--text); }
.cell-sub { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.nowrap { white-space: nowrap; }
.badge.in { background: rgba(34,197,94,.15); color: var(--success); }
.badge.out { background: rgba(245,158,11,.15); color: var(--warn); }
.qty-in { color: var(--success); font-weight: 600; }
.qty-out { color: var(--warn); font-weight: 600; }
tr.row-link { cursor: pointer; }
tr.row-link:hover td { background: rgba(59,130,246,.07); }
tr.row-link:focus-within td { background: rgba(59,130,246,.1); }
a.row-anchor { color: var(--accent-cyan); text-decoration: none; font-weight: 600; }
a.row-anchor:hover, a.row-anchor:focus-visible { text-decoration: underline; }
.searchbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 16px; }
.searchbar .sf { display: flex; flex-direction: column; gap: 4px; min-width: 150px; }
.searchbar .sf.grow { flex: 1 1 220px; }
.searchbar label { font-size: 12px; color: var(--text-muted); }
.searchbar input, .searchbar select { background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 9px 10px; font-size: 14px; min-height: 40px; }
.searchbar input:focus, .searchbar select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.searchbar .btn-search { background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 0 16px; min-height: 40px; font-weight: 600; cursor: pointer; }
.searchbar .btn-clear { color: var(--text-muted); font-size: 13px; padding: 10px 4px; }
.result-meta { color: var(--text-muted); font-size: 12.5px; margin: -6px 0 12px; }
.info-note { background: rgba(59,130,246,.08); border: 1px solid rgba(59,130,246,.25); color: var(--text); border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px; line-height: 1.5; }
.detail-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 18px; }
.detail-head h1 { font-size: 22px; margin: 0; }
.detail-head .sub { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.detail-item { background: var(--bg-panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }
.detail-item .k { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.detail-item .v { font-size: 16px; font-weight: 600; word-break: break-word; }
.totals { margin-left: auto; max-width: 360px; }
.totals .tl { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--border); font-variant-numeric: tabular-nums; }
.totals .tl.grand { border-bottom: 0; font-size: 18px; font-weight: 700; padding-top: 10px; }
.back-link { display: inline-block; color: var(--text-muted); text-decoration: none; font-size: 13px; margin-bottom: 12px; }
.back-link:hover { color: var(--text); }
tfoot td { font-weight: 700; border-top: 1px solid var(--border); }
@media (max-width: 640px) {
  .searchbar .sf { min-width: 100%; }
  .detail-head h1 { font-size: 19px; }
  .detail-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .detail-item .v { font-size: 14.5px; }
  .totals { max-width: none; }
}

/* Login: la tarjeta siempre centrada, aunque la página no traiga el panel de marca (.login-shell).
   Incidente BALAM 2026-10-06: login.php antiguo + este CSS dejaban la tarjeta pegada arriba a la izquierda. */
.login-body:has(> .login-card) { display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-body > .login-card { margin: auto; width: 100%; max-width: 400px; }
@media (max-width: 900px) {
  .login-form-side { padding: 24px 16px; min-height: 100vh; }
}

/* Gráfica de columnas (ChartHelpers::columnChart, 2026-10-06): serie única, rejilla discreta. */
.col-chart { width: 100%; height: auto; max-height: 280px; display: block; margin: 0 auto; }
.col-chart .grid { stroke: var(--border); stroke-width: 1; }
.col-chart .axis { stroke: #33476a; stroke-width: 1; }
.col-chart .tick, .col-chart .xlab { fill: var(--text-muted); font-size: 11px; }
.col-chart .vlab { fill: var(--text); font-size: 11.5px; font-weight: 600; }
.col-chart .bar { fill: var(--accent); }
.col-chart .hit { fill: transparent; }
.col-chart .col:hover .bar { fill: #60a5fa; }
.col-chart .col:hover .hit { fill: rgba(147,163,189,.07); }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 20px; }
.chart-grid .chart-card { min-width: 0; }
@media (min-width: 1100px) { .chart-grid .span-2 { grid-column: span 2; } }
.chart-grid .chart-card { margin-bottom: 0; }
.chart-row { margin-bottom: 20px; }
.chart-card .chart-head { flex-wrap: wrap; gap: 4px 12px; }
@media (max-width: 640px) {
  .col-chart .tick, .col-chart .xlab { font-size: 21px; }
  .col-chart .vlab { font-size: 22px; }
  .chart-card { padding: 14px; }
  .chart-card .chart-head { flex-direction: column; align-items: flex-start; }
}

/* Filtro de periodo con fecha y hora (2026-10-06) */
.filterbar .pf-custom { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin-left: auto; }
.filterbar .pf-field { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--text-muted); }
.filterbar .pf-field input { background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 6px 8px; font-size: 13px; color-scheme: dark; min-height: 36px; }
.filterbar .pf-custom .btn-ghost { min-height: 36px; }
.pf-caption { color: var(--text-muted); font-size: 12.5px; margin: -8px 0 16px; }
.pf-caption strong { color: var(--text); font-weight: 600; }
@media (max-width: 640px) { .filterbar .pf-custom { margin-left: 0; width: 100%; } .filterbar .pf-field { flex: 1 1 140px; } }

/* ---- Asistencia con archivo del checador (BALAM 2026-10-06) ---- */
.kpi-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }
.kpi-card .value.value-sm { font-size: 16px; line-height: 1.3; }
.field input[type=time] { background: var(--bg-panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 9px 10px; font: inherit; min-height: 40px; color-scheme: dark; }
.field .field-label { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.upload-form { margin: 14px 0 6px; }
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 28px 16px; border: 2px dashed var(--border); border-radius: var(--radius); background: var(--bg-panel-2); cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.dropzone:hover, .dropzone:focus-within { border-color: var(--accent); background: rgba(59,130,246,.06); }
.dropzone input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dropzone .dz-title { font-size: 15px; font-weight: 700; color: var(--text); padding: 10px 18px; border-radius: 8px; background: var(--accent); color: #fff; min-height: 44px; display: inline-flex; align-items: center; }
.dropzone .dz-sub { font-size: 12px; color: var(--text-muted); }
.dropzone .dz-file { font-size: 13px; color: var(--text); word-break: break-all; }
.rules { margin: 14px 0 0; padding-left: 18px; color: var(--text-muted); font-size: 13px; line-height: 1.6; }
.err-list { margin: 8px 0 0; padding-left: 18px; font-size: 12.5px; }
.err-list code { font-size: 11.5px; color: var(--text-muted); }
.day-head { font-size: 14px; margin: 18px 0 8px; font-weight: 700; }
.day-head:first-of-type { margin-top: 6px; }
.days-cell { font-size: 12.5px; color: var(--text-muted); min-width: 200px; }
.chip-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip-list a { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; font-size: 13px; }
.chip-list a:hover { border-color: var(--accent); }
.emp-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.emp-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-panel-2); }
.emp-card[open] { border-color: rgba(59,130,246,.5); }
.emp-card summary { list-style: none; display: grid; grid-template-columns: 56px minmax(0, 2fr) minmax(0, 1.6fr) 80px auto; gap: 12px; align-items: center; padding: 12px 14px; cursor: pointer; min-height: 56px; }
.emp-card summary::-webkit-details-marker { display: none; }
.emp-card summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius); }
.emp-id { font-family: ui-monospace, Menlo, monospace; color: var(--text-muted); font-size: 13px; }
.emp-name { font-weight: 600; min-width: 0; }
.emp-name .cell-sub, .emp-sched .cell-sub, .emp-count .cell-sub { display: block; font-weight: 400; }
.emp-count { text-align: right; }
.emp-edit { pointer-events: none; }
.emp-form { padding: 4px 14px 16px; border-top: 1px solid var(--border); }
.emp-form .form-grid { margin-top: 14px; }
.day-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.day-pick { position: relative; }
.day-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.day-pick span { display: inline-flex; align-items: center; justify-content: center; min-width: 52px; min-height: 44px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; cursor: pointer; user-select: none; }
.day-pick input:checked + span { background: rgba(245,158,11,.16); border-color: var(--warn); color: var(--warn); font-weight: 700; }
.day-pick input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 720px) {
  .emp-card summary { grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-areas: "id name count" "id sched edit"; row-gap: 6px; }
  .emp-id { grid-area: id; } .emp-name { grid-area: name; } .emp-sched { grid-area: sched; } .emp-count { grid-area: count; } .emp-edit { grid-area: edit; justify-self: end; }
}

/* ---- 2026-10-07: descarga de reportes en Excel / PDF (Export.php) ---- */
.export-actions { display: inline-flex; gap: 6px; }
.btn-export { display: inline-flex; align-items: center; min-height: 32px; font-weight: 600; color: var(--text); }
.btn-export:hover { border-color: var(--accent-cyan, var(--accent)); }
.btn-export:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 800px) {
  .export-actions { gap: 4px; }
  .btn-export { padding: 4px 7px; font-size: 11.5px; min-height: 30px; }
  .btn-export svg { display: none; }
}
@media (max-width: 480px) {
  .topbar .title { font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .right .status-pill { padding: 4px 6px; }
}
@media print {
  .sidebar, .topbar, .filterbar, .subnav, .export-actions { display: none !important; }
}

/* ---- 2026-10-07: trazabilidad (propinas, descuentos, cancelaciones, usuario) ---- */
.tk-hours { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding-top: 8px; }
.tk-hour { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.tk-bar { width: 100%; background: var(--accent-cyan, var(--accent)); border-radius: 3px 3px 0 0; opacity: .85; }
.tk-hour:hover .tk-bar { opacity: 1; }
.tk-hl { font-size: 9px; color: var(--text-muted); margin-top: 3px; }
.tk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 20px; }
.tk-grid > .panel { margin-bottom: 0; }
.tk-flag { display: inline-block; font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 10px; background: rgba(245,158,11,.14); color: var(--warn); border: 1px solid rgba(245,158,11,.35); margin-left: 6px; white-space: nowrap; }
.tk-section-gap { margin-top: 20px; }

/* 2026-10-13: inventario en línea — campos dentro de tablas de captura (compras, recetas, conteos). */
.field input[type=search], .field input[type=datetime-local], .field input[type=file],
.table-wrap td input[type=number], .table-wrap td select {
  background: var(--bg-panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 8px 10px; font: inherit; min-height: 38px; color-scheme: dark; width: 100%; box-sizing: border-box;
}
.table-wrap td input[type=number] { text-align: right; }
.table-wrap td input:focus, .table-wrap td select:focus, .field input[type=search]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.cnt-table td input[type=number] { max-width: 160px; }
@media (max-width: 640px) {
  .cnt-table th:nth-child(3), .cnt-table td:nth-child(3) { padding-left: 4px; }
  .cnt-table td input[type=number] { max-width: 110px; }
}

/* Confirmación dentro de la página (reemplaza window.confirm). */
.vx-confirm { position: fixed; inset: 0; background: rgba(2,6,23,.66); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 16px; }
.vx-confirm[hidden] { display: none; }
.vx-confirm-box { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 12px; padding: 20px 22px; max-width: 440px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.vx-confirm-msg { margin: 0 0 14px; font-size: 15px; line-height: 1.5; color: var(--text); }
.vx-confirm .form-actions { justify-content: flex-end; margin: 0; }

/* 2026-10-13: Alertas de caja */
a.kpi-card { display: block; color: inherit; text-decoration: none; }
a.kpi-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
details.alert-steps { margin-top: 6px; }
details.alert-steps > summary { cursor: pointer; color: var(--accent); font-size: 12px; min-height: 24px; }
.step-list { margin: 6px 0 0; padding-left: 18px; font-size: 12px; color: var(--text-muted); line-height: 1.6; }

/* 2026-10-14: inventario fácil — menú de 5 pestañas + "Más", primeros pasos, conteo y revisión. */
.inv-subnav { align-items: center; }
.inv-subnav > a, .subnav-more > summary { min-height: 40px; display: inline-flex; align-items: center; padding: 8px 14px; font-size: 13.5px; }
.subnav-more { position: relative; }
.subnav-more > summary { list-style: none; cursor: pointer; color: var(--text-muted); border-radius: 7px; border: 1px solid transparent; gap: 6px; user-select: none; }
.subnav-more > summary::-webkit-details-marker { display: none; }
.subnav-more > summary:hover, .subnav-more[open] > summary { color: var(--text); background: var(--bg-panel-2); }
.subnav-more > summary.active { color: var(--text); background: var(--bg-panel-2); border-color: var(--accent); }
.subnav-more > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.subnav-menu { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 300px; max-width: calc(100vw - 32px); display: flex; flex-direction: column; gap: 2px; padding: 6px; background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0,0,0,.45); }
.subnav-menu a { display: flex; align-items: center; min-height: 44px; padding: 8px 12px; border-radius: 7px; color: var(--text); text-decoration: none; font-size: 14px; border: 1px solid transparent; }
.subnav-menu a:hover, .subnav-menu a:focus-visible { background: var(--bg-panel-2); outline: none; }
.subnav-menu a.active { border-color: var(--accent); }
@media (max-width: 640px) { .subnav-more[open] { flex-basis: 100%; } .subnav-menu { position: static; margin-top: 6px; min-width: 0; max-width: none; box-shadow: none; } }

.inv-guide { border-color: var(--accent); }
.inv-guide-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.inv-guide-head h2 { margin: 0; }
.inv-guide-bar { height: 8px; border-radius: 99px; background: var(--bg-panel-2); overflow: hidden; margin: 12px 0 16px; }
.inv-guide-bar > span { display: block; height: 100%; background: var(--success); border-radius: 99px; }
.inv-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.inv-step { display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-panel-2); }
.inv-step.next { border-color: var(--accent); }
.inv-step.done { opacity: .75; }
.inv-step-top { display: flex; align-items: center; gap: 10px; }
.inv-step-num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; border: 2px solid var(--text-muted); color: var(--text-muted); }
.inv-step.next .inv-step-num { border-color: var(--accent); color: var(--text); }
.inv-step.done .inv-step-num { border-color: var(--success); background: var(--success); color: #04120a; }
.inv-step h3 { margin: 0; font-size: 15px; }
.inv-step p { margin: 0; font-size: 13px; color: var(--text-muted); line-height: 1.5; flex: 1; }
.inv-step .btn { align-self: flex-start; min-height: 40px; }
.inv-step-progress { font-size: 12.5px; color: var(--text); }

.cnt-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
.cnt-progress { font-size: 13px; color: var(--text-muted); padding-bottom: 10px; }
.cnt-progress strong { color: var(--text); }
.rev-kind { white-space: nowrap; }

/* 2026-10-17: insumos — cómo se compra, cómo se usa, cuánto rinde y cuánto cuesta (SupplyCost). */
.badge.warn { background: rgba(245,158,11,.15); color: var(--warn); }
.badge.muted { background: rgba(147,163,189,.15); color: var(--text-muted); }
.ic-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 4px 0 16px; }
.ic-flow-step { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-panel-2); min-width: 140px; }
.ic-flow-step .ic-k { font-size: 11.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.ic-flow-step .ic-v { font-size: 17px; font-weight: 700; }
.ic-flow-arrow { color: var(--text-muted); font-size: 18px; }
.ic-costs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.ic-cost { padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-panel); }
.ic-cost .label { color: var(--text-muted); font-size: 12px; margin-bottom: 6px; }
.ic-cost .value { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ic-cost .value.none { font-size: 14px; font-weight: 600; color: var(--text-muted); }
.ic-src { font-size: 12.5px; color: var(--text-muted); margin-top: 10px; line-height: 1.5; }
.ic-src strong { color: var(--text); }
.ic-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
.ic-table td { vertical-align: top; }
.ic-table .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ic-edit { display: flex; gap: 6px; flex-wrap: nowrap; align-items: center; }
.ic-edit input { background: var(--bg-panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 6px 8px; min-height: 36px; font-size: 13px; }
.table-wrap td .ic-edit input.ic-unit { width: 110px; flex: none; }
.table-wrap td .ic-edit input.ic-factor { width: 82px; flex: none; text-align: right; }
.table-wrap td .ic-edit input[aria-invalid="true"] { border-color: var(--danger); }
.ic-row-msg { display: block; min-height: 16px; font-size: 11.5px; margin-top: 4px; color: var(--text-muted); }
.ic-row-msg.bad { color: var(--danger); }
.ic-row-msg.ok { color: var(--success); }
.ic-flag { display: block; font-size: 11.5px; color: var(--warn); margin-top: 4px; }
.rc-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 12px; margin-top: 14px; }
.rc-line-cost { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rc-line-cost.none { color: var(--warn); font-size: 12px; }

/* 2026-10-17 (Balam): inventario por almacén — accesos rápidos, traspasos y existencias por almacén. */
.inv-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 0 0 16px; }
.inv-action { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; min-height: 44px; background: var(--bg-panel); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius); color: var(--text); text-decoration: none; transition: border-color .15s ease, background .15s ease; }
.inv-action strong { font-size: 15px; }
.inv-action span { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.inv-action:hover { background: var(--bg-panel-2); border-color: var(--accent); }
.inv-action:focus-visible, .kpi-link:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }
.kpi-link { color: var(--text); text-decoration: none; display: block; }
.kpi-link:hover { border-color: var(--accent); }
.inv-neg { color: var(--danger); }
.inv-warn { margin: 12px 0 0; padding: 10px 12px; border: 1px solid var(--warn); border-radius: 8px; color: var(--warn); background: rgba(245, 158, 11, .08); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.inv-wh-table th.num, .inv-wh-table td.num { white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .inv-action { transition: none; } }

/* 2026-10-17 (Balam): captura de conteo por almacén — una tarjeta por insumo, cómoda en el celular. */
.cc-check { display: flex; gap: 6px; align-items: center; min-height: 44px; font-size: 13px; }
.cc-list { display: grid; gap: 8px; margin-top: 8px; }
.cc-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; align-items: center; padding: 12px 14px; background: var(--bg-panel-2); border: 1px solid var(--border); border-left: 3px solid var(--border); border-radius: 8px; }
.cc-row.done { border-left-color: var(--success); }
.cc-row[hidden] { display: none; }
.cc-name strong { display: block; font-size: 14px; line-height: 1.35; }
.cc-meta { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.cc-inputs { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: flex-end; justify-content: flex-end; }
.cc-field { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--text-muted); }
/* 2026-10-18: General en dos apartados (piezas completas / piezas abiertas). */
.cc-tabs { display: flex; gap: 8px; margin: 8px 0 10px; }
.cc-list[data-tab="completas"] .cc-open { display: none; }
.cc-list[data-tab="abiertas"] .cc-closed, .cc-list[data-tab="abiertas"] .cc-qty { display: none; }
.cc-field input { width: 120px; min-height: 44px; font-size: 16px; text-align: right; background: var(--bg-panel); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 8px 10px; }
.cc-field input:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 1px; }
.cc-total { min-width: 110px; text-align: right; font-weight: 700; font-size: 14px; padding-bottom: 12px; }
.cc-total.bad { color: var(--danger); }
.cc-bar { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 14px; padding: 12px 0; background: var(--bg-panel); border-top: 1px solid var(--border); }
.cc-end { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; justify-content: space-between; margin-top: 16px; }
.cc-at { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--text-muted); }
.cc-at input { min-height: 44px; background: var(--bg-panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 8px 10px; color-scheme: dark; }
@media (max-width: 640px) {
  .cc-row { grid-template-columns: 1fr; }
  .cc-inputs { justify-content: flex-start; }
  .cc-field { flex: 1 1 100px; min-width: 0; }
  .cc-field input { width: 100%; }
  .cc-total { flex: 1 0 100%; text-align: left; padding-bottom: 0; }
  .cc-bar { flex-wrap: nowrap; padding: 8px 0; }
  .cc-bar .btn { flex: 1 1 0; min-height: 44px; padding-left: 8px; padding-right: 8px; }
  .cc-end { flex-direction: column; align-items: stretch; }
}

/* 2026-10-17 (Balam): alta de insumo — cuatro preguntas cortas, cómoda en el celular. */
.na-steps { display: grid; gap: 18px; max-width: 560px; }
.na-step label { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.na-n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-dim); color: #fff; font-size: 12px; flex: none; }
.na-step input { min-height: 44px; font-size: 16px; }
.na-factor { display: flex; align-items: center; gap: 10px; }
.na-factor input { width: 160px; }
.na-sug { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 0; padding: 8px 10px; border: 1px dashed var(--accent); border-radius: 8px; font-size: 13px; }
.na-confirm { display: flex; gap: 8px; align-items: center; min-height: 44px; margin-top: 14px; color: var(--warn); }
.na-more { margin-top: 18px; }
.na-more summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--text-muted); }
.na-more summary:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }

/* 2026-10-17 (Balam): contador de pendientes de receta y captura de mínimo/máximo en la ficha. */
.inv-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; }
.mm-in input { width: 64px; min-height: 36px; text-align: right; background: var(--bg-panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 4px 6px; }

/* 2026-10-17 (Balam, URGENTE): autoguardado del conteo y alta de insumo sin salir del conteo. */
.cc-save { flex: 1 1 100%; font-size: 13px; color: var(--text-muted); min-height: 20px; }
.cc-save.ok { color: var(--success); }
.cc-save.warn { color: var(--warning, #f5a524); font-weight: 600; }
.cc-save.bad { color: var(--danger); font-weight: 600; }
.cc-who { display: block; font-size: 11px; color: var(--success); margin-top: 2px; min-height: 0; }
.cc-who:empty { display: none; }
.cc-recovered { margin: 0 0 10px; padding: 10px 12px; border-radius: 8px; background: var(--bg-panel-2); border: 1px solid var(--success); color: var(--text); font-size: 14px; }
.cc-row.cc-new { border-color: var(--accent-cyan); box-shadow: 0 0 0 2px var(--accent-cyan) inset; }
.cc-dlg { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; padding: 18px; background: var(--bg-panel); color: var(--text); border: 1px solid var(--border); border-radius: 12px; }
.cc-dlg::backdrop { background: rgba(0, 0, 0, .6); }
.cc-dlg h2 { margin-top: 0; }
.cc-dlg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.cc-dlg-wide { grid-column: 1 / -1; }
.cc-dlg-f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-muted); }
.cc-dlg-f input, .cc-dlg-f select { min-height: 44px; font-size: 16px; background: var(--bg-panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 8px 10px; }
.cc-dlg-hint { margin: 0; font-size: 13px; }
.cc-dlg-similar { display: grid; gap: 8px; margin-top: 12px; }
.cc-dlg-similar p { margin: 0; font-size: 14px; }
.cc-dlg-similar .btn { min-height: 44px; text-align: left; white-space: normal; }
.cc-dlg-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }
.cc-dlg-actions .btn { min-height: 44px; }
@media (max-width: 560px) {
  .cc-dlg-grid { grid-template-columns: 1fr; }
  .cc-dlg-actions .btn { flex: 1 1 0; }
  #ccAlta { width: 100%; min-height: 44px; }
}
/* 2026-10-17: a 375 px un título largo empujaba «Cerrar sesión» fuera de la pantalla. */
@media (max-width: 720px) {
  .topbar .title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .right { flex: 0 0 auto; }
  .topbar .btn-ghost { white-space: nowrap; padding: 6px 8px; }
}
@media (max-width: 640px) { .cc-bar { flex-wrap: wrap; } .cc-bar .cc-save { flex: 1 1 100%; } }

/* 2026-10-17 19:16: compras con costo con o sin IVA. */
.b-taxbox { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; align-items: flex-end; font-size: 12px; color: var(--text-muted); }
.b-taxbox select { min-height: 32px; font-size: 13px; background: var(--bg-panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 4px 6px; }
.b-taxl { display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.b-more summary { cursor: pointer; font-size: 12px; color: var(--accent-cyan); }
.b-split { display: block; font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.hint.ok { color: var(--success); } .hint.bad { color: var(--danger); }
.tax-set { border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; margin: 0 0 14px; }
.tax-set legend { padding: 0 6px; font-weight: 600; }
.tax-opt { display: flex; gap: 8px; align-items: flex-start; min-height: 44px; padding: 8px 0; font-size: 14px; }
.tax-opt input { margin-top: 3px; }
.b-taxbox .b-mode { min-width: 150px; } .b-taxbox .b-tax { min-width: 64px; }
/* 2026-10-17 19:26: cuánto hay antes de traspasar. */
.t-stock { font-size: 12px; color: var(--text-muted); margin-top: 6px; display: grid; gap: 3px; max-width: 340px; white-space: normal; }
.t-stock:empty { display: none; }
.t-stock .t-after { color: var(--text); font-weight: 600; }
.t-stock .t-after.inv-neg { color: var(--danger); }
.t-stock .btn.small { min-height: 32px; margin-left: 4px; }
/* 2026-10-17 19:26: traspaso en celular — cada insumo como tarjeta, con lo que hay a la vista. */
@media (max-width: 640px) {
  #trTable thead { display: none; }
  #trTable, #trTable tbody, #trTable tr, #trTable td { display: block; width: 100%; }
  #trTable tr { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; background: var(--bg-panel-2); }
  #trTable td { padding: 4px 0; text-align: left; border: 0; }
  #trTable input, #trTable select { width: 100% !important; min-width: 0 !important; min-height: 44px; }
  #trTable td:nth-child(3)::before { content: 'Se traspasa en'; display: block; font-size: 11px; color: var(--text-muted); }
  #trTable td:nth-child(4)::before { content: 'Cantidad'; display: block; font-size: 11px; color: var(--text-muted); }
  #trTable td.t-base::before { content: 'Equivale a: '; color: var(--text-muted); }
  #trTable td.t-left::before { content: 'Queda en origen: '; color: var(--text-muted); }
  #trTable .t-stock { max-width: none; font-size: 13px; }
  #trTable .t-del { width: 100%; min-height: 40px; }
}
@media (max-width: 640px) { #trTable .t-del::after { content: ' Quitar'; } }

/* 2026-10-18 (C11): alta rápida de insumo desde Compras (usa el panel .cc-dlg del conteo). */
#altaPanel [hidden] { display: none !important; }
#altaPanel .cc-dlg-hint.muted { margin: 0 0 12px; }
#altaPanel .cc-dlg-actions a.btn { display: inline-flex; align-items: center; justify-content: center; }
/* 2026-10-18 (C12): sustitutos de receta. */
.sus-f { width: 72px; min-height: 40px; text-align: right; background: var(--bg-panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 4px 8px; }
.sus-s { min-width: 180px; min-height: 40px; }
/* 2026-10-22: compras — subir factura o ticket */
.scan-panel { border-style: dashed; border-color: var(--accent-dim); }
.scan-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.scan-row h2 { margin: 0 0 4px; }
.scan-hint { margin: 0; max-width: 62ch; font-size: 13px; }
.scan-pick { cursor: pointer; white-space: nowrap; }
.scan-pick:focus-within { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }
.scan-msg:empty { display: none; }
.scan-msg { margin-top: 12px; font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.scan-msg .s-ok { color: var(--success); } .scan-msg .s-bad { color: var(--danger); } .scan-msg .s-warn { color: var(--warn); }
.b-scan { margin-top: 6px; padding: 6px 8px; border-left: 3px solid var(--warn); background: var(--bg-panel-2); border-radius: 4px; font-size: 12px; max-width: 320px; }
.b-scan.done { border-left-color: var(--success); }
.b-scan .b-sdesc { display: block; color: var(--text); margin-bottom: 4px; overflow-wrap: anywhere; }
.b-scan .b-sopts { display: flex; flex-wrap: wrap; gap: 4px; }
.b-scan .btn.small { min-height: 28px; font-size: 12px; padding: 3px 8px; }
/* 2026-10-23: buscador de insumos en Capturar compra */
.b-drop { position: fixed; z-index: 60; max-height: 320px; overflow-y: auto; background: var(--bg-panel); border: 1px solid var(--accent-dim); border-radius: 8px; box-shadow: var(--shadow); padding: 4px; }
.b-opt { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.b-opt.on, .b-opt:hover { background: var(--bg-panel-2); outline: 1px solid var(--border); }
.b-opt-n { color: var(--text); overflow-wrap: anywhere; }
.b-opt-c { color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.b-drop-none { padding: 8px 10px; font-size: 13px; color: var(--text-muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* VORVEX asis-mes 2026-10-29: resumen mensual de asistencia */
.asis-month span.active{font-weight:600}
.asis-sum td,.asis-sum th{vertical-align:middle}
.asis-sum a.cell-main{color:inherit;text-decoration:none;font-weight:600}
.asis-sum a.cell-main:hover{text-decoration:underline}
.asis-sum tfoot th{border-top:2px solid rgba(127,127,127,.35)}
.asis-strip{display:inline-flex;gap:2px;text-decoration:none;flex-wrap:nowrap}
.asis-d{display:inline-flex;align-items:center;justify-content:center;width:16px;height:18px;border-radius:3px;font-size:10px;font-weight:700;line-height:1;color:#fff;background:rgba(127,127,127,.12)}
.asis-d.ok{background:#2e9e5b}
.asis-d.late{background:#e08a00}
.asis-d.noexit{background:#c9a400}
.asis-d.early{background:#8a5cc7}
.asis-d.in{background:#2f7bd6}
.asis-d.absent{background:#d23c3c}
.asis-d.nopunch{background:rgba(127,127,127,.35);color:inherit}
.asis-d.rest{background:rgba(127,127,127,.18);color:inherit;font-weight:400}
.asis-d.none{background:rgba(127,127,127,.08)}
.asis-legend{margin-top:10px;font-size:12px;line-height:2}
.asis-legend .asis-d{vertical-align:middle}
tr.asis-off td{opacity:.75}
.asis-d.noentry{background:#d9772b}
.asis-d.nr{background:rgba(127,127,127,.45);color:inherit;font-weight:600;font-size:9px}
tr.asis-ev th{font-weight:500;font-size:12px}

/* VORVEX reportes 2026-10-29: reportes estilo SoftRestaurant */
.rep-grid{display:grid;grid-template-columns:minmax(260px,1fr) minmax(320px,1.3fr);gap:20px}
@media (max-width:860px){.rep-grid{grid-template-columns:1fr}}
.rep-label{font-weight:600;margin-bottom:6px}
.rep-list{max-height:520px;overflow:auto;border:1px solid rgba(127,127,127,.25);border-radius:8px;padding:6px}
.rep-group{font-size:11px;text-transform:uppercase;letter-spacing:.06em;opacity:.7;margin:10px 6px 4px}
.rep-group:first-child{margin-top:2px}
.rep-item{display:block;padding:6px 8px;border-radius:6px;cursor:pointer;line-height:1.3}
.rep-item:hover{background:rgba(127,127,127,.1)}
.rep-item.sel{background:rgba(47,123,214,.18);font-weight:600}
.rep-item.off{opacity:.6}
.rep-item input{margin-right:6px}
.rep-box{border:1px solid rgba(127,127,127,.25);border-radius:8px;padding:10px 12px;margin:0 0 12px}
.rep-box legend{font-weight:600;padding:0 6px}
.rep-radios{display:flex;gap:18px;flex-wrap:wrap;margin-bottom:8px}
.rep-fields{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px;margin-bottom:6px}
.rep-f{display:flex;flex-direction:column;gap:4px;font-size:12px}
.rep-f input,.rep-f select{font-size:14px}
.rep-check{display:block;font-size:13px;margin:4px 0}
.rep-groups{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:0 12px;max-height:220px;overflow:auto;margin-top:8px}
.rep-hint{font-size:12px;margin:6px 0 0}
.rep-actions{display:flex;justify-content:flex-end}
.rep-run{min-width:140px}
.rep-head h2{margin-bottom:4px}
.rep-table tr.rep-grp td{font-weight:700;background:rgba(127,127,127,.12)}
.rep-table tr.rep-sub td{font-weight:600;border-top:1px solid rgba(127,127,127,.35)}
.rep-table tr.rep-canc td{opacity:.6;text-decoration:line-through}
.rep-table tr.rep-canc td:last-child{text-decoration:none}
.rep-heat td.heat-1{background:rgba(46,158,91,.12)}
.rep-heat td.heat-2{background:rgba(46,158,91,.25)}
.rep-heat td.heat-3{background:rgba(46,158,91,.4)}
.rep-heat td.heat-4{background:rgba(46,158,91,.55)}
.rep-heat td.heat-5{background:rgba(46,158,91,.75)}
