@import url('https://cdn.jsdelivr.net/npm/remixicon@4.5.0/fonts/remixicon.css');

/* ===== RESET & TOKENS ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sidebar-w: 200px;
  --sidebar-bg: #0d0d0d;
  --sidebar-border: rgba(255,255,255,0.07);
  --sidebar-text: rgba(255,255,255,0.55);
  --sidebar-text-hover: rgba(255,255,255,0.85);
  --sidebar-text-active: #ffffff;
  --sidebar-active-bg: rgba(255,255,255,0.09);

  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface2: #f9fafb;
  --border: #e5e7eb;
  --border-dark: #d1d5db;

  --text: #111827;
  --text-2: #374151;
  --text-muted: #6b7280;
  --text-xs: #9ca3af;

  --accent: #6c47ff;
  --accent-hover: #5835ee;
  --accent-light: rgba(108,71,255,0.1);

  --green: #10b981;
  --green-light: #d1fae5;
  --orange: #f59e0b;
  --orange-light: #fef3c7;
  --red: #ef4444;
  --red-light: #fee2e2;
  --blue: #3b82f6;
  --blue-light: #dbeafe;
  --yellow: #fbbf24;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
}

html { font-size: 14px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow: hidden;
}

.sidebar-brand {
  padding: 10px 16px 8px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-brand-link {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-decoration: none;
}

.sidebar-brand-link:hover { opacity: .85; }

.sidebar-logo-img {
  width: 110px; height: auto;
}

.sidebar-logo-name {
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  line-height: 1;
}

.sidebar-logo-sub {
  color: rgba(255,255,255,.35);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-top: -4px;
}

/* legacy - keep for fallback */
.sidebar-logo { display: flex; align-items: center; gap: 10px; }
.sidebar-logo-icon {
  width: 36px; height: 36px; background: var(--accent); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 900; color: #fff;
}
.sidebar-logo-text { color: #fff; font-size: 13px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }

.sidebar-local {
  margin: 6px 16px 1px;
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 700;
  color: #ffffff;
}

.sidebar-local-sub {
  font-size: 10px; font-weight: 400;
  color: var(--sidebar-text);
  margin: 0 16px 3px;
  padding-left: 14px;
}

.local-dot {
  width: 7px; height: 7px;
  background: var(--green);
  border-radius: 50%;
  flex-shrink: 0;
}

.sidebar-nav {
  flex: 1;
  padding: 2px 8px;
  display: flex; flex-direction: column; gap: 0px;
  overflow-y: auto;
}

.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background .15s, color .15s;
  position: relative;
  white-space: nowrap;
}

.sidebar-link:hover {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-text-hover);
}

.sidebar-link.active {
  background: var(--accent);
  color: #ffffff;
}

.sidebar-link.active::before { display: none; }

.sidebar-icon {
  font-size: 16px;
  color: inherit;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
  line-height: 1;
}
.sidebar-link:hover:not(.active) .sidebar-icon {
  color: var(--accent);
}

.sidebar-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
}

.sidebar-sep {
  height: 1px;
  background: var(--sidebar-border);
  margin: 6px 0;
}

.sidebar-bottom {
  padding: 12px 8px;
  border-top: 1px solid var(--sidebar-border);
}

.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background .15s;
}

.sidebar-user:hover { background: var(--sidebar-active-bg); }

.user-avatar {
  width: 30px; height: 30px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
}

.user-info { display: flex; flex-direction: column; min-width: 0; }

.user-name {
  font-size: 12.5px; font-weight: 600;
  color: var(--sidebar-text-active);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.user-role { font-size: 11px; color: var(--sidebar-text); }

/* ===== MAIN CONTENT ===== */
.page-wrap {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
}

.page-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 28px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  position: sticky; top: 0; z-index: 100;
}

.page-title-group { display: flex; flex-direction: column; gap: 2px; }

.page-title {
  font-size: 20px; font-weight: 700; color: var(--text);
  line-height: 1.2;
}

.page-subtitle {
  font-size: 12px; color: var(--text-muted);
  display: flex; align-items: center; gap: 6px;
}

.page-actions { display: flex; align-items: center; gap: 10px; }

.page-body { padding: 24px 28px; flex: 1; }

/* ===== STAT CARDS ===== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-sm);
}

.stat-card-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-card-icon--purple { background: rgba(108,71,255,.12); }
.stat-card-icon--orange { background: rgba(245,158,11,.12); }
.stat-card-icon--green  { background: rgba(16,185,129,.12); }
.stat-card-icon--blue   { background: rgba(59,130,246,.12); }
.stat-card-icon--red    { background: rgba(239,68,68,.12); }

.stat-card-body { min-width: 0; }

.stat-card-value {
  font-size: 24px; font-weight: 700; line-height: 1;
  color: var(--text);
}

.stat-card-label {
  font-size: 12px; color: var(--text-muted); margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ===== KANBAN ===== */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  height: calc(100vh - 200px);
  min-height: 500px;
}

.kanban-col {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  overflow: hidden;
}

.kanban-col-header {
  padding: 12px 14px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.kanban-col-title {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px;
  color: var(--text-muted);
  display: flex; align-items: center; gap: 7px;
}

.kanban-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.kanban-dot--recibido    { background: var(--orange); }
.kanban-dot--cocina      { background: var(--red); }
.kanban-dot--listo       { background: var(--blue); }
.kanban-dot--delivery    { background: var(--accent); }
.kanban-dot--entregado   { background: var(--green); }

.kanban-count {
  background: var(--border);
  color: var(--text-muted);
  font-size: 11px; font-weight: 600;
  padding: 1px 7px;
  border-radius: 20px;
}

.kanban-cards {
  flex: 1; overflow-y: auto;
  padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
}

.kanban-cards::-webkit-scrollbar { width: 3px; }
.kanban-cards::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius: 3px; }

