/* ============================================================
   DESIGN SYSTEM — CANGURU BURGUER
   Visual Identity: Artisanal Craft Burger & Backoffice Management
   ============================================================ */
:root {
  --bg: #F5F3ED;           /* Papel/pedra artesanal quente */
  --surface: #FFFFFF;      /* Cartões em branco puro e nítido */
  --surface-2: #EFECE4;    /* Superfície biscuit/aveia suave */
  --surface-3: #E6E1D6;    /* Contraste suave para cabeçalhos e tags */
  --ink: #1C1917;          /* Carvão espresso profundo e legível */
  --ink-soft: #5A534C;     /* Cinza ardósia quente */
  --ink-faint: #90877E;    /* Rótulos e ícones secundários */
  --pine: #B44A1D;         /* Terracota / Páprica defumada — Canguru Burguer */
  --pine-dark: #161412;    /* Carvão torrado profundo (sidebar/headers) */
  --pine-tint: #FAECE5;    /* Lavagem suave quente */
  --brand: #B44A1D;
  --brand-hover: #963A12;
  --brand-dark: #161412;
  --brand-tint: #FAECE5;
  --amber: #B86800;        /* Ouro cheddar / Brioche tostado */
  --amber-tint: #FCF4E3;
  --brick: #A82E22;        /* Vermelho tomate rústico */
  --brick-tint: #FCECE9;
  --success: #226848;      /* Verde erva fresca / Margem saudável */
  --success-tint: #EAF4EE;
  --line: #DED8CC;         /* Bordas finas e acolhedoras */
  --line-soft: #EAE5DB;    /* Divisórias suaves internas */
  --shadow-xs: 0 1px 2px rgba(28, 25, 23, 0.04);
  --shadow-sm: 0 1px 3px rgba(28, 25, 23, 0.05), 0 4px 12px rgba(28, 25, 23, 0.025);
  --shadow-md: 0 4px 8px -1px rgba(28, 25, 23, 0.07), 0 12px 24px -3px rgba(28, 25, 23, 0.035);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --nav-h: 64px;
  --sidebar-w: 240px;
}

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
  color: inherit;
}

input, select, textarea {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  min-height: 44px;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  font-size: 16px; /* evita zoom iOS */
  color: var(--ink);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(180, 74, 29, 0.14);
}

input.error, select.error { border-color: var(--brick); }

label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 5px;
  letter-spacing: 0.01em;
}

/* ============================================================
   BOTÕES
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.08s;
  text-decoration: none;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  box-shadow: 0 1px 2px rgba(180, 74, 29, 0.22);
}
.btn-primary:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  box-shadow: 0 3px 8px rgba(180, 74, 29, 0.32);
}

.btn-secondary {
  background: var(--surface);
  color: var(--brand);
  border-color: var(--line);
}
.btn-secondary:hover {
  background: var(--brand-tint);
  border-color: var(--brand);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--line);
}
.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.btn-danger {
  background: var(--surface);
  color: var(--brick);
  border-color: var(--line);
}
.btn-danger:hover {
  background: var(--brick-tint);
  border-color: var(--brick);
}

.btn-sm {
  min-height: 34px;
  padding: 5px 12px;
  font-size: 0.8125rem;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============================================================
   LAYOUT GERAL
   ============================================================ */

/* Mobile: nav inferior */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.app-content {
  flex: 1;
  padding: 16px 16px calc(var(--nav-h) + 24px + env(safe-area-inset-bottom));
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

/* Sidebar para desktop */
@media (min-width: 860px) {
  .app-shell {
    flex-direction: row;
  }
  .app-content {
    margin-left: var(--sidebar-w);
    padding: 32px 32px 40px;
    max-width: calc(900px + var(--sidebar-w));
    width: 100%;
  }
}

/* ============================================================
   SIDEBAR (desktop)
   ============================================================ */
.sidebar {
  display: none;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--pine-dark);
  color: #fff;
  flex-direction: column;
  padding: 24px 0 16px;
  z-index: 100;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 2px 0 18px rgba(0, 0, 0, 0.12);
}

@media (min-width: 860px) {
  .sidebar { display: flex; }
}

