/* ══════════════════════════════════════════════════════════════════
   FATIA CERTA — Design System v7
   Estética: confeitaria artesanal premium · clean · acolhedor
   ══════════════════════════════════════════════════════════════════ */

/* ── Google Fonts ─────────────────────────────────────────────── */
@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=Playfair+Display:wght@500;600&display=swap');

/* ── Tokens ──────────────────────────────────────────────────────*/
:root {
  /* Paleta original Fatia Certa (v6) */
  --cream:    #fff8f1;
  --petal:    #f3c7c5;
  --blush:    #f3ddd3;
  --rose:     #d89a9e;
  --rose-dk:  #c47e83;
  --cocoa:    #6f4e37;
  --cocoa-lt: #8a6951;
  --warm:     #8f7b70;
  --sand:     #c99a4a;
  --gold:     #c99a4a;
  --mint:     #5A8A6A;
  --sky:      #4A7AA8;
  --white:    #FFFFFF;

  /* Semânticas */
  --text:     #3d3028;
  --muted:    #8f7b70;
  --bd:       #f3ddd3;
  --danger:   #a32d2d;
  --success:  #3b6d11;

  /* Superfícies */
  --surface:  #FFFFFF;
  --surface2: #fff8f1;
  --surface3: #f7ece3;

  /* Sombras */
  --shadow-sm: 0 1px 4px rgba(61,43,31,.06);
  --shadow:    0 4px 20px rgba(61,43,31,.08);
  --shadow-lg: 0 12px 48px rgba(61,43,31,.12);

  /* Raios */
  --r-sm: 8px;
  --r:    14px;
  --r-lg: 20px;
  --r-xl: 28px;

  /* Tipografia */
  --font-body:    Inter, system-ui, sans-serif;
  --font-display: Inter, system-ui, sans-serif;
}

/* ── Reset ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
input, select, textarea { font: inherit; }

/* ── Auth ─────────────────────────────────────────────────────── */
.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 0;
  background: var(--cream);
}
.auth-card {
  width: min(420px, 100%);
  background: var(--white);
  border-radius: var(--r-xl);
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: 14px;
}
.auth-card h1 { text-align: center; color: var(--cocoa); font-size: 1.3rem; }
.auth-card .divider { border: none; border-top: 1px solid var(--bd); margin: 4px 0; }
.auth-card p { text-align: center; color: var(--muted); font-size: 12px; }
#authMsg { font-size: 11px; text-align: center; min-height: 16px; }
#authMsg.error   { color: var(--danger); }
#authMsg.success { color: var(--success); }

/* ── Marca ─────────────────────────────────────────────────────── */
.brand {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--cocoa);
  font-size: 1.1rem;
  display: flex;
  gap: 9px;
  align-items: center;
}
.brand .ico {
  background: var(--petal);
  border-radius: 10px;
  padding: 6px 8px;
  font-size: 1rem;
  flex-shrink: 0;
}