.kanban-empty {
  text-align: center; padding: 32px 12px;
  color: var(--text-xs); font-size: 12px;
}

/* ===== ORDER CARD ===== */
.order-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s, transform .1s;
}

.order-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.order-card.card--demorado { border-left: 3px solid var(--red); }
.order-card.card--warn     { border-left: 3px solid var(--orange); }

.order-card-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}

.order-number {
  font-size: 13px; font-weight: 700; color: var(--accent);
}

.order-time-badge {
  font-size: 11px; font-weight: 600;
  color: var(--text-muted);
}

.order-time-badge.badge--demorado { color: var(--red); }
.order-time-badge.badge--warn     { color: var(--orange); }

.order-client {
  font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 2px;
}

.order-amount {
  font-size: 12px; color: var(--text-muted);
  margin-bottom: 6px;
}

.order-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 8px; }

.order-tag {
  font-size: 10px; font-weight: 600;
  padding: 2px 7px; border-radius: 20px;
  white-space: nowrap;
}

.tag--delivery  { background: var(--blue-light); color: var(--blue); }
.tag--local     { background: var(--green-light); color: var(--green); }
.tag--demorado  { background: var(--red-light); color: var(--red); }

.order-notas {
  font-size: 11px; color: var(--orange);
  background: var(--orange-light);
  padding: 3px 7px; border-radius: var(--radius-xs);
  margin-bottom: 8px;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}

.order-timer {
  font-size: 20px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-bottom: 8px;
  color: var(--text-2);
}

.order-timer.timer--warn     { color: var(--orange); }
.order-timer.timer--demorado { color: var(--red); }

.order-items { margin-bottom: 8px; }

.order-item {
  font-size: 12px; color: var(--text-muted);
  padding: 1px 0;
  display: flex; gap: 4px;
}

.order-item .qty { font-weight: 600; color: var(--text-2); }

.order-actions { display: flex; gap: 6px; }

.order-actions .btn { flex: 1; justify-content: center; font-size: 12px; padding: 6px 8px; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600;
  cursor: pointer; border: none;
  transition: background .15s, box-shadow .15s, transform .1s;
  text-decoration: none; white-space: nowrap;
  line-height: 1;
}

.btn:active { transform: scale(.98); }

.btn-primary   { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }

