/* ============================================
   Tretcheiros Bar - Premium Design System v3.7
   Spec: Stripe / Linear / Vercel / Notion
   ============================================ */

/* ── Dark Theme (Default) ────────────────── */
:root {
  --bg-page: #0F172A;
  --bg-card: #1E293B;
  --bg-card-internal: #263548;
  --bg-input: #0F172A;
  --bg-elevated: #334155;
  --text-heading: #F8FAFC;
  --text-body: #CBD5E1;
  --text-muted: #94A3B8;
  --text-white: #F8FAFC;
  --border: #334155;
  --border-focus: #3B82F6;
  --primary: #3B82F6;
  --primary-hover: #60A5FA;
  --green: #22C55E;
  --green-muted: rgba(34,197,94,0.12);
  --red: #EF4444;
  --red-muted: rgba(239,68,68,0.12);
  --yellow: #F59E0B;
  --yellow-muted: rgba(245,158,11,0.12);
  --blue: #0EA5E9;
  --blue-muted: rgba(59,130,246,0.12);
  --purple: #8B5CF6;
  --purple-muted: rgba(139,92,246,0.12);
  --shadow-card: 0 4px 18px rgba(15,23,42,0.25);
  --shadow-card-hover: 0 8px 28px rgba(15,23,42,0.35);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.35);
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --touch-min: 42px;
  --navbar-height: 56px;
  --card-padding: 24px;
  --card-gap: 20px;
  /* ── Premium Mobile Tokens ──────────────── */
  --mobile-card-bg: rgba(30,41,59,0.85);
  --mobile-glass-blur: blur(20px);
  --mobile-glass-border: rgba(255,255,255,0.08);
  --mobile-shadow-sm: 0 2px 8px rgba(0,0,0,0.12);
  --mobile-shadow-md: 0 8px 24px rgba(0,0,0,0.18);
  --mobile-shadow-lg: 0 16px 48px rgba(0,0,0,0.25);
  --mobile-accent: linear-gradient(135deg, #3B82F6, #8B5CF6);
  --mobile-success: linear-gradient(135deg, #22C55E, #10B981);
  --mobile-danger: linear-gradient(135deg, #EF4444, #DC2626);
  --mobile-radius: 20px;
  --mobile-radius-sm: 14px;
  --mobile-spacing: 20px;

  /* ── BRC Design System (aliases aditivos) ──
     Apontam para os tokens existentes; herdam tema claro/escuro
     automaticamente. Documentacao: docs/UI_ANALISE_E_PADRAO_VISUAL.md */
  --brc-bg-page: var(--bg-page);
  --brc-bg-card: var(--bg-card);
  --brc-bg-card-internal: var(--bg-card-internal);
  --brc-bg-input: var(--bg-input);
  --brc-bg-elevated: var(--bg-elevated);
  --brc-text-heading: var(--text-heading);
  --brc-text-body: var(--text-body);
  --brc-text-muted: var(--text-muted);
  --brc-border: var(--border);
  --brc-border-focus: var(--border-focus);
  --brc-primary: var(--primary);
  --brc-primary-hover: var(--primary-hover);
  --brc-success: var(--green);
  --brc-success-muted: var(--green-muted);
  --brc-danger: var(--red);
  --brc-danger-muted: var(--red-muted);
  --brc-warning: var(--yellow);
  --brc-warning-muted: var(--yellow-muted);
  --brc-info: var(--blue);
  --brc-info-muted: var(--blue-muted);
  --brc-accent: var(--purple);
  --brc-accent-muted: var(--purple-muted);
  --brc-radius-sm: 8px;
  --brc-radius-md: 12px;
  --brc-radius-lg: 16px;
  --brc-shadow-1: 0 2px 8px rgba(0,0,0,0.12);
  --brc-shadow-2: var(--shadow-card);
  --brc-shadow-3: var(--shadow-lg);
  --brc-space-1: 4px;
  --brc-space-2: 8px;
  --brc-space-3: 12px;
  --brc-space-4: 16px;
  --brc-space-5: 24px;
  --brc-space-6: 32px;
  --brc-space-7: 48px;
  --brc-space-8: 64px;
  --brc-font-size-xs: 12px;
  --brc-font-size-sm: 14px;
  --brc-font-size-md: 16px;
  --brc-font-size-lg: 18px;
  --brc-font-size-xl: 22px;
  --brc-font-size-xxl: 28px;
  --brc-touch-min: 44px;
  --brc-z-dropdown: 1000;
  --brc-z-sticky: 1020;
  --brc-z-sheet: 2000;
  --brc-z-modal: 2100;
  --brc-z-toast: 3000;
}

/* ── Light Theme ─────────────────────────── */
[data-theme="light"] {
  --bg-page: #F5F7FB;
  --bg-card: #FFFFFF;
  --bg-card-internal: #FAFBFC;
  --bg-input: #F5F7FB;
  --bg-elevated: #F1F5F9;
  --text-heading: #111827;
  --text-body: #374151;
  --text-muted: #6B7280;
  --text-white: #111827;
  --border: #E5E7EB;
  --border-focus: #2563EB;
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --green: #22C55E;
  --green-muted: rgba(34,197,94,0.08);
  --red: #EF4444;
  --red-muted: rgba(239,68,68,0.08);
  --yellow: #F59E0B;
  --yellow-muted: rgba(245,158,11,0.08);
  --blue: #0EA5E9;
  --blue-muted: rgba(59,130,246,0.08);
  --purple: #8B5CF6;
  --purple-muted: rgba(139,92,246,0.08);
  --shadow-card: 0 4px 18px rgba(15,23,42,0.05);
  --shadow-card-hover: 0 8px 28px rgba(15,23,42,0.08);
  --shadow-lg: 0 12px 40px rgba(15,23,42,0.08);
  /* ── Premium Mobile Tokens (Light) ──────── */
  --mobile-card-bg: rgba(255,255,255,0.88);
  --mobile-glass-border: rgba(0,0,0,0.06);
  --mobile-shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
  --mobile-shadow-md: 0 8px 24px rgba(0,0,0,0.06);
  --mobile-shadow-lg: 0 16px 48px rgba(0,0,0,0.08);
}

/* ── Reset & Base ────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body {
  background-color: var(--bg-page);
  color: var(--text-body);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.9375rem;
  line-height: 1.6;
  scroll-padding-top: calc(var(--navbar-height) + 16px);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--primary); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--primary-hover); }

/* ── Typography ──────────────────────────── */
h1, h2, h3, h4, h5, h6 { color: var(--text-heading); font-weight: 700; letter-spacing: -0.01em; }

/* ── Navbar ──────────────────────────────── */
.navbar {
  background-color: var(--bg-card) !important;
  border-bottom: 1px solid var(--border);
  min-height: var(--navbar-height);
  backdrop-filter: blur(12px);
  position: relative;
  z-index: 1050;
}
.navbar .navbar-brand {
  color: var(--text-heading);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
}
.navbar .nav-link {
  color: var(--text-muted) !important;
  font-weight: 500;
  font-size: 0.875rem;
  transition: color 0.15s;
  padding: 0.5rem 0.75rem;
}
.navbar .nav-link:hover { color: var(--text-heading) !important; }
.navbar .nav-link.active { color: var(--primary) !important; }
.navbar .dropdown-menu {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 0.375rem;
  margin-top: 0.5rem;
}
.navbar .dropdown-item {
  color: var(--text-body);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  transition: background 0.1s, color 0.1s;
}
.navbar .dropdown-item:hover { background-color: var(--blue-muted); color: var(--primary); }
.navbar-toggler {
  border-color: var(--border);
  min-height: var(--touch-min);
  min-width: var(--touch-min);
  border-radius: var(--radius-sm);
}
.navbar-toggler-icon { filter: invert(1); }
[data-theme="light"] .navbar-toggler-icon { filter: invert(0); }
.navbar-user-section { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }
.navbar-user-section .navbar-avatar {
  width: 32px; height: 32px; border-radius: 50%; overflow: hidden;
  background: var(--bg-card); border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.navbar-user-section .navbar-avatar img { width: 100%; height: 100%; object-fit: cover; }
.navbar-user-section .navbar-avatar span { font-size: 0.7rem; font-weight: 700; color: var(--text-heading); }
.navbar-user-section .navbar-text { font-size: 0.8125rem; color: var(--text-muted); }
.navbar-user-section .btn-logout {
  background-color: var(--red-muted);
  color: var(--red);
  border: 1px solid transparent;
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  min-height: 36px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: all 0.15s;
}
.navbar-user-section .btn-logout:hover { background-color: var(--red); color: #fff; }
.navbar-logo { width: 32px; height: 32px; object-fit: contain; }

/* Theme toggle */
.theme-toggle {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
}
.theme-toggle:hover { background: var(--bg-elevated); color: var(--text-heading); border-color: var(--text-muted); }
.theme-toggle svg { width: 18px; height: 18px; }

/* ── Cards ───────────────────────────────── */
.card-custom {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
}
.card-custom:hover { box-shadow: var(--shadow-card-hover); }
.card-custom h5, .card-custom h6 { color: var(--text-heading); }

/* ── Dashboard ───────────────────────────── */
.dashboard-header {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--card-padding) 28px;
  box-shadow: var(--shadow-card);
}
.dashboard-logo { width: 52px; height: 52px; object-fit: contain; }
.dashboard-title {
  color: var(--text-heading);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.125rem;
}
.dashboard-subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 400;
  margin-bottom: 0;
}

/* Dashboard KPI Cards */
.dashboard-card {
  min-height: 152px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.dashboard-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}
.dashboard-card .card-body {
  padding: var(--card-padding);
  position: relative;
  z-index: 1;
}

/* KPI Icon — top-right corner, 15% opacity */
.kpi-icon-bg {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.15;
  pointer-events: none;
}
.kpi-icon-bg svg { width: 28px; height: 28px; }
.kpi-icon-bg.green { color: var(--green); }
.kpi-icon-bg.blue { color: var(--primary); }
.kpi-icon-bg.yellow { color: var(--yellow); }
.kpi-icon-bg.red { color: var(--red); }
.kpi-icon-bg.purple { color: var(--purple); }

/* KPI text */
.kpi-label {
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.kpi-value {
  color: var(--text-heading);
  font-weight: 700;
  font-size: 1.625rem;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  line-height: 1.2;
}

/* Metric badges */
.metric-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
  line-height: 1.4;
}
.metric-up { background: var(--green-muted); color: var(--green); }
.metric-down { background: var(--red-muted); color: var(--red); }
.metric-neutral { background: var(--bg-elevated); color: var(--text-muted); }

/* Ocupacao bar */
.ocupacao-bar { height: 6px; border-radius: 3px; background: var(--bg-elevated); overflow: hidden; }
.ocupacao-fill { height: 100%; border-radius: 3px; transition: width 0.4s ease; }

/* Dashboard Actions */
.dashboard-actions a {
  min-width: 140px;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
  padding: 0.625rem 1.25rem;
  transition: all 0.15s;
}
.section-title {
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
}

/* ── Clock ───────────────────────────────── */
.clock-date {
  color: var(--text-muted);
  font-size: 0.8125rem;
  margin-bottom: 0.125rem;
}
.clock-time {
  color: var(--text-heading);
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* ── Buttons ─────────────────────────────── */
.btn {
  min-height: var(--touch-min);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: 0.8125rem; border-radius: var(--radius-sm); }

/* Primary */
.btn-primary { background-color: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background-color: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }

/* Success */
.btn-success { background-color: var(--green); border-color: var(--green); color: #fff; }
.btn-success:hover { background-color: #16A34A; border-color: #16A34A; color: #fff; }

/* Danger */
.btn-danger { background-color: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background-color: #DC2626; border-color: #DC2626; color: #fff; }

/* Light (secondary cards) */
.btn-light {
  background-color: var(--bg-card);
  color: var(--text-body);
  border: 1px solid var(--border);
}
.btn-light:hover {
  background-color: var(--blue-muted);
  color: var(--primary);
  border-color: var(--primary);
}

/* Secondary */
.btn-secondary { background-color: var(--bg-elevated); border-color: var(--border); color: var(--text-body); }
.btn-secondary:hover { background-color: var(--text-muted); border-color: var(--text-muted); color: var(--text-heading); }

/* Warning */
.btn-warning { background-color: var(--yellow); border-color: var(--yellow); color: #111827; font-weight: 600; }
.btn-warning:hover { background-color: #D97706; border-color: #D97706; color: #111827; }

/* ── Forms ───────────────────────────────── */
.form-label { color: var(--text-heading); font-size: 0.8125rem; font-weight: 600; }
.form-control, .form-select {
  background-color: var(--bg-input);
  color: var(--text-heading);
  border: 1px solid var(--border);
  min-height: var(--touch-min);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus, .form-select:focus {
  background-color: var(--bg-input);
  color: var(--text-heading);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--blue-muted);
}
.form-control::placeholder { color: var(--text-muted); }
.form-select option { background-color: var(--bg-input); color: var(--text-heading); }
.form-control-sm, .form-select-sm { min-height: 38px; }

/* ── Tables ──────────────────────────────── */
.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text-body);
  --bs-table-striped-bg: rgba(148,163,184,0.04);
  --bs-table-hover-bg: rgba(148,163,184,0.06);
  --bs-table-border-color: var(--border);
}
.table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom-width: 1px;
}
.table td { vertical-align: middle; font-size: 0.875rem; }

/* ── Badges ──────────────────────────────── */
.badge-received, .badge-paid { background-color: var(--green); color: #fff; }
.badge-pending, .badge-unpaid { background-color: var(--yellow-muted); color: var(--yellow); }

/* ── Alerts ──────────────────────────────── */
.alert-info { background-color: var(--blue-muted); color: var(--text-heading); border: 1px solid rgba(14,165,233,0.2); border-radius: var(--radius); }
.alert-success { background-color: var(--green-muted); color: var(--text-heading); border: 1px solid rgba(34,197,94,0.2); border-radius: var(--radius); }
.alert-danger { background-color: var(--red-muted); color: var(--text-heading); border: 1px solid rgba(239,68,68,0.2); border-radius: var(--radius); }
.alert-warning { background-color: var(--yellow-muted); color: var(--text-heading); border: 1px solid rgba(245,158,11,0.2); border-radius: var(--radius); }

/* ── Comanda / Order Cards ───────────────── */
.comanda-card {
  background-color: var(--bg-card);
  border-left: 4px solid var(--primary);
  color: var(--text-body);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.comanda-card h5, .comanda-card h6 { color: var(--text-heading); }
.comanda-item { background-color: var(--bg-page); border-radius: var(--radius-sm); }
.open-command-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text-body);
  transition: border-color 0.15s;
}
.open-command-item:hover { border-color: var(--primary); }
.open-command-item h6 { color: var(--text-heading); }
.open-command-item .small { color: var(--text-muted); }
.open-command-details {
  background: var(--bg-page);
  border-radius: var(--radius-sm);
  padding: 1rem;
  color: var(--text-body);
}
.open-command-details h6 { color: var(--text-heading); }

/* ── Comanda Header ──────────────────────── */
.comanda-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.comanda-header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}

/* ── Comanda Items Table ─────────────────── */
.comanda-items-table th,
.comanda-items-table td {
  vertical-align: middle;
}

/* ── Payment ─────────────────────────────── */
.payment-section {
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.order-total-banner {
  background: var(--blue-muted);
  border: 1px solid rgba(59,130,246,0.15);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
}
.order-total-banner strong { color: var(--text-heading); }
.payment-summary { min-height: 1.5rem; color: var(--text-body); }

/* ── Summary Cards ───────────────────────── */
.summary-cards .card { border: none; border-radius: var(--radius-sm); }
.card-pending { background: var(--yellow-muted) !important; }
.card-received { background: var(--green-muted) !important; }
.card-expense { background: var(--red-muted) !important; }
.card-info { background: var(--blue-muted) !important; }

/* ── Table Map ───────────────────────────── */
.table-map-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-card);
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  color: inherit;
  width: 100%;
}
.table-map-item:hover { border-color: var(--primary); }
.table-map-item.occupied { border-color: var(--yellow); background: var(--yellow-muted); }
.table-map-item.available { border-color: var(--green); }
.table-map-item.reserved { border-color: var(--primary); background: var(--blue-muted); }
.table-map-item h6 { margin: 0; color: var(--text-heading); }
.table-map-item .small { color: var(--text-muted); }

/* Table Status Buttons */
.table-status-group { display: flex; gap: 4px; justify-content: center; margin-top: 6px; flex-wrap: wrap; }
.table-status-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 32px;
  min-width: 56px;
}
.table-status-btn:hover { opacity: 0.8; }
.table-status-btn.active-available { background: var(--green); color: #fff; border-color: var(--green); font-weight: 700; }
.table-status-btn.active-occupied { background: var(--yellow); color: #111827; border-color: var(--yellow); font-weight: 700; }
.table-status-btn.active-reserved { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 700; }

/* Table Order & Actions */
.table-order-total { margin-top: 4px; font-size: 1.05rem; font-weight: 700; color: var(--green); }
.table-actions { display: flex; gap: 6px; margin-top: 6px; justify-content: center; flex-wrap: wrap; }
.btn-close-order {
  padding: 6px 14px; border-radius: 20px; font-size: 0.8rem; font-weight: 600;
  text-decoration: none; transition: all 0.15s; border: 1px solid var(--red);
  color: #fff; background: var(--red); min-height: 34px;
  display: inline-flex; align-items: center;
}
.btn-close-order:hover { opacity: 0.85; color: #fff; }
.btn-view-order {
  padding: 6px 14px; border-radius: 20px; font-size: 0.8rem; font-weight: 600;
  text-decoration: none; transition: all 0.15s; border: 1px solid var(--primary);
  color: #fff; background: var(--primary); min-height: 34px;
  display: inline-flex; align-items: center;
}
.btn-view-order:hover { opacity: 0.85; color: #fff; }

/* ── Cash Register ───────────────────────── */
.cash-register-status {
  border: 1px solid var(--green);
  border-radius: var(--radius);
  padding: 1.5rem;
  background: var(--green-muted);
}
.cash-register-closed { border-color: var(--red); background: var(--red-muted); }

/* ── Search Input ────────────────────────── */
.search-input-wrapper { position: relative; }
.search-input-wrapper .form-control { padding-left: 2.5rem; }
.search-input-wrapper .search-icon {
  position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}

/* ── Transfer Modal ──────────────────────── */
.transfer-modal .table-option {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--bg-card);
  min-height: var(--touch-min);
}
.transfer-modal .table-option:hover { border-color: var(--primary); background: var(--blue-muted); }
.transfer-modal .table-option.selected { border-color: var(--green); background: var(--green-muted); }

/* ── Balcao Orders ──────────────────────── */
.balcao-order-card {
  border-color: var(--yellow) !important;
  background: var(--yellow-muted) !important;
}
.balcao-order-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--yellow);
  color: #111827;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}

/* ── Expand/Collapse ─────────────────────── */
.expand-icon {
  width: 40px; height: 40px; min-width: 40px; padding: 0;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  transition: all 0.15s;
}
.expand-icon:hover { background: var(--bg-elevated); color: var(--text-heading); }
.expand-icon .expanded-icon { display: none; }
.expand-icon:not(.collapsed) .expanded-icon { display: inline; }
.expand-icon:not(.collapsed) .collapsed-icon { display: none; }

/* Remove item */
.btn-remove-item {
  min-width: var(--touch-min); min-height: var(--touch-min);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem;
}

/* ── Login ───────────────────────────────── */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-page);
  padding: 1rem;
}
.login-wrapper {
  width: min(100%, 420px);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.login-card { width: 100%; }
.login-card .card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-body);
  box-shadow: var(--shadow-lg);
}
.login-logo { width: 120px; height: 120px; object-fit: contain; }
.login-brand {
  color: var(--text-heading);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}
.login-subtitle {
  color: var(--text-muted);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0;
}
.login-btn {
  min-height: 48px;
  font-weight: 600;
  font-size: 0.9375rem;
  border-radius: var(--radius-sm);
}
.login-footer {
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* ── Charts ──────────────────────────────── */
.chart-container { position: relative; height: 280px; width: 100%; }

/* ── Keyboard ────────────────────────────── */
.kbd {
  display: inline-block; padding: 2px 6px; font-size: 0.75rem; font-family: monospace;
  color: var(--text-muted); background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: 4px; line-height: 1.4;
}

/* ── Notifications ───────────────────────── */
#notifications-panel { animation: slideDown 0.3s ease; }
@keyframes slideDown {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ── Toast ───────────────────────────────── */
.toast-notification {
  position: fixed; bottom: 20px; right: 20px; z-index: 9999;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.5rem;
  box-shadow: var(--shadow-lg);
  color: var(--text-body); min-width: 280px; max-width: 400px;
  animation: slideIn 0.3s ease;
}
.toast-notification.success { border-left: 4px solid var(--green); }
.toast-notification.error { border-left: 4px solid var(--red); }
.toast-notification.info { border-left: 4px solid var(--primary); }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ── PIX ─────────────────────────────────── */
.pix-qr-section { text-align: center; }
.pix-qr-section img {
  max-width: 260px; border-radius: var(--radius);
  border: 4px solid var(--bg-card); background: var(--bg-card); padding: 8px;
}
.pix-qr-section .pix-total { font-size: 1.4rem; font-weight: 700; color: var(--green); margin: 0.75rem 0 0.25rem; }
.pix-qr-section .pix-instructions { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.5rem; }
.pix-qr-section .pix-payload {
  word-break: break-all; font-size: 0.7rem; color: var(--text-muted);
  max-height: 60px; overflow-y: auto; background: var(--bg-elevated);
  border-radius: var(--radius-xs); padding: 6px; margin-top: 0.5rem;
}
.btn-pix { background: linear-gradient(135deg, #00bfa6 0%, #00a98a 100%); color: #fff; font-weight: 600; border: none; }
.btn-pix:hover { background: linear-gradient(135deg, #00a98a 0%, #009070 100%); color: #fff; }
.pix-status-bar {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.5rem 1rem; background: var(--bg-elevated);
  border-radius: var(--radius-sm); font-size: 0.85rem;
}
.pix-status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--yellow); animation: pixPulse 1.5s infinite; }
.pix-status-dot.confirmed { background: var(--green); animation: none; }
.pix-status-dot.rejected { background: var(--red); animation: none; }
.pix-timer { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text-muted); }
@keyframes pixPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.pix-copy-container { display: flex; gap: 0.5rem; }
.pix-copy-container input { flex: 1; font-size: 0.75rem; background: var(--bg-elevated); color: var(--text-body); border: 1px solid var(--border); }
.pix-copy-container .btn { white-space: nowrap; min-height: 36px; }
.pix-confirmation-success { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; padding: 1.5rem; animation: pixFadeIn 0.5s ease; }
.pix-success-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: bold; }
.pix-success-text { font-size: 1.1rem; font-weight: 600; color: var(--green); }
@keyframes pixFadeIn { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }

/* ── Skeleton ────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
.skeleton-text { height: 14px; margin-bottom: 8px; border-radius: 4px; }
.skeleton-text:last-child { width: 60%; }
.skeleton-card { height: 120px; }
@keyframes skeletonShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Text Utilities ──────────────────────── */
.text-end { text-align: right !important; }
.text-muted { color: var(--text-muted) !important; }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 991px) {
  .comanda-card { padding: 1rem; }
  .payment-section { padding: 1rem; }
  .card .row.g-2.align-items-end > .col-auto { width: 100%; }
  .card .row.g-2.align-items-end { gap: 1rem; }
  .form-control, .form-select { width: 100%; }
  .table { font-size: 0.95rem; }
  .text-end { text-align: left !important; }
  .order-total-banner { text-align: left; }
  .navbar-collapse { border-top: 1px solid var(--border); margin-top: 0.5rem; }
  .btn-remove-item { min-width: var(--touch-min); min-height: var(--touch-min); }
  .expand-icon { min-width: var(--touch-min); min-height: var(--touch-min); }
  .btn-whatsapp { min-height: 40px; }
}

/* ============================================
   Premium Mobile — 767px (Tablet / Small desktop)
   ============================================ */
@media (max-width: 767px) {
  :root { --navbar-height: 50px; }
  .page-title { font-size: 1.3rem; }
  .card-custom { padding: 0.75rem; }
  .table-responsive table { font-size: 0.88rem; }
  .btn { font-size: 0.95rem; }
  .payment-summary { font-size: 0.9rem; }
  .dashboard-actions { flex-direction: column; align-items: stretch !important; }
  .dashboard-actions a { width: 100%; min-width: unset; }
  .navbar .container-fluid { flex-wrap: wrap; gap: 0.5rem; }
  .table-map-item { min-height: 130px; padding: 0.75rem; }
  .table-status-btn { padding: 5px 10px; font-size: 0.75rem; min-width: 50px; }

  /* ── Premium: Navbar Mobile ───────────── */
  .navbar {
    backdrop-filter: var(--mobile-glass-blur);
    background: var(--mobile-card-bg) !important;
    border-bottom: 1px solid var(--mobile-glass-border);
    min-height: 52px;
  }
  .navbar-toggler {
    min-height: 44px;
    min-width: 44px;
    border-radius: var(--mobile-radius-sm);
  }
  .navbar .nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: var(--mobile-radius-sm);
    transition: background 0.15s;
  }
  .navbar .nav-link:active {
    background: var(--blue-muted);
  }
  .navbar .dropdown-menu {
    border-radius: var(--mobile-radius);
    box-shadow: var(--mobile-shadow-lg);
    border: 1px solid var(--mobile-glass-border);
    backdrop-filter: var(--mobile-glass-blur);
    padding: 0.5rem;
  }

  /* ── Premium: Form Adicionar Produto ──── */
  .comanda-card.p-4 {
    border-left: none;
    border-radius: var(--mobile-radius);
    backdrop-filter: var(--mobile-glass-blur);
    border: 1px solid var(--mobile-glass-border);
    box-shadow: var(--mobile-shadow-md);
    padding: var(--mobile-spacing) !important;
  }
  .comanda-card h5 {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
  }
  .form-mobile-stack .col-md-2,
  .form-mobile-stack .col-md-1,
  .form-mobile-stack .col-md-3,
  .form-mobile-stack .col-md-4 {
    flex: 0 0 100%;
    max-width: 100%;
  }
  .form-mobile-stack .col-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }
  .form-mobile-stack .btn-success {
    background: var(--mobile-success);
    border: none;
    border-radius: var(--mobile-radius-sm);
    min-height: 48px;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 12px rgba(34,197,94,0.3);
    transition: transform 0.2s, box-shadow 0.2s;
  }
  .form-mobile-stack .btn-success:active {
    transform: scale(0.97);
    box-shadow: 0 2px 6px rgba(34,197,94,0.2);
  }
  .form-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 6px;
  }
  .form-control, .form-select {
    border-radius: var(--mobile-radius-sm);
    border: 1.5px solid var(--border);
    background: var(--bg-input);
    transition: border-color 0.2s, box-shadow 0.2s;
  }
  .form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
  }

  /* ── Premium: Cards de Mesas Abertas ──── */
  .open-command-item {
    border: 1px solid var(--mobile-glass-border);
    border-radius: var(--mobile-radius);
    background: var(--mobile-card-bg);
    backdrop-filter: var(--mobile-glass-blur);
    box-shadow: var(--mobile-shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: visible;
    margin-bottom: var(--mobile-spacing);
  }
  .open-command-item:active {
    transform: scale(0.99);
  }
  .comanda-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .comanda-header-info { text-align: center; }
  .comanda-header-info h6 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
  }
  .comanda-header-info .small {
    font-size: 0.75rem;
    color: var(--text-muted);
  }
  .comanda-header-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
  }
  .comanda-header-actions .btn {
    border-radius: var(--mobile-radius-sm);
    min-height: 40px;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 14px;
    backdrop-filter: blur(8px);
  }
  .expand-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    transition: all 0.2s;
  }
  .expand-icon:active {
    transform: scale(0.92);
    background: var(--blue-muted);
  }

  /* ── Premium: Detalhes da Comanda ─────── */
  .open-command-details {
    background: var(--bg-page);
    border-radius: var(--mobile-radius-sm);
    padding: var(--mobile-spacing);
    border: 1px solid var(--border);
  }
  .order-total-banner {
    background: var(--mobile-accent);
    color: #fff;
    border-radius: var(--mobile-radius-sm);
    padding: 14px 18px;
    font-size: 0.95rem;
    text-align: center;
  }
  .order-total-banner strong {
    font-size: 1.15rem;
    color: #fff;
  }
  .comanda-items-table {
    border-collapse: separate;
    border-spacing: 0 6px;
  }
  .comanda-items-table thead th {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    border: none;
    padding: 4px 8px;
  }
  .comanda-items-table tbody tr {
    background: var(--bg-card);
    border-radius: var(--mobile-radius-sm);
    box-shadow: var(--mobile-shadow-sm);
    transition: transform 0.15s;
  }
  .comanda-items-table tbody tr:active {
    transform: scale(0.99);
  }
  .comanda-items-table td {
    padding: 10px 8px;
    border: none;
    font-size: 0.85rem;
  }
  .comanda-items-table td:first-child {
    border-radius: var(--mobile-radius-sm) 0 0 var(--mobile-radius-sm);
  }
  .comanda-items-table td:last-child {
    border-radius: 0 var(--mobile-radius-sm) var(--mobile-radius-sm) 0;
  }
  .btn-remove-item {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* ── Premium: Pagamento Mobile ─────────── */
  .payment-section {
    background: var(--mobile-card-bg);
    backdrop-filter: var(--mobile-glass-blur);
    border: 1px solid var(--mobile-glass-border);
    border-radius: var(--mobile-radius);
    padding: var(--mobile-spacing) !important;
    box-shadow: var(--mobile-shadow-md);
  }
  .payment-mobile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  .payment-mobile-grid .btn-close-final { grid-column: 1 / -1; }
  .payment-mobile-grid .form-label {
    font-size: 0.7rem;
  }
  .payment-mobile-grid .form-control,
  .payment-mobile-grid .form-select {
    min-height: 48px;
    font-size: 1rem;
    border-radius: var(--mobile-radius-sm);
  }
  .btn-close-final .btn-danger {
    background: var(--mobile-danger);
    border: none;
    border-radius: var(--mobile-radius-sm);
    min-height: 52px;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 16px rgba(239,68,68,0.3);
    transition: transform 0.2s, box-shadow 0.2s;
  }
  .btn-close-final .btn-danger:active {
    transform: scale(0.97);
    box-shadow: 0 2px 8px rgba(239,68,68,0.2);
  }
  .btn-pix-generate {
    border-radius: var(--mobile-radius-sm);
    min-height: 48px;
    font-weight: 700;
  }
  .product-combobox .voice-btn { width: 36px; height: 36px; }
  .notes-input-wrapper .voice-btn-sm,
  .client-input-wrapper .voice-btn-sm { width: 30px; height: 30px; }

  /* ── Premium: Micro-interactions ───────── */
  .open-command-item {
    animation: premiumFadeIn 0.4s ease-out;
  }
}

