:root {
  --marron-oscuro: #4a0f0f;
  --rojo-tierra: #7a2020;
  --rojo-claro: #963333;
  --crema: #f3e6c8;
  --crema-clara: #faf3e2;
  --dorado: #c9a35a;
  --dorado-oscuro: #a9833a;
  --texto-oscuro: #2b1a12;
  --verde-libre: #2e7d4f;
  --rojo-ocupada: #b23a3a;

  --bg-app: #f6f1e7;
  --surface: #ffffff;
  --border: #e8dfcf;
  --muted: #7a6a5c;

  --sidebar-width: 264px;
  --sidebar-width-collapsed: 76px;
  --navbar-height: 68px;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(74, 15, 15, .06), 0 2px 8px rgba(74, 15, 15, .05);
  --shadow-md: 0 8px 24px rgba(74, 15, 15, .12);

  --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bs-body-color: var(--texto-oscuro);
  --bs-primary: var(--rojo-tierra);
  --bs-primary-rgb: 122, 32, 32;
  --bs-link-color: var(--rojo-tierra);
  --bs-link-hover-color: var(--marron-oscuro);
  --bs-border-color: var(--border);
  --bs-border-radius: .6rem;
}

* { box-sizing: border-box; }

.min-w-0 { min-width: 0; }

body {
  background-color: var(--bg-app);
  color: var(--texto-oscuro);
  font-family: var(--bs-body-font-family);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { letter-spacing: -.01em; }

::selection { background: var(--dorado); color: var(--marron-oscuro); }

.layout {
  display: flex;
  min-height: 100vh;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  width: var(--sidebar-width);
  height: 100vh;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 12px 16px 0;
  background:
    radial-gradient(circle at 0% 0%, rgba(201, 163, 90, .12), transparent 45%),
    linear-gradient(180deg, var(--marron-oscuro), #35090a);
  transition: width .2s ease, transform .25s ease;
  z-index: 1040;
}

.sidebar__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 4px 14px 16px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(243, 230, 200, .12);
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
  color: var(--crema-clara);
}
.sidebar__brand img {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--dorado);
  background: #fff;
}
.sidebar__brand-text {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: .12em;
  white-space: nowrap;
}
.sidebar__brand-text small {
  display: block;
  font-size: .62rem;
  font-weight: 500;
  letter-spacing: .18em;
  color: var(--dorado);
}

.sidebar__toggle {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(243, 230, 200, .25);
  border-radius: 8px;
  background: transparent;
  color: var(--crema);
  font-size: .8rem;
  cursor: pointer;
  transition: background .15s;
}
.sidebar__toggle:hover { background: rgba(243, 230, 200, .12); }

.sidebar__nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(243, 230, 200, .25) transparent;
}

.sidebar__section {
  margin: 14px 0 4px 20px;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(243, 230, 200, .45);
  white-space: nowrap;
}

