/* ============ AMA by María — Charcutería & Más (Verde y Crema) ============ */
:root {
  --primary: #2d5a3d;
  --primary-dark: #1f422b;
  --primary-light: #e8f2ec;
  --accent: #c59b47;
  --cream: #f5eedc;
  --bg: #faf6ee;
  --card: #fffdf8;
  --text: #1c2a21;
  --muted: #5a6b5f;
  --border: #e2dac9;
  --sidebar: #1b3726;
  --sidebar-text: #d8eadf;
  --success: #15803d;
  --warning: #b45309;
  --danger: #b91c1c;
  --info: #0369a1;
  --whatsapp: #128c7e;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(27, 55, 38, .08), 0 6px 16px rgba(27, 55, 38, .05);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1b3726 0%, #2d5a3d 55%, #e8dcc0 140%);
  padding: 20px;
}
.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 36px 32px;
  width: 100%;
  max-width: 410px;
  box-shadow: 0 22px 60px rgba(17, 36, 25, .28);
}
.login-badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.login-logo {
  font-size: 30px;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: -0.5px;
  line-height: 1.15;
}
.login-brand-sub {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .3px;
  margin-top: 2px;
}
.login-sub { color: var(--muted); margin: 10px 0 22px; font-size: 13.5px; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 242px;
  background: var(--sidebar);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
}
.sidebar-brand {
  padding: 20px 18px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.sidebar-logo {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
}
.sidebar-tagline {
  font-size: 12px;
  color: #e6c67c;
  font-weight: 600;
  margin-top: 2px;
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 10px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  margin: 2px 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .9; }
.nav-item:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; font-weight: 700; box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.sidebar-foot {
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  font-size: 12px;
}
.sidebar-user { color: #fff; font-weight: 600; }
.sidebar-user small { display: block; color: var(--sidebar-text); font-weight: 400; opacity: .85; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar h1 { margin: 0; font-size: 19px; font-weight: 800; color: var(--primary-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.content { padding: 22px 24px 64px; max-width: 1400px; width: 100%; margin: 0 auto; }

.cupo-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--cream);
  color: var(--primary-dark);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.cupo-pill.near { background: #fef3c7; border-color: #f59e0b; color: #92400e; }
.cupo-pill.full { background: #fee2e2; border-color: #ef4444; color: #991b1b; }

/* ---------- Cards & Grids ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 18px;
}
.card h2, .card h3 { margin: 0 0 14px; font-size: 16px; color: var(--primary-dark); }
.grid { display: grid; gap: 14px; margin-bottom: 16px; }
.grid-kpi { grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.kpi {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.kpi.highlight {
  background: linear-gradient(145deg, #fffdf8 0%, #f1f7f3 100%);
  border-color: #b7d2c0;
}
.kpi-label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 700; }
.kpi-value { font-size: 25px; font-weight: 800; margin-top: 6px; color: var(--primary-dark); }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---------- Cupo diario ---------- */
.capacity-bar {
  height: 10px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}
.capacity-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  transition: width .25s ease;
}
.capacity-fill.near { background: #d97706; }
.capacity-fill.full { background: #dc2626; }

.capacity-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--primary-light);
  border: 1px solid #b8d5c2;
  margin-bottom: 14px;
}
.capacity-banner.near { background: #fef3c7; border-color: #f59e0b; }
.capacity-banner.full { background: #fee2e2; border-color: #ef4444; }

.capacity-alert {
  background: #fef2f2;
  border: 2px solid #dc2626;
  color: #991b1b;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 14px;
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

/* ---------- Tables ---------- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 600px; }
table.data.compact { min-width: 0; }
table.data th {
  text-align: left;
  padding: 10px 10px;
  color: var(--muted);
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .3px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
table.data td { padding: 10px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tr:hover td { background: #f8f3e6; }
table.data tr:last-child td { border-bottom: 0; }

/* ---------- Buttons & Forms ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--cream); color: var(--primary-dark); border-color: var(--border); }
.btn-secondary:hover { background: #eadfc5; }
.btn-danger { background: #fee2e2; color: var(--danger); }
.btn-danger:hover { background: #fecaca; }
.btn-success { background: #dcfce7; color: var(--success); }
.btn-success:hover { background: #bbf7d0; }
.btn-wa { background: #16a34a; color: #fff; }
.btn-wa:hover { background: #128c7e; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--cream); color: var(--text); }
.btn-sm { min-height: 32px; padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn-block { width: 100%; }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; min-width: 12px; }

input, select, textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
textarea { resize: vertical; min-height: 84px; }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 12px; color: var(--primary-dark); }
label input, label select, label textarea { margin-top: 5px; font-weight: 400; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.form-error {
  background: #fef2f2;
  border: 1px solid #ef4444;
  color: var(--danger);
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
}
.search-input { max-width: 280px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-cotizacion { background: #fef3c7; color: #92400e; }
.badge-separada { background: #dbeafe; color: #1e40af; }
.badge-en_preparacion { background: #f3e8ff; color: #6b21a8; }
.badge-lista { background: #e8f2ec; color: #1f422b; }
.badge-entregada, .badge-pagada, .badge-enviado { background: #dcfce7; color: #166534; }
.badge-cancelada, .badge-anulada, .badge-inactiva { background: #fee2e2; color: #991b1b; }
.badge-deposito_recibido { background: #dbeafe; color: #1e40af; }
.badge-pendiente { background: #ffedd5; color: #9a3412; }
.badge-whatsapp { background: #dcfce7; color: #166534; }
.badge-email { background: #e0f2fe; color: #075985; }
.badge-interno { background: #f3e8ff; color: #6b21a8; }
.badge-active { background: #e8f2ec; color: #1f422b; }

/* ---------- Chips ---------- */
.chip {
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.chip:hover { border-color: var(--primary); color: var(--primary-dark); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- Mobile Order Cards & Order Items ---------- */
.order-cards { display: grid; gap: 12px; }
.order-card {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  padding: 14px;
}
.order-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.order-card-meta { font-size: 12.5px; color: var(--muted); margin: 6px 0; }
.order-card-items { font-size: 13px; background: var(--bg); padding: 8px 10px; border-radius: 8px; margin: 8px 0; }
.order-card-foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* ---------- Kanban ---------- */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; }
.kanban-col {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 12px;
  min-width: 245px;
  max-width: 245px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 250px);
}
.kanban-col.drag-over { background: var(--primary-light); outline: 2px dashed var(--primary); }
.kanban-head { padding: 12px 14px; font-weight: 700; font-size: 13px; display: flex; justify-content: space-between; align-items: center; color: var(--primary-dark); }
.kanban-head .count { background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 1px 9px; font-size: 12px; }
.kanban-body { padding: 0 10px 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.kanban-card {
  background: #fff;
  border-radius: 8px;
  padding: 11px;
  box-shadow: var(--shadow);
  cursor: grab;
  border-left: 4px solid var(--primary);
}
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging { opacity: .5; }
.kanban-card .kc-title { font-weight: 700; font-size: 13.5px; margin-bottom: 4px; }
.kanban-card .kc-meta { font-size: 12px; color: var(--muted); }
.kanban-card .kc-value { font-weight: 700; color: var(--primary-dark); margin-top: 6px; font-size: 13px; }

/* ---------- Modals & Toasts ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 38, 26, .55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 28px 12px;
  z-index: 200;
  overflow-y: auto;
}
.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 640px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, .3);
}
.modal-lg { max-width: 880px; }
.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-head h3 { margin: 0; font-size: 17px; color: var(--primary-dark); }
.modal-body { padding: 18px 20px; max-height: 72vh; overflow-y: auto; }
.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.modal-close { background: none; border: 0; font-size: 24px; cursor: pointer; color: var(--muted); line-height: 1; }

#toast-root { position: fixed; bottom: 20px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 40px); }
.toast {
  background: var(--primary-dark);
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
  font-size: 13.5px;
  max-width: 380px;
  animation: toast-in .22s ease-out;
}
.toast.success { background: #15803d; }
.toast.error { background: #b91c1c; }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Notificaciones ---------- */
.notif-wrap { position: relative; }
.icon-btn {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--primary-dark);
  position: relative;
}
.icon-btn:hover { background: #eadfc5; }
.notif-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 6px;
  min-width: 20px;
  text-align: center;
}
.notif-dropdown {
  position: absolute;
  right: 0;
  top: 46px;
  width: 340px;
  max-width: calc(100vw - 24px);
  max-height: 430px;
  overflow-y: auto;
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .22);
  border: 1px solid var(--border);
  z-index: 150;
}
.notif-head { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.notif-item { padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; }
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: var(--primary-light); }
.notif-item .nt { font-weight: 700; font-size: 13.5px; }
.notif-item .nb { font-size: 12.5px; color: var(--muted); }
.notif-item .nd { font-size: 11px; color: var(--muted); margin-top: 3px; }
.notif-empty { padding: 24px; text-align: center; color: var(--muted); }

/* ---------- Recibos & Facturas ---------- */
.invoice-print { background: #fff; padding: 8px; border-radius: 8px; }
.invoice-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.invoice-head h2 { margin: 0 0 4px; font-size: 20px; color: var(--primary-dark); }
.invoice-meta { text-align: right; color: var(--muted); font-size: 13px; }
.total-row td { font-weight: 800; font-size: 14.5px; border-top: 2px solid var(--text); }
.wa-box {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 10px;
  padding: 12px;
  margin-top: 14px;
}
.wa-preview {
  white-space: pre-wrap;
  font-size: 12.5px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  max-height: 180px;
  overflow-y: auto;
  margin-top: 8px;
}

@media print {
  .sidebar, .topbar, .no-print, .modal-foot, .modal-head { display: none !important; }
  body { background: #fff; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; }
}

/* ---------- Extras ---------- */
.toggle { position: relative; width: 44px; height: 24px; flex-shrink: 0; display: inline-block; margin: 0; }
.toggle input { opacity: 0; width: 0; height: 0; min-height: 0; }
.toggle .slider { position: absolute; inset: 0; background: #cbd5e1; border-radius: 999px; cursor: pointer; transition: .2s; }
.toggle .slider:before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.toggle input:checked + .slider { background: var(--success); }
.toggle input:checked + .slider:before { transform: translateX(20px); }

.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 180px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
canvas.chart { width: 100%; height: 240px; }
.empty { text-align: center; color: var(--muted); padding: 28px 14px; }
.hint { font-size: 12.5px; color: var(--muted); background: var(--cream); border: 1px dashed var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; }
.item-builder-row {
  display: grid;
  grid-template-columns: 2fr 1.4fr .7fr .9fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.ing-builder-row {
  display: grid;
  grid-template-columns: 2fr .8fr .8fr 1.4fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.shop-check { width: 20px !important; min-height: 20px !important; height: 20px; accent-color: var(--primary); cursor: pointer; }
.shop-done { text-decoration: line-through; opacity: .55; }

/* ---------- Fase 5: Redes Sociales y Campañas Mobile-First ---------- */
html, body, .app, .main, .content { max-width: 100%; overflow-x: hidden; }
.btn-touch {
  min-height: 48px;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 10px;
}
.btn-fb { background: #1877f2; color: #fff; }
.btn-fb:hover { background: #1462c9; }
.social-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.social-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.social-meta-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.social-meta-item small { display: block; color: var(--muted); font-size: 11.5px; text-transform: uppercase; font-weight: 700; }
.campaign-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.campaign-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.campaign-preview-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--cream);
  border-bottom: 1px solid var(--border);
  display: block;
}
.campaign-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.campaign-post-text {
  white-space: pre-wrap;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font-size: 13.5px;
  line-height: 1.5;
}
.campaign-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
}
.campaign-actions .btn-full { grid-column: 1 / -1; }
.badge-borrador { background: #fef3c7; color: #92400e; }
.badge-publicada { background: #dcfce7; color: #166534; }
.badge-aprobada_programada { background: #dbeafe; color: #1e40af; }
.badge-rechazada { background: #fee2e2; color: #991b1b; }
.badge-pausada { background: #ffedd5; color: #9a3412; }
.badge-connected { background: #dcfce7; color: #166534; }
.badge-disconnected { background: #e2e8f0; color: #475569; }
.badge-reconnect_required { background: #fee2e2; color: #991b1b; }
.badge-ajustado { background: #fef3c7; color: #92400e; border: 1px solid #f59e0b; }

.stepper-row {
  display: grid;
  grid-template-columns: 58px 1fr 58px;
  gap: 10px;
  align-items: center;
  margin: 12px 0;
}
.stepper-btn {
  min-height: 50px;
  font-size: 24px;
  font-weight: 800;
  padding: 0;
  border-radius: 12px;
}
.stepper-input {
  min-height: 50px;
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  color: var(--primary-dark);
}

/* ---------- Responsive (Celular / Tablet) ---------- */
@media (max-width: 820px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: sticky;
    top: 0;
    z-index: 60;
  }
  .sidebar-brand {
    padding: 10px 14px 8px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
  }
  .sidebar-logo { font-size: 17px; }
  .sidebar-nav {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
    padding: 6px 10px 10px;
    -webkit-overflow-scrolling: touch;
  }
  .nav-item {
    width: auto;
    flex-shrink: 0;
    min-height: 40px;
    padding: 8px 12px;
    margin: 0;
    font-size: 13px;
    background: rgba(255, 255, 255, .07);
  }
  .nav-item svg { width: 16px; height: 16px; }
  .sidebar-foot { display: none; }
  .topbar { padding: 10px 12px; position: static; flex-wrap: wrap; }
  .topbar h1 { font-size: 16px; }
  .topbar-actions { width: 100%; justify-content: space-between; }
  .content { padding: 12px 10px 64px; }
  .grid-2, .grid-3, .grid-kpi, .campaign-grid, .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .search-input { max-width: 100%; }
  .item-builder-row, .ing-builder-row { grid-template-columns: 1fr 1fr; }
  .campaign-actions { grid-template-columns: 1fr; }
  .btn, .btn-touch { min-height: 44px; }
  .modal-overlay { padding: 10px 8px; }
  .modal-body { padding: 14px; max-height: 76vh; }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; }
  .invoice-meta { text-align: left; }
  #ord-cap-summary { width: 100%; min-width: 100% !important; }
  #btn-adjust-day-cap { width: 100%; }
}
