/* ============================================================
   CAJU FINANÇAS — Design tokens
   Paleta e tipografia derivadas da identidade visual da logo:
   fundo creme, coral/laranja, folha oliva, caju bege, corações.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;600;700&family=Caveat:wght@600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* cor */
  --bg: #FBF3EA;
  --surface: #FFFFFF;
  --surface-soft: #FCE7DA;
  --coral: #D8532E;
  --coral-dark: #B03F20;
  --coral-soft: #F3C8B8;
  --olive: #7C8A52;
  --olive-soft: #E1E6D2;
  --tan: #C08A54;
  --tan-soft: #EFDFC7;
  --ink: #3B2A22;
  --ink-soft: #8A7A6D;
  --border: #EEDCC9;

  /* tipografia */
  --font-display: 'Baloo 2', system-ui, sans-serif;
  --font-script: 'Caveat', cursive;
  --font-body: 'Inter', system-ui, sans-serif;

  /* forma */
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --shadow: 0 6px 20px rgba(59, 42, 34, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 88px; /* espaço pra tab bar fixa */
  position: relative;
}

/* ---------- Cabeçalho ---------- */
.app-header {
  padding: 28px 20px 18px;
  text-align: center;
  position: relative;
}

.app-header .brand {
  font-family: var(--font-script);
  font-size: 42px;
  color: var(--coral);
  line-height: 1;
}

.app-header .brand .heart { color: var(--coral); }

.app-header .subtitle {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-soft);
  text-transform: capitalize;
  margin-top: 2px;
}

.dotted-ring {
  position: absolute;
  top: 14px; left: 14px; right: 14px; bottom: 6px;
  border: 1.5px dotted var(--coral-soft);
  border-radius: 999px;
  pointer-events: none;
}

/* ---------- Divisor "coração" (elemento assinatura) ---------- */
.heart-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 22px 0 14px;
  color: var(--coral-soft);
}
.heart-divider::before,
.heart-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
  max-width: 60px;
}
.heart-divider span { font-size: 16px; color: var(--coral); }

/* ---------- Cards / seções ---------- */
.section { padding: 0 18px; }

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  margin: 0 0 10px 2px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

/* ---------- Badges de estatística (dashboard) ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.stat-badge {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 18px 14px;
  text-align: center;
  border: 1px dotted var(--coral-soft);
  box-shadow: var(--shadow);
}

.stat-badge .label {
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.stat-badge .value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--coral);
  margin-top: 4px;
}

.stat-badge.lucro .value { color: var(--olive); }

/* ---------- Listas (pedidos, produtos, insumos, despesas) ---------- */
.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 4px;
  border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }

.list-item .name {
  font-weight: 600;
  font-size: 14px;
}
.list-item .meta {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 2px;
}
.list-item .amount {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--coral);
}

.status-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--tan-soft);
  color: var(--tan);
}
.status-pill.entregue { background: var(--olive-soft); color: var(--olive); }
.status-pill.novo { background: var(--coral-soft); color: var(--coral-dark); }

/* ---------- Botões e formulários ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 14px;
  border-radius: 999px;
  border: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  background: var(--coral);
  color: #fff;
  box-shadow: 0 4px 14px rgba(216, 83, 46, 0.35);
}
.btn:active { background: var(--coral-dark); }
.btn.secondary {
  background: var(--surface);
  color: var(--coral);
  border: 1.5px solid var(--coral-soft);
  box-shadow: none;
}

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 5px;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--coral);
}

/* ---------- Tab bar inferior ---------- */
.tab-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  max-width: 480px;
  margin: 0 auto;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 16px rgba(59,42,34,0.06);
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 6px 2px;
  cursor: pointer;
}
.tab-btn .icon { font-size: 18px; }
.tab-btn.active { color: var(--coral); }

/* ---------- View de tela cheia (nova venda etc.) ---------- */
.view { display: none; }
.view.active { display: block; }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-soft);
  font-size: 13px;
}

@media (prefers-reduced-motion: no-preference) {
  .card, .stat-badge { transition: transform .15s ease; }
}
