/* =============================================
   Jhoram — Design System
   Minimal, professional, easy to modify.
   All variables live here. Change once, apply everywhere.
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

/* ─── TOKENS ───────────────────────────────── */
:root {
  /* Brand */
  --brand:       #1a56db;
  --brand-dark:  #1242b4;
  --brand-light: #e8f0fe;

  /* Status */
  --success:  #0d9f6e;
  --warning:  #d97706;
  --danger:   #dc2626;
  --info:     #0284c7;

  /* Neutrals */
  --gray-50:  #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Surfaces */
  --bg:        #f5f7fa;
  --surface:   #ffffff;
  --surface-2: #f9fafb;

  /* Text */
  --text:       var(--gray-900);
  --text-muted: var(--gray-500);

  /* Layout */
  --sidebar-w:  240px;
  --nav-h:      60px;
  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  16px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow:     0 4px 12px rgba(0,0,0,.08);
  --shadow-lg:  0 8px 24px rgba(0,0,0,.10);

  /* Typography */
  --font:       'DM Sans', system-ui, sans-serif;
  --font-mono:  'DM Mono', monospace;

  /* Transitions */
  --ease:       all 0.18s ease;
}

/* Dark mode token overrides */
[data-theme="dark"] {
  --bg:        #0f1117;
  --surface:   #1a1d27;
  --surface-2: #222535;
  --text:       #f0f2f8;
  --text-muted: #8b91a7;
  --gray-200:  #2d3148;
  --gray-300:  #3a3f5c;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
  --shadow:    0 4px 12px rgba(0,0,0,.35);
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img {width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

/* ─── LAYOUT ─────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-body {
  flex: 1;
  padding: 32px 28px;
  width: 100%;
}

/* ─── SIDEBAR ────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--gray-200);
  height: 100vh;
  position: fixed;
  top: 0; left: 0;
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: var(--ease);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--gray-200);
}

.sidebar-logo-icon {
  width: 36px; height: 36px;
  background: var(--brand);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.sidebar-logo-text span {
  color: var(--brand);
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 8px;
  margin: 16px 0 6px;
}

.nav-section-label:first-child { margin-top: 0; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-600);
  transition: var(--ease);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
}

.nav-link i { font-size: 1rem; width: 18px; text-align: center; flex-shrink: 0; }

.nav-link:hover {
  background: var(--brand-light);
  color: var(--brand);
}

.nav-link.active {
  background: var(--brand);
  color: #fff;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--gray-200);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}

.user-avatar {
  width: 32px; height: 32px;
  background: var(--brand-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.user-name  { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.user-role  { font-size: 0.72rem; color: var(--text-muted); }

/* ─── TOP NAV (no-sidebar pages) ────────────── */
.topnav {
  height: var(--nav-h);
  background: var(--surface);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topnav-brand {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.02em;
}

.topnav-brand .icon {
  width: 32px; height: 32px;
  background: var(--brand);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 15px;
}

.topnav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ─── PAGE HEADER ────────────────────────────── */
.page-header {
  margin-bottom: 28px;
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.page-header p {
  margin-top: 4px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ─── CARDS ──────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.card-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1;
}

.stat-change {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }

.stat-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 14px;
}

.stat-icon.brand   { background: var(--brand-light);              color: var(--brand); }
.stat-icon.success { background: rgba(13,159,110,.12);            color: var(--success); }
.stat-icon.warning { background: rgba(217,119, 6,.12);            color: var(--warning); }
.stat-icon.danger  { background: rgba(220, 38, 38,.12);           color: var(--danger); }

/* ─── GRID HELPERS ───────────────────────────── */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ─── BUTTONS ────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  transition: var(--ease);
  white-space: nowrap;
  line-height: 1;
}

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

.btn-secondary { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-200); }
.btn-secondary:hover { background: var(--gray-200); }

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

.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover { opacity: .9; }

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

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }

/* ─── FORMS ──────────────────────────────────── */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 9px 13px;
  background: var(--surface);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-family: var(--font);
  color: var(--text);
  transition: var(--ease);
  outline: none;
}

.form-control:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}

.form-control::placeholder { color: var(--gray-400); }

select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 0.75rem; color: var(--danger); margin-top: 4px; }

/* ─── TABLE ──────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead th {
  background: var(--gray-50);
  padding: 11px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}

tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--text);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--gray-50); }

/* ─── BADGES ─────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-brand   { background: var(--brand-light);          color: var(--brand); }
.badge-success { background: rgba(13,159,110,.12);         color: var(--success); }
.badge-warning { background: rgba(217,119, 6,.12);         color: var(--warning); }
.badge-danger  { background: rgba(220, 38, 38,.12);        color: var(--danger); }
.badge-neutral { background: var(--gray-100);              color: var(--gray-600); }

/* ─── ALERTS ─────────────────────────────────── */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid transparent;
  margin-bottom: 16px;
}