/* ── Botões ────────────────────────────────────────────────────── */
.btn {
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all .18s ease;
  white-space: nowrap;
  letter-spacing: .01em;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

.btn-primary {
  background: var(--rose);
  color: #fff;
  box-shadow: 0 4px 16px rgba(196,115,122,.30);
}
.btn-primary:hover:not(:disabled) { background: var(--rose-dk); box-shadow: 0 6px 22px rgba(196,115,122,.40); }

.btn-soft {
  background: var(--petal);
  color: var(--cocoa);
  border: 1px solid var(--blush);
}
.btn-soft:hover:not(:disabled) { background: var(--blush); }

.btn-ghost {
  background: var(--white);
  color: var(--cocoa);
  border: 1px solid var(--bd);
}
.btn-ghost:hover:not(:disabled) { background: var(--surface3); }

.btn-danger {
  background: #FDF0F0;
  color: var(--danger);
  border: 1px solid #F0C8C8;
}
.btn-danger:hover:not(:disabled) { background: #F9DCDC; }

.btn-green {
  background: #EDF5EF;
  color: var(--success);
  border: 1px solid #C0D9C8;
}

.btn-sm  { padding: 5px 12px; font-size: 11px; }
.btn-full { width: 100%; }

.icon-btn {
  border: 1px solid var(--bd);
  border-radius: var(--r-sm);
  background: var(--white);
  color: var(--warm);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: .14s;
}
.icon-btn:hover { background: var(--petal); }
.icon-btn.d { color: var(--danger); border-color: #F0C8C8; }
.icon-btn.d:hover { background: #FDF0F0; }
.hidden { display: none !important; }

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

/* ── Sidebar ────────────────────────────────────────────────────── */
.sidebar {
  width: 56px;
  background: var(--white);
  border-right: 1px solid var(--bd);
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  transition: width .24s cubic-bezier(.4,0,.2,1);
  z-index: 20;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
}
.sidebar:hover,
.sidebar:focus-within { width: 210px; }

.sidebar .sb-brand {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--cocoa);
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  padding: 4px 2px;
}
.sidebar .sb-brand .sb-ico { font-size: 18px; }

.sb-ico { font-size: 17px; min-width: 30px; text-align: center; flex-shrink: 0; }
.sb-label {
  opacity: 0;
  transition: opacity .12s .05s;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--cocoa);
}
.sidebar:hover .sb-label,
.sidebar:focus-within .sb-label { opacity: 1; }

.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border-radius: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
  width: 100%;
  overflow: hidden;
  transition: .14s;
  position: relative;
}
.nav-btn:hover { background: var(--petal); color: var(--cocoa); }
.nav-btn.active { background: var(--rose); color: #fff; }

/* Ícones modo colapsado */
.sidebar:not(:hover):not(:focus-within) .nav-btn { color: transparent; background: transparent; }
.sidebar:not(:hover):not(:focus-within) .nav-btn::after {
  content: attr(data-ico);
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%,-50%);
  font-size: 16px;
  color: var(--muted);
}
.sidebar:not(:hover):not(:focus-within) .nav-btn.active::after { color: #fff; }
.sidebar:not(:hover):not(:focus-within) .nav-btn.active { background: var(--rose); }

.sidebar .sb-support {
  margin-top: auto;
  background: var(--surface2);
  border: 1px solid var(--bd);
  border-radius: 10px;
  padding: 10px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  color: var(--muted);
  font-size: 11px;
  transition: .14s;
  width: 100%;
  font-family: inherit;
  text-align: left;
}
.sidebar .sb-support:hover { background: var(--petal); }

/* ── Conteúdo ────────────────────────────────────────────────────── */
.content {
  flex: 1;
  padding: 0 28px 80px 80px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ── Header ──────────────────────────────────────────────────────── */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 0 18px;
  gap: 12px;
  border-bottom: 1px solid var(--bd);
  margin-bottom: 24px;
}
.app-header .eyebrow {
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
}
.app-header h1 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--cocoa);
  margin-top: 2px;
}

/* ── Páginas ─────────────────────────────────────────────────────── */
.page { display: none; flex-direction: column; gap: 20px; }
.page.active { display: flex; }