.sidebar-logo {
  padding: 0 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 16px;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-text h1 {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 800;
  color: #FFF6F0;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.15;
}

.brand-text span {
  font-size: 0.6875rem;
  color: #A89F96;
  letter-spacing: 0.04em;
  font-weight: 500;
  display: block;
  margin-top: 2px;
}

.brand-tag {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  background: rgba(180, 74, 29, 0.22);
  color: #FFA57D;
  border: 1px solid rgba(180, 74, 29, 0.4);
  padding: 2px 8px;
  border-radius: 4px;
}

.sidebar nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 12px;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
}

.sidebar nav a svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: 0.75;
  transition: opacity 0.15s;
}

.sidebar nav a:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}
.sidebar nav a:hover svg { opacity: 1; }

.sidebar nav a.active {
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(180, 74, 29, 0.35);
}
.sidebar nav a.active svg { opacity: 1; }

.sidebar-footer {
  padding: 16px 14px 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: auto;
}

.store-badge {
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 8px 10px;
}

.store-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2ECC71;
  box-shadow: 0 0 8px rgba(46, 204, 113, 0.6);
  flex-shrink: 0;
}

.store-info {
  display: flex;
  flex-direction: column;
}

.store-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #FFF6F0;
  line-height: 1.2;
}

.store-sub {
  font-size: 0.65rem;
  color: #8E867E;
  margin-top: 1px;
}

/* ============================================================
   NAV INFERIOR (mobile)
   ============================================================ */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  background: var(--pine-dark);
  display: flex;
  align-items: flex-start;
  justify-content: space-around;
  padding-top: 8px;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 100;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

@media (min-width: 860px) {
  .bottom-nav { display: none; }
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  font-size: 0.65rem;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 4px;
  border-radius: var(--radius-sm);
  transition: color 0.15s;
  min-width: 0;
  flex: 1;
  text-align: center;
}

.bottom-nav a svg {
  width: 20px; height: 20px;
}

.bottom-nav a.active {
  color: #FFA57D;
  font-weight: 600;
}

/* ============================================================
   ABAS / VIEWS
   ============================================================ */
.view { display: none; }
.view.active { display: block; }

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-header h2 {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.page-header p {
  color: var(--ink-soft);
  font-size: 0.875rem;
  margin-top: 2px;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-sm);
  padding: 18px;
  margin-bottom: 14px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.card-header h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

/* ============================================================
   PAINEL — KPI GRID
   ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

@media (min-width: 600px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kpi:hover {
  box-shadow: var(--shadow-md);
}

.kpi-label {
  font-size: 0.71875rem;
  font-weight: 700;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 5px;
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: 1.3125rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.kpi-sub {
  font-size: 0.75rem;
  color: var(--ink-soft);
  margin-top: 3px;
}

.kpi.kpi-positive .kpi-value { color: var(--success); }
.kpi.kpi-negative .kpi-value { color: var(--brick); }
.kpi.kpi-warning .kpi-value { color: var(--amber); }

/* ============================================================
   ALERTAS INLINE
   ============================================================ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  margin-bottom: 12px;
  border-left: 3px solid;
  line-height: 1.45;
}

.alert-warning {
  background: var(--amber-tint);
  border-color: var(--amber);
  color: var(--amber);
}

.alert-error {
  background: var(--brick-tint);
  border-color: var(--brick);
  color: var(--brick);
}

.alert-success {
  background: var(--pine-tint);
  border-color: var(--pine);
  color: var(--pine);
}

.alert-info {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--ink-soft);
}

/* ============================================================
   FORMULÁRIOS
   ============================================================ */
.form-section {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
}

.form-section h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
}

