:root {
  --primary: #e11d48;
  --primary-soft: rgba(225,29,72,.1);
  --sidebar: #0f172a;
  --sidebar-2: #111c33;
  --bg: #f4f6f9;
  --surface: #fff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e8ecf1;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(15,23,42,.06);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { font-family: var(--font); background: var(--bg); color: var(--text); margin: 0; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; }

/* Layout */
.admin-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 256px; flex: 0 0 256px; background: var(--sidebar); color: #cbd5e1;
  position: fixed; inset: 0 auto 0 0; z-index: 1040; display: flex; flex-direction: column;
  transition: transform .22s ease;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .brand .logo { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--primary), #fb7185); display: grid; place-items: center; color: #fff; font-size: 18px; }
.sidebar .brand .name { color: #fff; font-weight: 800; font-size: 1rem; line-height: 1.1; }
.sidebar .brand .sub { font-size: .68rem; color: #94a3b8; }
.sidebar .nav {
  display: flex; flex-direction: column; flex-wrap: nowrap;
  padding: 12px 10px; overflow-y: auto; flex: 1; min-height: 0;
  overscroll-behavior: contain; scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.2) transparent;
}
.sidebar .nav::-webkit-scrollbar { width: 6px; }
.sidebar .nav::-webkit-scrollbar-track { background: transparent; }
.sidebar .nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 999px; }
.sidebar .nav .nav-group { display: flex; flex-direction: column; }
.sidebar .nav .group-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; padding: 14px 10px 6px; border: 0; background: transparent;
  font-family: inherit; font-size: .64rem; text-transform: uppercase; letter-spacing: .14em;
  color: #64748b; font-weight: 700; cursor: pointer; text-align: left;
  transition: color .15s ease;
}
.sidebar .nav .group-toggle:hover { color: #cbd5e1; }
.sidebar .nav .group-toggle i { font-size: .62rem; opacity: .7; transition: transform .22s ease; }
.sidebar .nav .nav-group.open .group-toggle i { transform: rotate(180deg); }
.sidebar .nav .group-items { max-height: 0; overflow: hidden; transition: max-height .25s ease; }
.sidebar .nav .nav-group.open .group-items { max-height: 640px; }
.sidebar .nav .group-items-inner { padding-top: 2px; }
.sidebar .nav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px;
  color: #cbd5e1; font-size: .88rem; font-weight: 500; margin-bottom: 2px;
}
.sidebar .nav a i { width: 18px; text-align: center; opacity: .8; }
.sidebar .nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar .nav a.active { background: var(--primary); color: #fff; }
.sidebar .nav a.active i { opacity: 1; }
.sidebar .nav a .pill { margin-left: auto; background: rgba(255,255,255,.15); font-size: .66rem; padding: 2px 7px; border-radius: 999px; }
.sidebar-footer { flex: 0 0 auto; padding: 10px 14px 12px; border-top: 1px solid rgba(255,255,255,.08); color: #64748b; font-size: .62rem; line-height: 1.35; text-align: center; letter-spacing: .01em; }

.main { flex: 1; margin-left: 256px; min-width: 0; transition: margin-left .22s ease; }
.topbar {
  height: 64px; background: rgba(255,255,255,.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px;
  padding: 0 22px; position: sticky; top: 0; z-index: 1030;
}
.topbar .toggle {
  display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto;
  border: 0; border-radius: 10px; background: transparent; color: var(--text);
  font-size: 1.15rem; cursor: pointer;
}
.topbar .toggle:hover { background: #f1f5f9; }
.topbar .page-title { font-weight: 800; font-size: 1.05rem; letter-spacing: -.01em; }
.topbar .spacer { flex: 1; }
.topbar .user { display: flex; align-items: center; gap: 10px; }
.topbar .user .avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 800; }
.topbar .user .meta { line-height: 1.15; }
.topbar .user .meta strong { font-size: .84rem; display: block; }
.topbar .user .meta span { font-size: .72rem; color: var(--muted); }

.content { padding: 24px; max-width: 1500px; margin: 0 auto; }

/* Cards */
.card-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-box .head { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card-box .head h3 { font-size: .98rem; font-weight: 750; margin: 0; }
.card-box .body { padding: 18px; }
.card-box .body.tight { padding: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 17px 18px; box-shadow: var(--shadow); }
.stat .icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.05rem; margin-bottom: 12px; }
.stat .label { font-size: .78rem; color: var(--muted); font-weight: 600; }
.stat .value { font-size: 1.5rem; font-weight: 850; letter-spacing: -.02em; margin-top: 2px; }
.stat .sub { font-size: .72rem; color: var(--muted); margin-top: 3px; }
.bg-soft-primary { background: var(--primary-soft); color: var(--primary); }
.bg-soft-green { background: rgba(22,163,74,.12); color: #16a34a; }
.bg-soft-blue { background: rgba(37,99,235,.12); color: #2563eb; }
.bg-soft-amber { background: rgba(217,119,6,.14); color: #d97706; }
.bg-soft-purple { background: rgba(147,51,234,.12); color: #9333ea; }

/* Tables */
.table { margin: 0; font-size: .86rem; }
.table > :not(caption) > * > * { padding: 11px 12px; vertical-align: middle; }
.table thead th { background: #f8fafc; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table tbody tr:hover { background: #fafbfc; }
.table .actions { white-space: nowrap; }
.table .actions .btn { padding: 5px 9px; font-size: .76rem; border-radius: 8px; }

.badge-status { font-size: .72rem; font-weight: 700; padding: 5px 9px; border-radius: 999px; }
.badge-status.warning { background: #fef3c7; color: #92400e; }
.badge-status.info { background: #dbeafe; color: #1e40af; }
.badge-status.primary { background: #ede9fe; color: #5b21b6; }
.badge-status.success { background: #dcfce7; color: #166534; }
.badge-status.danger { background: #fee2e2; color: #991b1b; }
.badge-status.secondary { background: #e2e8f0; color: #334155; }
.music-track-icon {
  width: 32px; height: 32px; border-radius: 50%; flex: 0 0 32px;
  display: grid; place-items: center; background: var(--primary-soft); color: var(--primary);
  font-size: .8rem;
}

/* Configuración por pestañas */
.settings-tabs {
  display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto;
  border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 18px;
  scrollbar-width: none;
}
.settings-tabs::-webkit-scrollbar { display: none; }
.settings-tabs .nav-item { flex: 0 0 auto; }
.settings-tabs .nav-link {
  border: 1px solid transparent; border-radius: 10px; padding: 9px 14px;
  background: transparent; color: var(--muted); font-size: .84rem; font-weight: 650;
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
}
.settings-tabs .nav-link i { font-size: .82rem; opacity: .8; }
.settings-tabs .nav-link:hover { background: #f1f5f9; color: var(--text); }
.settings-tabs .nav-link.active {
  background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: 0 8px 20px rgba(15,23,42,.14);
}
.settings-tabs .nav-link.active i { opacity: 1; }
.settings-tab-content > form { margin: 0; }
.settings-tab-content .tab-pane { display: none; }
.settings-tab-content .tab-pane.active { display: block; }
.settings-pane-actions {
  display: flex; justify-content: flex-end; align-items: center; gap: 10px;
  margin-top: 16px; padding: 14px 18px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  position: sticky; bottom: 16px; z-index: 5;
}
.settings-pane-actions .text-muted { margin-right: auto; font-size: .78rem; }
.settings-head-icon { color: var(--primary); margin-right: 8px; }
.settings-media-preview {
  width: 100%; max-height: 120px; object-fit: contain; border: 1px dashed var(--line);
  border-radius: 12px; background: #f8fafc; padding: 8px;
}
.settings-day { display: flex; align-items: center; gap: 8px; font-size: .84rem; font-weight: 600; }
.settings-day .badge-status { font-size: .62rem; padding: 3px 7px; }
.payment-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.payment-options .form-check {
  margin: 0; padding: 11px 12px 11px 38px; border: 1px solid var(--line);
  border-radius: 10px; background: #f8fafc;
}
.payment-options .form-check-input { margin-left: -26px; }
@media (max-width: 576px) {
  .payment-options { grid-template-columns: 1fr; }
  .settings-pane-actions { position: static; flex-wrap: wrap; }
  .settings-pane-actions .text-muted { width: 100%; margin-right: 0; }
}

/* Visitas */
.ip-cell {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .76rem;
  letter-spacing: -.02em;
}
.visit-path {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .76rem;
  word-break: break-all;
  max-width: 280px;
}

/* Forms */
.form-label { font-weight: 600; font-size: .82rem; margin-bottom: 5px; }
.form-control, .form-select { border-radius: 10px; border-color: var(--line); padding: 9px 12px; font-size: .88rem; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.btn { border-radius: 10px; font-weight: 600; font-size: .86rem; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { filter: brightness(.92); background: var(--primary); border-color: var(--primary); }
.btn-sm { font-size: .78rem; padding: 6px 10px; }
.btn-icon { width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; }

.close-table-total {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: #f8fafc; border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 15px; margin-bottom: 14px;
}
.close-table-total span { color: var(--muted); font-size: .84rem; }
.close-table-total strong { font-size: 1.35rem; font-weight: 850; letter-spacing: -.02em; }
.table-actions { gap: 6px; }
.table-actions .btn { white-space: nowrap; }

/* Manual order items */
.item-row { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 12px; background: #fbfcfe; }
.item-row:last-child { margin-bottom: 0; }
.item-row-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.item-row-head h3 { font-size: .86rem; font-weight: 800; margin: 0; }
.item-options .option-group { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 8px; }
.item-options .og-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.item-options .og-head strong { font-size: .8rem; }
.item-options .og-head span { font-size: .7rem; color: var(--muted); }
.item-options .option-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-top: 1px dashed var(--line); margin: 0; cursor: pointer; }
.item-options .option-row:first-of-type { border-top: 0; }
.item-options .opt-name { flex: 1; font-size: .82rem; }
.item-options .opt-price { font-size: .74rem; color: var(--muted); font-weight: 700; }
.item-price { font-weight: 800; font-size: .9rem; padding: 9px 0; }

/* Kanban board */
.board-page { display: flex; flex-direction: column; height: calc(100dvh - 64px - 48px); min-height: 420px; }
.board-head { margin-bottom: 12px; }
.board-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.board-search { position: relative; flex: 1 1 260px; min-width: 200px; }
.board-search > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .82rem; pointer-events: none; }
.board-search input {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #fff;
  padding: 9px 36px 9px 33px; font-size: .86rem;
}
.board-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.board-search-clear {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--muted); width: 24px; height: 24px;
  border-radius: 50%; display: grid; place-items: center; cursor: pointer;
}
.board-search-clear:hover { background: #f1f5f9; color: var(--text); }
.board-toolbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.board-switch { display: inline-flex; align-items: center; gap: 7px; font-size: .8rem; font-weight: 600; color: var(--muted); cursor: pointer; user-select: none; margin: 0; }
.board-switch input { accent-color: var(--primary); }
.board-columns-menu { min-width: 220px; padding: 6px; }
.board-column-option { display: flex; align-items: center; gap: 8px; border-radius: 8px; cursor: pointer; }
.board-column-option .form-check-input { margin: 0; flex: 0 0 auto; }
.board-column-option-label { flex: 1; }
.board-column-option-count { font-size: .68rem; color: var(--muted); background: #f1f5f9; border-radius: 999px; padding: 1px 7px; }

.kanban {
  flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 8px; align-items: stretch; overflow-x: auto; overflow-y: hidden; padding-bottom: 2px;
}
.kanban-col {
  display: flex; flex-direction: column; min-height: 0; min-width: 0;
  --status-color: #64748b;
  --col-bg: #eef1f6;
  background: var(--col-bg); border-radius: 12px; padding: 8px;
  border-top: 3px solid var(--status-color);
}
.kanban-col:nth-child(odd) { --col-bg: #eef1f6; }
.kanban-col:nth-child(even) { --col-bg: #e3e9f2; }
.kanban-col[data-column="pending"] { --status-color: #d97706; }
.kanban-col[data-column="confirmed"] { --status-color: #2563eb; }
.kanban-col[data-column="preparing"] { --status-color: #7c3aed; }
.kanban-col[data-column="ready"] { --status-color: #16a34a; }
.kanban-col[data-column="assigned"] { --status-color: #0891b2; }
.kanban-col[data-column="on_the_way"] { --status-color: #ea580c; }
.kanban-col-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: 0 2px 8px; flex: 0 0 auto; }
.kanban-col h4 { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 800; color: #475569; margin: 0; display: flex; align-items: center; gap: 6px; min-width: 0; }
.kanban-col h4 .kanban-col-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kanban-col h4 .n { background: #fff; border-radius: 999px; padding: 1px 7px; font-size: .68rem; flex: 0 0 auto; }
.kanban-collapse {
  border: 0; background: transparent; color: #94a3b8; width: 22px; height: 22px; border-radius: 6px;
  display: grid; place-items: center; cursor: pointer; font-size: .62rem; flex: 0 0 auto;
}
.kanban-collapse:hover { background: #fff; color: var(--text); }
.kanban-cards { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding-right: 2px; scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
.kanban-cards::-webkit-scrollbar { width: 5px; }
.kanban-cards::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }
.order-card { background: #fff; border-radius: 9px; padding: 8px 9px; margin-bottom: 6px; box-shadow: 0 1px 4px rgba(15,23,42,.07); border-left: 3px solid var(--status-color, var(--primary)); }
.order-card .top { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; }
.order-card .num { font-weight: 800; font-size: .78rem; white-space: nowrap; }
.order-card .time { font-size: .64rem; color: var(--muted); white-space: nowrap; }
.order-card .client { font-size: .74rem; color: #334155; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-card .line-meta { font-size: .66rem; color: var(--muted); margin-top: 1px; }
.order-card .amount { font-weight: 800; font-size: .8rem; margin-top: 3px; }
.order-card .foot { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; align-items: center; }
.order-card .foot form { display: inline-flex; margin: 0; }
.order-card .btn-icon-sm { padding: 3px 6px; font-size: .64rem; line-height: 1.1; border-radius: 6px; display: inline-flex; align-items: center; gap: 4px; }
.order-card .btn-icon-sm span { font-weight: 700; }
.kanban-empty { font-size: .72rem; padding: 14px 4px; }
.board-no-results { text-align: center; color: var(--muted); font-size: .84rem; padding: 10px 0 2px; }
.kanban-col.is-hidden { display: none; }
.order-card.is-filtered-out { display: none; }
.kanban-col.is-collapsed { padding: 0; }
.kanban-col.is-collapsed .kanban-cards { display: none; }
.kanban-col.is-collapsed .kanban-col-head { height: 100%; flex-direction: column; align-items: center; justify-content: flex-start; margin: 0; padding: 8px 0; gap: 8px; }
.kanban-col.is-collapsed h4 { flex-direction: column; align-items: center; gap: 8px; }
.kanban-col.is-collapsed .kanban-col-label { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; max-height: 100%; overflow: hidden; text-overflow: ellipsis; }
.kanban-col.is-collapsed .kanban-collapse i { transform: rotate(180deg); }

@media (max-width: 1200px) {
  .order-card .btn-icon-sm span { display: none; }
}
@media (max-width: 900px) {
  .board-page { height: auto; min-height: 0; }
  .kanban { min-height: 60vh; }
}

/* Kitchen */
body.kitchen-body { background: #0b1220; color: #e2e8f0; }
.kitchen-header { display: flex; align-items: center; gap: 14px; padding: 16px 22px; background: #0f172a; border-bottom: 1px solid #1e293b; position: sticky; top: 0; z-index: 10; }
.kitchen-header .title { font-weight: 800; font-size: 1.1rem; }
.kitchen-nav { display: flex; gap: 6px; }
.kitchen-header .clock { margin-left: auto; font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kitchen-summary-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 20px 22px 14px; }
.kitchen-summary-head h1 { color: #fff; font-size: 1.35rem; font-weight: 850; letter-spacing: -.02em; margin: 0; }
.kitchen-summary-head .summary-eyebrow { color: #fb7185; font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 3px; }
.kitchen-summary-head .summary-sub { color: #94a3b8; font-size: .82rem; margin-top: 4px; }
.kitchen-summary-head .summary-refresh { color: #94a3b8; font-size: .82rem; white-space: nowrap; }
.summary-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; padding: 0 18px 24px; }
.summary-item { display: flex; gap: 14px; padding: 14px 16px; background: #111c33; border: 1px solid #1e293b; border-radius: 14px; }
.summary-qty { min-width: 64px; color: #fb7185; font-size: 1.45rem; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.summary-main { min-width: 0; flex: 1; }
.summary-title { color: #fff; font-size: 1rem; line-height: 1.3; }
.summary-title strong { font-weight: 800; }
.summary-variant { color: #94a3b8; }
.summary-orders { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: #1e293b; color: #cbd5e1; font-size: .7rem; font-weight: 700; vertical-align: 2px; }
.summary-options { color: #94a3b8; font-size: .78rem; line-height: 1.45; margin-top: 5px; }
.summary-notes { color: #fbbf24; font-size: .78rem; margin-top: 5px; }
.summary-warning { color: #f59e0b; font-size: .78rem; margin-top: 5px; }
.summary-order-list { margin-top: 6px; color: #94a3b8; font-size: .72rem; }
.summary-order-list summary { color: #cbd5e1; cursor: pointer; user-select: none; }
.summary-order-list span { display: block; margin-top: 3px; }
@media (max-width: 760px) {
  .kitchen-header { flex-wrap: wrap; gap: 8px; padding: 12px 14px; }
  .kitchen-header .clock { order: 5; margin-left: 0; }
  .kitchen-nav { order: 6; width: 100%; }
  .kitchen-nav .btn { flex: 1; }
  .kitchen-summary-head { align-items: flex-start; flex-direction: column; gap: 6px; padding: 16px 14px 10px; }
  .summary-list { grid-template-columns: 1fr; padding: 0 12px 20px; }
}
.kitchen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; padding: 18px; }
.kitchen-card { background: #111c33; border: 1px solid #1e293b; border-radius: 14px; overflow: hidden; }
.kitchen-card.preparing { border-color: #7c3aed; }
.kitchen-card.ready { border-color: #16a34a; }
.kitchen-card.is-warning { border-color: #f59e0b; box-shadow: 0 0 0 1px rgba(245, 158, 11, .35); }
.kitchen-card.is-danger { border-color: #ef4444; box-shadow: 0 0 0 1px rgba(239, 68, 68, .45); }
.kitchen-card .k-item.is-done { opacity: .55; }
.kitchen-card .k-item.is-done .q { color: #4ade80; }
.kitchen-card .k-head { padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; background: rgba(255,255,255,.03); }
.kitchen-card .k-head .num { font-weight: 800; font-size: 1.05rem; color: #fff; }
.kitchen-card .k-head .timer { font-size: .8rem; color: #94a3b8; }
.kitchen-card .k-body { padding: 12px 14px; }
.kitchen-card .k-item { padding: 7px 0; border-bottom: 1px dashed #1e293b; }
.kitchen-card .k-item:last-child { border-bottom: 0; }
.kitchen-card .k-item .q { color: #fb7185; font-weight: 800; }
.kitchen-card .k-item .opts { font-size: .76rem; color: #94a3b8; }
.kitchen-card .k-item .obs { font-size: .76rem; color: #fbbf24; }
.kitchen-card .k-foot { padding: 12px 14px; display: flex; gap: 8px; }
.kitchen-card .k-foot form { flex: 1; }
.kitchen-card .k-foot .btn { width: 100%; }
.kitchen-empty { text-align: center; padding: 80px 20px; color: #64748b; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; }
.login-art { background: linear-gradient(135deg, #0f172a, #3f0d1c 70%, var(--primary)); color: #fff; padding: 54px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art::after { content: '🍕'; position: absolute; font-size: 22rem; right: -60px; bottom: -100px; opacity: .06; }
.login-art h1 { font-size: 2.3rem; font-weight: 850; letter-spacing: -.03em; line-height: 1.1; }
.login-art p { color: #cbd5e1; max-width: 420px; }
.login-form-wrap { display: grid; place-items: center; padding: 30px; background: #fff; }
.login-card { width: min(400px, 100%); }
.login-version { margin-bottom: 14px; color: var(--muted); font-size: .68rem; text-align: center; letter-spacing: .01em; }
.login-card h2 { font-weight: 850; letter-spacing: -.02em; }
.login-card .brand { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; font-weight: 800; }
.login-card .brand .logo { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, var(--primary), #fb7185); display: grid; place-items: center; color: #fff; font-size: 20px; }
.demo-creds { background: #f8fafc; border: 1px dashed var(--line); border-radius: 12px; padding: 12px 14px; font-size: .78rem; color: var(--muted); margin-top: 18px; }
.demo-creds code { color: var(--primary); font-weight: 700; }

/* Quick demo login */
.quick-login { margin-top: 18px; border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: #fff; }
.quick-login-title { font-size: .8rem; font-weight: 800; margin-bottom: 10px; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick-btn { display: flex; align-items: center; gap: 9px; width: 100%; padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; text-align: left; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.quick-btn:hover { border-color: var(--primary); background: var(--primary-soft); }
.quick-btn i { width: 18px; text-align: center; color: var(--primary); }
.quick-btn .ql-label { display: block; font-size: .8rem; font-weight: 700; line-height: 1.1; }
.quick-btn .ql-mail { display: block; font-size: .66rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 135px; }
.quick-login-note { margin-top: 9px; font-size: .7rem; color: var(--muted); }
.quick-login-note code { color: var(--primary); font-weight: 700; }
@media (max-width: 520px) { .quick-grid { grid-template-columns: 1fr; } }


/* Misc */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { font-size: 1.3rem; font-weight: 850; letter-spacing: -.02em; margin: 0; }
.page-head p { color: var(--muted); font-size: .84rem; margin: 2px 0 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.filters .form-control, .filters .form-select { min-width: 130px; }
.empty { text-align: center; color: var(--muted); padding: 34px 16px; }
.empty i { font-size: 2.2rem; color: #cbd5e1; margin-bottom: 10px; display: block; }
.nav-tabs .nav-link { border: 0; color: var(--muted); font-weight: 600; font-size: .86rem; border-bottom: 2px solid transparent; }
.nav-tabs .nav-link.active { color: var(--primary); border-bottom-color: var(--primary); background: transparent; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 16px 24px; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li::before { content: ''; position: absolute; left: -7px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); }
.timeline li:last-child { border-left-color: transparent; }
.timeline .t { font-size: .8rem; font-weight: 700; }
.timeline .d { font-size: .74rem; color: var(--muted); }

@media (min-width: 993px) {
  html.sidebar-hidden .sidebar { transform: translateX(-100%); }
  html.sidebar-hidden .main { margin-left: 0; }
}
@media (max-width: 992px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .content { padding: 16px; }
}
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; }
}

/* Flash messages (admin) */
.flash-stack { position: fixed; top: 18px; right: 18px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; max-width: 360px; }
.flash { background: #fff; border-radius: 10px; padding: 12px 16px; font-size: .85rem; font-weight: 600; color: #0f172a; animation: flash-in .25s ease; }
.flash.success { border-left: 4px solid #16a34a; }
.flash.error { border-left: 4px solid #dc2626; }
.flash.info { border-left: 4px solid #2563eb; }
.flash { cursor: pointer; transition: opacity .25s ease, transform .25s ease; }
.flash.is-hiding { opacity: 0; transform: translateY(-6px); }
@keyframes flash-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* Manual order product picker */
.pos-scan { position: relative; display: flex; align-items: center; margin-bottom: 14px; }
.pos-scan > i { position: absolute; left: 14px; color: var(--primary); font-size: 1rem; pointer-events: none; }
.pos-scan .form-control { height: 46px; padding-left: 40px; padding-right: 74px; border-radius: 12px; font-weight: 600; }
.pos-scan-hint { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: .68rem; color: var(--muted); }
.pos-scan-hint kbd { font-size: .64rem; padding: 2px 5px; border-radius: 5px; background: #f1f5f9; color: #475569; border: 1px solid var(--line); }

.pos-empty { text-align: center; color: var(--muted); padding: 30px 16px; border: 1px dashed #d6dee9; border-radius: 12px; background: #fbfcfe; }
.pos-empty > i { display: block; font-size: 1.9rem; color: #cbd5e1; margin-bottom: 8px; }
.pos-empty strong { display: block; color: var(--text); font-size: .92rem; margin-bottom: 3px; }
.pos-empty p { font-size: .8rem; margin: 0 0 12px; }

.product-selected { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.product-selected .ps-thumb { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 10px; overflow: hidden; background: #f1f5f9; display: grid; place-items: center; color: #94a3b8; }
.product-selected .ps-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-selected .ps-main { flex: 1; min-width: 0; line-height: 1.25; }
.product-selected .ps-name { display: block; font-size: .9rem; font-weight: 750; }
.product-selected .ps-meta { display: block; font-size: .72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-selected .change-product { flex: 0 0 auto; }

.channel-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.channel-pill { margin: 0; cursor: pointer; }
.channel-pill input { position: absolute; opacity: 0; pointer-events: none; }
.channel-pill span { display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-family: inherit; font-size: .84rem; font-weight: 650; color: #3f4652; transition: all .16s ease; }
.channel-pill span i { font-size: .82rem; opacity: .8; }
.channel-pill:hover span { border-color: #cbd5e1; background: #f8fafc; }
.channel-pill input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 5px 14px rgba(225,29,72,.22); }
.channel-pill input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

.order-total-line { display: flex; align-items: center; justify-content: space-between; padding: 13px 15px; border-radius: 12px; background: #f8fafc; border: 1px solid var(--line); }
.order-total-line span { font-size: .82rem; color: var(--muted); font-weight: 650; }
.order-total-line strong { font-size: 1.2rem; font-weight: 850; letter-spacing: -.02em; }

.pos-picker-search { position: relative; margin-bottom: 12px; }
.pos-picker-search > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.pos-picker-search .form-control { height: 48px; padding-left: 40px; border-radius: 12px; }

.pos-cat-scroll { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 14px; scrollbar-width: none; }
.pos-cat-scroll::-webkit-scrollbar { display: none; }
.cat-pill { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-family: inherit; font-weight: 650; font-size: .84rem; white-space: nowrap; color: #3f4652; cursor: pointer; transition: all .16s ease; }
.cat-pill.active, .cat-pill:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.cat-pill .count { font-size: .7rem; opacity: .72; }

.pos-product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.pos-card { display: flex; flex-direction: column; text-align: left; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--text); font-family: inherit; overflow: hidden; cursor: pointer; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.pos-card:hover { transform: translateY(-2px); border-color: #fda4af; box-shadow: 0 10px 24px rgba(15,23,42,.09); }
.pos-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.pos-card-thumb { height: 96px; background: #f1f5f9; display: grid; place-items: center; color: #94a3b8; font-size: 1.4rem; overflow: hidden; }
.pos-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pos-card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pos-card-body strong { font-size: .86rem; font-weight: 750; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pos-card-cat { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.pos-card-price { font-size: .9rem; font-weight: 850; color: var(--primary); margin-top: 2px; }
.pos-card-code { font-size: .66rem; color: #94a3b8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos-picker-empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.pos-picker-empty > i { display: block; font-size: 2rem; color: #cbd5e1; margin-bottom: 10px; }
.pos-picker-empty strong { display: block; color: var(--text); margin-bottom: 3px; }
.pos-picker-empty p { font-size: .82rem; margin: 0; }

@media (max-width: 575px) {
  .product-selected { flex-wrap: wrap; }
  .product-selected .change-product { width: 100%; }
  .pos-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pos-card-thumb { height: 78px; }
}

/* Order data summary */
.order-data-summary { display: flex; flex-direction: column; gap: 9px; }
.ods-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: .82rem; }
.ods-row[hidden] { display: none; }
.ods-row span { color: var(--muted); }
.ods-row strong { text-align: right; font-weight: 700; max-width: 62%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#order-data-modal-alert[hidden] { display: none !important; }
.order-data-status { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; padding: 9px 11px; border-radius: 10px; background: #fff7ed; color: #b45309; font-size: .76rem; font-weight: 700; line-height: 1.3; }
.order-data-status.is-complete { background: #f0fdf4; color: #15803d; }
.order-data-status i { font-size: .85rem; margin-top: 1px; }

[hidden] { display: none !important; }

/* Close table consumption details */
.close-table-details { margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fbfcfe; }
.close-table-details[hidden] { display: none !important; }
.close-details-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; background: #f1f5f9; font-size: .78rem; color: var(--muted); font-weight: 650; }
.close-details-summary strong { color: var(--text); font-size: .88rem; }
.close-details-loading, .close-details-empty { padding: 16px 12px; text-align: center; color: var(--muted); font-size: .8rem; }
.close-detail-order { border-top: 1px solid var(--line); background: #fff; }
.close-detail-order:first-of-type { border-top: 0; }
.close-detail-order-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 9px 12px 5px; }
.close-detail-order-head > div { display: flex; flex-direction: column; line-height: 1.25; }
.close-detail-order-head strong { font-size: .8rem; font-weight: 800; }
.close-detail-order-head span { font-size: .68rem; color: var(--muted); }
.close-detail-order-head > strong { color: var(--primary); font-size: .82rem; white-space: nowrap; }
.close-detail-items { list-style: none; margin: 0; padding: 0 12px 9px; }
.close-detail-items li { padding: 5px 0; border-top: 1px dashed var(--line); }
.close-detail-items li:first-child { border-top: 0; }
.close-detail-item { display: flex; justify-content: space-between; gap: 12px; font-size: .78rem; }
.close-detail-item span:last-child { font-weight: 700; white-space: nowrap; }
.close-detail-options, .close-detail-note { font-size: .68rem; color: var(--muted); margin-top: 2px; }
.close-detail-note { color: #b45309; }

/* POS: nuevo pedido */
.pos-page-head { align-items: flex-start; }
.pos-shortcut-hint { padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font-size: .72rem; white-space: nowrap; }
.pos-shortcut-hint kbd { padding: 1px 5px; border-radius: 5px; background: #f1f5f9; border: 1px solid var(--line); color: #475569; font-size: .64rem; }
.pos-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(360px, .85fr); gap: 18px; align-items: start; }
.pos-catalog { min-width: 0; }
.pos-catalog .body { padding-top: 14px; }
.pos-head-hint { color: var(--muted); font-size: .76rem; }
.pos-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.pos-toolbar .pos-picker-search { flex: 1 1 auto; min-width: 0; margin-bottom: 0; }
.pos-toolbar .pos-scan { flex: 0 1 300px; min-width: 220px; margin-bottom: 0; }
.pos-aside { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pos-cart-body { max-height: 44vh; overflow-y: auto; }
.pos-cart-empty { padding: 24px 16px; }
.pos-cart-body .item-row { background: #fff; }
.order-totals { display: flex; flex-direction: column; gap: 8px; }
.order-totals-row { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .84rem; }
.order-totals-row strong { color: var(--text); font-weight: 750; }
.order-totals .order-total-line { margin-top: 4px; }
.pos-warning { margin-top: 10px; padding: 9px 11px; border-radius: 10px; background: #fff7ed; color: #b45309; font-size: .76rem; font-weight: 700; line-height: 1.35; }
.pos-warning[hidden] { display: none !important; }
.pos-btn-shortcut { display: inline-block; margin-left: 6px; padding: 2px 6px; border-radius: 5px; background: rgba(255,255,255,.18); font-size: .64rem; font-weight: 800; letter-spacing: .04em; vertical-align: 1px; }
.customer-lookup { position: relative; }
.customer-lookup-input { position: relative; }
.customer-lookup-input > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.customer-lookup-input .form-control { height: 44px; padding-left: 38px; border-radius: 10px; }
.customer-results { position: absolute; z-index: 1080; left: 0; right: 0; top: calc(100% + 6px); max-height: 260px; overflow-y: auto; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 14px 36px rgba(15,23,42,.14); }
.customer-results[hidden] { display: none !important; }
.customer-result { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 9px; background: transparent; text-align: left; font-family: inherit; cursor: pointer; }
.customer-result:hover, .customer-result:focus-visible { background: #f8fafc; outline: none; }
.customer-result > i { width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: .76rem; }
.customer-result-body { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.customer-result-body strong { font-size: .84rem; font-weight: 750; }
.customer-result-body span { overflow: hidden; color: var(--muted); font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.customer-result-empty { padding: 10px 12px; color: var(--muted); font-size: .78rem; }
@media (max-width: 1199px) {
  .pos-layout { grid-template-columns: 1fr; }
  .pos-aside { position: static; }
  .pos-cart-body { max-height: none; }
}
@media (max-width: 767px) {
  .pos-toolbar { flex-direction: column; align-items: stretch; }
  .pos-toolbar .pos-scan { flex: 1 1 auto; }
  .pos-cart-body .item-row { padding: 10px; }
}

/* Catálogo de productos sin fotos */
.pos-product-grid.is-compact { display: flex; flex-direction: column; gap: 8px; }
.pos-product-grid.is-compact .pos-card { flex-direction: row; align-items: center; border-radius: 10px; }
.pos-product-grid.is-compact .pos-card-body {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name price" "cat code";
  align-items: center; gap: 2px 12px; width: 100%; padding: 10px 12px;
}
.pos-product-grid.is-compact .pos-card-body strong { grid-area: name; -webkit-line-clamp: 1; }
.pos-product-grid.is-compact .pos-card-cat { grid-area: cat; }
.pos-product-grid.is-compact .pos-card-price { grid-area: price; margin: 0; text-align: right; }
.pos-product-grid.is-compact .pos-card-code { grid-area: code; text-align: right; }
.pos-picker-hint { display: flex; justify-content: flex-end; margin: -4px 0 12px; color: var(--muted); font-size: .7rem; }
.pos-picker-hint kbd { padding: 2px 5px; border-radius: 5px; background: #f1f5f9; border: 1px solid var(--line); color: #475569; font-size: .64rem; }

/* Mejoras y cambios */
.sidebar-changelog-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; padding: 3px 8px; border-radius: 999px; color: #94a3b8; font-size: .64rem; font-weight: 700; text-decoration: none; transition: color .15s ease, background .15s ease; }
.sidebar-changelog-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.sidebar-changelog-link.active { color: #fff; background: var(--primary); }
.changelog-list { display: flex; flex-direction: column; gap: 14px; }
.changelog-entry .head.changelog-toggle { width: 100%; margin: 0; font: inherit; color: inherit; text-align: left; background: none; cursor: pointer; border-radius: var(--radius) var(--radius) 0 0; }
.changelog-entry .head.changelog-toggle:hover { background: #f8fafc; }
.changelog-entry:not(.is-open) .head.changelog-toggle { border-bottom-color: transparent; border-radius: var(--radius); }
.changelog-entry:not(.is-open) .body { display: none; }
.changelog-toggle-main { display: flex; flex-direction: column; }
.changelog-toggle-main .changelog-title { font-size: .98rem; font-weight: 750; }
.changelog-toggle-side { display: flex; align-items: center; gap: 10px; }
.changelog-chevron { color: var(--muted); font-size: .7rem; transition: transform .22s ease; }
.changelog-entry.is-open .changelog-chevron { transform: rotate(180deg); }
.changelog-date { display: inline-block; margin-top: 3px; color: var(--muted); font-size: .74rem; }
.changelog-items { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.changelog-items li { display: flex; align-items: flex-start; gap: 10px; font-size: .86rem; line-height: 1.45; }
.changelog-items li .badge-status { flex: 0 0 auto; margin-top: 1px; font-size: .64rem; padding: 3px 8px; }