.btn-success   { background: var(--green); color: #fff; }
.btn-success:hover { background: #0ea472; }

.btn-danger    { background: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-orange    { background: var(--orange); color: #fff; }
.btn-orange:hover { background: #d97706; }

.btn-yellow    { background: var(--yellow); color: #111; }
.btn-yellow:hover { background: #f59e0b; }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--surface2); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover { background: var(--surface2); color: var(--text); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 8px; border-radius: var(--radius-xs); }

.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
}

.modal-overlay.hidden { display: none; }

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%; max-width: 500px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.modal--wide { max-width: 680px; }
.modal--cobrar { max-width: 540px; }
.modal--confirm { max-width: 520px; }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 { font-size: 16px; font-weight: 700; color: var(--text); }

.modal-close {
  background: none; border: none;
  color: var(--text-muted); font-size: 16px; cursor: pointer;
  padding: 4px 6px; border-radius: var(--radius-xs);
  transition: background .15s;
}
.modal-close:hover { background: var(--surface2); color: var(--text); }

.modal-body {
  padding: 20px 22px;
  overflow-y: auto; flex: 1;
  display: flex; flex-direction: column; gap: 14px;
}

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
}

/* ===== FORMS ===== */
.form-row { display: flex; flex-direction: column; gap: 5px; }

.form-row label {
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .4px;
}

.form-row input,
.form-row select,
.form-row textarea {
  background: var(--surface);
  border: 1px solid var(--border-dark);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.form-row small { font-size: 11px; color: var(--text-xs); }

/* ===== TABLES ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table thead tr {
  border-bottom: 2px solid var(--border);
}

.data-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-muted);
}

.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
}

.data-table tbody tr:hover { background: var(--surface2); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ===== STATUS BADGES ===== */
.status-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}

.status-badge--green  { background: var(--green-light);  color: var(--green); }
.status-badge--orange { background: var(--orange-light); color: var(--orange); }
.status-badge--red    { background: var(--red-light);    color: var(--red); }
.status-badge--blue   { background: var(--blue-light);   color: var(--blue); }
.status-badge--purple { background: var(--accent-light); color: var(--accent); }
.status-badge--gray   { background: var(--surface2);     color: var(--text-muted); }

/* ===== CARD CONTAINERS ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}

.card-title {
  font-size: 14px; font-weight: 700; color: var(--text);
}

.card-body { padding: 16px 18px; }

/* ===== AUTOCOMPLETE ===== */
.ac-wrap { position: relative; }

.ac-list {
  position: absolute;
  top: calc(100% + 4px); left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  list-style: none;
  z-index: 150;
  max-height: 220px;
  overflow-y: auto;
}

.ac-list.hidden { display: none; }

.ac-list li {
  padding: 9px 12px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}

.ac-list li:last-child { border-bottom: none; }
.ac-list li:hover { background: var(--surface2); }

.ac-dir { font-size: 11px; color: var(--text-muted); }

/* ===== COMANDAS PAGE LAYOUT ===== */
.cmd-layout {
  display: flex;
  height: calc(100vh - 61px);
}

.cmd-sidebar {
  width: 190px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 14px 12px;
  display: flex; flex-direction: column; gap: 16px;
}

.cmd-main {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.sidebar-block { display: flex; flex-direction: column; gap: 8px; }

.sidebar-title {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px;
  color: var(--text-muted);
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.horaria-table { width: 100%; border-collapse: collapse; }

.horaria-table td {
  padding: 4px 4px;
  font-size: 12px; color: var(--text-muted);
}

.horaria-table .horaria-cnt {
  text-align: right; font-weight: 600; color: var(--text);
}

.horaria-row--activa td { color: var(--text); font-weight: 500; }
.horaria-row--activa .horaria-cnt { color: var(--accent); }

.horaria-total-row {
  display: flex; justify-content: space-between;
  padding: 4px 4px 0;
  font-size: 11px; font-weight: 700;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 2px;
}

.insumos-list { display: flex; flex-direction: column; gap: 4px; }

.insumo-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 3px 0;
  font-size: 12px;
}

.insumo-nombre { color: var(--text-muted); }
.insumo-qty { font-weight: 700; color: var(--text); }
.qty--low { color: var(--red); }

/* ===== COMANDA CARDS ===== */
.comandas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  align-content: start;
}

.comanda-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 10px;
}

.add-slot-card {
  background: var(--surface);
  border: 2px dashed var(--border-dark);
  border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; cursor: pointer;
  min-height: 180px;
  color: var(--text-muted);
  font-size: 13px; font-weight: 500;
  transition: border-color .15s, color .15s, background .15s;
}

.add-slot-card:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.add-slot-icon {
  font-size: 28px; font-weight: 300; line-height: 1;
}

.cc-head {
  display: flex; align-items: center; gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.cc-slot-badge {
  font-size: 10px; font-weight: 700;
  background: var(--accent-light);
  color: var(--accent);
  padding: 2px 8px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: .4px;
}

.cc-ultimo {
  font-size: 11px; color: var(--text-muted); flex: 1;
}

.cc-remove {
  background: none; border: none;
  color: var(--text-xs); cursor: pointer;
  font-size: 13px; padding: 2px 4px;
  border-radius: 4px;
  transition: color .15s, background .15s;
}

.cc-remove:hover { color: var(--red); background: var(--red-light); }

.cc-row2 { display: flex; gap: 8px; }

.cc-field { display: flex; flex-direction: column; gap: 4px; }
.cc-field--grow { flex: 1; min-width: 0; }
.cc-field--hora { width: 90px; flex-shrink: 0; }

.cc-field label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .4px;
  color: var(--text-muted);
}

.cc-field input,
.cc-field select {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-xs);
  padding: 7px 9px;
  font-size: 13px;
  font-family: inherit;
  transition: border-color .15s;
}

.cc-field input:focus,
.cc-field select:focus {
  outline: none;
  border-color: var(--accent);
}

.cc-items-head {
  display: grid;
  grid-template-columns: 1fr 50px 68px 22px;
  gap: 4px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .4px;
  color: var(--text-muted);
  padding: 0 2px;
}

.cc-item-row {
  display: grid;
  grid-template-columns: 1fr 50px 68px 22px;
  gap: 4px; align-items: center;
}

.cc-item-row select,
.cc-item-row input {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-xs);
  padding: 5px 6px;
  font-size: 12px;
  font-family: inherit;
}

.cc-item-row select:focus,
.cc-item-row input:focus {
  outline: none; border-color: var(--accent);
}

.cc-precio {
  font-size: 12px; font-weight: 600;
  color: var(--text-2); text-align: right;
}

.cc-footer {
  display: flex; gap: 8px; flex-wrap: wrap;
}

.cc-total-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: 12px; font-weight: 600;
  color: var(--text-muted);
}

.cc-total-val {
  font-size: 16px; font-weight: 700;
  color: var(--accent);
}

/* ===== CAJA PAGE ===== */
.caja-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 28px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}

.caja-topbar-left {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text-muted);
}

.tb-sep { color: var(--border-dark); }
.tb-label { font-weight: 500; }
.tb-value { font-weight: 700; color: var(--text); font-size: 16px; }
.tb-fecha { font-weight: 600; color: var(--text-2); }

.caja-topbar-right { display: flex; gap: 8px; }

.caja-actions-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 28px;
  display: flex; align-items: center; gap: 8px;
}

.caja-action-sep {
  width: 1px; height: 24px;
  background: var(--border);
  margin: 0 4px;
}

.caja-layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 0;
  min-height: calc(100vh - 120px);
}

.caja-panel-left {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
  overflow-y: auto;
}

.caja-panel-right {
  display: flex; flex-direction: column;
  overflow: hidden;
}

.caja-logo-area {
  text-align: center; padding: 8px 0;
}

.caja-brand-text {
  font-size: 28px; font-weight: 900;
  letter-spacing: 2px; line-height: 1;
  color: var(--text);
}

.jornada-estado {
  text-align: center; padding: 8px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 800;
  letter-spacing: 2px;
}

.jornada-estado--abierta { background: var(--green-light); color: var(--green); }
.jornada-estado--cerrada { background: var(--red-light); color: var(--red); }

.jornada-info-table { width: 100%; border-collapse: collapse; }

.jornada-info-table td {
  padding: 6px 0;
  font-size: 12.5px;
  border-bottom: 1px solid var(--border);
}

.jornada-info-table td:first-child { color: var(--text-muted); font-weight: 600; width: 110px; }
.jornada-info-table td:last-child  { font-weight: 600; color: var(--text); }

.billetes-section { display: flex; flex-direction: column; gap: 6px; }

.billetes-title {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px;
  color: var(--text-muted);
}

.billetes-table {
  width: 100%; border-collapse: collapse; font-size: 12px;
}