.form-row {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

@media (max-width: 480px) {
  .form-row.cols-2,
  .form-row.cols-3 { grid-template-columns: 1fr; }
}

.form-group { margin-bottom: 12px; }

.field-hint {
  font-size: 0.75rem;
  color: var(--ink-faint);
  margin-top: 4px;
}

.field-error {
  font-size: 0.75rem;
  color: var(--brick);
  margin-top: 4px;
  display: none;
}

.field-error.visible { display: block; }

.calc-preview {
  background: var(--brand-tint);
  border: 1px solid #ECCDBE;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.8125rem;
  color: var(--brand);
  font-weight: 600;
  margin-top: 6px;
  font-family: var(--font-mono);
}

/* ============================================================
   LISTAS DE INGREDIENTES / PRODUTOS
   ============================================================ */
.item-list { display: flex; flex-direction: column; gap: 8px; }

.item-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.item-card:hover {
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.item-card-main { flex: 1; min-width: 0; }

.item-card-name {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-card-meta {
  font-size: 0.8125rem;
  color: var(--ink-soft);
  margin-top: 2px;
}

/* Badges de status */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 5px;
  line-height: 1.2;
}

.badge-dentro {
  background: var(--success-tint) !important;
  color: var(--success) !important;
  border: 1px solid #C4E3D2 !important;
}

.badge-fora {
  background: var(--brick-tint) !important;
  color: var(--brick) !important;
  border: 1px solid #F5CDC7 !important;
}

.badge-neutro {
  background: var(--surface-2) !important;
  color: var(--ink-soft) !important;
  border: 1px solid var(--line) !important;
}

.badge-menor-preco {
  background: var(--amber-tint) !important;
  color: #8C4E04 !important;
  border: 1px solid #F3DFB7 !important;
}

.item-card-badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--success-tint);
  color: var(--success);
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid #C4E3D2;
}

.item-card-badge.warning {
  background: var(--amber-tint);
  color: var(--amber);
  border-color: #F3DFB7;
}

.item-card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.economy-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--brand);
  font-weight: 600;
  margin-top: 6px;
  background: var(--brand-tint);
  border: 1px solid #ECCDBE;
  padding: 3px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

/* Autocomplete de busca de ingredientes existentes */
.autocomplete-wrapper {
  position: relative;
  width: 100%;
}

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 22px rgba(0,0,0,0.14);
  z-index: 120;
  max-height: 220px;
  overflow-y: auto;
  margin-top: 4px;
}

.autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.875rem;
  transition: background 0.12s;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover {
  background: var(--pine-tint);
}

.autocomplete-item .ac-name {
  font-weight: 600;
  color: var(--ink);
}

.autocomplete-item .ac-badge {
  font-size: 0.72rem;
  color: var(--pine-dark);
  background: var(--pine-tint);
  padding: 2px 7px;
  border-radius: 100px;
  font-weight: 600;
  white-space: nowrap;
}

.autocomplete-item .ac-meta {
  font-size: 0.75rem;
  color: var(--ink-soft);
  margin-top: 1px;
}

/* Alerta de economia em tempo real */
.economy-alert-box {
  background: var(--amber-tint);
  border: 1px solid #E8CD96;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin: 12px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.8125rem;
  color: #634300;
}

.economy-alert-box strong {
  font-weight: 700;
  color: #4a3200;
}

.economy-alert-btn {
  background: var(--amber);
  color: #fff;
  border: none;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.economy-alert-btn:hover {
  opacity: 0.9;
}

.supplier-price-block.is-current {
  border-color: var(--pine);
  background: #f1f7f3;
}

.supplier-price-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
}

.supplier-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.supplier-radio-label input[type="radio"] {
  accent-color: var(--pine);
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
}

/* ============================================================
   TABELA → CARDS no mobile
   ============================================================ */
.responsive-table { width: 100%; }

@media (max-width: 859px) {
  .responsive-table thead { display: none; }
  .responsive-table tr {
    display: block;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    padding: 12px;
  }
  .responsive-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 0.8125rem;
    border: none;
  }
  .responsive-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--ink-faint);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }
}

@media (min-width: 860px) {
  .responsive-table {
    border-collapse: collapse;
  }
  .responsive-table th {
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ink-faint);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
  }
  .responsive-table td {
    padding: 10px 10px;
    border-bottom: 1px solid var(--line-soft);
    font-size: 0.875rem;
    vertical-align: middle;
  }
  .responsive-table tbody tr:last-child td { border-bottom: none; }
}

/* ============================================================
   FICHA TÉCNICA
   ============================================================ */
.tech-sheet {
  background: var(--surface-2);
  border-radius: var(--radius-md);
  padding: 16px;
  font-size: 0.875rem;
}

.tech-sheet-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 5px 0;
  gap: 8px;
}

.tech-sheet-row.divider {
  border-top: 1px solid var(--line);
  margin-top: 6px;
  padding-top: 10px;
  font-weight: 600;
}

.tech-sheet-row.total {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--ink);
}