.alert-success { background: rgba(13,159,110,.08);  border-color: rgba(13,159,110,.2);  color: var(--success); }
.alert-danger  { background: rgba(220,38, 38,.08);  border-color: rgba(220,38, 38,.2);  color: var(--danger); }
.alert-warning { background: rgba(217,119, 6,.08);  border-color: rgba(217,119, 6,.2);  color: var(--warning); }
.alert-info    { background: rgba( 2,132,199,.08);  border-color: rgba( 2,132,199,.2);  color: var(--info); }

/* ─── DIVIDER ────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--gray-200);
  margin: 24px 0;
}

/* ─── UTILITIES ──────────────────────────────── */
.text-muted  { color: var(--text-muted); }
.text-sm     { font-size: 0.8rem; }
.text-xs     { font-size: 0.72rem; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.fw-600      { font-weight: 600; }
.fw-700      { font-weight: 700; }
.mt-auto     { margin-top: auto; }
.mb-4        { margin-bottom: 4px; }
.mb-8        { margin-bottom: 8px; }
.mb-16       { margin-bottom: 16px; }
.mb-24       { margin-bottom: 24px; }
.gap-8       { gap: 8px; }
.gap-12      { gap: 12px; }
.flex        { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between{ display: flex; align-items: center; justify-content: space-between; }
.flex-col    { flex-direction: column; }
.flex-wrap   { flex-wrap: wrap; }

/* ─── MONEY / CODE ───────────────────────────── */
.mono { font-family: var(--font-mono); }

/* ─── LOADING SPINNER ────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--gray-200);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── RESPONSIVE ─────────────────────────────── */

/* Overlay para cerrar sidebar en móvil */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 999;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.sidebar-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Botón hamburguesa — oculto por defecto en desktop */
.mobile-menu-btn {
  display: none;
}

/* ── Desktop grande (1280px+) ── */
@media (min-width: 1280px) {
  .page-body { padding: 36px 40px; }
  .grid-4    { grid-template-columns: repeat(4, 1fr); }
}

/* ── Laptop / tablet landscape (992px – 1279px) ── */
@media (max-width: 1279px) and (min-width: 993px) {
  :root { --sidebar-w: 190px; }
  .page-body { padding: 28px 24px; }
  .grid-4    { grid-template-columns: repeat(4, 1fr); }
}

/* ── Tablet (768px – 992px) ── */
@media (max-width: 992px) {
  :root { --sidebar-w: 200px; }

  .grid-4    { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .grid-3    { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .grid-2    { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .grid-auto { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

  .page-body { padding: 24px 20px; }

  .stat-value { font-size: 1.75rem; }
  .page-header h1 { font-size: 1.35rem; }

  /* Tablas con scroll horizontal desde tablet */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ── Móvil (≤ 768px) ── */
@media (max-width: 768px) {

  /* — Sidebar deslizable — */
  .sidebar {
    transform: translateX(-100%);
    width: 272px;
    position: fixed;
    top: 0; left: 0;
    height: 100dvh;
    z-index: 1000;
    transition: transform 0.28s cubic-bezier(.4,0,.2,1);
    box-shadow: none;
    overflow-y: auto;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  /* — Overlay activo — */
  .sidebar-overlay { display: block; }

  /* — Contenido principal sin margen del sidebar — */
  .main-content {
    margin-left: 0 !important;
    width: 100%;
  }

  /* — Botón hamburguesa — */
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 1001;
    width: 40px;
    height: 40px;
    background: var(--surface);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    font-size: 1.1rem;
    color: var(--text);
    cursor: pointer;
    transition: var(--ease);
  }
  .mobile-menu-btn:hover {
    background: var(--brand-light);
    color: var(--brand);
    border-color: var(--brand);
  }

  /* — Espacio superior para el botón hamburguesa — */
  .page-body {
    padding: 60px 16px 24px;
  }

  /* — Page header adaptado — */
  .page-header {
    margin-bottom: 20px;
    margin-top: 0;
  }
  .page-header h1 { font-size: 1.3rem; }
  .page-header p  { font-size: 0.82rem; }

  /* flex-between en header se convierte en columna */
  .page-header.flex-between,
  .page-header > .flex-between {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .page-header .flex-between .btn,
  .page-header .flex-between .flex {
    width: 100%;
  }

  /* — Grids en columna — */
  .grid-4,
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .grid-auto { grid-template-columns: 1fr; }

  /* — Cards — */
  .card { padding: 18px; }

  /* — Stats — */
  .stat-value { font-size: 1.7rem; }
  .stat-icon  { width: 38px; height: 38px; font-size: 1rem; margin-bottom: 12px; }

  /* — Tablas — */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
  }
  table { min-width: 560px; }
  thead th, tbody td { padding: 10px 12px; }

  /* — Formularios — */
  .form-control,
  select.form-control,
  textarea.form-control,
  input.form-control {
    width: 100%;
    font-size: 1rem; /* evita zoom en iOS */
  }
  .form-group { margin-bottom: 14px; }

  /* — Botones — */
  .btn-block-mobile {
    width: 100%;
    justify-content: center;
  }

  /* Grupos de botones: wrap en columna */
  .flex.gap-8,
  .flex.gap-12 {
    flex-wrap: wrap;
  }

  /* — Topnav — */
  .topnav {
    padding: 0 16px 0 60px; /* espacio para hamburguesa */
  }

  /* — Modales — */
  .modal-overlay {
    padding: 12px;
    align-items: flex-end; /* bottom sheet en móvil */
  }
  .modal-overlay .card,
  .modal-overlay > div {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 20px !important;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
  }

  /* — Gráficas — */
  canvas { max-height: 220px !important; }

  /* — Selector de sucursales — */
  .tienda-selector {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .tienda-selector .flex { flex-wrap: wrap; gap: 8px; }

  /* — Override de layouts inline en ventas.php — */
  [style*="grid-template-columns: 1fr 200px"],
  [style*="grid-template-columns: 1fr 300px"],
  [style*="grid-template-columns: 2fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* — Badges — */
  .badge { font-size: 0.68rem; padding: 2px 8px; }

  /* — Alert — */
  .alert { padding: 12px 14px; font-size: 0.82rem; }
}

/* ── Móvil pequeño (≤ 480px) ── */
@media (max-width: 480px) {
  .page-body { padding: 56px 12px 20px; }
  .card      { padding: 14px; }

  .stat-value { font-size: 1.45rem; }
  .stat-icon  { width: 34px; height: 34px; font-size: 0.9rem; }

  .page-header h1 { font-size: 1.15rem; }

  .btn    { padding: 8px 14px; font-size: 0.82rem; }
  .btn-sm { padding: 5px 10px; font-size: 0.75rem; }
  .btn-lg { padding: 11px 20px; font-size: 0.9rem; }

  thead th { font-size: 0.68rem; }
  tbody td  { font-size: 0.8rem; }

  .form-label { font-size: 0.78rem; }
  .form-hint, .form-error { font-size: 0.7rem; }

  .sidebar { width: 260px; }
}

/* ── Móvil muy pequeño (≤ 360px) ── */
@media (max-width: 360px) {
  .page-body { padding: 52px 10px 16px; }
  .card      { padding: 12px; }
  .sidebar   { width: 100%; }
}

/* ── Pantallas muy grandes (≥ 1600px) ── */
@media (min-width: 1600px) {
  .page-body { padding: 40px 56px; }
}

/* ── Touch: quitar hover en dispositivos táctiles ── */
@media (hover: none) and (pointer: coarse) {
  .nav-link:hover  { background: transparent; color: var(--gray-600); }
  .btn-primary:hover  { background: var(--brand); }
  .btn-secondary:hover { background: var(--gray-100); }
  .nav-link.active { background: var(--brand); color: #fff; }
}

/* ── Tarjetas móviles para tablas ── */
.mobile-cards { display: none; }

@media (max-width: 768px) {
  /* Ocultar tabla, mostrar tarjetas */
  .table-as-cards .table-wrap  { display: none !important; }
  .table-as-cards .mobile-cards { display: flex; flex-direction: column; gap: 12px; }

  .m-card {
    background: var(--surface);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
  }
  .m-card-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    padding: 5px 0;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--gray-100);
  }
  .m-card-row:last-child { border-bottom: none; padding-bottom: 0; }
  .m-card-row:first-child { padding-top: 0; }
  .m-card-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
    min-width: 70px;
  }
  .m-card-val {
    text-align: right;
    font-weight: 500;
    word-break: break-word;
  }
  .m-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--gray-100);
  }
  .m-card-title {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text);
  }
  .m-card-actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--gray-100);
    justify-content: flex-end;
  }

  /* ventas.php — carrito como tarjetas */
  #carrito-mobile-cards { display: flex; flex-direction: column; gap: 10px; }

  /* dashboard chart grid en columna */
  .dashboard-chart-grid { grid-template-columns: 1fr !important; }
  .cart-item-card {
    background: var(--surface);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 12px 14px;
  }
  .cart-item-name { font-weight: 700; font-size: 0.9rem; margin-bottom: 8px; }
  .cart-item-row  { display: flex; justify-content: space-between; font-size: 0.82rem; padding: 3px 0; color: var(--text-muted); }
  .cart-item-row span:last-child { font-weight: 600; color: var(--text); }
  .cart-item-controls { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--gray-100); }
  .cart-item-controls .qty-input { flex: 1; }
}

/* ── Safe area para notch/punch-hole (iOS/Android) ── */
@supports (padding: env(safe-area-inset-left)) {
  .sidebar {
    padding-left: env(safe-area-inset-left);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .main-content {
    padding-right: env(safe-area-inset-right);
  }
}