.billetes-table th {
  font-size: 10px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .3px;
  padding: 4px 4px; text-align: center;
  border-bottom: 1px solid var(--border);
}

.billetes-table th:first-child { text-align: left; }

.billetes-table td {
  padding: 4px 4px; text-align: center;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
}

.billetes-table td:first-child { text-align: left; font-weight: 600; }
.billetes-table tfoot td { font-weight: 700; color: var(--text); border-top: 2px solid var(--border); }

.bill-cie-input {
  width: 50px; padding: 3px 4px;
  border: 1px solid var(--border); border-radius: 4px;
  text-align: center; font-size: 12px; font-family: inherit;
}

.bill-cie-input:focus { outline: none; border-color: var(--accent); }

.diferencia-caja-bar {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px; font-weight: 700;
  color: var(--text);
}

/* Right panel */
.caja-right-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-bottom: 1px solid var(--border);
}

.resumen-jornada,
.cierre-caja {
  padding: 16px 18px;
}

.cierre-caja { border-left: 1px solid var(--border); }

.rj-title {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.rj-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }

.rj-table td {
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
}

.rj-table td:first-child { color: var(--text-muted); }
.rj-table td:last-child  { text-align: right; font-weight: 600; color: var(--text); }

.rj-val--total   { color: var(--accent) !important; font-size: 15px !important; }
.rj-val--pending { color: var(--orange) !important; }
.rj-val--neg     { color: var(--red) !important; }
.rj-val--pos     { color: var(--green) !important; }
.rj-sep td       { border-top: 2px solid var(--border); }

.cierre-input {
  width: 100%; padding: 5px 8px;
  border: 1px solid var(--border); border-radius: 4px;
  font-size: 13px; font-family: inherit;
}

.cierre-input:focus { outline: none; border-color: var(--accent); }

.comandas-table-wrap {
  flex: 1; overflow-y: auto;
}

.comandas-table { width: 100%; border-collapse: collapse; font-size: 13px; }

.comandas-table th {
  position: sticky; top: 0;
  background: var(--surface);
  padding: 10px 14px;
  text-align: left;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  z-index: 5;
}

.comandas-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); }

.cmd-row { cursor: pointer; transition: background .1s; }
.cmd-row:hover { background: var(--surface2); }
.cmd-row--selected { background: var(--accent-light) !important; }
.cmd-row--cancelada { opacity: .5; }

.cmd-numero { font-weight: 700; color: var(--accent); }
.cmd-delivery { font-size: 12px; color: var(--text-muted); }

.saldo--pagado   { color: var(--green); font-weight: 600; }
.saldo--pendiente { color: var(--orange); font-weight: 600; }
.saldo--cancelado { color: var(--text-xs); }

.estado-badge { /* uses status-badge */ }
.estado-badge--pagada      { background: var(--green-light);  color: var(--green);      padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.estado-badge--pendiente   { background: var(--orange-light); color: var(--orange);     padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.estado-badge--cancelada   { background: var(--surface2);     color: var(--text-muted); padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.estado-badge--preparacion { background: rgba(59,130,246,.12); color: #3b82f6;           padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.estado-badge--listo       { background: var(--green-light);  color: var(--green);      padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }

/* ===== COBRAR MODAL ===== */
.cobrar-resumen {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px;
}

.cobrar-row3 {
  display: flex; justify-content: space-between; gap: 12px;
}

.pago-completo {
  font-size: 13px; font-weight: 600; color: var(--green);
}

.cobrar-metodos { display: flex; flex-direction: column; gap: 6px; }

.cobrar-metodo-row {
  display: grid;
  grid-template-columns: 1fr auto 50px 90px;
  gap: 8px; align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.cb-metodo-label { font-weight: 500; color: var(--text); }
.cb-actual { font-size: 11px; color: var(--text-muted); }
.cb-agregar-label { font-size: 11px; color: var(--text-muted); text-align: right; }

.cb-monto-input {
  padding: 6px 8px;
  border: 1px solid var(--border); border-radius: var(--radius-xs);
  font-size: 13px; font-family: inherit; text-align: right;
  width: 100%;
}

.cb-monto-input:focus { outline: none; border-color: var(--accent); }

.cobrar-footer { justify-content: space-between; }

/* ===== CONFIRM MODAL ===== */
.confirm-meta {
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex; flex-direction: column; gap: 4px;
  font-size: 13px; color: var(--text-2);
}

.cm-label { font-weight: 600; color: var(--text-muted); }

.confirm-items { margin-top: 4px; }

.confirm-items table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}

.confirm-items th {
  text-align: left; padding: 6px 8px;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
}

.confirm-items td { padding: 7px 8px; border-bottom: 1px solid var(--border); color: var(--text-2); }
.confirm-items tfoot td { font-weight: 700; border-top: 2px solid var(--border); padding-top: 8px; }

/* ===== DISPONIBILIDAD MODAL ===== */
.modal-sub { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }

.search-input {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border-dark); border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit; color: var(--text);
}

.search-input:focus { outline: none; border-color: var(--accent); }

.disponib-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 10px; }
.disponib-table th { padding: 7px 12px; text-align: left; font-size: 11px; font-weight: 700; color: var(--text-muted); border-bottom: 2px solid var(--border); }
.disponib-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.disponib-qty { text-align: right; font-weight: 700; }
.disponib-qty.qty--ok  { color: var(--green); }
.disponib-qty.qty--low { color: var(--red); }

/* ===== EMPTY STATE ===== */
.empty-col {
  text-align: center; padding: 32px;
  color: var(--text-muted); font-size: 13px;
}

/* ===== UTILITY ===== */
.hidden { display: none !important; }

.text-muted { color: var(--text-muted); }
.text-green  { color: var(--green); }
.text-orange { color: var(--orange); }
.text-red    { color: var(--red); }
.text-accent { color: var(--accent); }

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    width: 100%;
    height: auto;
    position: fixed;
    top: auto; bottom: 0; left: 0;
    flex-direction: row;
    height: 56px;
    z-index: 200;
    border-top: 1px solid var(--sidebar-border);
  }

  .sidebar-brand,
  .sidebar-local,
  .sidebar-local-sub,
  .sidebar-bottom,
  .sidebar-sep,
  .sidebar-section-label { display: none; }

  .sidebar-nav {
    flex-direction: row;
    padding: 0;
    gap: 0;
    justify-content: space-around;
    align-items: stretch;
    width: 100%;
  }

  .sidebar-link {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 4px;
    border-radius: 0;
    font-size: 10px;
    flex: 1;
  }

  .sidebar-link::before { display: none; }
  .sidebar-link.active { border-top: 2px solid var(--accent); }

  .sidebar-icon { font-size: 18px; }
  .sidebar-badge { position: absolute; top: 4px; right: 10px; font-size: 9px; padding: 1px 4px; }

  .page-wrap { margin-left: 0; padding-bottom: 56px; }

  .page-header { padding: 12px 16px; }
  .page-body   { padding: 14px 16px; }
  .page-title  { font-size: 17px; }

  .kanban-board { grid-template-columns: 1fr; height: auto; }

  .stats-row { grid-template-columns: repeat(2, 1fr); }

  .caja-layout { grid-template-columns: 1fr; }
  .caja-panel-left { order: 2; }
  .caja-panel-right { order: 1; }
  .caja-right-top { grid-template-columns: 1fr; }
  .cierre-caja { border-left: none; border-top: 1px solid var(--border); }

  .cmd-layout { flex-direction: column; height: auto; }
  .cmd-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }

  .comandas-grid { grid-template-columns: 1fr; }

  .modal { max-width: 100%; margin: 0 12px; }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
  .caja-actions-bar { flex-wrap: wrap; padding: 8px 12px; }
}