.tech-sheet-label { color: var(--ink-soft); flex: 1; }
.tech-sheet-qty { color: var(--ink-faint); width: 70px; text-align: right; font-family: var(--font-mono); font-size: 0.8125rem; }
.tech-sheet-val { font-family: var(--font-mono); font-size: 0.875rem; text-align: right; min-width: 80px; }

.tech-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 12px 0 6px;
}

.channel-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 6px;
}

.channel-card-name {
  font-weight: 700;
  font-size: 0.8125rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.channel-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
}

@media (min-width: 640px) {
  .channel-card-grid { grid-template-columns: repeat(4, 1fr); }
}

.channel-metric-label {
  font-size: 0.6875rem;
  color: var(--ink-faint);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.channel-metric-value {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
}

.channel-metric-value.positive { color: var(--pine); }
.channel-metric-value.negative { color: var(--brick); }
.channel-metric-value.warning { color: var(--amber); }

/* ============================================================
   ACORDEÃO
   ============================================================ */
.accordion {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 12px;
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--surface);
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  font-size: 0.9375rem;
  gap: 8px;
}

.accordion-header:hover { background: var(--surface-2); }

.accordion-icon {
  width: 20px; height: 20px;
  color: var(--ink-faint);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.accordion.open .accordion-icon { transform: rotate(180deg); }

.accordion-body {
  display: none;
  padding: 16px;
  background: var(--surface-2);
  border-top: 1px solid var(--line-soft);
}

.accordion.open .accordion-body { display: block; }

/* ============================================================
   PRODUTO EXPANDIDO
   ============================================================ */
.product-item {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  overflow: hidden;
}

.product-item-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  flex-wrap: wrap;
}

.product-item-header:hover { background: var(--surface-2); }

.product-item-body {
  display: none;
  padding: 0 16px 16px;
  border-top: 1px solid var(--line-soft);
}

.product-item.expanded .product-item-body { display: block; }
.product-item.expanded .product-item-header { background: var(--surface-2); }

/* ============================================================
   PREÇO PRATICADO INLINE
   ============================================================ */
.price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.price-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.price-input-wrap input {
  width: 110px;
  min-width: 80px;
}

/* ============================================================
   FORNECEDOR LISTA
   ============================================================ */
.supplier-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  flex-wrap: wrap;
}

.supplier-row:last-child { border-bottom: none; }

.supplier-name-input {
  flex: 1;
  min-width: 120px;
}

/* ============================================================
   GRÁFICO SIMPLES
   ============================================================ */
.bar-chart { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }

.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bar-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-soft);
  min-width: 80px;
  max-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-track {
  flex: 1;
  height: 20px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--pine);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.bar-fill.warning { background: var(--amber); }
.bar-fill.danger { background: var(--brick); }

.bar-value {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  min-width: 50px;
  text-align: right;
  color: var(--ink-soft);
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(21,34,25,0.55);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

@media (min-width: 560px) {
  .modal-overlay {
    align-items: center;
    padding: 24px;
  }
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  width: 100%;
  max-height: 92dvh;
  overflow-y: auto;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  animation: slideUp 0.2s ease;
}

@media (min-width: 560px) {
  .modal {
    border-radius: var(--radius-md);
    max-width: 600px;
    padding: 24px;
    max-height: 88dvh;
  }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-faint);
  padding: 4px;
  display: flex;
  border-radius: 4px;
}

.modal-close:hover { color: var(--ink); background: var(--surface-2); }

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--ink-faint);
}

.empty-state svg {
  width: 48px; height: 48px;
  margin: 0 auto 12px;
  opacity: 0.4;
}

.empty-state h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.empty-state p { font-size: 0.875rem; }

/* ============================================================
   FORNECEDOR PREÇOS
   ============================================================ */
.supplier-price-block {
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 10px;
  position: relative;
}

.supplier-price-block h4 {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.remove-price-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-faint);
  padding: 4px;
  border-radius: 4px;
  line-height: 1;
}
.remove-price-btn:hover { color: var(--brick); background: var(--brick-tint); }

/* ============================================================
   AJUSTES
   ============================================================ */
.settings-section {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
}

.settings-section h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}

.channel-edit-card {
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 12px;
  transition: border-color 0.15s;
}