.sidebar a.pill {
  display: flex;
  text-decoration: none;
  border-left: 0;
}
.sidebar a.pill .pill-inner {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 20px;
  border-radius: 0 999px 999px 0;
  color: var(--crema);
  font-size: .92rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.sidebar a.pill .bi {
  width: 20px;
  flex-shrink: 0;
  text-align: center;
  font-size: 1.1rem;
  color: rgba(243, 230, 200, .75);
}
.sidebar a.pill:hover .pill-inner { background: rgba(243, 230, 200, .1); color: #fff; }
.sidebar a.pill.activo .pill-inner {
  background: rgba(201, 163, 90, .22);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--dorado);
}
.sidebar a.pill.activo .bi { color: var(--dorado); }
.sidebar a.pill:focus-visible { outline: 2px solid var(--dorado); outline-offset: -2px; }

.sidebar__foot {
  padding: 12px 8px 0 20px;
  border-top: 1px solid rgba(243, 230, 200, .12);
  font-size: .7rem;
  color: rgba(243, 230, 200, .45);
  white-space: nowrap;
}

.sidebar--collapsed { width: var(--sidebar-width-collapsed); }
.sidebar--collapsed .sidebar__brand-text,
.sidebar--collapsed .pill-label,
.sidebar--collapsed .sidebar__section,
.sidebar--collapsed .sidebar__foot { display: none; }
.sidebar--collapsed .sidebar__top { flex-direction: column; padding-left: 8px; gap: 10px; }
.sidebar--collapsed a.pill .pill-inner { padding-left: 24px; }

.sidebar__mobile-toggle,
.sidebar__overlay { display: none; }
.sidebar__overlay[hidden] { display: none !important; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  height: var(--navbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--dorado), transparent 60%);
  opacity: .8;
}
.topbar__titulo {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.topbar__titulo strong {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--marron-oscuro);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar__titulo span { font-size: .75rem; color: var(--muted); }
.topbar__titulo span::first-letter { text-transform: uppercase; }

.usuario-menu .usuario-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px 5px 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--texto-oscuro);
  font-size: .88rem;
  font-weight: 600;
  transition: box-shadow .15s, border-color .15s;
}
.usuario-menu .usuario-toggle:hover,
.usuario-menu .usuario-toggle:focus { border-color: var(--dorado); box-shadow: var(--shadow-sm); color: var(--texto-oscuro); }
.usuario-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rojo-tierra), var(--marron-oscuro));
  color: var(--crema-clara);
  font-size: .8rem;
  font-weight: 700;
}
.usuario-menu .usuario-toggle::after { margin-left: 2px; }
.usuario-menu .dropdown-menu {
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  padding: 8px;
  margin-top: 10px !important;
  min-width: 220px;
}
.usuario-menu .dropdown-header {
  padding: 8px 12px;
  font-size: .8rem;
  color: var(--muted);
}
.usuario-menu .dropdown-header b { display: block; color: var(--texto-oscuro); font-size: .92rem; }
.usuario-menu .dropdown-item {
  border-radius: 10px;
  padding: 9px 12px;
  font-weight: 600;
  color: var(--rojo-tierra);
  display: flex;
  align-items: center;
  gap: 8px;
}
.usuario-menu .dropdown-item:hover,
.usuario-menu .dropdown-item:focus { background: var(--crema-clara); color: var(--marron-oscuro); }

.topbar .badge-rol {
  background: var(--crema);
  color: var(--marron-oscuro);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: .62rem;
  padding: 3px 8px;
  border-radius: 999px;
}

.contenido {
  flex: 1;
  padding: 28px;
  min-width: 0;
}

.contenido > .row,
.contenido > .card-tb { clear: both; }

.titulo-seccion {
  display: inline-block;
  color: var(--marron-oscuro);
  font-weight: 800;
  font-size: 1.55rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0;
  border: 0;
  position: relative;
}
.titulo-seccion::after {
  content: '';
  display: block;
  width: 44px;
  height: 4px;
  margin-top: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--dorado), var(--rojo-tierra));
}

.card-tb {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s, border-color .15s;
}
.card-tb:hover { box-shadow: var(--shadow-md); border-color: #dccfb3; }

.opcion-grande {
  cursor: pointer;
  text-align: center;
  padding: 2.25rem 1.5rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--marron-oscuro);
  font-weight: 700;
  font-size: 1.15rem;
  box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s, background .15s, color .15s, border-color .15s;
}
.opcion-grande:hover {
  background: linear-gradient(135deg, var(--rojo-tierra), var(--marron-oscuro));
  border-color: var(--rojo-tierra);
  color: var(--crema-clara);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.opcion-grande .bi {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin: 0 auto .75rem;
  border-radius: 50%;
  background: var(--crema-clara);
  color: var(--rojo-tierra);
  font-size: 2rem;
  transition: background .15s, color .15s;
}
.opcion-grande:hover .bi { background: rgba(255, 255, 255, .14); color: var(--dorado); }

.opcion-grande.seleccionada {
  background: linear-gradient(135deg, var(--rojo-tierra), var(--marron-oscuro));
  border-color: var(--rojo-tierra);
  color: var(--crema-clara);
  box-shadow: var(--shadow-md), 0 0 0 3px rgba(201, 162, 74, .55);
}
.opcion-grande.seleccionada .bi { background: rgba(255, 255, 255, .14); color: var(--dorado); }
.opcion-grande.seleccionada::after { content: 'Elegido'; display: block; margin-top: .35rem; font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--dorado); }