/* ===== FILTER BAR ===== */
.filter-bar {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.filter-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.input-field {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface2);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
  background: var(--surface);
}
select.input-field { cursor: pointer; }

/* ===== TABLE CARD ===== */
.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.table-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
}
.tc-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.tc-title i { font-size: 16px; color: var(--accent); }
.tc-actions {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.table-scroll { overflow-x: auto; }
.table-empty {
  text-align: center;
  padding: 36px 16px !important;
  color: var(--text-muted);
  font-size: 13px;
}

/* ===== TWO-COL GRID ===== */
.two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 860px) {
  .two-col-grid { grid-template-columns: 1fr; }
}

/* ===== STAT CARD EXTRAS ===== */
.stat-card-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}
.stat-card-value--green  { color: var(--green) !important; }
.stat-card-value--red    { color: var(--red) !important; }
.stat-card-value--orange { color: var(--orange) !important; }
.stat-card-value--blue   { color: var(--blue) !important; }

/* ===== HORA BARS (historial cocina) ===== */
.hora-chart-wrap {
  padding: 16px 20px 20px;
}
.hora-bars-container {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 100px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
}
.hora-bar {
  flex: 1;
  min-width: 0;
  background: var(--accent-light);
  border-radius: 3px 3px 0 0;
  position: relative;
  transition: background 0.2s;
  cursor: default;
  min-height: 2px;
}
.hora-bar:hover { background: var(--accent); }
.hora-bar.hora-bar--empty { background: var(--border); }
.hora-labels-row {
  display: flex;
  gap: 5px;
  margin-top: 4px;
}
.hora-label {
  flex: 1;
  text-align: center;
  font-size: 0.62rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
}

/* ===== SIDEBAR GROUP (colapsable Madre) ===== */
.sidebar-group-toggle {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px;
  background: none; border: none; cursor: pointer;
  color: var(--sidebar-text);
  font-size: 13px; font-weight: 600;
  border-radius: var(--radius-xs);
  text-align: left;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.sidebar-group-toggle:hover {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-text-hover);
}
.sidebar-group-toggle.open {
  color: var(--accent);
}
.sidebar-group-arrow {
  margin-left: auto;
  font-size: 16px;
  transition: transform .2s;
  flex-shrink: 0;
}
.sidebar-group-toggle.open .sidebar-group-arrow {
  transform: rotate(180deg);
}
.sidebar-group-items {
  overflow: hidden;
  max-height: 0;
  transition: max-height .25s ease;
}
.sidebar-group-items.open {
  max-height: 600px;
}
.sidebar-sub {
  padding-left: 26px !important;
  font-size: 12.5px !important;
  opacity: .92;
}

/* ===== SIDEBAR SECTION LABELS ===== */
.sidebar-section-label {
  padding: 7px 10px 2px;
  font-size: 10px; font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.28);
  user-select: none;
}

.sidebar-nav { overflow-y: auto; }
.sidebar-nav::-webkit-scrollbar { width: 2px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); }

.sidebar-cerrar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  color: var(--sidebar-text);
  font-size: 13px; cursor: pointer;
  border-radius: var(--radius-xs);
  transition: color .15s, background .15s;
  text-decoration: none;
}
.sidebar-cerrar:hover { background: rgba(239,68,68,.15); color: var(--red); }

/* ===== GLOBAL TOP HEADER ===== */
.top-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  position: sticky; top: 0; z-index: 100;
}

.th-left { display: flex; align-items: center; gap: 12px; }

.th-page-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--accent-light);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}