.channel-edit-card:hover {
  border-color: var(--line);
}

.channel-edit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.channel-edit-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 200px;
}

.channel-fee-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--pine-tint);
  color: var(--pine);
  padding: 3px 9px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  white-space: nowrap;
}

.channel-fee-badge.high {
  background: var(--brick-tint);
  color: var(--brick);
}

.channel-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  align-items: flex-end;
}

.channel-edit-field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

.channel-edit-sub {
  font-size: 0.75rem;
  color: var(--ink-soft);
  margin-top: 8px;
  line-height: 1.35;
}

.channel-presets-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-soft);
}

.btn-preset-channel {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.btn-preset-channel:hover {
  background: var(--surface-2);
  border-color: var(--brand);
  color: var(--brand);
}

.channel-edit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
  flex-wrap: wrap;
}

.channel-edit-row:last-child { border-bottom: none; }

.channel-edit-name {
  flex: 1;
  min-width: 100px;
}

.channel-edit-commission {
  width: 90px;
}

/* ============================================================
   MISC UTILITIES
   ============================================================ */
.mono { font-family: var(--font-mono); }
.text-pine { color: var(--pine); }
.text-amber { color: var(--amber); }
.text-brick { color: var(--brick); }
.text-faint { color: var(--ink-faint); }
.text-soft { color: var(--ink-soft); }
.text-sm { font-size: 0.8125rem; }
.text-xs { font-size: 0.75rem; }
.fw-600 { font-weight: 600; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.flex-1 { flex: 1; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.divider { border: none; border-top: 1px solid var(--line-soft); margin: 16px 0; }

/* ============================================================
   RECEITA — LISTA DE ITENS & ABINHA DE CONVERSÃO DE UNIDADE
   ============================================================ */
.recipe-item-wrapper {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-bottom: 8px;
  box-sizing: border-box;
  transition: all 0.15s ease;
}
.recipe-item-wrapper.has-tab {
  border-color: var(--line);
  background: #FCFDFB;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}

.recipe-item {
  display: grid;
  grid-template-columns: 1fr 78px 84px 30px;
  gap: 6px;
  align-items: center;
}
.recipe-item > * {
  min-width: 0;
}

@media (max-width: 480px) {
  .recipe-item-wrapper {
    padding: 7px 8px;
    margin-bottom: 8px;
  }
  .recipe-item {
    grid-template-columns: 1fr 66px 74px 28px;
    gap: 4px;
  }
}

@media (max-width: 380px) {
  .recipe-item {
    grid-template-columns: 1fr 58px 68px 24px;
    gap: 3px;
  }
  .recipe-item select,
  .recipe-item input {
    font-size: 0.8125rem;
    padding: 6px 4px;
  }
  .unit-tab-main {
    flex-direction: column;
    align-items: stretch;
  }
  .unit-tab-input-wrap {
    width: 100%;
  }
}

.recipe-item-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-faint);
  padding: 4px;
  border-radius: 4px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.recipe-item-remove:hover { color: var(--brick); background: var(--brick-tint); }

/* Abinha de conversão de unidades (g por unidade) */
.unit-converter-tab {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--pine);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
  animation: fadeInTab 0.15s ease-out;
}
@keyframes fadeInTab {
  from { opacity: 0; transform: translateY(-2px); }
  to { opacity: 1; transform: translateY(0); }
}

.unit-tab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}
.unit-tab-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pine-dark);
  display: flex;
  align-items: center;
  gap: 5px;
}
.unit-tab-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--pine-tint);
  color: var(--pine-dark);
  border: 1px solid rgba(31, 75, 63, 0.2);
}
.unit-tab-badge.warning {
  background: var(--amber-tint);
  color: var(--amber);
  border-color: rgba(169, 116, 14, 0.25);
}

.unit-tab-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.unit-tab-label {
  font-size: 0.8125rem;
  color: var(--ink);
  font-weight: 600;
  flex: 1;
  min-width: 130px;
}
.unit-tab-input-wrap {
  width: 120px;
  max-width: 100%;
}
.unit-tab-input-wrap input {
  font-weight: 700;
  color: var(--pine-dark);
  text-align: right;
  padding-right: 28px;
}