/* ── Métricas ────────────────────────────────────────────────────── */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.metric {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  border: 1px solid var(--bd);
  position: relative;
  overflow: hidden;
  transition: box-shadow .16s;
}
.metric:hover { box-shadow: var(--shadow); }
.metric::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--blush);
  border-radius: 4px 0 0 4px;
}
.metric.accent::before { background: var(--rose); }
.metric span {
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  display: block;
  margin-bottom: 8px;
}
.metric strong {
  font-size: 1.7rem;
  font-weight: 300;
  color: var(--cocoa);
  display: block;
  font-family: var(--font-display);
  letter-spacing: -.02em;
}
.metric.accent { background: linear-gradient(135deg, #fff 60%, #FDF5F5); border-color: var(--blush); }

/* ── Painel ──────────────────────────────────────────────────────── */
.panel {
  background: var(--white);
  border: 1px solid var(--bd);
  border-radius: var(--r-lg);
  padding: 20px 22px;
}
.panel h2 {
  font-size: 13px;
  font-weight: 600;
  color: var(--cocoa);
  margin-bottom: 14px;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.panel-head h2 { margin-bottom: 0; }

.search-input {
  padding: 8px 14px;
  border: 1px solid var(--bd);
  border-radius: 999px;
  font-size: 11px;
  background: var(--surface2);
  color: var(--text);
  min-width: 180px;
  transition: .15s;
}
.search-input:focus { outline: none; border-color: var(--rose); background: var(--white); box-shadow: 0 0 0 3px rgba(196,115,122,.1); }

/* ── Itens de lista ──────────────────────────────────────────────── */
.list { display: grid; gap: 8px; }
.item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface2);
  border: 1px solid var(--bd);
  border-radius: var(--r);
  padding: 13px 16px;
  gap: 10px;
  transition: border-color .14s, box-shadow .14s;
}
.item:hover { border-color: var(--blush); box-shadow: var(--shadow-sm); }
.item.alert { border-color: #F0C8C8; background: #FDF5F5; }
.item.done { opacity: .45; }
.item .nm { font-size: 12px; font-weight: 600; color: var(--cocoa); }
.item .sub { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.item .ra { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; flex-shrink: 0; }
.item a { color: var(--rose); font-weight: 600; }
.empty { font-size: 12px; color: var(--muted); text-align: center; padding: 28px 0; }

/* ── Badges / status ─────────────────────────────────────────────── */
.badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: .01em;
}
.badge           { background: var(--petal); color: var(--rose-dk); }
.badge.g         { background: #EBF5EE; color: #2E6B3C; }
.badge.a         { background: #FBF2E3; color: #7A5010; }
.badge.b         { background: #EBF2FA; color: #1E5A8A; }
.badge.r         { background: #FBF0F0; color: var(--danger); }

.badge.s-pendente    { background: #FFF8E8; color: #8A6000; border: 1px solid #F0DFA0; }
.badge.s-confirmado  { background: #EBF8EE; color: #1E6B35; border: 1px solid #A8DAB8; }
.badge.s-em-producao { background: #FFF3EB; color: #9A4E00; border: 1px solid #F0C898; }
.badge.s-pronto      { background: #EEF0FF; color: #3040A0; border: 1px solid #B0B8F0; }
.badge.s-entregue    { background: #EBF6F4; color: #1A6860; border: 1px solid #98D0C8; }
.badge.s-cancelado   { background: #FBF0F0; color: var(--danger); border: 1px solid #F0C0C0; }

/* Status duplicados sem ponto (para usar diretamente) */
.s-pendente    { background: #FFF8E8; color: #8A6000; }
.s-confirmado  { background: #EBF8EE; color: #1E6B35; }
.s-em-producao { background: #FFF3EB; color: #9A4E00; }
.s-pronto      { background: #EEF0FF; color: #3040A0; }
.s-entregue    { background: #EBF6F4; color: #1A6860; }
.s-cancelado   { background: #FBF0F0; color: var(--danger); }

/* ── Formulários ─────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}
.form-grid.c2 { grid-template-columns: 1fr 1fr; }
.form-grid.c4 { grid-template-columns: repeat(4, 1fr); }
.form-grid.c1 { grid-template-columns: 1fr; }
.form-grid input,
.form-grid select,
.form-grid textarea {
  padding: 9px 13px;
  border: 1px solid var(--bd);
  border-radius: var(--r-sm);
  font-size: 12px;
  background: var(--white);
  color: var(--text);
  width: 100%;
  transition: .15s;
}
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  outline: none;
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(196,115,122,.10);
}
.form-grid input.invalid { border-color: var(--danger) !important; }
.form-grid textarea { resize: vertical; min-height: 64px; }
.action-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── Paginação ───────────────────────────────────────────────────── */
.pager {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 12px;
}
.pager span { font-size: 11px; color: var(--muted); }

/* ── Gráfico de barras ───────────────────────────────────────────── */
.revenue-panel { overflow: hidden; }
.chart-period {
  background: var(--surface2);
  border: 1px solid var(--bd);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  padding: 4px 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.chart-wrap { overflow-x: auto; padding-bottom: 2px; }
.chart-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 11px;
  flex-wrap: wrap;
}
.chart-summary strong { color: var(--cocoa); font-size: 12px; }
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 168px;
  padding: 6px 2px 0;
  min-width: 490px;
}
.bar-col {
  display: grid;
  grid-template-rows: 18px 1fr 14px 12px;
  align-items: end;
  justify-items: center;
  gap: 4px;
  flex: 1;
  min-width: 54px;
  height: 100%;
}
.bar-col .bar-track {
  width: 100%;
  height: 104px;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid var(--bd);
  display: flex;
  align-items: flex-end;
  padding: 4px;
  cursor: pointer;
  transition: .15s;
}
.bar-col .bar-track:hover { border-color: var(--blush); transform: translateY(-2px); }
.bar-col .bar {
  width: 100%;
  background: linear-gradient(180deg, var(--rose) 0%, var(--rose-dk) 100%);
  border-radius: 6px;
  transition: height .4s ease;
  min-height: 3px;
}
.bar-col.today .bar-track { border-color: var(--blush); background: linear-gradient(180deg, #fff, #FDF5F5); }
.bar-col.today .bar { background: linear-gradient(180deg, var(--gold), #A07830); }
.bar-col .bar.profit { background: linear-gradient(180deg, #7AC07A, var(--success)); }
.bar-col .lbl { font-size: 10px; color: var(--cocoa); font-weight: 600; text-align: center; text-transform: capitalize; }
.bar-col .day { font-size: 9px; color: var(--muted); font-weight: 600; text-align: center; }
.bar-col .val { font-size: 9px; color: var(--cocoa); font-weight: 700; line-height: 1; text-align: center; max-width: 58px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-legend { display: flex; gap: 14px; margin-top: 10px; }
.chart-legend span { font-size: 10px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.chart-legend .dot { width: 8px; height: 8px; border-radius: 50%; }

/* ── Calendário ──────────────────────────────────────────────────── */
.cal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 16px; }
.cal-head { text-align: center; font-size: 10px; font-weight: 600; color: var(--muted); padding: 4px 0; text-transform: uppercase; letter-spacing: .04em; }
.cal-cell {
  height: 72px;
  background: var(--surface2);
  border: 1px solid var(--bd);
  border-radius: var(--r);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
  transition: .13s;
}
.cal-cell:hover { border-color: var(--blush); }
.cal-cell.dim { opacity: .22; }
.cal-cell.today { border-color: var(--rose); border-width: 1.5px; background: #FFF8F8; }
.cal-cell strong { font-size: 10px; color: var(--cocoa); font-weight: 600; }
.cal-cell .ev {
  background: var(--white);
  border-radius: 5px;
  padding: 2px 6px;
  font-size: 8px;
  color: var(--rose-dk);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid var(--petal);
}

/* ── Timeline ────────────────────────────────────────────────────── */
.timeline .item { border-left: 3px solid var(--blush); border-radius: 0 var(--r) var(--r) 0; }

/* ── Relacionamento ──────────────────────────────────────────────── */
.rel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rel-card { background: var(--surface2); border-radius: var(--r); padding: 16px; border: 1px solid var(--bd); }
.rel-card h3 { font-size: 12px; color: var(--cocoa); margin-bottom: 10px; font-weight: 600; }
.rel-card p { font-size: 11px; color: var(--muted); }
.mini-line { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-top: 1px solid var(--bd); font-size: 11px; color: var(--muted); gap: 6px; }
.mini-line a { font-weight: 600; color: var(--success); cursor: pointer; font-size: 10px; padding: 3px 8px; background: #EDF5EF; border-radius: 999px; }
.rel-card.wide { grid-column: 1 / -1; }

/* ── Perfil / Config ─────────────────────────────────────────────── */
.section-label { font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; display: block; }

/* ── Financeiro ──────────────────────────────────────────────────── */
.fin-row { display: flex; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--bd); font-size: 12px; }
.fin-row .val { font-weight: 600; color: var(--cocoa); }

/* ── Toast ───────────────────────────────────────────────────────── */
#toast {
  position: fixed;
  right: 20px; bottom: 20px;
  background: var(--cocoa);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--r);
  font-size: 12px;
  font-weight: 500;
  z-index: 999;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: .22s cubic-bezier(.4,0,.2,1);
  max-width: 300px;
  box-shadow: var(--shadow-lg);
}
#toast.show  { opacity: 1; transform: translateY(0); }
#toast.error   { background: var(--danger); }
#toast.success { background: var(--success); }

/* ── Modal de confirmação ────────────────────────────────────────── */
#confirmOverlay {
  position: fixed; inset: 0;
  background: rgba(61,43,31,.40);
  display: none; align-items: center; justify-content: center;
  z-index: 500;
}
#confirmOverlay.on { display: flex; }
.confirm-card {
  background: var(--white);
  border-radius: var(--r-xl);
  padding: 28px 30px;
  max-width: 300px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.confirm-card p { font-size: 13px; color: var(--cocoa); margin-bottom: 18px; font-weight: 500; }

/* ── Summary box ─────────────────────────────────────────────────── */
.summary-box { background: var(--surface2); border: 1px solid var(--bd); border-radius: var(--r-sm); padding: 10px 14px; font-size: 11px; color: var(--muted); }

/* ── Bottom nav (mobile) ─────────────────────────────────────────── */
.bottom-nav {
  display: none;
  position: fixed;
  left: 12px; right: 12px; bottom: 12px;
  background: var(--white);
  border: 1px solid var(--bd);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: 8px 6px;
  z-index: 30;
  overflow-x: auto;
  gap: 4px;
  justify-content: flex-start;
}
.bottom-nav button {
  border: none;
  background: transparent;
  border-radius: var(--r);
  padding: 8px 12px;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 58px;
  white-space: nowrap;
  transition: .14s;
}
.bottom-nav button.active { background: var(--rose); color: #fff; }
.bottom-nav button .bico { font-size: 17px; }

/* ── Landing page ────────────────────────────────────────────────── */
.landing { min-height: 100vh; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 20px 7vw; }
.hero { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; padding: 50px 7vw 70px; align-items: center; }
.hero h1 { font-size: clamp(2rem, 4vw, 3.6rem); line-height: 1.05; color: var(--cocoa); margin: 10px 0; }
.hero-text { font-size: 1rem; color: var(--muted); line-height: 1.75; }
.hero-actions { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.hero-card { background: var(--white); border-radius: var(--r-xl); padding: 28px; box-shadow: var(--shadow-lg); }
.section { padding: 50px 7vw; }
.section h2 { font-size: 1.6rem; color: var(--cocoa); margin-bottom: 22px; font-family: var(--font-display); font-weight: 500; }
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.product-card { background: var(--white); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-sm); border: 1px solid var(--bd); }
.product-card .pico { font-size: 2rem; margin-bottom: 8px; }
.product-card h3 { color: var(--cocoa); margin-bottom: 4px; font-weight: 500; }
.product-card p { color: var(--muted); font-size: 12px; }
.order-form { background: var(--white); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--shadow); display: grid; gap: 10px; }
.order-form input { padding: 10px 14px; border: 1px solid var(--bd); border-radius: var(--r-sm); font-size: 12px; width: 100%; }
.order-form input:focus { outline: none; border-color: var(--rose); }

/* ── Google Calendar ─────────────────────────────────────────────── */
.gcal-badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 13px; font-size: 11px; font-weight: 600; cursor: pointer; border: 1px solid; transition: .15s; }
.gcal-badge.connected    { background: #EDF5EF; border-color: #B0D8B8; color: #1E6B35; }
.gcal-badge.disconnected { background: var(--petal); border-color: var(--blush); color: var(--cocoa-lt); }
.gcal-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.gcal-badge.connected .gcal-dot    { background: #3DB858; animation: gcalpulse 2s infinite; }
.gcal-badge.disconnected .gcal-dot { background: var(--rose); }
@keyframes gcalpulse { 0%,100%{opacity:1} 50%{opacity:.4} }

.gcal-panel { background: #F2F8F4; border: 1px solid #B8D8C0; border-radius: var(--r-lg); padding: 18px 20px; }
.gcal-panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }
.gcal-panel-title { font-size: 13px; font-weight: 600; color: #1A5C30; }
.gcal-panel-sub { font-size: 10px; color: var(--muted); margin-top: 2px; }
.gcal-logo { width: 26px; height: 26px; border-radius: 6px; background: linear-gradient(135deg, #4285f4, #34a853); display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.gcal-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.gcal-sync-status { display: flex; align-items: center; gap: 10px; background: var(--white); border-radius: var(--r-sm); padding: 10px 13px; border: 1px solid #B8D8C0; }
.gcal-sync-status-wrap { margin-bottom: 10px; }
.gcal-pulse { width: 9px; height: 9px; border-radius: 50%; background: #3DB858; animation: gcalpulse 2s infinite; flex-shrink: 0; }
.gcal-st-title { font-size: 11px; font-weight: 600; color: #1E6B35; }
.gcal-st-sub { font-size: 10px; color: var(--muted); margin-top: 1px; }
.gcal-connect-banner { display: flex; align-items: flex-start; gap: 14px; background: var(--white); border: 1px solid var(--bd); border-radius: var(--r-lg); padding: 18px 20px; }
.gcal-connect-banner strong { font-size: 13px; color: var(--cocoa); display: block; margin-bottom: 4px; }
.gcal-connect-banner p { font-size: 11px; color: var(--muted); line-height: 1.6; }
.gcal-connect-banner > div { flex: 1; }
.btn-gcal { background: #EDF5EF; color: #1A73E8; border: 1px solid #B8D8C0; border-radius: 999px; padding: 7px 15px; font-size: 11px; font-weight: 600; cursor: pointer; transition: .15s; display: inline-flex; align-items: center; gap: 5px; }
.btn-gcal:hover { background: #D8EEE0; }
.gcal-setting-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid rgba(184,216,192,.4); }
.gcal-setting-row:last-of-type { border: none; }
.gcal-sl { font-size: 12px; font-weight: 600; color: var(--cocoa); }
.gcal-sd { font-size: 10px; color: var(--muted); margin-top: 2px; }
.toggle { width: 38px; height: 21px; border-radius: 11px; background: var(--bd); cursor: pointer; position: relative; transition: .2s; flex-shrink: 0; border: none; }
.toggle.on { background: #3DB858; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.toggle.on::after { left: 20px; }
.gcal-event-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--white); border-radius: var(--r-sm); margin-bottom: 5px; border: 1px solid #B8D8C0; }
.gcal-icon-sm { width: 24px; height: 24px; border-radius: 5px; background: linear-gradient(135deg, #4285f4, #34a853); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.gcal-ev-info { flex: 1; min-width: 0; }
.gcal-ev-title { font-size: 11px; font-weight: 600; color: var(--cocoa); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcal-ev-time { font-size: 10px; color: #1A73E8; font-weight: 600; margin-top: 1px; }
.gcal-synced-badge { font-size: 9px; background: #EDF5EF; color: #1E6B35; border: 1px solid #B0D8B8; border-radius: 999px; padding: 2px 7px; font-weight: 600; }
.gcal-sync-message { margin-top: 10px; padding: 10px 12px; border: 1px solid #B0D8B8; border-radius: 10px; background: #fff; color: #1E6B35; font-size: 11px; font-weight: 600; }

/* ── Carrinho multi-produto ──────────────────────────────────────── */
.cart-wrap { background: var(--surface2); border: 1px solid var(--bd); border-radius: var(--r); padding: 16px 18px; margin-top: 12px; }
.cart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.cart-header h3 { font-size: 12px; font-weight: 600; color: var(--cocoa); margin: 0; }
.cart-items-wrap { display: grid; gap: 8px; min-height: 50px; }
.cart-item { background: var(--white); border: 1px solid var(--bd); border-radius: var(--r-sm); padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.cart-item-name { display: flex; flex-direction: column; gap: 2px; min-width: 130px; flex: 1; }
.cart-item-product { font-size: 12px; font-weight: 600; color: var(--cocoa); }
.cart-item-price { font-size: 10px; color: var(--muted); }
.cart-item-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.qty-btn { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--bd); background: var(--white); cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; color: var(--cocoa); font-weight: 700; flex-shrink: 0; transition: .13s; }
.qty-btn:hover { background: var(--petal); }
.qty-input { width: 48px; text-align: center; border: 1px solid var(--bd); border-radius: var(--r-sm); padding: 5px 6px; font-size: 12px; }
.cart-item-sub { font-size: 12px; font-weight: 600; color: var(--cocoa); min-width: 60px; text-align: right; }
.cart-remove { background: #FBF0F0; border: none; color: var(--danger); width: 22px; height: 22px; border-radius: 50%; cursor: pointer; font-size: 11px; font-weight: 700; flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: .13s; }
.cart-remove:hover { background: #F5DADA; }
.cart-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--bd); flex-wrap: wrap; gap: 6px; }
.cart-total { font-size: 15px; font-weight: 600; color: var(--cocoa); font-family: var(--font-display); }
.cart-total-cost { font-size: 11px; color: var(--muted); }
.cart-empty { color: var(--muted); font-size: 12px; text-align: center; padding: 18px 0; }
.add-to-cart-row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 0; }
.add-to-cart-row .fg { margin-bottom: 0; flex: 1; min-width: 120px; }
.order-item-calculation { display:flex; justify-content:space-between; gap:12px; margin:-2px 0 10px; padding:9px 12px; background:#fff; border:1px dashed var(--blush); border-radius:9px; color:var(--muted); font-size:11px; }
.order-item-calculation strong { color:var(--cocoa); }
.order-item-calculation span { color:var(--rose-dk); font-size:13px; font-weight:800; white-space:nowrap; }
.street-sale-card { position:relative; overflow:hidden; padding:20px; border-radius:18px; color:#fff; background:linear-gradient(120deg,#ff5b45 0%,#e82b6d 55%,#9f36c7 100%); box-shadow:0 12px 32px rgba(232,43,109,.25); }
.street-sale-card::after { content:''; position:absolute; width:220px; height:220px; right:-80px; top:-120px; border-radius:50%; background:rgba(255,255,255,.13); }
.street-sale-head { position:relative; z-index:1; display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:15px; }
.street-sale-head h2 { font-family:var(--font-display); font-size:22px; margin:2px 0; color:#fff; }
.street-sale-head p { font-size:11px; opacity:.9; }
.street-sale-kicker { font-size:9px; letter-spacing:1.2px; font-weight:800; }
.street-sale-icon { font-size:31px; }
.street-sale-grid { position:relative; z-index:1; display:grid; grid-template-columns:minmax(180px,2fr) 100px 130px 145px auto; gap:8px; align-items:center; }
.street-sale-grid select,.street-sale-grid input { width:100%; min-height:38px; padding:8px 11px; border:1px solid rgba(255,255,255,.55); border-radius:10px; background:#fff; color:var(--cocoa); font-size:11px; }
.street-sale-total { min-height:38px; display:flex; align-items:center; justify-content:center; padding:8px 11px; border-radius:10px; background:rgba(255,255,255,.18); border:1px solid rgba(255,255,255,.35); font-size:12px; font-weight:800; white-space:nowrap; }
.street-sale-button { min-height:38px; border:0; border-radius:10px; padding:8px 15px; background:#fff; color:#c61f5d; font-size:11px; font-weight:800; cursor:pointer; box-shadow:0 5px 14px rgba(72,0,30,.18); }
.street-sale-button:disabled { opacity:.6; cursor:wait; }

/* Support assistant */
.support-fab { position:fixed; right:20px; bottom:22px; z-index:120; display:none; align-items:center; gap:7px; border:0; border-radius:999px; padding:11px 15px; background:var(--rose); color:#fff; box-shadow:0 8px 24px rgba(196,115,122,.35); font-size:12px; font-weight:700; cursor:pointer; }
.support-chat-overlay { position:fixed; inset:0; z-index:1000; display:none; justify-content:flex-end; background:rgba(50,35,28,.28); backdrop-filter:blur(2px); }
.support-chat-overlay.open { display:flex; }
.support-chat { width:min(410px,100%); height:100%; display:flex; flex-direction:column; background:#fff; box-shadow:-12px 0 38px rgba(55,35,25,.18); }
.support-chat-header { display:flex; align-items:center; gap:10px; padding:16px 18px; background:linear-gradient(135deg,var(--rose-dk),var(--rose)); color:#fff; }
.support-avatar { width:38px; height:38px; display:grid; place-items:center; border-radius:12px; background:rgba(255,255,255,.18); font-size:20px; }
.support-chat-header div:nth-child(2) { flex:1; }
.support-chat-header h2 { margin:0; color:#fff; font-size:14px; }
.support-chat-header p { display:flex; align-items:center; gap:5px; margin-top:2px; font-size:9px; opacity:.9; }
.support-chat-header p span { width:7px; height:7px; border-radius:50%; background:#76f29a; }
.support-chat-header > button { width:30px; height:30px; border:0; border-radius:50%; background:rgba(255,255,255,.15); color:#fff; font-size:20px; cursor:pointer; }
.support-chat-messages { flex:1; overflow-y:auto; padding:18px 14px; background:#fcfaf8; }
.support-message { display:flex; margin-bottom:11px; }
.support-message > div { max-width:86%; padding:10px 12px; border-radius:14px; font-size:11px; line-height:1.55; white-space:pre-line; box-shadow:0 2px 8px rgba(60,40,30,.06); }
.support-message.bot { justify-content:flex-start; }
.support-message.bot > div { background:#fff; border:1px solid var(--bd); color:var(--cocoa); border-bottom-left-radius:4px; }
.support-message.user { justify-content:flex-end; }
.support-message.user > div { background:var(--rose); color:#fff; border-bottom-right-radius:4px; }
.support-chat-suggestions { display:flex; gap:6px; overflow-x:auto; padding:9px 12px; border-top:1px solid var(--bd); background:#fff; }
.support-chat-suggestions button { flex-shrink:0; border:1px solid var(--blush); border-radius:999px; padding:6px 10px; background:var(--petal); color:var(--rose-dk); font-size:9px; font-weight:600; cursor:pointer; }
.support-whatsapp { margin:0 12px 8px; display:flex; justify-content:center; padding:9px 12px; border-radius:10px; background:#25d366; color:#fff !important; text-decoration:none; font-size:11px; font-weight:700; }
.support-chat-compose { display:flex; gap:8px; padding:11px 12px; border-top:1px solid var(--bd); background:#fff; }
.support-chat-compose input { flex:1; min-width:0; border:1px solid var(--bd); border-radius:999px; padding:9px 13px; font-size:11px; outline:none; }
.support-chat-compose input:focus { border-color:var(--rose); box-shadow:0 0 0 3px rgba(196,115,122,.1); }
.support-chat-compose button { width:36px; height:36px; flex-shrink:0; border:0; border-radius:50%; background:var(--rose); color:#fff; cursor:pointer; }

/* ── Responsivo ──────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .content { padding: 0 18px 90px; }
  .app-header { padding: 16px 0 14px; }
  .bottom-nav { display: flex; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid.c4 { grid-template-columns: 1fr 1fr; }
  .rel-grid { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
  .hero-card { display: none; }
  .product-grid { grid-template-columns: 1fr 1fr; }
  .street-sale-grid { grid-template-columns:1fr 1fr; }
  .street-sale-button { grid-column:1/-1; }
  .support-fab { display:flex; bottom:78px; }
  #toast { left: 16px; right: 16px; bottom: 88px; max-width: none; }
  .calendar-grid { gap: 3px; }
  .cal-cell { height: 60px; padding: 5px; border-radius: 10px; }
}
@media (max-width: 560px) {
  .metrics { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric strong { font-size: 1.4rem; }
  .form-grid, .form-grid.c4 { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: 1fr; }
  .street-sale-grid { grid-template-columns:1fr; }
  .street-sale-button { grid-column:auto; }
}

/* ── Separadores de grupo no menu lateral (P9) ───────────────────── */
.sb-group-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  padding: 14px 8px 4px;
  white-space: nowrap;
  overflow: hidden;
  opacity: 0;
  transition: opacity .12s .05s;
  pointer-events: none;
}
.sidebar .sb-group-label:first-of-type { padding-top: 2px; }
.sidebar:hover .sb-group-label,
.sidebar:focus-within .sb-group-label { opacity: 1; }
.sb-group-label.hidden { display: none; }
