/* =============================================
   DELIVERY SYSTEM — Coral Vibrante + Grafite
   ============================================= */

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

:root {
  /* Cores base dark */
  --bg-primary:    #0f0f0e;
  --bg-secondary:  #161614;
  --bg-tertiary:   #1e1e1b;
  --bg-hover:      #252520;
  --bg-card:       #1a1a17;

  /* Coral primário */
  --primary:       #D85A30;
  --primary-dark:  #993C1D;
  --primary-light: rgba(216,90,48,0.12);
  --primary-glow:  rgba(216,90,48,0.25);

  /* Texto */
  --text-primary:   #f0f0eb;
  --text-secondary: #8b8b80;
  --text-tertiary:  #55554a;

  /* Bordas */
  --border:         rgba(255,255,255,0.07);
  --border-hover:   rgba(255,255,255,0.14);
  --border-active:  rgba(216,90,48,0.4);

  /* Status */
  --green:    #10b981;
  --green-bg: rgba(16,185,129,0.1);
  --amber:    #f59e0b;
  --amber-bg: rgba(245,158,11,0.1);
  --red:      #ef4444;
  --red-bg:   rgba(239,68,68,0.1);
  --blue:     #3b82f6;
  --blue-bg:  rgba(59,130,246,0.1);

  /* Layout */
  --topbar-h:   56px;
  --nav-h:      48px;
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  18px;

  /* Sombras */
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 20px rgba(216,90,48,0.25);
}

/* Light mode override */
body.light-mode {
  --bg-primary:    #f5f0ed;
  --bg-secondary:  #fdf8f6;
  --bg-tertiary:   #ede5e0;
  --bg-hover:      #e0d5cf;
  --bg-card:       #fdf8f6;

  --text-primary:   #1a1208;
  --text-secondary: #5a3d30;
  --text-tertiary:  #8a6655;

  --border:         rgba(153,60,29,0.15);
  --border-hover:   rgba(153,60,29,0.28);
  --border-active:  rgba(216,90,48,0.55);

  --shadow-sm:  0 1px 4px rgba(100,40,10,0.10);
  --shadow-md:  0 4px 16px rgba(100,40,10,0.14);
  --shadow-lg:  0 8px 32px rgba(100,40,10,0.18);

  --primary-light: rgba(216,90,48,0.13);
  --primary-glow:  rgba(216,90,48,0.20);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
button, [onclick] {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body {
  font-family: 'DM Sans', -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── LAYOUT ─────────────────────────────────── */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ── TOPBAR ─────────────────────────────────── */
.topbar {
  height: 60px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.25rem 0 0;
  gap: 1rem;
  flex-shrink: 0;
  position: relative;
  z-index: 100;
  box-shadow: 0 1px 0 var(--border);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
}

.topbar-logo {
  width: 52px;
  height: 52px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: var(--shadow-glow);
  flex-shrink: 0;
}

.topbar-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.topbar-sub {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: -2px;
}

/* ── NAV HORIZONTAL ─────────────────────────── */
.nav-bar {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-bar::-webkit-scrollbar { display: none; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all 0.15s;
  position: relative;
  border: none;
  background: transparent;
  letter-spacing: 0.01em;
  font-family: 'DM Sans', sans-serif;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  box-shadow: 0 0 0 1px rgba(216,90,48,0.3);
}

.nav-icon {
  font-size: 16px;
  line-height: 1;
}

.nav-badge {
  background: var(--red);
  color: #fff;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  min-width: 20px;
  text-align: center;
  line-height: 1.4;
}

/* ── TOPBAR RIGHT ───────────────────────────── */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.topbar-date {
  font-size: 12px;
  color: var(--text-tertiary);
  font-family: 'DM Mono', monospace;
}

.status-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid rgba(16,185,129,0.2);
}

.theme-btn {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
}
.theme-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

/* Status loja */
.sidebar-status {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  border: 1px solid transparent;
}
.sidebar-status:hover { opacity: 0.8; }
.sidebar-status.aberta {
  background: var(--green-bg);
  color: var(--green);
  border-color: rgba(16,185,129,0.2);
}
.sidebar-status.fechada {
  background: var(--red-bg);
  color: var(--red);
  border-color: rgba(239,68,68,0.2);
}
.sidebar-status .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sidebar-status.aberta .dot { background: var(--green); }
.sidebar-status.fechada .dot { background: var(--red); }

/* ── MAIN ───────────────────────────────────── */
.main {
  flex: 1;
  overflow-y: auto;
  background: var(--bg-primary);
}

.page-header {
  padding: 1.5rem 1.5rem 0;
  margin-bottom: 1.25rem;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.content {
  padding: 1.25rem 1.5rem 2rem;
}

/* ── CARDS ──────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}

.card-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 1rem;
}

/* ── MÉTRICAS ───────────────────────────────── */
.grid4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 1.25rem;
}
.grid3 { display: grid; grid-template-columns: repeat(3,1fr); gap:12px; margin-bottom:1.25rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap:12px; margin-bottom:1rem; }

.metric {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  transition: border-color 0.15s;
}
.metric:hover { border-color: var(--border-hover); }
.metric-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}
.metric-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  font-family: 'DM Mono', monospace;
}
.metric-sub {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 3px;
}

/* ── TABELA ─────────────────────────────────── */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1rem;
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th {
  background: var(--bg-tertiary);
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg-hover); }