.th-titles { display: flex; flex-direction: column; gap: 1px; }
.th-title { font-size: 18px; font-weight: 700; color: var(--text); line-height: 1.1; }
.th-subtitle { font-size: 12px; color: var(--text-muted); }

.th-right { display: flex; align-items: center; gap: 12px; }

.caja-chip {
  display: flex; align-items: center; gap: 6px;
  border: 1.5px solid;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px; font-weight: 600;
}

.caja-chip--abierta { border-color: var(--green); color: var(--green); }
.caja-chip--cerrada { border-color: var(--red); color: var(--red); }

.chip-dot {
  width: 7px; height: 7px; border-radius: 50%;
}

.chip-dot--verde  { background: var(--green); }
.chip-dot--rojo   { background: var(--red); }

.turno-info {
  display: flex; flex-direction: column; gap: 1px;
  font-size: 11.5px; color: var(--text-muted);
  border-left: 1px solid var(--border); padding-left: 12px;
}
.turno-info strong { color: var(--text-2); font-weight: 600; }

.clock-widget {
  display: flex; align-items: center; gap: 10px;
  border-left: 1px solid var(--border); padding-left: 12px;
}

.clock-icon {
  width: 32px; height: 32px;
  border: 1.5px solid var(--border-dark);
  border-radius: var(--radius-xs);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: var(--text-muted);
}

.clock-times { display: flex; flex-direction: column; gap: 1px; text-align: right; }
.clock-date { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.clock-time { font-size: 18px; font-weight: 700; color: var(--text); line-height: 1; font-variant-numeric: tabular-nums; }

.th-actions { display: flex; gap: 8px; }

/* ===== HOME PAGE ===== */
.home-welcome {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex; align-items: center; gap: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.hw-icon {
  width: 60px; height: 60px;
  background: var(--accent-light);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; flex-shrink: 0;
}

.hw-body { flex: 1; }
.hw-title { font-size: 20px; font-weight: 700; color: var(--text); }
.hw-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.hw-stats { display: flex; gap: 28px; }

.hw-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.hw-stat-val { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1; }
.hw-stat-label { font-size: 11px; color: var(--text-muted); }
.hw-stat-link { font-size: 11px; color: var(--accent); font-weight: 600; text-decoration: none; }
.hw-stat-link:hover { text-decoration: underline; }
.hw-stat-val--orange { color: var(--orange); }
.hw-stat-val--red { color: var(--red); }

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.module-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
}

.module-card-body { padding: 18px 20px 10px; flex: 1; }

.mc-icon-row {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 12px;
}

.mc-icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0;
}

.mc-icon--purple { background: rgba(108,71,255,.1); }
.mc-icon--green  { background: rgba(16,185,129,.1); }
.mc-icon--orange { background: rgba(245,158,11,.1); }
.mc-icon--blue   { background: rgba(59,130,246,.1); }
.mc-icon--red    { background: rgba(239,68,68,.1); }
.mc-icon--gray   { background: rgba(107,114,128,.1); }

.mc-heading {
  font-size: 14px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .5px;
}

.mc-heading--purple { color: var(--accent); }
.mc-heading--green  { color: var(--green); }
.mc-heading--orange { color: var(--orange); }
.mc-heading--blue   { color: var(--blue); }
.mc-heading--red    { color: var(--red); }
.mc-heading--gray   { color: var(--text-muted); }

.mc-desc { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

.mc-items {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 3px; margin-top: 12px;
}

.mc-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--text-2);
}

.mc-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}

.mc-dot--purple { background: var(--accent); }
.mc-dot--green  { background: var(--green); }
.mc-dot--orange { background: var(--orange); }
.mc-dot--red    { background: var(--red); }
.mc-dot--blue   { background: var(--blue); }
.mc-dot--gray   { background: var(--text-muted); }

.module-card-footer {
  border-top: 1px solid var(--border);
  padding: 12px 20px;
}

.mc-link {
  display: flex; align-items: center; justify-content: space-between;
  text-decoration: none;
  font-size: 13px; font-weight: 600;
  transition: color .15s;
}

.mc-link--purple { color: var(--accent); }
.mc-link--green  { color: var(--green); }
.mc-link--orange { color: var(--orange); }
.mc-link--blue   { color: var(--blue); }
.mc-link--red    { color: var(--red); }
.mc-link--gray   { color: var(--text-muted); }

.mc-link:hover { opacity: .8; }

.home-tip {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 20px;
  font-size: 12.5px; color: var(--text-muted);
  gap: 16px;
}

.tip-info { display: flex; align-items: center; gap: 8px; }
.tip-icon { font-size: 16px; color: var(--accent); }

/* ===== KITCHEN CONTROL COCINA ===== */
.kitchen-layout {
  display: flex; flex-direction: column;
  height: calc(100vh - 60px);
  overflow: hidden;
}

.kitchen-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  padding: 16px 24px 0;
  flex-shrink: 0;
}

.kstat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.kstat-val { font-size: 28px; font-weight: 800; line-height: 1; }
.kstat-label { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.kstat-link { font-size: 11px; color: var(--accent); font-weight: 600; text-decoration: none; }
.kstat-link:hover { text-decoration: underline; }

.kstat-val--orange { color: var(--orange); }
.kstat-val--blue   { color: var(--blue); }
.kstat-val--green  { color: var(--green); }
.kstat-val--red    { color: var(--red); }

.kitchen-tabs-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}

.ktabs { display: flex; gap: 0; }

.ktab {
  padding: 8px 14px;
  font-size: 13px; font-weight: 500;
  color: var(--text-muted);
  cursor: pointer; border: none; background: none;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}