/* Calculadora rápida de pacote */
.unit-calc-box {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.unit-calc-header {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.unit-calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.unit-calc-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.unit-calc-field label {
  font-size: 0.6875rem;
  color: var(--ink-faint);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.25;
}
.unit-calc-result {
  font-size: 0.75rem;
  color: var(--ink-soft);
  margin-top: 6px;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--line-soft);
}
.btn-calc-apply {
  background: var(--pine-tint);
  border: 1px solid var(--pine);
  color: var(--pine-dark);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
}
.btn-calc-apply:hover {
  background: var(--pine);
  color: #fff;
}

/* Resumo da conversão */
.unit-summary-pill {
  font-size: 0.75rem;
  color: var(--ink-soft);
  background: rgba(31, 75, 63, 0.08);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  line-height: 1.35;
}
.unit-summary-pill strong {
  color: var(--pine-dark);
}
.unit-summary-pill.alert {
  background: var(--amber-tint);
  color: var(--amber);
  border: 1px solid rgba(169, 116, 14, 0.25);
}

/* número com prefixo R$ */
.input-prefix-wrap {
  position: relative;
}
.input-prefix-wrap span {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-faint);
  font-size: 0.875rem;
  pointer-events: none;
}
.input-prefix-wrap input { padding-left: 28px; }

/* sufixo % */
.input-suffix-wrap {
  position: relative;
}
.input-suffix-wrap span {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-faint);
  font-size: 0.875rem;
  pointer-events: none;
}
.input-suffix-wrap input { padding-right: 28px; }

/* input com ícone */
.input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-faint);
  pointer-events: none;
}
.input-icon-wrap input {
  padding-left: 36px;
  width: 100%;
}

#modalFornecedor { z-index: 250; }
#modalConfirm { z-index: 300; }

/* Mobile-first header with logo on mobile */
.mobile-header {
  background: var(--pine-dark);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-brand h1 {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: #FFF6F0;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.15;
}

.mobile-brand span {
  font-size: 0.6875rem;
  color: #A89F96;
}

.mobile-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(180, 74, 29, 0.25);
  color: #FFA57D;
  border: 1px solid rgba(180, 74, 29, 0.45);
  padding: 3px 8px;
  border-radius: 4px;
}

@media (min-width: 860px) {
  .mobile-header { display: none; }
}

/* Toast notification */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--ink);
  color: #fff;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  animation: toastIn 0.2s ease;
  max-width: 340px;
  pointer-events: auto;
  box-shadow: 0 6px 18px rgba(0,0,0,0.22);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.toast.success { background: var(--success); }
.toast.error { background: var(--brick); }
.toast.warning { background: var(--amber); }

@keyframes toastIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Painel: PE section — Canguru Burguer Meta */
.pe-box {
  background: #FAF6EE;
  border: 1.5px solid #E2D7C3;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  margin-bottom: 16px;
}

.pe-box h3 {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.pe-box .pe-value {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.pe-box .pe-sub { font-size: 0.8125rem; color: var(--ink-soft); margin-top: 3px; }

/* Toast com botão de ação (ex: Desfazer) */
.toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.toast-action-btn {
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #FFFFFF;
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-weight: 700;
  font-size: 0.8125rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.toast-action-btn:hover {
  background: rgba(255, 255, 255, 0.38);
}

/* ============================================================
   VENDAS — PDV RÁPIDO & HISTÓRICO
   ============================================================ */

/* Resumo do dia no topo de Vendas (grid 2x2 no mobile) */
.vendas-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
@media (min-width: 640px) {
  .vendas-kpi-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
  }
}

.vendas-kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-xs);
}
.vendas-kpi .kpi-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.vendas-kpi .kpi-value {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}
@media (min-width: 640px) {
  .vendas-kpi .kpi-value { font-size: 1.45rem; }
}
.vendas-kpi.highlight {
  border-left: 3px solid var(--brand);
}
.vendas-kpi.highlight-success {
  border-left: 3px solid var(--success);
}

/* Barra de busca de produtos */
.vendas-search-bar {
  margin-bottom: 16px;
  position: relative;
}
.vendas-search-bar input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px 10px 38px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-family: var(--font-body);
  color: var(--ink);
  outline: none;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s;
}
.vendas-search-bar input:focus {
  border-color: var(--brand);
}
.vendas-search-bar svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-faint);
  pointer-events: none;
}