/* ============================================
   Premium Mobile — 576px (Phones)
   ============================================ */
@media (max-width: 576px) {
  .page-title { font-size: 1.15rem; }
  .card-custom { padding: 0.5rem; border-radius: var(--radius-sm); }
  .container { padding-left: 10px; padding-right: 10px; }
  .table-map-item { min-height: 120px; }
  .form-mobile-stack [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
  .payment-mobile-grid { grid-template-columns: 1fr; }
  .installment-row .row { gap: 0.5rem !important; }
  .installment-row .row > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
  .navbar-brand { font-size: 1rem !important; }
  .navbar-user-section .navbar-text { display: none; }
  .dashboard-header { padding: 16px; }
  .dashboard-logo { width: 40px; height: 40px; }
  .dashboard-title { font-size: 1.25rem; }
  .dashboard-subtitle { font-size: 0.8125rem; }
  .kpi-icon-bg { width: 36px; height: 36px; top: 12px; right: 12px; }
  .kpi-icon-bg svg { width: 22px; height: 22px; }
  .kpi-value { font-size: 1.375rem; }
  .comanda-items-table th,
  .comanda-items-table td { padding: 0.4rem 0.3rem; font-size: 0.85rem; }
  .comanda-items-table td:first-child { max-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .btn-close-final { flex-direction: column; }
  .btn-close-final .btn { min-height: 48px; }
}

/* ── Premium: Animations ───────────────── */
@keyframes premiumFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes premiumSlideDown {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 2000px; }
}
@keyframes premiumRipple {
  from { opacity: 1; transform: scale(0); }
  to { opacity: 0; transform: scale(2); }
}

/* Touch devices */
@media (hover: hover) and (pointer: fine) {
  .table-map-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