.ktab:hover { color: var(--text); }
.ktab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.ktab-count {
  display: inline-block;
  margin-left: 4px;
  background: var(--border);
  color: var(--text-muted);
  font-size: 11px; font-weight: 600;
  padding: 1px 6px; border-radius: 20px;
}

.ktab.active .ktab-count { background: var(--accent-light); color: var(--accent); }

.ktabs-search { display: flex; align-items: center; gap: 8px; }

.kitchen-search {
  padding: 7px 12px;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  font-size: 13px; font-family: inherit; color: var(--text);
  background: var(--surface);
}
.kitchen-search:focus { outline: none; border-color: var(--accent); }

.kitchen-kanban {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  padding: 14px 24px;
  flex: 1; overflow: hidden;
}

.kcol {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.kcol-header {
  padding: 10px 14px;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  border-top: 3px solid transparent;
  flex-shrink: 0;
}

.kcol--orange .kcol-header  { border-top-color: var(--orange); }
.kcol--blue   .kcol-header  { border-top-color: var(--blue); }
.kcol--green  .kcol-header  { border-top-color: var(--green); }
.kcol--red    .kcol-header  { border-top-color: var(--red); }

.kcol-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px;
}

.kcol--orange .kcol-title { color: var(--orange); }
.kcol--blue   .kcol-title { color: var(--blue); }
.kcol--green  .kcol-title { color: var(--green); }
.kcol--red    .kcol-title { color: var(--red); }

.kcol-cnt {
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 20px;
}

.kcol--orange .kcol-cnt { background: var(--orange-light); color: var(--orange); }
.kcol--blue   .kcol-cnt { background: var(--blue-light);   color: var(--blue); }
.kcol--green  .kcol-cnt { background: var(--green-light);  color: var(--green); }
.kcol--red    .kcol-cnt { background: var(--red-light);    color: var(--red); }

.kcol-cards {
  flex: 1; overflow-y: auto;
  padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
}

.kcol-cards::-webkit-scrollbar { width: 3px; }
.kcol-cards::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius: 3px; }

/* ===== KITCHEN ORDER CARDS ===== */
.kcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow .15s, transform .1s;
  display: flex; flex-direction: column; gap: 7px;
}

.kcard:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.kcard--retrasada { border-left: 3px solid var(--red); }

.kcard-top {
  display: flex; align-items: center; justify-content: space-between;
}

.kcard-num { font-size: 13px; font-weight: 700; color: var(--accent); }
.kcard-mesa { font-size: 11px; color: var(--text-muted); }

.kcard-tiempo {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
}
.kcard-tiempo--warn { color: var(--orange); }
.kcard-tiempo--late { color: var(--red); }

.kcard-late-badge {
  font-size: 10px; font-weight: 700;
  background: var(--red-light); color: var(--red);
  padding: 1px 6px; border-radius: 20px;
}

.kcard-items { font-size: 12px; color: var(--text-2); }

.kcard-item { padding: 1px 0; display: flex; gap: 4px; }
.kcard-item .kqty { font-weight: 700; color: var(--text-2); }

.kcard-footer {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; color: var(--text-muted);
}

.kcard-operator { display: flex; align-items: center; gap: 4px; }
.kcard-station { font-size: 10px; font-weight: 600; color: var(--text-xs); }

.kcard-progress {
  height: 4px; background: var(--border);
  border-radius: 2px; overflow: hidden;
  margin: 2px 0;
}

.kcard-progress-bar {
  height: 100%; border-radius: 2px;
  background: var(--blue);
  transition: width .5s;
}

.kcard-progress-bar--warn { background: var(--orange); }
.kcard-progress-bar--late { background: var(--red); }

.kcard-action {
  width: 100%;
  padding: 7px 0;
  border-radius: var(--radius-xs);
  font-size: 12px; font-weight: 600;
  cursor: pointer; border: none;
  transition: opacity .15s;
  text-align: center;
  margin-top: 3px;
}

.kcard-action:hover { opacity: .85; }
.kcard-action--green  { background: var(--green-light); color: var(--green); border: 1px solid var(--green); }
.kcard-action--orange { background: var(--orange-light); color: var(--orange); border: 1px solid var(--orange); }
.kcard-action--red    { background: transparent; color: var(--red); border: 1.5px solid var(--red); }
.kcard-action--blue   { background: var(--blue-light); color: var(--blue); border: 1px solid var(--blue); }

.kcol-empty { text-align: center; padding: 24px 12px; color: var(--text-xs); font-size: 12px; }

/* ===== KITCHEN BOTTOM LEGEND ===== */
.kitchen-legend {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 8px 24px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11.5px; color: var(--text-muted);
  flex-shrink: 0;
}

.klegend-items { display: flex; align-items: center; gap: 14px; }

.klegend-item { display: flex; align-items: center; gap: 5px; }

/* ===== KITCHEN DETAIL MODAL ===== */
.kmodal-status-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.kmodal-badge {
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
}

.kmodal-badge--pendiente   { background: var(--orange-light); color: var(--orange); }
.kmodal-badge--preparacion { background: var(--blue-light); color: var(--blue); }
.kmodal-badge--listo       { background: var(--green-light); color: var(--green); }
.kmodal-badge--retrasado   { background: var(--red-light); color: var(--red); }

.kmodal-meta-chip {
  font-size: 12px; font-weight: 500; color: var(--text-muted);
  background: var(--surface2); border-radius: 20px; padding: 2px 10px;
}

.kmodal-info-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px;
}

.kmodal-info-item { display: flex; flex-direction: column; gap: 3px; }
.kmodal-info-label { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; }
.kmodal-info-val { font-size: 13px; font-weight: 600; color: var(--text-2); }
.kmodal-timer { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text); }