/* Cards de produtos para venda rápida */
.venda-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 28px;
}
@media (min-width: 720px) {
  .venda-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1100px) {
  .venda-cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.venda-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.venda-card:hover {
  border-color: #D3C9B8;
  box-shadow: var(--shadow-sm);
}

.venda-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.venda-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}
.venda-card-cost {
  font-size: 0.8125rem;
  color: var(--ink-soft);
  margin-top: 3px;
}

/* Seletor de canal e preço */
.venda-canal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface-2);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-soft);
}
.venda-canal-select {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  padding: 4px 0;
  flex: 1;
}
.venda-price-display {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

/* Resultado da venda / Margem */
.venda-resultado-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  padding: 7px 10px;
  background: #F4F7F4;
  border: 1px solid #D6E4D9;
  border-radius: var(--radius-sm);
  color: var(--success);
}
.venda-resultado-box.warning {
  background: var(--amber-tint);
  border-color: #ECD2A2;
  color: #7A4B00;
}
.venda-resultado-box.negative {
  background: var(--brick-tint);
  border-color: #E8BDB6;
  color: var(--brick);
}
.venda-resultado-val {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9375rem;
}

/* Botão principal +1 VENDA */
.btn-venda {
  width: 100%;
  min-height: 48px;
  background: var(--brand);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 4px rgba(180, 74, 29, 0.2);
  transition: background 0.15s, transform 0.08s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn-venda:active {
  transform: scale(0.985);
  background: var(--brand-hover);
}
.btn-venda.success {
  background: var(--success);
  box-shadow: 0 2px 4px rgba(34, 104, 72, 0.25);
}

.btn-venda-secondary {
  width: 100%;
  background: transparent;
  color: var(--ink-soft);
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 7px;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, color 0.15s;
}
.btn-venda-secondary:hover {
  background: var(--surface-2);
  color: var(--ink);
}

/* Detalhamento expandido "Ver cálculo" */
.venda-calc-details {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 0.75rem;
  color: var(--ink-soft);
  display: none;
  margin-top: 6px;
}
.venda-calc-details.open {
  display: block;
}
.venda-calc-row {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
}
.venda-calc-toggle {
  font-size: 0.75rem;
  color: var(--ink-faint);
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

/* Histórico de vendas */
.vendas-history-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-xs);
  margin-top: 24px;
}
.vendas-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

/* Filtros em pills */
.filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.filter-pill {
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  color: var(--ink-soft);
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-pill:hover {
  border-color: var(--line);
}
.filter-pill.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #FFFFFF;
}

/* Linha de venda no histórico */
.venda-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background 0.12s;
  border-radius: var(--radius-sm);
  gap: 12px;
}
.venda-row:last-child {
  border-bottom: none;
}
.venda-row:hover {
  background: var(--surface-2);
}
.venda-row.cancelada {
  opacity: 0.55;
  background: #FAF8F5;
}
.venda-row-main {
  flex: 1;
  min-width: 0;
}
.venda-row-prod {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.venda-row-meta {
  font-size: 0.8125rem;
  color: var(--ink-soft);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.venda-row-right {
  text-align: right;
  flex-shrink: 0;
}
.venda-row-total {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
}
.venda-row-margem {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--success);
  margin-top: 1px;
}
.venda-row-margem.negative {
  color: var(--brick);
}

/* Barra de progresso do Ponto de Equilíbrio */
.pe-progress-container {
  background: var(--surface-2);
  border-radius: 100px;
  height: 10px;
  width: 100%;
  overflow: hidden;
  margin: 10px 0 6px 0;
}
.pe-progress-fill {
  background: linear-gradient(90deg, var(--brand) 0%, var(--success) 100%);
  height: 100%;
  border-radius: 100px;
  transition: width 0.3s ease;
}
.pe-progress-fill.full {
  background: var(--success);
}

/* Seletor Realizado vs Projeção no Painel */
.painel-mode-switch {
  display: flex;
  background: var(--surface-2);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-soft);
  margin-bottom: 16px;
}
.painel-mode-btn {
  flex: 1;
  padding: 8px;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--ink-soft);
  border: none;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.painel-mode-btn.active {
  background: var(--surface);
  color: var(--brand);
  box-shadow: var(--shadow-xs);
}