/* ── BOTÕES ─────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'DM Sans', sans-serif;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-hover); border-color: var(--border-hover); }

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

.btn-danger {
  background: var(--red-bg);
  border-color: rgba(239,68,68,0.3);
  color: var(--red);
}
.btn-danger:hover { background: var(--red); color: #fff; }

.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ── FORMULÁRIOS ────────────────────────────── */
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-bottom: 5px;
  margin-top: 12px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

input[type=text],input[type=number],input[type=tel],
input[type=password],input[type=date],select,textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  margin-bottom: 2px;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
input::placeholder { color: var(--text-tertiary); }
select option { background: var(--bg-secondary); }
.form-sel { width: 100%; }

input[type=range] {
  accent-color: var(--primary);
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
}

/* ── TAGS / BADGES ──────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.tag-green  { background: var(--green-bg); color: var(--green); }
.tag-amber  { background: var(--amber-bg); color: var(--amber); }
.tag-red    { background: var(--red-bg);   color: var(--red); }
.tag-blue   { background: var(--blue-bg);  color: var(--blue); }
.tag-gray   { background: var(--bg-tertiary); color: var(--text-secondary); }
/* tag-purple agora vira coral */
.tag-purple { background: var(--primary-light); color: var(--primary); }

/* ── MODAL ──────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 1rem;
}
.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  width: 460px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  letter-spacing: -0.2px;
}

/* ── PRODUTO CARDS ──────────────────────────── */
.prod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.prod-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  position: relative;
}
.prod-card:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.prod-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}
.prod-emoji { font-size: 26px; margin-bottom: 6px; }
.prod-nome { font-size: 12px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.prod-preco { font-size: 13px; font-weight: 700; color: var(--primary); }
.prod-badge {
  position: absolute;
  top: 6px; right: 6px;
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
}

/* ── PEDIDO LAYOUT ──────────────────────────── */
.pedido-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1rem;
  height: calc(100vh - var(--topbar-h) - var(--nav-h) - 2rem);
}
.pedido-produtos {
  overflow-y: auto;
  padding-right: 4px;
}
.pedido-layout .pedido-resumo.card {
  background: var(--bg-card);

  border: 2px solid var(--border-active);
  border-left: 4px solid var(--primary);

  border-radius: var(--radius-lg);
  padding: 1.25rem;

  box-shadow: var(--shadow-md);

  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
/* ── CART ───────────────────────────────────── */
.cart-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}
.cart-item-nome { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.cart-item-desc { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
.qty-ctrl {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.qty-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.qty-btn:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ── STATUS PEDIDOS (KANBAN) ────────────────── */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  height: calc(100vh - var(--topbar-h) - var(--nav-h) - 6rem);
  overflow-x: auto;
}
.kanban-col {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  display: flex;
  flex-direction: column;
  min-width: 220px;
  overflow-y: auto;
}
.kanban-col-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: grab;
  transition: all 0.15s;
}
.kanban-card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }

/* ── PILLS / FILTROS ────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  transition: all 0.15s;
  white-space: nowrap;
}
.pill:hover { border-color: var(--border-hover); color: var(--text-primary); }
.pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ── BARS ───────────────────────────────────── */
.bar-track {
  height: 6px;
  background: var(--bg-hover);
  border-radius: 3px;
  overflow: hidden;
  flex: 1;
}
.bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.3s;
}
.bar-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── MISC ───────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 0.75rem 0; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex { display: flex; align-items: center; }
.gap-8 { gap: 8px; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.empty {
  text-align: center;
  padding: 2rem;
  color: var(--text-tertiary);
  font-size: 13px;
}

/* ── PRODUCT GRID (Novo Pedido) ─────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.product-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 12px 12px;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.product-card:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(216,90,48,0.15);
}
.product-card--ativo {
  border-color: var(--primary) !important;
  background: var(--primary-light) !important;
  box-shadow: 0 4px 16px rgba(216,90,48,0.18);
}
.product-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
}
.product-card-emoji { font-size: 24px; line-height: 1; }
.product-card-badge {
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  min-width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  padding: 0 6px;
}
.product-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.3;
}
.product-desc {
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.4;
  margin-bottom: 8px;
  flex: 1;

  display: flex;
  overflow: hidden;
}
.product-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.product-price {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary);
}
.product-card-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  transition: transform 0.15s;
}
.product-card:hover .product-card-btn { transform: scale(1.15); }
.product-card--ativo .product-card-btn { font-size: 11px; font-weight: 800; }

/* ── BAR LABELS (Dashboard) ─────────────────── */
.bar-label {
  font-size: 12px;
  color: var(--text-secondary);
  min-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}
.bar-val {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 48px;
  text-align: right;
  flex-shrink: 0;
}

/* ── LOGIN FIREBASE ──────────────────────────── */
#fb-login-screen {
  position: fixed; inset: 0;
  background: var(--bg-primary);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  background-image:
    radial-gradient(ellipse at 30% 40%, rgba(216,90,48,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 70%, rgba(216,90,48,0.04) 0%, transparent 60%);
}
.fb-login-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem;
  width: 380px; max-width: calc(100vw - 2rem);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 40px rgba(216,90,48,0.12);
  animation: fbLoginIn 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes fbLoginIn {
  from { transform: translateY(30px) scale(0.95); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
.fb-login-logo {
  display: flex;
  align-items: center;
  justify-content: center;

  margin: 10px auto 5px;
  background: none;
  box-shadow: none;
}
.fb-login-title {
  font-size: 22px; font-weight: 700;
  text-align: center; color: var(--text-primary);
  margin-bottom: 4px;
}
.fb-login-sub {
  font-size: 13px; color: var(--text-secondary);
  text-align: center; margin-bottom: 1.75rem;
}
.fb-login-err {
  background: var(--red-bg);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius-sm);
  padding: 8px 12px; font-size: 12px;
  color: var(--red); margin-top: 10px;
  text-align: center; display: none;
}

/* ── SCROLLBAR ──────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-hover); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* ── SEÇÕES / TABS ──────────────────────────── */
.section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 8px;
  margin-top: 1rem;
}
.tab-btn {
  padding: 8px 16px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.15s;
  font-family: 'DM Sans', sans-serif;
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-bar { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }

/* ── TOAST ──────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
  animation: slideIn 0.2s ease;
}
@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── LOGIN ──────────────────────────────────── */
.login-screen {
  position: fixed; inset: 0;
  background: var(--bg-primary);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}
.login-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  width: 360px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.login-logo {
  width: 56px; height: 56px;
  background: var(--primary);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  margin: 0 auto 1rem;
  box-shadow: var(--shadow-glow);
}

/* ── TIPO TAG ───────────────────────────────── */
.tipo-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  margin-left: 4px;
}
.tag-gratis  { background: var(--green-bg); color: var(--green); }
.tag-pago    { background: var(--amber-bg); color: var(--amber); }
.tag-premium { background: var(--blue-bg);  color: var(--blue); }

/* ── BARRA PROGRESSO ────────────────────────── */
.barra-combo {
  height: 6px;
  background: var(--bg-hover);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}
.barra-fill { height: 100%; border-radius: 3px; }

/* ── SIDEBAR VERTICAL COLAPSÁVEL ───────────── */
.layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.sidebar {
  width: 48px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  transition: width 0.25s cubic-bezier(0.4,0,0.2,1);
  position: relative;
  z-index: 50;
}

.sidebar.open {
  width: 200px;
  box-shadow: 4px 0 20px rgba(0,0,0,0.4);
}

.sidebar-toggle {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  color: var(--text-secondary);
  transition: color 0.15s, background 0.15s;
  border: none;
  background: transparent;
  font-size: 18px;
}
.sidebar-toggle:hover { color: var(--primary); background: var(--bg-hover); }

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 0 8px;
  flex-shrink: 0;
}