.kmodal-items-list { display: flex; flex-direction: column; gap: 8px; }

.kmodal-item-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 12px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.kmodal-item-qty { font-size: 14px; font-weight: 800; color: var(--accent); flex-shrink: 0; }
.kmodal-item-name { font-size: 13px; font-weight: 600; color: var(--text); }
.kmodal-item-desc { font-size: 11px; color: var(--text-muted); }

.kmodal-item-station {
  margin-left: auto; flex-shrink: 0;
  font-size: 10px; font-weight: 700;
  padding: 3px 8px; border-radius: 20px;
  background: var(--accent-light); color: var(--accent);
  text-transform: uppercase;
}

.kmodal-notas {
  background: var(--orange-light);
  border: 1px solid rgba(245,158,11,.3);
  border-radius: var(--radius-sm); padding: 10px 14px;
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13px; color: var(--orange);
}

.kmodal-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.kmodal-actions .btn { flex: 1; justify-content: center; }

/* ===== NEW CAJA LAYOUT ===== */
.caja-top-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
}

.caja-top-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer;
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap; min-width: 72px;
}

.caja-top-btn:hover { background: var(--surface2); border-color: var(--border-dark); color: var(--text); }
.caja-top-btn .btn-icon-lg { font-size: 18px; }

.caja-top-btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.caja-top-btn--primary:hover { background: var(--accent-hover); }
.caja-top-btn--danger  { color: var(--red); }
.caja-top-btn--danger:hover  { background: var(--red-light); border-color: var(--red); }

.caja-main {
  display: grid;
  grid-template-columns: 320px 1fr 260px;
  height: calc(100vh - 130px);
  min-height: 0;
}

.caja-col {
  overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 14px;
  border-right: 1px solid var(--border);
}

.caja-col:last-child { border-right: none; }

.caja-col-title {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.jornada-abierta-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--green-light); color: var(--green);
  padding: 4px 12px; border-radius: 20px;
  font-size: 13px; font-weight: 800; letter-spacing: 1px;
}

.jornada-cerrada-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--red-light); color: var(--red);
  padding: 4px 12px; border-radius: 20px;
  font-size: 13px; font-weight: 800; letter-spacing: 1px;
}

.bill-qty-input {
  width: 52px; padding: 4px 6px;
  border: 1px solid var(--border); border-radius: 4px;
  text-align: center; font-size: 13px; font-family: inherit;
  background: var(--surface2);
}
.bill-qty-input:focus { outline: none; border-color: var(--accent); }

.arqueo-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.arqueo-table th { padding: 6px 8px; text-align: left; font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); border-bottom: 2px solid var(--border); }
.arqueo-table th:not(:first-child) { text-align: right; }
.arqueo-table td { padding: 7px 8px; border-bottom: 1px solid var(--border); }
.arqueo-table td:not(:first-child) { text-align: right; font-weight: 500; }
.arqueo-table tfoot td { font-weight: 700; color: var(--text); border-top: 2px solid var(--border-dark); }

.arqueo-total-box {
  background: var(--accent-light);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex; flex-direction: column; gap: 2px;
}
.arqueo-total-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.arqueo-total-val { font-size: 28px; font-weight: 800; color: var(--accent); }

.diferencia-box {
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex; flex-direction: column; gap: 2px;
}
.diferencia-box--ok { background: var(--green-light); border: 1px solid var(--green); }
.diferencia-box--bad { background: var(--red-light); border: 1px solid var(--red); }
.diferencia-box--neutral { background: var(--surface2); border: 1px solid var(--border); }
.diferencia-label { font-size: 11px; font-weight: 600; color: var(--text-muted); }
.diferencia-val { font-size: 20px; font-weight: 800; }
.diferencia-box--ok .diferencia-val { color: var(--green); }
.diferencia-box--bad .diferencia-val { color: var(--red); }
.diferencia-box--neutral .diferencia-val { color: var(--text); }

.rj-group { display: flex; flex-direction: column; gap: 4px; }
.rj-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.rj-row:last-child { border-bottom: none; }
.rj-key { color: var(--text-muted); }
.rj-val { font-weight: 600; color: var(--text); }
.rj-val--accent { color: var(--accent) !important; font-size: 16px !important; }
.rj-val--green  { color: var(--green) !important; }
.rj-val--orange { color: var(--orange) !important; }

.movimientos-list { display: flex; flex-direction: column; gap: 4px; }
.mv-row { display: flex; justify-content: space-between; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.mv-row:last-child { border-bottom: none; }
.mv-left { display: flex; flex-direction: column; gap: 1px; }
.mv-hora { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.mv-desc { color: var(--text-2); }
.mv-amt { font-weight: 700; }
.mv-amt--pos { color: var(--green); }
.mv-amt--neg { color: var(--red); }

.dist-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.dist-label { font-size: 11px; color: var(--text-muted); }
.dist-val { font-size: 20px; font-weight: 800; color: var(--text); }
.dist-sub { font-size: 11px; color: var(--text-muted); }

@media (max-width: 900px) {
  .module-grid { grid-template-columns: 1fr 1fr; }
  .kitchen-stats { grid-template-columns: repeat(3, 1fr); }
  .kitchen-kanban { grid-template-columns: repeat(3, 1fr); height: auto; }
  .caja-main { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .module-grid { grid-template-columns: 1fr; }
  .kitchen-stats { grid-template-columns: repeat(2, 1fr); }
  .kitchen-kanban { grid-template-columns: 1fr; }
  .kmodal-info-grid { grid-template-columns: repeat(2, 1fr); }
  .hw-stats { flex-direction: column; gap: 12px; }
}