.mesa-card {
  cursor: pointer;
  border-radius: 14px;
  padding: 1.25rem .5rem;
  text-align: center;
  font-weight: 700;
  color: #fff;
  border: none;
  box-shadow: var(--shadow-sm);
  transition: transform .12s, box-shadow .12s;
}
.mesa-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.mesa-card.libre { background: linear-gradient(135deg, #2e7d4f, #256a42); }
.mesa-card.ocupada { background: linear-gradient(135deg, #b23a3a, #8f2d2d); cursor: not-allowed; opacity: .85; }
.mesa-card.ocupada:hover { transform: none; box-shadow: var(--shadow-sm); }
.mesa-card small { display: block; font-weight: 400; opacity: .9; }
.mesa-card.seleccionada { outline: 3px solid var(--dorado); outline-offset: 3px; }

.producto-card {
  border-radius: var(--radius);
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: box-shadow .15s, border-color .15s, transform .15s;
}
.producto-card:hover { box-shadow: var(--shadow-md); border-color: var(--dorado); transform: translateY(-2px); }
.producto-card .nombre { font-weight: 700; color: var(--marron-oscuro); }
.producto-card .descripcion { font-size: .78rem; color: var(--muted); flex: 1; }
.producto-card .precio { font-weight: 800; color: var(--rojo-tierra); font-size: 1.05rem; }

.carrito {
  position: sticky;
  top: calc(var(--navbar-height) + 16px);
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.carrito .carrito-header {
  background: linear-gradient(135deg, var(--marron-oscuro), var(--rojo-tierra));
  color: var(--crema-clara);
  padding: .9rem 1.1rem;
  font-weight: 700;
}
.carrito-item { padding: .65rem 1.1rem; border-bottom: 1px dashed var(--border); font-size: .9rem; }
.carrito-total { padding: 1rem 1.1rem; font-weight: 800; font-size: 1.25rem; color: var(--rojo-tierra); text-align: right; }

.btn { border-radius: 10px; font-weight: 600; transition: background .15s, border-color .15s, box-shadow .15s, transform .08s; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { box-shadow: 0 0 0 .2rem rgba(201, 163, 90, .45); }

.btn-tb {
  background: linear-gradient(135deg, var(--rojo-tierra), var(--marron-oscuro));
  border: 0;
  color: #fff;
  box-shadow: 0 2px 8px rgba(122, 32, 32, .25);
}
.btn-tb:hover, .btn-tb:focus { background: linear-gradient(135deg, var(--rojo-claro), var(--rojo-tierra)); color: #fff; }

.btn-dorado {
  background: var(--dorado);
  border: 0;
  color: var(--marron-oscuro);
  font-weight: 700;
}
.btn-dorado:hover { background: var(--dorado-oscuro); color: #fff; }

.btn-outline-secondary { --bs-btn-color: var(--muted); --bs-btn-border-color: var(--border); --bs-btn-hover-bg: var(--crema-clara); --bs-btn-hover-border-color: var(--dorado); --bs-btn-hover-color: var(--marron-oscuro); --bs-btn-active-bg: var(--crema); --bs-btn-active-border-color: var(--dorado); --bs-btn-active-color: var(--marron-oscuro); }

.form-label { font-weight: 600; font-size: .82rem; color: var(--texto-oscuro); margin-bottom: .3rem; }
.form-control, .form-select {
  border-radius: 10px;
  border-color: #dccfb3;
  background-color: #fffdf8;
}
.form-control:focus, .form-select:focus {
  border-color: var(--dorado);
  box-shadow: 0 0 0 .2rem rgba(201, 163, 90, .25);
  background-color: #fff;
}
.form-check-input:checked { background-color: var(--rojo-tierra); border-color: var(--rojo-tierra); }
.form-text { color: var(--muted); }

.table { --bs-table-bg: transparent; --bs-table-hover-bg: var(--crema-clara); margin-bottom: 0; }
.table > thead > tr > th {
  background: var(--crema-clara);
  color: var(--marron-oscuro);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table > tbody > tr > td { border-color: #f0e8d8; vertical-align: middle; }
.table-responsive { border-radius: var(--radius); }
.card-tb > .table-responsive:only-child,
.card-tb > .table:only-child { border-radius: var(--radius); overflow: hidden; }

.alert { border: 0; border-left: 4px solid; border-radius: 12px; box-shadow: var(--shadow-sm); }
.alert-success { background: #eaf6ef; border-left-color: var(--verde-libre); color: #1d5a37; }
.alert-danger  { background: #fbeceb; border-left-color: var(--rojo-ocupada); color: #7d2323; }
.alert-warning { background: #fff6e2; border-left-color: var(--dorado); color: #6b4f12; }
.alert-info    { background: #eef4f8; border-left-color: #3b7ea1; color: #234c63; }

.nav-pills .nav-link { border-radius: 999px; color: var(--muted); font-weight: 600; }
.nav-pills .nav-link:hover { background: var(--crema-clara); color: var(--marron-oscuro); }
.nav-pills .nav-link.active { background: var(--rojo-tierra); color: #fff; }

.list-group-item { border-color: var(--border); }
.modal-content { border: 0; border-radius: 18px; box-shadow: var(--shadow-md); }

.stat-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  padding: 1.25rem;
  color: #fff;
  background: linear-gradient(135deg, var(--marron-oscuro), var(--rojo-claro));
  box-shadow: var(--shadow-sm);
}
.stat-card::after {
  content: '';
  position: absolute;
  right: -30px; top: -30px;
  width: 110px; height: 110px;
  border-radius: 50%;
  background: rgba(201, 163, 90, .22);
}
.stat-card .valor { font-size: clamp(1.25rem, 2.4vw, 1.75rem); font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.stat-card .etiqueta { font-size: .8rem; opacity: .9; text-transform: uppercase; letter-spacing: .06em; }

.badge { border-radius: 999px; font-weight: 600; padding: .4em .75em; }
.badge-estado-abierto { background: #6c757d; }
.badge-estado-pendiente_factura { background: var(--dorado); color: var(--marron-oscuro); }
.badge-estado-facturado { background: var(--verde-libre); }
.badge-estado-cancelado { background: var(--rojo-ocupada); }

.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background:
    radial-gradient(circle at 15% 10%, rgba(201, 163, 90, .35), transparent 40%),
    radial-gradient(circle at 90% 90%, rgba(122, 32, 32, .35), transparent 45%),
    linear-gradient(135deg, var(--marron-oscuro), #2a0708);
}
.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 36px 32px 30px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}
.auth-card__marca { text-align: center; margin-bottom: 24px; padding-bottom: 22px; border-bottom: 1px solid var(--border); }
.auth-card__marca img {
  width: 88px; height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--dorado);
  box-shadow: 0 6px 18px rgba(74, 15, 15, .25);
}
.auth-card__marca h1 { margin: 12px 0 2px; font-size: 1.35rem; font-weight: 800; letter-spacing: .14em; color: var(--marron-oscuro); }
.auth-card__marca p { margin: 0; font-size: .8rem; color: var(--muted); }

@page { size: auto; margin: 12mm; }
@page ticket { size: 48mm auto; margin: 0; }
.pagina-ticket { page: ticket; }

@media print {
  .no-imprimir { display: none !important; }
  body { background: #fff; }
  body.pagina-ticket { background: #fff; width: 48mm; }
  .layout { display: block; min-height: 0; }
  .main { display: block; }
  .contenido { padding: 0; }
  .card-tb { box-shadow: none; }
  .pagina-ticket .contenido { padding: 0; }
  .ticket {
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 0 1mm;
    box-shadow: none;
    border: none;
    border-radius: 0;
  }
}

.ticket {
  max-width: 380px;
  margin: 0 auto;
  background: #fff;
  padding: 1.25rem;
  font-family: 'Courier New', monospace;
  color: #000;
  font-size: .75rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.ticket h2 { text-align: center; margin: 0; font-size: .95rem; }
.ticket .linea { border-top: 1px dashed #000; margin: .3rem 0; }
.ticket table { width: 100%; font-size: .72rem; border-collapse: collapse; table-layout: fixed; }
.ticket table td { padding: 1px 2px; word-break: break-word; overflow-wrap: break-word; }
.ticket table td:first-child { width: 1.8em; white-space: nowrap; }
.ticket p { word-break: break-word; overflow-wrap: break-word; }
.ticket .total-final { font-size: .9rem; font-weight: 700; }
.ticket .nota-item { font-style: italic; }

.comprobante-nomina {
  max-width: 480px;
  margin: 0 auto;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}
.comprobante-nomina .comprobante-header {
  background: linear-gradient(135deg, var(--marron-oscuro), var(--rojo-tierra));
  color: #fff;
  text-align: center;
  padding: 1.75rem 1.5rem 1.25rem;
}
.comprobante-nomina .comprobante-header img {
  width: 84px; height: 84px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--dorado);
  margin-bottom: .5rem;
}
.comprobante-nomina .comprobante-titulo { font-weight: 800; font-size: 1.4rem; letter-spacing: 1px; }
.comprobante-nomina .comprobante-subtitulo { color: var(--crema); font-size: .9rem; }
.comprobante-nomina .comprobante-body { padding: 1.5rem; }
.comprobante-nomina .comprobante-linea { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 .6rem; font-size: .95rem; }
.comprobante-nomina .comprobante-linea span { color: var(--muted); }
.comprobante-nomina hr { border-top: 1px dashed rgba(0, 0, 0, .15); margin: 1rem 0; }
.comprobante-nomina .comprobante-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.3rem; font-weight: 800; color: var(--rojo-tierra); margin: 0; }
.comprobante-nomina .comprobante-nota { font-size: .8rem; color: var(--muted); text-align: center; margin-top: 1rem; }

@media print {
  .comprobante-nomina { box-shadow: none; border: 1px solid #ccc; margin: 2rem auto; }
}

.kds-card {
  background: #fff;
  border-radius: 18px;
  border: 3px solid var(--verde-libre);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.kds-card.kds-atencion { border-color: var(--dorado); }
.kds-card.kds-urgente { border-color: var(--rojo-ocupada); animation: kds-parpadeo 1.5s infinite; }
.kds-card.kds-listo { opacity: .55; border-color: #999; animation: none; }
@keyframes kds-parpadeo {
  0%, 100% { box-shadow: 0 4px 14px rgba(178, 58, 58, .25); }
  50% { box-shadow: 0 4px 26px rgba(178, 58, 58, .7); }
}
.kds-card-header {
  background: linear-gradient(135deg, var(--marron-oscuro), var(--rojo-tierra));
  color: #fff;
  padding: .9rem 1.1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .3rem .6rem;
  font-weight: 800;
  font-size: 1.2rem;
}
.kds-card-header > div:first-child { white-space: nowrap; }
.kds-card-header .bi { font-size: 1.25rem; margin-right: .15rem; }
.kds-minutos { background: rgba(255, 255, 255, .18); border-radius: 1rem; padding: .3rem .8rem; font-size: .95rem; font-weight: 700; white-space: nowrap; }
.kds-card.kds-atencion .kds-minutos { background: var(--dorado); color: var(--marron-oscuro); }
.kds-card.kds-urgente .kds-minutos { background: #fff; color: var(--rojo-ocupada); }
.kds-card-body { padding: 1rem 1.1rem; flex: 1; }
.kds-item { display: flex; align-items: flex-start; gap: .65rem; padding: .55rem 0; border-bottom: 1px dashed rgba(0, 0, 0, .12); }
.kds-item:last-child { border-bottom: none; }
.kds-cantidad { flex-shrink: 0; background: var(--crema); color: var(--marron-oscuro); font-weight: 800; font-size: 1rem; border-radius: .6rem; padding: .2rem .55rem; min-width: 2.5rem; text-align: center; }
.kds-nombre { font-size: 1.15rem; font-weight: 600; line-height: 1.3; color: var(--texto-oscuro); }
.kds-nota { margin-top: .35rem; background: #fff4e0; border-left: 3px solid var(--dorado); color: var(--rojo-tierra); font-size: .85rem; font-weight: 600; padding: .3rem .55rem; border-radius: .4rem; }
.kds-card-footer { padding: .8rem 1.1rem 1rem; border-top: 1px solid var(--border); background: var(--crema-clara); }
.kds-card-footer .kds-mesero { font-size: .85rem; color: var(--muted); margin-bottom: .5rem; display: flex; align-items: center; gap: .35rem; }
.kds-card-footer form { margin: 0; }
.kds-card-footer .btn { width: 100%; font-size: 1.05rem; font-weight: 700; padding: .6rem; }

.grafica-cont { position: relative; height: 220px; margin-bottom: .75rem; }
@media print { .grafica-cont { display: none; } }

@media (max-width: 991.98px) {
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(var(--sidebar-width), 84vw);
    transform: translateX(-100%);
    box-shadow: none;
  }
  .sidebar--mobile-open { transform: translateX(0); box-shadow: 0 0 40px rgba(0, 0, 0, .45); }
  .sidebar--collapsed { width: min(var(--sidebar-width), 84vw); }
  .sidebar--collapsed .sidebar__brand-text,
  .sidebar--collapsed .pill-label,
  .sidebar--collapsed .sidebar__section,
  .sidebar--collapsed .sidebar__foot { display: revert; }
  .sidebar--collapsed .sidebar__top { flex-direction: row; padding-left: 16px; }
  .sidebar--collapsed a.pill .pill-inner { padding-left: 20px; }
  .sidebar__toggle { display: none; }

  .sidebar__mobile-toggle {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--marron-oscuro);
    font-size: 1.25rem;
  }
  .sidebar__overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(30, 5, 5, .55);
    z-index: 1035;
  }

  .topbar { padding: 0 16px; }
  .contenido { padding: 18px 16px; }
}

@media (max-width: 767.98px) {
  .titulo-seccion { font-size: 1.25rem; }
  .usuario-menu .usuario-nombre,
  .usuario-menu .badge-rol { display: none; }
  .usuario-menu .usuario-toggle { padding-right: 8px; }

  .d-flex.gap-2.align-items-end { flex-wrap: wrap; }
  .d-flex.gap-2.align-items-end > * { flex: 1 1 auto; }
  .d-flex.gap-2.align-items-end input[type="date"] { min-width: 140px; }

  .opcion-grande { padding: 1rem .35rem; font-size: .85rem; border-radius: 14px; }
  .opcion-grande .bi { width: 44px; height: 44px; font-size: 1.3rem; margin-bottom: .4rem; }
  .mesa-card { padding: .75rem .25rem; font-size: .8rem; }
  .producto-card { padding: .85rem; }
  .nav-pills .nav-link { font-size: .8rem; padding: .35rem .65rem; }
  .carrito { position: static; margin-top: 1rem; }
  .stat-card .valor { font-size: 1.5rem; }
  .ticket { padding: 1rem .5rem; }
}

@media (max-width: 420px) {
  .mesa-card { font-size: .72rem; }
}

@media screen and (max-width: 991.98px) {
  .contenido .table-responsive,
  .contenido .card-tb:has(> table) { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
  .contenido { overflow-wrap: break-word; }
  .contenido table { overflow-wrap: normal; }
}
@media screen and (max-width: 767.98px) {
  .form-control, .form-select { font-size: 16px; }
  .topbar { gap: 8px; padding: 0 12px; }
  .contenido { padding: 16px 12px; }
  .contenido .d-flex.gap-2:not(.flex-nowrap) { flex-wrap: wrap; }
  .contenido .table td.text-end { white-space: nowrap; }
  .stat-card { padding: 1rem .7rem; }
  .stat-card .etiqueta { font-size: .7rem; letter-spacing: 0; overflow-wrap: anywhere; }
  .stat-card .valor { font-size: clamp(1.05rem, 5.4vw, 1.5rem); }
  .comprobante-nomina .comprobante-body { overflow-x: auto; padding: 1.25rem .75rem; }
}

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

.sidebar__subs { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 6px 52px; padding-left: 12px; border-left: 1px solid rgba(243, 230, 200, .2); }
.sidebar__subs a.sub { padding: 6px 10px; border-radius: 8px; color: rgba(243, 230, 200, .75); font-size: .84rem; text-decoration: none; white-space: nowrap; }
.sidebar__subs a.sub:hover { background: rgba(243, 230, 200, .1); color: #fff; }
.sidebar__subs a.sub.activo { color: #fff; font-weight: 600; background: rgba(201, 163, 90, .22); }
.sidebar--collapsed .sidebar__subs { display: none; }

.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.perm-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 12px 14px; margin: 0; min-width: 0; }
.perm-card legend { float: none; width: auto; margin: 0 0 6px; padding: 0; font-size: .95rem; font-weight: 700; color: var(--marron-oscuro); }
.perm-card__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: .78rem; color: var(--muted); }
.perm-card__all { border: 0; background: none; color: var(--rojo-tierra); font-weight: 600; font-size: .78rem; cursor: pointer; padding: 0; }
.perm-card__item { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; font-size: .88rem; cursor: pointer; }
.perm-card__item input { margin-top: 3px; }
.perm-card__item--locked { opacity: .55; cursor: not-allowed; }
.perm-card__lock { display: block; font-size: .72rem; color: var(--muted); }


.tabs-modulo { display: flex; flex-wrap: wrap; gap: .25rem 1.4rem; border-bottom: 1px solid var(--border); margin: -.25rem 0 1.4rem; padding: 0 .25rem; }
.tabs-modulo__tab { display: inline-flex; align-items: center; gap: .5rem; padding: .85rem .15rem; color: var(--texto-suave, #7a6f68); font-weight: 600; font-size: .92rem; text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: color .15s, border-color .15s; }
.tabs-modulo__tab:hover { color: var(--marron-oscuro); }
.tabs-modulo__tab.activa { color: var(--marron-oscuro); font-weight: 700; border-bottom-color: var(--rojo-tierra, #7a2020); }
.tabs-modulo__tab .bi { font-size: 1.05rem; }


.pg-card { max-width: 1280px; margin: 0 auto; border-radius: 20px; padding: 1.75rem 2rem; }
.pg-card--angosta { max-width: 760px; }
.pg-titulo { text-align: center; font-weight: 800; font-size: 1.3rem; letter-spacing: .05em; color: var(--marron-oscuro); margin: 0; text-transform: uppercase; }
.pg-icono { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--marron-oscuro); color: #fff; font-size: 1rem; line-height: 1; vertical-align: middle; margin-left: .4rem; }
.pg-sub { text-align: center; max-width: 640px; margin: .55rem auto 1.4rem; font-size: .88rem; color: var(--muted, #7a6f68); }
.pg-filtro { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-bottom: 1.1rem; }
.pg-filtro .form-control { max-width: 380px; }
.pg-panel { border: 1px solid var(--border); border-radius: 16px; padding: 1.4rem; max-width: 600px; margin: 0 auto; }
.pg-acciones { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.25rem; flex-wrap: wrap; }
.tabla-vino { border-radius: 14px; overflow: hidden; border: 1px solid rgba(127,127,127,.25); }
.tabla-vino table { margin: 0; }
.tabla-vino thead th { background: var(--marron-oscuro); color: #fff; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; padding: .85rem .8rem; border: 0; white-space: nowrap; }
.tabla-vino td { padding: .75rem .8rem; font-size: .9rem; }
.pildora { display: inline-block; padding: .2rem .65rem; border-radius: 999px; background: rgba(127,127,127,.15); font-size: .78rem; white-space: nowrap; }
.pildora--vino { background: rgba(122,32,32,.12); color: var(--marron-oscuro); font-weight: 600; }
.acc-links { display: flex; gap: .2rem .9rem; white-space: nowrap; align-items: center; }
.acc-links a, .acc-links button { border: 0; background: none; padding: 0; font-size: .74rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--marron-oscuro); text-decoration: none; cursor: pointer; }
.acc-links a:hover, .acc-links button:hover { text-decoration: underline; }
.acc-links .peligro { color: #b3261e; }
.perm-aviso { border: 1px dashed rgba(127,127,127,.5); border-radius: 12px; padding: .7rem 1rem; font-size: .86rem; color: var(--muted, #7a6f68); margin-bottom: 1.2rem; }
.perm-barra { position: sticky; bottom: 0; background: linear-gradient(to top, var(--surface) 70%, transparent); padding: 1rem 0 .2rem; margin-top: 1rem; display: flex; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; }
.perm-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.perm-card { border-radius: 14px; padding: .9rem 1rem; }
.perm-card legend { text-transform: uppercase; letter-spacing: .05em; font-size: .78rem; }

.campo-clave { position: relative; }
.campo-clave > input.form-control { padding-right: 46px; background-image: none; }
.campo-clave > input::-ms-reveal { display: none; }
.campo-clave__ojo { position: absolute; top: 0; bottom: 0; right: 0; width: 44px; display: flex; align-items: center; justify-content: center; border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 0 10px 10px 0; }
.campo-clave__ojo:hover { color: var(--marron-oscuro); }
.campo-clave__ojo:focus-visible { outline: 2px solid var(--dorado); outline-offset: -2px; }