.sidebar-section {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  padding: 10px 14px 4px;
  white-space: nowrap;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.15s;
}
.sidebar.open .sidebar-section { opacity: 1; }

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  height: 44px;
  border-radius: 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.15s;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-family: 'DM Sans', sans-serif;
}
.sidebar-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.sidebar-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}
.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--primary);
  border-radius: 0 2px 2px 0;
}

.sidebar-icon {
  font-size: 17px;
  flex-shrink: 0;
  width: 48px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-label {
  opacity: 0;
  transition: opacity 0.15s 0.05s;
  white-space: nowrap;
}
.sidebar.open .sidebar-label { opacity: 1; }

.sidebar:not(.open) .sidebar-item:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 52px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-hover);
  color: var(--text-primary);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid var(--border);
  pointer-events: none;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  overflow: hidden;
}

/* ═══════════════════════════════════════════════
   RESPONSIVIDADE MOBILE
   ═══════════════════════════════════════════════ */

@media (max-width: 768px) {

  .topbar {
    padding: 0 0.75rem;
    gap: 0.5rem;
    height: 52px;
    flex-wrap: nowrap;
  }
  .topbar-brand { min-width: 0; flex-shrink: 1; }
  .topbar-sub   { display: none; }
  .topbar-date  { display: none; }
  .status-badge { display: none; }

  .nav-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    border-bottom: none;
    justify-content: space-around;
    padding: 4px 0 env(safe-area-inset-bottom, 4px);
    z-index: 200;
    gap: 0;
    overflow-x: hidden;
  }

  .nav-item {
    flex-direction: column;
    gap: 2px;
    padding: 6px 8px;
    font-size: 10px;
    border-radius: var(--radius-sm);
    flex: 1;
    justify-content: center;
    text-align: center;
  }

  .nav-item .nav-icon { font-size: 20px; }

/* SIDEBAR MOBILE FUNCIONAL */


  .main { padding-bottom: 64px; overflow-y: auto !important; }

  .grid4 { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .grid3 { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .grid2 { grid-template-columns: 1fr; gap: 8px; }

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .modal {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    max-height: 92vh;
    padding: 1.25rem 1rem 1.5rem;
  }

  .layout { flex-direction: column; }
  .content { padding: 0.75rem; }

  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table th, .table td { white-space: nowrap; }

  .kanban-board,
  .status_pedidos-board {
    grid-template-columns: repeat(2, minmax(280px, 1fr)) !important;
    height: auto !important;
    overflow-x: auto;
  }

  .pedido-layout {
    grid-template-columns: 1fr !important;
    height: auto !important;
  }
  .pedido-resumo { min-height: auto; }

  #content > div[style*="grid-template-columns: 1fr 1fr"] {
    display: flex !important;
    flex-direction: column !important;
  }

  /* Entregas mobile — força coluna única */
  #content > div[style*="grid-template-columns:repeat(4"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  #content > div[style*="grid-template-columns: 1fr 1fr;gap:1rem"] {
    display: flex !important;
    flex-direction: column !important;
  }

  .metric-value { font-size: 20px; }

  .form-row { grid-template-columns: 1fr !important; }

