/* ============================================================
   Aplicativo TPV · hoja de estilos
   ============================================================ */
:root {
  --bg: #f2eee7;
  --surface: #fffdf9;
  --surface-2: #f8f4ed;
  --surface-3: #efe8dc;
  --ink: #1c2228;
  --ink-soft: #39424b;
  --muted: #737d86;
  --line: #e4dccf;
  --line-strong: #d2c6b4;
  --sidebar: #141b21;
  --sidebar-2: #1c262e;
  --accent: #b00000;
  --accent-dark: #8a0000;
  --accent-soft: #f7e3e3;
  --green: #2f7d5b;
  --green-soft: #e2f1e9;
  --red: #b23a3a;
  --red-soft: #f8e4e4;
  --amber: #a96f16;
  --amber-soft: #fbf0d9;
  --blue: #2e6f95;
  --blue-soft: #e3eef5;
  --shadow: 0 12px 32px rgba(28, 34, 40, 0.09);
  --shadow-sm: 0 4px 14px rgba(28, 34, 40, 0.06);
  --radius: 18px;
  --radius-sm: 12px;
  --font: ui-sans-serif, "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1100px 560px at 100% 0%, #fff8ec 0%, transparent 62%),
    radial-gradient(900px 520px at 0% 100%, #e7efe9 0%, transparent 58%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, p { margin: 0; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ------------------------------------------------------------
   Estructura
   ------------------------------------------------------------ */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.main { min-width: 0; display: flex; flex-direction: column; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 18px;
  padding: 22px 16px 18px;
  color: #eef2f4;
  background:
    radial-gradient(420px 260px at 0% 0%, rgba(176, 0, 0, 0.26), transparent 70%),
    linear-gradient(180deg, var(--sidebar) 0%, #10161b 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 30;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 6px 8px; }
.brand-mark {
  width: 58px; height: 46px; border-radius: 12px;
  display: grid; place-items: center; padding: 5px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
}
.brand-mark img, .brand-mark svg { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 15px; letter-spacing: -0.01em; }
.brand-text span { font-size: 11.5px; color: #94a3ad; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 11px;
  color: #b7c2ca; font-size: 14px; font-weight: 500;
  transition: background 0.16s, color 0.16s, transform 0.16s;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; text-decoration: none; }
.nav-item.active { background: rgba(176, 0, 0, 0.22); color: #fff; }
.nav-item.active::before {
  content: ""; position: absolute; left: -16px; top: 9px; bottom: 9px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav-item .icon { width: 19px; height: 19px; opacity: 0.9; }
.nav-item.active .icon { color: #ff9d78; }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 9px; }
.drawer-btn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; padding: 13px 12px; border: 0; border-radius: 12px;
  color: #fff; font-weight: 700; font-size: 14px;
  background: linear-gradient(135deg, #c81e1e, var(--accent) 55%, var(--accent-dark));
  box-shadow: 0 10px 22px rgba(176, 0, 0, 0.3);
  transition: transform 0.12s, box-shadow 0.12s, filter 0.12s;
}
.drawer-btn:hover { filter: brightness(1.08); box-shadow: 0 12px 26px rgba(176, 0, 0, 0.38); }
.drawer-btn:active { transform: translateY(1px) scale(0.995); }
.drawer-btn:disabled { opacity: 0.65; cursor: wait; }
.hw-chip {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 9px 11px;
  background: rgba(255, 255, 255, 0.055); border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px; color: #b9c4cc; font-size: 12px; text-align: left;
}
.hw-chip:hover { background: rgba(255, 255, 255, 0.09); }
.hw-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 3px rgba(169, 111, 22, 0.18); flex: none; }
.hw-chip.ok .hw-dot { background: #4ecb8b; box-shadow: 0 0 0 3px rgba(78, 203, 139, 0.16); }
.hw-chip.off .hw-dot { background: #7d8890; box-shadow: none; }
.hw-chip.error .hw-dot { background: #ff7b7b; box-shadow: 0 0 0 3px rgba(255, 123, 123, 0.16); }
.version { font-size: 10.5px; color: #68747d; text-align: center; letter-spacing: 0.04em; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 16px 28px;
  background: rgba(242, 238, 231, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(210, 198, 180, 0.55);
}
.page-heading h1 { font-size: 24px; letter-spacing: -0.03em; line-height: 1.15; }
.page-heading p { margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.today-chip {
  padding: 8px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft);
  box-shadow: var(--shadow-sm); white-space: nowrap;
}
.today-chip .pos { color: var(--green); }
.clock { display: flex; flex-direction: column; align-items: flex-end; min-width: 78px; }
.clock #clock-time { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.clock #clock-date { font-size: 10.5px; color: var(--muted); text-transform: capitalize; }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 11px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-soft); box-shadow: var(--shadow-sm);
  transition: background 0.15s, transform 0.12s;
}
.icon-btn:hover { background: #fff; }
.icon-btn:active { transform: scale(0.96); }
.mobile-drawer { display: none; }

.view { width: 100%; max-width: 1560px; margin: 0 auto; padding: 24px 28px 48px; }

/* ------------------------------------------------------------
   Login inspirado en la identidad Avannubo
   ------------------------------------------------------------ */
body.auth-pending .app { display: none; }
.login-screen {
  position: fixed; inset: 0; z-index: 400; overflow: hidden;
  background: #000 url('/assets/login-bg-plesk.png') center center / cover no-repeat;
}
.login-card {
  position: absolute; left: 50%; top: 50%; z-index: 2;
  width: min(392px, 92vw); padding: 28px 28px 20px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(62, 32, 32, 0.9), rgba(26, 13, 13, 0.95));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(14px);
  color: #fff;
}
.login-wordmark {
  display: block;
  width: 240px; max-width: 100%; height: auto;
  margin-bottom: 24px;
}
.login-field { margin-bottom: 14px; }
.login-field label {
  display: block; margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.72); font-size: 12px; font-weight: 650;
}
.login-field .input {
  width: 100%; min-height: 48px;
  padding: 12px 18px;
  border: 0; border-radius: 999px;
  background: #fff; color: #1e2328;
  font-size: 15px; outline: none;
}
.login-field .input:focus { box-shadow: 0 0 0 3px rgba(255, 90, 90, 0.28); }
.password-wrap { position: relative; }
.password-wrap .input { padding-right: 50px; }
.password-toggle {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: transparent; color: #6b7075;
}
.password-toggle:hover { background: #f0efec; color: #b00000; }
.password-toggle .icon { width: 18px; height: 18px; }
.login-submit {
  width: 100%; min-height: 50px; margin-top: 8px;
  border: 0; border-radius: 999px;
  background: #c40000; color: #fff;
  font-size: 16px; font-weight: 800; letter-spacing: 0.03em;
  box-shadow: 0 10px 24px rgba(196, 0, 0, 0.35);
}
.login-submit:hover { background: #a80000; }
.login-submit:disabled { opacity: 0.7; cursor: wait; }
.login-error {
  margin-bottom: 12px; padding: 10px 13px;
  border: 1px solid rgba(255, 70, 70, 0.25);
  border-radius: 10px;
  background: rgba(255, 60, 60, 0.16);
  color: #ffb3b3;
  font-size: 12.5px; line-height: 1.4;
}
.login-foot {
  margin-top: 18px; text-align: center;
  color: rgba(255, 255, 255, 0.38);
  font-size: 11px; letter-spacing: 0.04em;
}
@media (max-width: 900px) {
  .login-card { width: min(392px, 92vw); }
}
@media (max-width: 520px) {
  .login-card { padding: 24px 22px 18px; }
  .login-wordmark { width: 210px; }
}

/* ------------------------------------------------------------
   Componentes genéricos
   ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 15px; border-radius: 11px; border: 1px solid transparent;
  font-size: 13.5px; font-weight: 650; line-height: 1.2; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.12s, box-shadow 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn .icon { width: 17px; height: 17px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(176, 0, 0, 0.24); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #2a333b; }
.btn-success { background: var(--green); color: #fff; box-shadow: 0 6px 16px rgba(47, 125, 91, 0.22); }
.btn-success:hover { background: #266a4c; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #983030; }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: transparent; }
.btn-ghost:hover { background: var(--surface-3); }
.btn-outline { background: var(--surface); border-color: var(--line); color: var(--ink-soft); box-shadow: var(--shadow-sm); }
.btn-outline:hover { border-color: var(--line-strong); background: #fff; }
.btn-soft { background: var(--accent-soft); color: var(--accent-dark); }
.btn-soft:hover { background: #efcaca; }
.btn-sm { padding: 7px 11px; font-size: 12.5px; border-radius: 9px; }
.btn-lg { padding: 14px 20px; font-size: 15px; border-radius: 13px; }
.btn-block { width: 100%; }
.btn-icon { width: 34px; height: 34px; padding: 0; border-radius: 9px; }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.section-head h2 { font-size: 19px; letter-spacing: -0.02em; }
.section-head p { margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.section-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { position: relative; overflow: hidden; padding: 15px 17px; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow-sm); }
.kpi::after { content: ""; position: absolute; right: -18px; top: -18px; width: 68px; height: 68px; border-radius: 50%; background: var(--accent-soft); opacity: 0.6; }
.kpi .kpi-label { font-size: 11.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.kpi .kpi-value { margin-top: 5px; font-size: 24px; font-weight: 750; letter-spacing: -0.03em; }
.kpi .kpi-hint { margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.kpi.accent::after { background: var(--accent-soft); }
.kpi.green .kpi-value { color: var(--green); }
.kpi.amber .kpi-value { color: var(--amber); }

.chip-row { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-soft);
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.chip:hover { border-color: var(--line-strong); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-grey { background: var(--surface-3); color: var(--muted); }

.empty-state { padding: 38px 20px; text-align: center; color: var(--muted); }
.empty-state .empty-icon { width: 52px; height: 52px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 16px; background: var(--surface-3); color: var(--muted); }
.empty-state .empty-icon .icon { width: 25px; height: 25px; }
.empty-state h3 { font-size: 15px; color: var(--ink-soft); }
.empty-state p { margin-top: 4px; font-size: 12.5px; max-width: 380px; margin-left: auto; margin-right: auto; }
.empty-state .btn { margin-top: 14px; }

.loading-screen { min-height: 50vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--muted); font-size: 13px; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------
   Salón
   ------------------------------------------------------------ */
.table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 13px; }
.table-card {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  min-height: 148px; padding: 15px;
  text-align: left; border-radius: 16px; border: 1px solid var(--line);
  background: var(--surface); box-shadow: var(--shadow-sm);
  transition: transform 0.14s, box-shadow 0.14s, border-color 0.14s;
}
.table-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.table-card:active { transform: translateY(0); }
.table-card.occupied { background: linear-gradient(165deg, #fffaf3 0%, #fffdf9 70%); border-color: #e7c9b8; }
.table-card.occupied::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 16px 0 0 16px; background: var(--accent); }
.table-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.zone-pill { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.table-status { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 650; color: var(--muted); }
.table-status .dot { width: 7px; height: 7px; border-radius: 50%; background: #b9c1c7; }
.table-card.occupied .table-status { color: var(--accent-dark); }
.table-card.occupied .table-status .dot { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.table-name { font-size: 21px; font-weight: 750; letter-spacing: -0.03em; }
.table-meta { font-size: 11.5px; color: var(--muted); }
.table-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.table-time { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.table-foot strong { font-size: 16px; letter-spacing: -0.02em; color: var(--ink); }

/* ------------------------------------------------------------
   Pedido / venta
   ------------------------------------------------------------ */
.order-header {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.order-title { display: flex; align-items: center; gap: 13px; min-width: 0; }
.order-title .back { width: 38px; height: 38px; }
.order-title h2 { font-size: 23px; letter-spacing: -0.03em; }
.order-title .order-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 3px; font-size: 12px; color: var(--muted); }
.order-title .order-meta span { display: inline-flex; align-items: center; gap: 4px; }
.order-title .order-meta .icon { width: 13px; height: 13px; }
.order-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.order-layout { display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(360px, 0.78fr); gap: 18px; align-items: start; }
.catalog-panel { padding: 18px; }
.catalog-search { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.search-box { position: relative; flex: 1; }
.search-box .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.search-box input {
  width: 100%; padding: 10px 12px 10px 37px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2);
  font-size: 13.5px; outline: none;
}
.search-box input:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px var(--accent-soft); }

.category-bar { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; scrollbar-width: thin; }
.category-bar .chip { flex: none; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 9px; }
.product-card {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 10px;
  min-height: 82px; padding: 12px 12px 11px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  text-align: left; transition: border-color 0.14s, transform 0.12s, box-shadow 0.14s, background 0.14s;
}
.product-card:hover { border-color: var(--accent); background: #fffaf6; box-shadow: var(--shadow-sm); }
.product-card:active { transform: scale(0.985); }
.product-card .p-name { font-size: 13px; font-weight: 650; line-height: 1.3; }
.product-card .p-price { font-size: 14.5px; font-weight: 750; color: var(--accent-dark); letter-spacing: -0.02em; }
.product-card .p-cat { display: flex; align-items: center; gap: 5px; font-size: 9.5px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.product-card .p-cat i { width: 6px; height: 6px; border-radius: 50%; background: var(--cat, var(--accent)); }
.product-card.disabled { opacity: 0.45; pointer-events: none; }

.ticket-panel {
  position: sticky; top: 92px;
  display: flex; flex-direction: column;
  max-height: calc(100vh - 116px);
  background: #fffdf7; border: 1px solid #e6ddcc; border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.ticket-head { padding: 16px 18px 12px; border-bottom: 1px dashed var(--line-strong); }
.ticket-head .t-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ticket-head h3 { font-size: 17px; letter-spacing: -0.02em; }
.ticket-head .t-sub { margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.ticket-scroll { flex: 1; overflow-y: auto; padding: 8px 18px; min-height: 120px; }
.ticket-empty { padding: 34px 10px; text-align: center; color: var(--muted); font-size: 12.5px; }
.ticket-empty .icon { width: 30px; height: 30px; margin-bottom: 8px; opacity: 0.45; }
.ticket-line { padding: 10px 0; border-bottom: 1px dotted var(--line); }
.ticket-line:last-child { border-bottom: 0; }
.tl-main { display: flex; align-items: flex-start; gap: 8px; }
.tl-name { flex: 1; font-size: 13px; font-weight: 600; line-height: 1.3; }
.tl-name small { display: block; margin-top: 2px; font-size: 10.5px; font-weight: 500; color: var(--muted); }
.tl-total { font-size: 13px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tl-actions { display: flex; align-items: center; gap: 6px; margin-top: 7px; }
.qty { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.qty button { width: 25px; height: 25px; display: grid; place-items: center; border: 0; background: transparent; color: var(--ink-soft); border-radius: 7px; }
.qty button:hover { background: var(--surface-3); }
.qty span { min-width: 20px; text-align: center; font-size: 12px; font-weight: 700; }
.tl-note { margin-top: 4px; padding: 4px 7px; border-radius: 6px; background: var(--amber-soft); color: #7a5710; font-size: 10.5px; }
.tl-note-btn { border: 0; background: transparent; color: var(--muted); font-size: 10.5px; padding: 4px 2px; }
.tl-note-btn:hover { color: var(--accent-dark); }
.tl-del { border: 0; background: transparent; color: #b9a99a; width: 25px; height: 25px; display: grid; place-items: center; border-radius: 7px; }
.tl-del:hover { background: var(--red-soft); color: var(--red); }
.tl-del .icon { width: 14px; height: 14px; }

.ticket-totals { padding: 13px 18px; border-top: 1px dashed var(--line-strong); background: #fffaf1; }
.t-row { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; font-size: 12px; color: var(--muted); }
.t-row strong { color: var(--ink-soft); font-weight: 650; }
.t-row.discount { color: var(--green); }
.t-total { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 9px; padding-top: 10px; border-top: 1px solid var(--line); }
.t-total span { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.t-total strong { font-size: 27px; font-weight: 800; letter-spacing: -0.04em; }
.ticket-foot { padding: 12px 18px 16px; display: flex; flex-direction: column; gap: 8px; }
.ticket-foot .pay-btn { width: 100%; padding: 15px; font-size: 16px; border-radius: 13px; }
.ticket-foot .foot-row { display: flex; gap: 8px; }
.ticket-foot .foot-row .btn { flex: 1; }

/* ------------------------------------------------------------
   Formularios
   ------------------------------------------------------------ */
.form-grid { display: grid; gap: 13px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font-size: 11.5px; font-weight: 700; color: var(--ink-soft); letter-spacing: 0.01em; }
.field .hint { font-size: 10.5px; color: var(--muted); line-height: 1.35; }
.input, .select, .textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px;
  background: #fff; font-size: 13.5px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.textarea { min-height: 74px; resize: vertical; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.input-group { display: flex; align-items: center; }
.input-group .input { border-radius: 10px 0 0 10px; }
.input-group .suffix { padding: 10px 12px; border: 1px solid var(--line); border-left: 0; border-radius: 0 10px 10px 0; background: var(--surface-2); font-size: 13px; color: var(--muted); }
.check { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; }
.check input { width: 17px; height: 17px; margin-top: 1px; accent-color: var(--accent); }
.check span { font-size: 12.5px; color: var(--ink-soft); line-height: 1.35; }
.check small { display: block; color: var(--muted); font-size: 10.5px; }
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-3); border-radius: 10px; }
.segmented button { border: 0; background: transparent; padding: 7px 13px; border-radius: 8px; font-size: 12.5px; font-weight: 650; color: var(--muted); }
.segmented button.active { background: #fff; color: var(--ink); box-shadow: 0 2px 6px rgba(28,34,40,.08); }

/* ------------------------------------------------------------
   Modal
   ------------------------------------------------------------ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 18px;
  background: rgba(15, 21, 26, 0.55); backdrop-filter: blur(4px);
  animation: fadeIn 0.16s ease-out;
}
.modal {
  width: 100%; max-width: 620px; max-height: 92vh;
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: 20px;
  box-shadow: 0 30px 80px rgba(10, 15, 20, 0.35);
  animation: popIn 0.18s ease-out;
  overflow: hidden;
}
.modal.lg { max-width: 820px; }
.modal.xl { max-width: 1040px; }
.modal-head { display: flex; align-items: flex-start; gap: 14px; padding: 19px 22px 14px; border-bottom: 1px solid var(--line); }
.modal-head .m-title { flex: 1; min-width: 0; }
.modal-head h2 { font-size: 19px; letter-spacing: -0.02em; }
.modal-head p { margin-top: 2px; font-size: 12px; color: var(--muted); }
.modal-close { width: 32px; height: 32px; border: 0; border-radius: 9px; background: var(--surface-3); color: var(--ink-soft); display: grid; place-items: center; flex: none; }
.modal-close:hover { background: var(--line); }
.modal-body { padding: 19px 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px 19px; border-top: 1px solid var(--line); background: var(--surface-2); flex-wrap: wrap; }
.modal-foot .spacer { margin-right: auto; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(0.985); } }

/* ------------------------------------------------------------
   Cobro
   ------------------------------------------------------------ */
.pay-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 15px; flex-wrap: wrap; }
.pay-total span { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.pay-total strong { font-size: 32px; font-weight: 800; letter-spacing: -0.04em; }
.invoice-fields { padding: 14px; margin-bottom: 15px; border: 1px solid #ead7c6; border-radius: 13px; background: #fffaf3; }
.invoice-fields .hint { margin-top: 8px; font-size: 10.5px; color: var(--muted); }
.pay-methods { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 15px; }
.pay-method {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 13px 8px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); font-size: 12px; font-weight: 650; color: var(--ink-soft);
  transition: border-color 0.14s, background 0.14s, transform 0.12s;
}
.pay-method .icon { width: 21px; height: 21px; }
.pay-method:hover { border-color: var(--line-strong); background: #fff; }
.pay-method.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); box-shadow: 0 0 0 3px rgba(176, 0, 0, 0.1); }
.pay-method:disabled { opacity: 0.4; cursor: not-allowed; }
.pay-detail { padding: 14px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--line); }
.cash-display { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 7px 0 12px; padding: 13px 16px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.cash-display .amount { font-size: 30px; font-weight: 800; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.cash-display .label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.quick-cash { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-bottom: 11px; }
.quick-cash button { padding: 8px 4px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 12px; font-weight: 650; }
.quick-cash button:hover { border-color: var(--accent); color: var(--accent-dark); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.keypad button { padding: 11px 4px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 16px; font-weight: 650; }
.keypad button:hover { background: var(--surface-3); }
.keypad button.span-2 { grid-column: span 2; }
.change-line { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--line-strong); font-size: 12.5px; color: var(--muted); }
.change-line strong { font-size: 19px; color: var(--green); letter-spacing: -0.02em; }
.change-line.negative strong { color: var(--red); }
.pay-note { display: flex; gap: 9px; padding: 12px; border-radius: 10px; background: var(--blue-soft); color: #245a78; font-size: 12px; line-height: 1.4; }
.pay-note .icon { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.pay-summary-line { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 12.5px; color: var(--muted); }
.pay-summary-line strong { color: var(--ink); }
.pay-summary-line.total { margin-top: 5px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink); }
.pay-summary-line.total strong { font-size: 19px; }

.success-hero { text-align: center; padding: 8px 0 18px; }
.success-icon { width: 66px; height: 66px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); }
.success-icon .icon { width: 34px; height: 34px; stroke-width: 2.4; }
.success-hero h2 { font-size: 22px; letter-spacing: -0.03em; }
.success-hero p { margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.success-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 16px; }
.success-grid > div { padding: 12px 14px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); }
.success-grid span { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.success-grid strong { display: block; margin-top: 3px; font-size: 16px; letter-spacing: -0.02em; }
.success-grid strong.warn { color: var(--amber); font-size: 13px; }
.success-grid strong.err { color: var(--red); font-size: 13px; }
.success-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.success-actions .btn { flex: 1; }

/* ------------------------------------------------------------
   Tablas de datos / ventas
   ------------------------------------------------------------ */
.toolbar { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .search-box { min-width: 220px; flex: 1; max-width: 360px; }
.toolbar .grow { flex: 1; }
.data-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.data-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.data-table th { text-align: left; padding: 10px 14px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 11px 14px; font-size: 12.5px; border-bottom: 1px solid #eee7dc; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { cursor: pointer; transition: background 0.12s; }
.data-table tbody tr:hover { background: #fffaf4; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; }
.data-table .mono { font-family: var(--mono); font-size: 11.5px; }
.data-table .muted { color: var(--muted); }
.row-title { font-weight: 650; }
.row-sub { font-size: 10.5px; color: var(--muted); margin-top: 1px; }

.list-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; }
.list-row { display: flex; align-items: center; gap: 13px; padding: 13px 16px; border-bottom: 1px solid #eee7dc; }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: #fffaf4; }
.list-row .lr-main { flex: 1; min-width: 0; }
.list-row .lr-title { font-size: 13px; font-weight: 650; }
.list-row .lr-sub { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.list-row .lr-amount { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------
   Cierre de caja
   ------------------------------------------------------------ */
.cash-hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 16px; margin-bottom: 18px; }
.cash-card { padding: 20px; }
.cash-status { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.cash-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.cash-status.closed .dot { background: var(--muted); box-shadow: none; }
.cash-amount { margin-top: 10px; font-size: 36px; font-weight: 800; letter-spacing: -0.045em; }
.cash-amount small { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.cash-meta { margin-top: 4px; font-size: 12px; color: var(--muted); }
.method-list { display: flex; flex-direction: column; gap: 2px; }
.method-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed #eee7dc; font-size: 12.5px; }
.method-row:last-child { border-bottom: 0; }
.method-row .m-name { display: flex; align-items: center; gap: 7px; color: var(--muted); }
.method-row .m-name i { width: 8px; height: 8px; border-radius: 50%; background: var(--method, var(--line-strong)); }
.method-row strong { font-variant-numeric: tabular-nums; }
.movement-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed #eee7dc; font-size: 12px; }
.movement-row:last-child { border-bottom: 0; }
.movement-row .mv-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--green-soft); color: var(--green); flex: none; }
.movement-row.out .mv-icon { background: var(--red-soft); color: var(--red); }
.movement-row .mv-main { flex: 1; }
.movement-row .mv-sub { font-size: 10.5px; color: var(--muted); }
.movement-row strong { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------
   Ajustes
   ------------------------------------------------------------ */
.settings-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 18px; align-items: start; }
.settings-nav { display: flex; flex-direction: column; gap: 4px; padding: 8px; position: sticky; top: 92px; }
.settings-nav button { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; text-align: left; }
.settings-nav button:hover { background: var(--surface-2); color: var(--ink-soft); }
.settings-nav button.active { background: var(--accent-soft); color: var(--accent-dark); }
.settings-content { padding: 22px; }
.settings-section-title { font-size: 17px; letter-spacing: -0.02em; margin-bottom: 3px; }
.settings-section-sub { font-size: 12px; color: var(--muted); margin-bottom: 18px; }
.settings-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.hardware-status { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 18px; }
.hardware-status .hs-icon { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-dark); flex: none; }
.hardware-status .hs-main { flex: 1; }
.hardware-status .hs-title { font-size: 13px; font-weight: 700; }
.hardware-status .hs-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.settings-block { padding: 16px; border: 1px solid var(--line); border-radius: 13px; margin-bottom: 14px; background: var(--surface); }
.settings-block h3 { font-size: 13.5px; margin-bottom: 2px; }
.settings-block .block-sub { font-size: 11px; color: var(--muted); margin-bottom: 12px; }
.install-steps { margin: 16px 0 0; padding-left: 24px; color: var(--ink-soft); font-size: 14px; line-height: 1.7; }
.install-steps li { margin-bottom: 5px; }
.install-steps .mono { background: var(--surface-2); padding: 1px 6px; border-radius: 5px; font-size: 12.5px; }
.help-box { display: flex; gap: 10px; padding: 12px 14px; border-radius: 11px; background: var(--amber-soft); color: #74510e; font-size: 11.5px; line-height: 1.5; }
.help-box .icon { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.app-hero { display: flex; align-items: center; gap: 16px; padding: 18px; border-radius: 14px; background: linear-gradient(145deg, #1e2a33, #141b21); color: #fff; margin-bottom: 16px; }
.app-hero .app-icon { width: 58px; height: 58px; border-radius: 15px; display: grid; place-items: center; background: linear-gradient(145deg, #c81e1e, var(--accent)); box-shadow: 0 8px 20px rgba(176,0,0,.3); flex: none; }
.app-hero .app-icon .icon { width: 28px; height: 28px; }
.app-hero h3 { font-size: 16px; }
.app-hero p { margin-top: 3px; font-size: 11.5px; color: #aab7c0; }

/* ------------------------------------------------------------
   Toasts
   ------------------------------------------------------------ */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100vw - 36px)); }
.toast {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px;
  border-radius: 12px; background: #1d262d; color: #fff;
  box-shadow: 0 16px 40px rgba(10, 15, 20, 0.3);
  animation: toastIn 0.2s ease-out;
  border-left: 4px solid var(--accent);
}
.toast.success { border-left-color: #4ecb8b; }
.toast.error { border-left-color: #ff7b7b; }
.toast.warning { border-left-color: #f0b429; }
.toast .t-icon { width: 20px; height: 20px; flex: none; margin-top: 1px; color: #4ecb8b; }
.toast.error .t-icon { color: #ff7b7b; }
.toast.warning .t-icon { color: #f0b429; }
.toast .t-main { flex: 1; min-width: 0; }
.toast .t-title { font-size: 12.5px; font-weight: 650; line-height: 1.35; }
.toast .t-detail { margin-top: 2px; font-size: 10.5px; color: #aab7c0; line-height: 1.35; }
.toast .t-action { margin-top: 6px; display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 650; color: #ffb08f; }
.toast .t-close { border: 0; background: transparent; color: #7d8a93; padding: 0 0 0 4px; font-size: 15px; line-height: 1; }
.toast .t-close:hover { color: #fff; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* ------------------------------------------------------------
   Detalles varios
   ------------------------------------------------------------ */
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.tiny { font-size: 10.5px; }
.spacer { flex: 1; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; } .mb-20 { margin-bottom: 20px; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.pill-row { display: flex; gap: 6px; flex-wrap: wrap; }
.stat-line { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 12.5px; color: var(--muted); }
.stat-line strong { color: var(--ink); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--green); }
.status-dot.amber { background: var(--amber); }
.status-dot.red { background: var(--red); }
.status-dot.grey { background: var(--muted); }

.ticket-preview { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px; font-family: var(--mono); font-size: 11px; line-height: 1.4; white-space: pre-wrap; max-height: 52vh; overflow: auto; }

.table-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.table-admin-card { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.table-admin-card .tac-main { flex: 1; min-width: 0; }
.table-admin-card .tac-name { font-size: 13px; font-weight: 650; }
.table-admin-card .tac-sub { font-size: 10.5px; color: var(--muted); }
.table-admin-card .tac-open { font-size: 9.5px; font-weight: 700; color: var(--accent-dark); text-transform: uppercase; }

.zone-group { margin-bottom: 18px; }
.zone-group h4 { font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 8px; }

/* ============================================================
   MODO TPV ACCESIBLE
   Botones grandes, alto contraste y jerarquía clara para uso
   con personas mayores o poco habituadas a la informática.
   ============================================================ */
:root {
  --muted: #5b6670;
  --line: #ded4c6;
  --radius: 20px;
  --radius-sm: 14px;
}
body { font-size: 16px; }
button, a, input, select, textarea { touch-action: manipulation; }
.app { grid-template-columns: 268px minmax(0, 1fr); }
.sidebar { padding: 22px 18px 18px; gap: 20px; }
.brand { gap: 13px; padding-bottom: 10px; }
.brand-mark { width: 58px; height: 46px; border-radius: 12px; }
.brand-text strong { font-size: 17px; }
.brand-text span { font-size: 12.5px; }
.nav { gap: 5px; }
.nav-sep { margin: 14px 14px 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #6f7b84; }
.nav-item {
  min-height: 54px;
  padding: 13px 15px;
  gap: 13px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
}
.nav-item .icon { width: 24px; height: 24px; }
.nav-item.active { background: rgba(176, 0, 0, 0.24); }
.drawer-btn { min-height: 58px; font-size: 16px; border-radius: 14px; }
.drawer-btn .icon { width: 24px; height: 24px; }
.hw-chip { min-height: 46px; padding: 11px 13px; font-size: 13px; }
.version { font-size: 11.5px; }
.topbar { padding: 18px 30px; }
.page-heading h1 { font-size: 30px; }
.page-heading p { font-size: 14px; }
.top-actions { gap: 12px; }
.today-chip { font-size: 14px; padding: 10px 15px; }
.clock #clock-time { font-size: 24px; }
.clock #clock-date { font-size: 12px; }
.icon-btn { width: 48px; height: 48px; border-radius: 14px; }
.icon-btn .icon { width: 24px; height: 24px; }
.view { padding: 26px 30px 52px; }

.kpi { padding: 18px 20px; border-radius: 18px; }
.kpi .kpi-label { font-size: 13px; }
.kpi .kpi-value { font-size: 30px; }
.kpi .kpi-hint { font-size: 13px; }
.section-head { margin-bottom: 18px; }
.section-head h2 { font-size: 24px; }
.section-head p { font-size: 14px; }

.btn { min-height: 48px; padding: 12px 18px; font-size: 15px; border-radius: 13px; gap: 9px; }
.btn .icon { width: 20px; height: 20px; }
.btn-sm { min-height: 44px; padding: 10px 14px; font-size: 14px; border-radius: 11px; }
.btn-lg { min-height: 60px; padding: 16px 24px; font-size: 18px; border-radius: 15px; }
.btn-icon { width: 44px; height: 44px; }
.chip { min-height: 46px; padding: 10px 16px; font-size: 14.5px; }
.chip .dot { width: 10px; height: 10px; }
.badge { font-size: 11.5px; padding: 5px 10px; }

/* Acciones grandes de la pantalla de salón */
.home-actions { display: grid; grid-template-columns: 1.15fr 1fr; gap: 14px; margin-bottom: 14px; }
.home-action {
  display: flex; align-items: center; gap: 15px; min-height: 88px;
  padding: 16px 20px; border-radius: 18px; border: 2px solid var(--line);
  background: var(--surface); text-align: left; box-shadow: var(--shadow-sm);
  transition: transform .14s, box-shadow .14s, border-color .14s;
}
.home-action:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.home-action.primary { background: linear-gradient(135deg, #338963, #256b4c); border-color: #256b4c; color: #fff; }
.home-action.primary:hover { box-shadow: 0 14px 32px rgba(37, 107, 76, 0.3); }
.home-action .ha-icon { width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-dark); flex: none; }
.home-action .ha-icon .icon { width: 28px; height: 28px; }
.home-action.primary .ha-icon { background: rgba(255, 255, 255, 0.16); color: #fff; }
.home-action .ha-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.home-action .ha-text strong { font-size: 19px; letter-spacing: -.01em; }
.home-action .ha-text small { font-size: 13px; color: var(--muted); }
.home-action.primary .ha-text small { color: rgba(255, 255, 255, 0.82); }
.home-action .ha-arrow { width: 26px; height: 26px; opacity: .45; }
.home-action.primary .ha-arrow { opacity: .95; }
.help-strip {
  display: flex; align-items: center; gap: 11px; padding: 13px 16px; margin-bottom: 20px;
  border-radius: 13px; background: var(--blue-soft); color: #245a78; font-size: 14px; line-height: 1.4;
}
.help-strip .icon { width: 23px; height: 23px; flex: none; }

/* Mesas grandes con estado inequívoco */
.table-grid { grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 16px; }
.table-card {
  min-height: 192px; padding: 18px; gap: 10px;
  border-width: 2px; border-radius: 20px;
}
.table-card.occupied { background: linear-gradient(165deg, #fff3f3, #fffafa); border-color: #d98a8a; }
.table-card:not(.occupied) { background: linear-gradient(165deg, #f3fbf7, #fffdf9); border-color: #c9e5d6; }
.table-card.occupied::before { width: 7px; border-radius: 20px 0 0 20px; }
.table-card:hover { border-color: var(--accent); }
.table-top { align-items: flex-start; }
.zone-pill { font-size: 12px; }
.table-status { font-size: 12.5px; font-weight: 800; padding: 6px 11px; border-radius: 999px; letter-spacing: .03em; }
.table-status .dot { width: 9px; height: 9px; }
.table-card:not(.occupied) .table-status { background: #dcf2e5; color: #1c6b47; }
.table-card:not(.occupied) .table-status .dot { background: #2f9b68; box-shadow: 0 0 0 3px #dcf2e5; }
.table-card.occupied .table-status { background: #f6d9d9; color: #8a0000; }
.table-card.occupied .table-status .dot { background: #b00000; box-shadow: 0 0 0 3px #f6d9d9; }
.table-name { font-size: 29px; }
.table-meta { font-size: 13.5px; }
.table-foot { align-items: center; }
.table-time { font-size: 12.5px; }
.table-foot strong { font-size: 22px; }
.table-cta { font-size: 13px; font-weight: 850; letter-spacing: .05em; color: var(--green); }

/* Catálogo y ticket */
.order-header { margin-bottom: 14px; }
.order-title h2 { font-size: 29px; }
.order-title .order-meta { font-size: 13.5px; gap: 12px; }
.order-title .back { width: 48px; height: 48px; }
.order-actions .btn { min-height: 52px; }
.order-help {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; margin-bottom: 18px;
  border-radius: 13px; background: var(--amber-soft); color: #6f4d0c; font-size: 14px;
}
.order-help .icon { width: 22px; height: 22px; flex: none; }
.order-layout { grid-template-columns: minmax(0, 1fr) minmax(380px, 410px); gap: 22px; }
.catalog-panel { padding: 22px; }
.catalog-search { margin-bottom: 14px; }
.search-box input { min-height: 50px; font-size: 16px; padding-left: 42px; }
.search-box .icon { width: 20px; height: 20px; left: 14px; }
.category-bar { gap: 8px; margin-bottom: 16px; flex-wrap: wrap; overflow: visible; }
.product-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.product-card {
  min-height: 112px; padding: 15px; border-width: 2px; border-radius: 15px; gap: 12px;
}
.product-card .p-name { font-size: 16px; }
.product-card .p-price { font-size: 19px; }
.product-card .p-cat { font-size: 10.5px; }
.product-card:hover { border-color: var(--accent); background: #fff8f3; }

.ticket-panel { top: 104px; max-height: calc(100vh - 124px); border-radius: 20px; overflow: hidden; }
.ticket-scroll { min-height: 0; }
.ticket-head { padding: 18px 20px 14px; }
.ticket-head h3 { font-size: 23px; }
.ticket-head .t-sub { font-size: 13px; }
.ticket-scroll { padding: 8px 20px; }
.ticket-line { padding: 14px 0; }
.tl-name { font-size: 16px; }
.tl-name small { font-size: 12px; }
.tl-total { font-size: 16px; }
.tl-actions { gap: 8px; margin-top: 9px; }
.qty button { width: 38px; height: 38px; }
.qty button .icon { width: 16px !important; height: 16px !important; }
.qty span { min-width: 28px; font-size: 16px; }
.tl-note-btn { font-size: 12.5px; padding: 8px 4px; }
.tl-del { width: 38px; height: 38px; }
.tl-del .icon { width: 17px; height: 17px; }
.tl-note { font-size: 12.5px; padding: 6px 9px; }
.ticket-totals { padding: 15px 20px; }
.t-row { font-size: 14px; }
.t-total span { font-size: 13px; }
.t-total strong { font-size: 36px; }
.ticket-foot { padding: 14px 20px 18px; gap: 10px; }
.pay-hint { text-align: center; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.ticket-foot .pay-btn { min-height: 70px; font-size: 20px; border-radius: 15px; letter-spacing: .02em; }
.ticket-foot .foot-row .btn { min-height: 48px; }
.link-danger { border: 0; background: transparent; color: #a34a4a; font-size: 13px; font-weight: 600; padding: 8px; align-self: center; border-radius: 8px; }
.link-danger:hover { background: var(--red-soft); color: var(--red); }
.waiter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); font-size: 12.5px; }
.waiter-chip:hover { border-color: var(--accent); color: var(--accent-dark); }
.waiter-chip .icon { width: 15px; height: 15px; }
.waiter-chip strong { font-weight: 750; }
.waiter-chip span { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.emp-avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-dark); font-weight: 850; font-size: 15px; flex: none; }
.employee-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.employee-option { display: flex; align-items: center; gap: 12px; min-height: 82px; padding: 14px 16px; border: 2px solid var(--line); border-radius: 14px; background: #fff; text-align: left; }
.employee-option:hover { border-color: var(--accent); }
.employee-option.active { border-color: var(--accent); background: var(--accent-soft); }
.employee-option strong { font-size: 16px; flex: 1; }
.employee-option .emp-check { color: var(--green); font-weight: 850; font-size: 18px; }

/* Formularios y modales grandes */
.modal { max-width: 760px; border-radius: 24px; }
.modal.lg { max-width: 980px; }
.modal.xl { max-width: 1120px; }
.modal-head { padding: 22px 26px 16px; }
.modal-head h2 { font-size: 25px; }
.modal-head p { font-size: 14px; }
.modal-close { width: 46px; height: 46px; border-radius: 12px; }
.modal-close .icon { width: 22px; height: 22px; }
.modal-body { padding: 22px 26px; }
.modal-foot { padding: 16px 26px 22px; gap: 10px; }
.field label { font-size: 13.5px; }
.input, .select, .textarea { min-height: 50px; font-size: 16px; border-radius: 12px; }
.textarea { min-height: 92px; }
.input-group .suffix { font-size: 15px; }
.check input { width: 22px; height: 22px; }
.check span { font-size: 14px; line-height: 1.4; }
.check small { font-size: 12px; }
.segmented button { min-height: 46px; padding: 9px 16px; font-size: 14px; }
.hint { font-size: 12.5px; line-height: 1.45; }

/* Cobro a pantalla grande en dos columnas */
.pay-layout { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: 24px; align-items: start; }
.pay-left { min-width: 0; }
.pay-right { min-width: 0; padding: 16px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; }
.step-label { margin: 0 0 10px; font-size: 12px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.pay-top { margin-bottom: 14px; }
.pay-total span { font-size: 13px; }
.pay-total strong { font-size: 44px; }
.pay-left .segmented { margin-bottom: 18px; }
.pay-methods { grid-template-columns: repeat(2, 1fr); gap: 11px; margin-bottom: 18px; }
.pay-method { min-height: 108px; font-size: 15px; border-width: 2px; border-radius: 14px; gap: 8px; }
.pay-method .icon { width: 30px; height: 30px; }
.pay-method.active { border-width: 3px; }
.pay-detail, #pay-detail { padding: 0; background: transparent; border: 0; }
.cash-display { margin: 0 0 14px; padding: 16px 18px; }
.cash-display .amount { font-size: 38px; }
.cash-display .label { font-size: 12px; }
.quick-cash { gap: 8px; margin-bottom: 14px; }
.quick-cash button { min-height: 52px; font-size: 15px; border-radius: 11px; }
.keypad { gap: 7px; }
.keypad button { min-height: 58px; font-size: 24px; border-radius: 11px; }
.change-line { font-size: 15px; }
.change-line strong { font-size: 27px; }
.pay-note { font-size: 14px; padding: 16px; border-radius: 12px; }
.pay-tip { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; margin-bottom: 16px; border-radius: 12px; background: var(--blue-soft); color: #245a78; font-size: 13.5px; line-height: 1.45; }
.pay-tip .icon { width: 21px; height: 21px; flex: none; margin-top: 1px; }
.pay-summary-line { font-size: 14px; }
.modal.invoice-mode .pay-tip { display: none; }
.modal.invoice-mode .pay-method { min-height: 86px; }
.modal.invoice-mode .pay-total { margin-bottom: 6px; }
.modal.invoice-mode .pay-total strong { font-size: 38px; }
.modal.invoice-mode .pay-left .segmented { margin-bottom: 12px; }
.modal.invoice-mode .step-label { margin-bottom: 6px; }
.modal.invoice-mode .pay-methods { margin-bottom: 12px; }
.modal.invoice-mode .invoice-fields { margin-bottom: 0; padding: 12px; }

/* Cuenta completa antes de cobrar */
.checkout-summary { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #fffdf7; }
.checkout-summary-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding: 18px 20px; border-bottom: 1px dashed var(--line-strong); }
.checkout-summary-head h3 { font-size: 26px; letter-spacing: -.03em; }
.checkout-sub { margin-top: 2px; font-size: 13px; color: var(--muted); }
.checkout-total-box { text-align: right; flex: none; }
.checkout-total-box span { display: block; font-size: 11px; font-weight: 800; letter-spacing: .09em; color: var(--muted); }
.checkout-total-box strong { display: block; font-size: 36px; letter-spacing: -.04em; }
.checkout-lines { max-height: 180px; overflow-y: auto; padding: 8px 20px; }
.checkout-line { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px dotted var(--line); font-size: 15px; }
.checkout-line:last-child { border-bottom: 0; }
.cl-qty { width: 36px; flex: none; font-weight: 850; color: var(--accent-dark); }
.cl-name { flex: 1; }
.cl-name small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.checkout-line strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.checkout-totals { padding: 12px 20px 16px; border-top: 1px dashed var(--line-strong); background: #fffaf1; }
.checkout-totals > div { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; font-size: 14px; color: var(--muted); }
.checkout-totals > div strong { color: var(--ink); }
.checkout-totals .discount { color: var(--green); }
.checkout-grand { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 16px; color: var(--ink) !important; }
.checkout-grand strong { font-size: 32px; letter-spacing: -.03em; }
.checkout-choose { margin-top: 18px; }
.checkout-method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.checkout-method { display: flex; align-items: center; gap: 14px; min-height: 96px; padding: 18px; text-align: left; border-radius: 16px; border: 2px solid var(--line); background: #fff; transition: transform .14s, box-shadow .14s; }
.checkout-method:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.checkout-method .cm-icon { width: 56px; height: 56px; border-radius: 15px; display: grid; place-items: center; flex: none; }
.checkout-method .cm-icon .icon { width: 30px; height: 30px; }
.checkout-method .cm-text strong { display: block; font-size: 20px; letter-spacing: .01em; }
.checkout-method .cm-text small { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); line-height: 1.35; }
.checkout-method.cash { border-color: #bfe3d0; background: #f1fbf5; }
.checkout-method.cash .cm-icon { background: #d7f0e1; color: #1f6b4a; }
.checkout-method.card { border-color: #c9dceb; background: #f2f8fc; }
.checkout-method.card .cm-icon { background: #dcebf6; color: #245a78; }
.checkout-more { margin-top: 12px; border: 0; background: transparent; color: var(--blue); font-size: 14px; font-weight: 700; padding: 8px 4px; text-decoration: underline; }
.checkout-more-options { display: flex; gap: 10px; margin-top: 8px; }
.checkout-more-options .btn { flex: 1; }
.checkout-invoice-line { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.checkout-invoice-line .hint { flex: 1; min-width: 200px; }
.card-pay-instructions { padding: 18px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.cpi-title { margin-bottom: 12px; font-size: 12px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.cpi-step { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.cpi-step:last-child { border-bottom: 0; padding-bottom: 0; }
.cpi-step > span { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); font-weight: 850; flex: none; }
.cpi-step strong { display: block; font-size: 16px; line-height: 1.3; }
.cpi-step small { display: block; margin-top: 3px; font-size: 13px; color: var(--muted); line-height: 1.4; }
@media (max-width: 760px) {
  .checkout-method-grid { grid-template-columns: 1fr; }
  .checkout-summary-head { flex-direction: column; }
  .checkout-total-box { text-align: left; }
}

/* Éxito del cobro */
.success-hero h2 { font-size: 30px; }
.success-hero p { font-size: 14.5px; }
.success-icon { width: 86px; height: 86px; }
.success-icon .icon { width: 46px; height: 46px; }
.success-grid { gap: 12px; }
.success-grid > div { padding: 15px 17px; border-radius: 13px; }
.success-grid span { font-size: 12px; }
.success-grid strong { font-size: 22px; }
.success-grid strong.warn, .success-grid strong.err { font-size: 16px; }
.success-actions { gap: 10px; }
.success-actions .btn { min-height: 58px; font-size: 16px; }

/* Ventas, caja, productos y ajustes más legibles */
.toolbar { gap: 10px; margin-bottom: 18px; }
.data-table th { font-size: 12px; padding: 12px 16px; }
.data-table td { font-size: 14px; padding: 14px 16px; }
.data-table .mono { font-size: 13px; }
.row-title { font-size: 14.5px; }
.row-sub { font-size: 12px; }
.list-row { padding: 15px 18px; }
.lr-title { font-size: 14.5px; }
.lr-sub { font-size: 12px; }
.lr-amount { font-size: 16px; }
.cash-amount { font-size: 44px; }
.cash-meta { font-size: 13px; }
.method-row { font-size: 14px; padding: 9px 0; }
.movement-row { font-size: 13.5px; }
.settings-nav button { min-height: 52px; font-size: 15px; }
.settings-section-title { font-size: 23px; }
.settings-section-sub { font-size: 13.5px; }
.settings-block h3 { font-size: 16px; }
.settings-block .block-sub { font-size: 12.5px; }
.hardware-status .hs-title { font-size: 15px; }
.hardware-status .hs-sub { font-size: 12px; }
.help-box { font-size: 13px; line-height: 1.55; }
.toast { padding: 14px 16px; border-radius: 14px; }
.toast .t-title { font-size: 14.5px; }
.toast .t-detail { font-size: 12.5px; }
.toast .t-action { font-size: 12.5px; }

@media (max-width: 760px) {
  .home-actions { grid-template-columns: 1fr; }
  .pay-layout { grid-template-columns: 1fr; }
  .pay-right { padding: 13px; }
}

@media (max-width: 1180px) {
  .order-layout { grid-template-columns: 1fr; }
  .ticket-panel { position: static; max-height: none; }
  .ticket-scroll { max-height: 380px; }
  .cash-hero { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; }
  .settings-nav button { flex: none; }
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: auto;
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid rgba(255,255,255,.08);
    background: #11181e;
  }
  .brand, .sidebar-foot { display: none; }
  .nav-sep { display: none; }
  .nav { flex-direction: row; justify-content: space-around; gap: 2px; }
  .nav-item { flex-direction: column; gap: 3px; padding: 6px 5px; font-size: 9.5px; border-radius: 9px; min-width: 52px; }
  .nav-item .icon { width: 20px; height: 20px; }
  .nav-item.active::before { display: none; }
  .main { padding-bottom: 72px; }
  .topbar { padding: 13px 16px; }
  .page-heading h1 { font-size: 20px; }
  .view { padding: 16px 16px 34px; }
  .today-chip { display: none; }
  .mobile-drawer { display: grid; }
  .clock #clock-date { display: none; }
  .clock { min-width: auto; }
  .order-actions .btn span { display: none; }
  .order-actions .btn { padding: 9px; }
  .order-actions .btn .icon { width: 19px; height: 19px; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }
  .settings-content { padding: 16px; }
}

@media (max-width: 620px) {
  .form-grid.two, .form-grid.three { grid-template-columns: 1fr; }
  .pay-methods { grid-template-columns: repeat(2, 1fr); }
  .table-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .table-card { min-height: 134px; padding: 12px; }
  .table-name { font-size: 18px; }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; }
  .modal-foot .spacer { display: none; }
  .success-grid { grid-template-columns: 1fr; }
  .success-actions { flex-direction: column; }
  .topbar { gap: 10px; }
  .icon-btn { width: 36px; height: 36px; }
  .order-title h2 { font-size: 19px; }
  .t-total strong { font-size: 24px; }
  .pay-total strong { font-size: 27px; }
  .cash-amount { font-size: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