.product-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
  }

  .topbar-right .sidebar-status span { display: none; }
  .topbar-right .sidebar-status .dot { display: block; }

  ::-webkit-scrollbar { width: 3px; height: 3px; }
}

@media (max-width: 400px) {
  .grid4 { grid-template-columns: repeat(2, 1fr); }
  .nav-item { font-size: 9px; padding: 4px 4px; }
  .nav-item .nav-icon { font-size: 18px; }
  .metric-value { font-size: 18px; }
  .content { padding: 0.5rem; }
}

@media (max-width: 768px) {
  .pedido-main-layout {
    grid-template-columns: 1fr !important;
    height: auto !important;
  }
  .pedido-main-layout > div:first-child {
    max-height: 55vh;
    overflow-y: auto;
  }
}

@media (max-width: 480px) {
  .pag-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ── TOPBAR CORAL ───────────────────────────── */
.topbar {
  background: #993C1D !important;
  border-bottom-color: #712B13 !important;
}

.topbar-name {
  color: #fff !important;
}

.topbar-sub,
.topbar-date {
  color: #F5C4B3 !important;
}

.nav-item {
  color: #F5C4B3 !important;
}

.nav-item:hover {
  background: rgba(255,255,255,0.1) !important;
  color: #fff !important;
}

.nav-item.active {
  background: #D85A30 !important;
  color: #fff !important;
  box-shadow: none !important;
}

.theme-btn,
.sair-btn,
.topbar-right > button {
  color: #F5C4B3 !important;
  border-color: rgba(255,255,255,0.2) !important;
}

.theme-btn:hover,
.sair-btn:hover,
.topbar-right > button:hover {
  background: rgba(255,255,255,0.1) !important;
  color: #fff !important;
}

/* Topbar coral no mobile também */
@media (max-width: 768px) {
  .topbar {
    background: #993C1D !important;
  }
  .nav-bar {
    background: #1a1a17 !important;
    border-top-color: #712B13 !important;
  }
}
/* ── SIDEBAR LATERAL CORAL ─────────────────── */
.sidebar {
  background: #712B13 !important;
  border-right-color: #993C1D !important;
}

.sidebar-toggle {
  color: #F5C4B3 !important;
}
.sidebar-toggle:hover {
  background: rgba(255,255,255,0.1) !important;
  color: #fff !important;
}

.sidebar-section {
  color: #F0997B !important;
}

.sidebar-item {
  color: #F5C4B3 !important;
}
.sidebar-item:hover {
  background: rgba(255,255,255,0.1) !important;
  color: #fff !important;
}
.sidebar-item.active {
  background: rgba(216,90,48,0.3) !important;
  color: #fff !important;
}
.sidebar-item.active::before {
  background: #F0997B !important;
}

.sidebar-divider,
.sidebar-footer {
  border-color: rgba(255,255,255,0.12) !important;
}
/* ── NOVO PEDIDO — MELHORIAS ─────────────────── */

/* Pills de categoria maiores e mais presentes */
.pedido-main-layout [style*="border-radius:999px"] {
  padding: 7px 18px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  border-width: 2px !important;
}

/* Painel direito (resumo) com mais destaque */
.pedido-main-layout > div:last-child > .card {
  border: 2px solid var(--border-active);
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow-md);
}
/* Campos do formulário com fundo mais visível no light mode */
body.light-mode .pedido-main-layout input,
body.light-mode .pedido-main-layout select,
body.light-mode .pedido-main-layout textarea {
  background: #fff !important;
  border-color: rgba(153,60,29,0.25) !important;
}

/* Estado vazio do cardápio — mensagem orientadora */
body.light-mode .pedido-main-layout .empty {
  color: #8a6655 !important;
}

/* Cards de produto mais sólidos no light mode */
body.light-mode .product-card {
  background: #fff !important;
  border-color: rgba(153,60,29,0.2) !important;
}
body.light-mode .product-card:hover,
body.light-mode .product-card--ativo {
  border-color: #D85A30 !important;
  background: rgba(216,90,48,0.06) !important;
}
body.light-mode .product-card-footer { border-top-color: rgba(153,60,29,0.12) !important; }
body.light-mode .product-price { color: #993C1D !important; }
body.light-mode .product-card-btn { background: #D85A30 !important; }
body.light-mode .product-card-badge { background: #D85A30 !important; }
body.light-mode .product-desc { color: #b07a65 !important; }

.confirmar-cliente-wrap {
  margin-top: 10px;
}

.btn-confirmar-cliente {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-md);
  border: none;

  background: var(--green);
  color: #fff;

  font-size: 14px;
  font-weight: 700;

  cursor: pointer;
  transition: all 0.15s;

  box-shadow: 0 4px 12px rgba(16,185,129,0.25);
}

.confirmar-cliente-wrap {
  margin-top: auto;
  padding-top: 10px;
}
.btn-confirmar-cliente:active {
  transform: scale(0.97);
}

/* Título RESUMO DO PEDIDO em coral */
body.light-mode .pedido-main-layout .card-title {
  color: #993C1D !important;
}
.logo-topbar {
  width: 52px;
  height: 52px;
  object-fit: contain;
}
.logo-login {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin-bottom: 10px;
}
.logo-fixed {
  position: fixed;
  bottom: 80px;
  right: 16px;
  width: 48px;
  height: 48px;
  object-fit: contain;
  opacity: 0.6;
  z-index: 10000;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.logo-fixed.hidden {
  opacity: 0 !important;
  pointer-events: none;
}
/* Label do status some quando sidebar fechada */
#sidebar:not(.open) #sidebar-status-label {
  opacity: 0 !important;
  pointer-events: none;
}
#sidebar.open #sidebar-status-label {
  opacity: 1 !important;
}
/* FIX MOBILE — STATUS TOPBAR */
@media (max-width: 768px) {

  .topbar {
    flex-wrap: nowrap !important;
    height: 52px !important;
    padding: 0 8px !important;
    overflow: hidden;
  }

  .topbar-right {
    flex-wrap: nowrap !important;
    justify-content: flex-end;
    gap: 4px !important;
  }

.sidebar-status {
    display: none !important;
  }

  #badge-horario {
    display: none !important;
  }

  #status-loja {
    font-size: 9px !important;
    padding: 1px 5px !important;
  }

  .topbar-name {
    font-size: 12px !important;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-logo {
    width: 36px !important;
    height: 36px !important;
  }

  .cfg-layout {
    grid-template-columns: 1fr !important;
  }

}
.sidebar-toggle {
  display: flex;
}

.topbar-icon-btn {
  height: 34px;
  min-width: 34px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.2);
  background: transparent;
  color: #F5C4B3;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  font-family: 'DM Sans', sans-serif;
  white-space: nowrap;
}
.topbar-icon-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

@media (max-width: 768px) {
  .sidebar-toggle {
    display: flex !important;
    position: static !important;
    background: transparent !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    color: #F5C4B3 !important;
    height: 34px !important;
    min-width: 34px !important;
    width: auto !important;
    border-radius: var(--radius-sm) !important;
    font-size: 14px !important;
    box-shadow: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    padding: 0 10px !important;
  }
}
/* MOBILE SIDEBAR FUNCIONANDO 100% */
@media (max-width: 768px) {

  .layout {
    flex-direction: column;
  }

  .sidebar {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 200px;
    height: 100%;
    z-index: 9998;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

 .sidebar.open {
    transform: translateX(0);
  }

  /* Overlay escuro atrás do sidebar mobile */
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9997;
  }
  .sidebar-overlay.active {
    display: block;
  }

}
.ped-status-pagamento{
  font-size:12px;
  font-weight:700;
  white-space:nowrap;
}
#nav-mesas[style*="display:none"] {
  display: none !important;
  flex: 0 !important;
  width: 0 !important;
  padding: 0 !important;
  min-width: 0 !important;
}
