/* ════════════════════════════════════════════════
   DOCE CONTA — Estilo Principal
   ════════════════════════════════════════════════ */

:root {
  color-scheme: light dark;

  /* Cores da marca */
  --pink:        #D4537E;
  --pink-dark:   #993556;
  --pink-light:  #FBEAF0;
  --pink-mid:    #F4C0D1;
  --pink-deep:   #72243E;

  /* Fundos e superfícies */
  --bg:          #FAFAFA;
  --surface:     #FFFFFF;
  --surface2:    #F5F5F5;

  /* Bordas */
  --border:      rgba(0, 0, 0, 0.08);
  --border2:     rgba(0, 0, 0, 0.14);

  /* Texto */
  --text:        #1A1A1A;
  --text2:       #666;
  --text3:       #999;

  /* Estados */
  --green:       #1D9E75;
  --green-bg:    #E1F5EE;
  --amber:       #BA7517;
  --amber-bg:    #FAEEDA;
  --red:         #E24B4A;

  /* Raios */
  --r:           10px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  background: #e8e0e5;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
}

/* ──────────── SHELL ──────────── */
.shell {
  width: 100%;
  height: 100dvh;   /* dynamic viewport — desconta barra do browser */
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Desktop: exibe como frame de celular centralizado */
@media (min-width: 600px) {
  body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #e2e2e2;
  }
  .shell {
    width: 390px;
    height: 844px;
    max-height: 95vh;
    border-radius: 32px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.18);
    overflow: hidden;
  }
}

/* ──────────── STATUS BAR ──────────── */
.status {
  height: 44px;
  background: var(--pink-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
}

.status-time {
  font-size: 15px;
  font-weight: 600;
  color: var(--pink-deep);
}

.status-icons {
  display: flex;
  gap: 5px;
  align-items: center;
}

/* ──────────── TOPBAR ──────────── */
.topbar {
  background: var(--pink-light);
  padding: 14px 16px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--pink-mid);
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--pink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
}

.logo-name {
  font-family: 'DM Serif Display', serif;
  font-size: 18px;
  color: var(--pink-deep);
  letter-spacing: -0.3px;
}

.back-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(212, 83, 126, 0.1);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.back-btn svg {
  width: 18px;
  height: 18px;
  stroke: var(--pink);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

.page-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.action-btn {
  font-size: 16px;
  font-weight: 500;
  color: var(--pink);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  transition: color .15s;
}
.action-btn.mod {
  color: var(--pink-dark);
  font-weight: 600;
}
.action-btn.mod::after {
  content: ' ●';
  font-size: 8px;
  vertical-align: super;
  color: var(--pink);
}

.add-recipe-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--pink);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}

.add-recipe-btn svg {
  width: 15px;
  height: 15px;
  stroke: #fff;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
}

/* ──────────── CONTEÚDO PRINCIPAL ──────────── */
.content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.scr {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  position: relative;
}

.scr.on {
  display: flex;
  animation: scr-in 0.2s ease both;
}

@keyframes scr-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.scroll-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.scroll-body::-webkit-scrollbar {
  display: none;
}

/* ──────────── FAB ──────────── */
@keyframes fab-pop {
  0%   { transform: scale(0.4) rotate(-15deg); opacity: 0; }
  65%  { transform: scale(1.12) rotate(3deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.fab {
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--pink);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(212,83,126,0.45);
  z-index: 20;
  flex-shrink: 0;
  animation: fab-pop 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.fab svg {
  width: 22px;
  height: 22px;
  stroke: #fff;
  fill: none;
  stroke-width: 2.5;
}

.fab:active {
  transform: scale(0.88);
  box-shadow: 0 2px 8px rgba(212,83,126,0.35);
}

/* padding extra no topbar da tela Minha Receita */
.topbar--pad {
  padding-top: 14px;
}

/* ──────────── TOPBAR USER ──────────── */
.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
  position: relative;
}

.topbar-greeting {
  font-size: 12px;
  font-weight: 500;
  color: var(--pink-deep);
  white-space: nowrap;
}

.topbar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--pink);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(212,83,126,0.35);
  cursor: pointer;
  user-select: none;
}

.avatar-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.18);
  overflow: hidden;
  min-width: 160px;
  z-index: 200;
}
.avatar-menu-item {
  display: block;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  text-align: left;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s;
}
.avatar-menu-item:hover { background: var(--hover); }
.avatar-menu-sair { color: #dc2626; }

.plans-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}
.plans-close-btn:hover { background: var(--hover); }

/* ──────────── BOTTOM NAV ──────────── */
.bottom-nav {
  height: 80px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  padding-top: 8px;
  flex-shrink: 0;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  padding: 4px 0;
  transition: transform 0.12s ease;
}

.nav-item:active {
  transform: scale(0.85);
}

.nav-item svg {
  width: 22px;
  height: 22px;
  stroke: var(--text3);
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item span {
  font-size: 10px;
  color: var(--text3);
  font-weight: 500;
}

.nav-item.on svg {
  stroke: var(--pink);
}

.nav-item.on span {
  color: var(--pink);
}

/* ──────────── BUSCA ──────────── */
.search-frozen {
  padding: 10px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 9px 12px;
}

.search-box svg {
  width: 15px;
  height: 15px;
  stroke: var(--text3);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  flex-shrink: 0;
}

.search-box input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 13px;
  color: var(--text);
  outline: none;
  font-family: inherit;
}

.search-box input::placeholder {
  color: var(--text3);
}

.search-clear {
  font-size: 16px;
  color: var(--text3);
  cursor: pointer;
  display: none;
  line-height: 1;
}

.search-clear.show {
  display: block;
}

.search-count {
  font-size: 10px;
  color: var(--text3);
  padding: 4px 14px 0;
}

/* ──────────── RECEITAS LIST ──────────── */
.recipe-item {
  margin: 0 14px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.recipe-item:active {
  background: var(--surface2);
  transform: scale(0.984);
  box-shadow: 0 1px 6px rgba(0,0,0,0.07);
}

.recipe-info {
  flex: 1;
  min-width: 0;
}

.recipe-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}

.recipe-meta {
  font-size: 11px;
  color: var(--text3);
}

.recipe-price {
  text-align: right;
  flex-shrink: 0;
}

.recipe-venda {
  font-family: 'DM Serif Display', serif;
  font-size: 15px;
  font-weight: 400;
  color: var(--pink-dark);
  letter-spacing: -0.2px;
}

.recipe-porcao {
  font-size: 10px;
  color: var(--text3);
}

.recipe-actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.icon-btn svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn.dup svg {
  stroke: var(--pink);
}

.icon-btn.del svg,
.icon-btn.del-ico svg {
  stroke: var(--red);
}

.icon-btn.edit-ico svg {
  stroke: var(--pink);
}

.empty-state {
  padding: 30px 14px;
  text-align: center;
  color: var(--text3);
  font-size: 13px;
  display: none;
}

.empty-state.show {
  display: block;
}

/* ──────────── RECEITA — TOPO ──────────── */
.recipe-name-bar {
  background: var(--pink-light);
  padding: 10px 14px;
  border-bottom: 1px solid var(--pink-mid);
  flex-shrink: 0;
}

.rname-inp {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--pink-mid);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--pink-deep);
  background: #fff;
  font-family: inherit;
  outline: none;
}

.rname-inp::placeholder {
  color: var(--pink-mid);
  font-weight: 400;
}

.recipe-top-inner {
  background: var(--pink-light);
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--pink-mid);
}

.rt-row2 {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: flex-end;
}

.rt-field {
  flex: 1;
  min-width: 0;
  position: relative;
}

.rt-lbl {
  font-size: 9px;
  color: var(--pink);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  height: 16px;
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 3px;
}

.info-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--pink);
  color: #fff;
  font-size: 7px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
}

.rt-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.rt-inp {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 7px 8px;
  border: 1px solid var(--pink-mid);
  border-radius: 7px;
  font-size: 13px;
  color: var(--pink);
  font-weight: 600;
  background: #fff;
  font-family: inherit;
  outline: none;
}

.rt-unit {
  font-size: 11px;
  color: var(--pink);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ──────────── CARDS DE RESULTADO ──────────── */
.rt-results {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 7px;
  margin-bottom: 8px;
}

.rt-res {
  background: #fff;
  border: 1px solid var(--pink-mid);
  border-radius: 8px;
  padding: 8px 9px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.rt-res-lbl {
  font-size: 11px;
  color: var(--pink);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 700;
  margin-bottom: 4px;
}

.rt-res-val {
  font-family: 'DM Serif Display', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--pink-deep);
  letter-spacing: -0.2px;
}

.rt-res-val.venda {
  font-size: 18px;
  color: var(--pink-dark);
}

.rt-res--destaque {
  background: #fff;
  border: 2px solid var(--pink);
  box-shadow: 0 4px 18px rgba(212,83,126,0.22);
  transform: scale(1.06);
  position: relative;
  z-index: 1;
}

.rt-res--destaque .rt-res-lbl {
  color: var(--pink);
  font-size: 10px;
  letter-spacing: 0.8px;
}

.rt-res--destaque .rt-res-val {
  color: var(--pink) !important;
  font-size: 22px !important;
  font-weight: 700;
}

.rt-res-val.empty {
  color: var(--text3);
  font-size: 12px;
}

/* ──────────── SELETOR DE FORMA (combo box) ──────────── */
.forma-sel-combo {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--pink-mid);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--pink);
  background: #fff;
  font-family: inherit;
  margin-bottom: 8px;
  cursor: pointer;
  outline: none;
}

/* ──────────── CARD DE COMPLETUDE ──────────── */
.card-completude {
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
  margin: 8px 0 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.10);
}

.card-completude.amber {
  background: var(--amber-bg);
  color: var(--amber);
  border: 1px solid rgba(186,117,23,0.22);
}

.card-completude.red {
  background: #FDEAEA;
  color: var(--red);
  border: 1px solid rgba(226,75,74,0.22);
}

.card-completude.green {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid rgba(29,158,117,0.25);
}

/* ──────────── BOTÃO VISÃO GERAL ──────────── */
.visao-btn {
  width: 100%;
  background: transparent;
  border: 1px solid var(--pink-mid);
  border-radius: 8px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--pink-dark);
  cursor: pointer;
  font-family: inherit;
}

.visao-btn svg {
  width: 15px;
  height: 15px;
  stroke: var(--pink);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ──────────── BOTÃO BAIXAR RECEITA ──────────── */
.baixar-btn {
  width: 100%;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s, color .15s, background .15s;
}
.baixar-btn:hover {
  border-color: var(--pink);
  color: var(--pink);
  background: rgba(214,63,126,.04);
}
.baixar-btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.baixar-pro {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--pink);
  background: rgba(214,63,126,.1);
  border-radius: 4px;
  padding: 2px 5px;
  margin-left: 2px;
}

/* ──────────── MODAL ALERTA INGREDIENTE ──────────── */
.alerta-ing-header {
  text-align: center;
  padding: 12px 0 18px;
}
.alerta-ing-icone  { font-size: 28px; margin-bottom: 8px; }
.alerta-ing-titulo { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.alerta-ing-sub    { font-size: 12px; color: var(--text3); }

.alerta-rec-item {
  padding: 10px 12px;
  background: var(--surface2);
  border-radius: 8px;
  margin-bottom: 6px;
}
.alerta-rec-nome {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.alerta-rec-valores {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.alerta-rec-old   { color: var(--text3); text-decoration: line-through; }
.alerta-rec-seta  { color: var(--text3); font-size: 10px; }
.alerta-rec-new   { font-weight: 600; }
.alerta-rec-new.subiu  { color: #dc2626; }
.alerta-rec-new.baixou { color: var(--green); }
.alerta-rec-delta {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}
.alerta-rec-delta.subiu  { background: #fef2f2; color: #dc2626; }
.alerta-rec-delta.baixou { background: var(--green-bg); color: var(--green); }

/* ──────────── MODAL PLANO NECESSÁRIO ──────────── */
.plano-req-hero {
  text-align: center;
  padding: 16px 8px 20px;
}
.plano-req-icon {
  font-size: 34px;
  margin-bottom: 10px;
}
.plano-req-titulo {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.plano-req-sub {
  font-size: 13px;
  color: var(--text3);
}
.plano-req-lista {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 8px;
}
.plano-req-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text2);
  background: var(--surface2);
  border-radius: 8px;
  padding: 10px 12px;
  line-height: 1.4;
}
.plano-req-check {
  color: var(--pink);
  font-weight: 700;
  flex-shrink: 0;
}

/* ──────────── ÁREA DE IMPRESSÃO / PDF ──────────── */
#print-area { display: none; }

@media print {
  body > *:not(#print-area) { display: none !important; }
  #print-area {
    display: block !important;
    padding: 24px;
    font-family: Arial, sans-serif;
    color: #222;
    font-size: 12px;
  }
}

.print-doc { max-width: 800px; margin: 0 auto; }
.print-header {
  text-align: center;
  border-bottom: 2px solid #d63f7e;
  padding-bottom: 14px;
  margin-bottom: 22px;
}
.print-logo {
  font-size: 10px;
  font-weight: 700;
  color: #d63f7e;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.print-title { font-size: 22px; font-weight: 700; margin: 0 0 4px; }
.print-meta  { font-size: 11px; color: #999; }

.print-section       { margin-bottom: 22px; }
.print-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: #d63f7e;
  border-bottom: 1px solid #eee;
  padding-bottom: 5px;
  margin-bottom: 10px;
}
.print-table          { width: 100%; border-collapse: collapse; font-size: 12px; }
.print-table th       { background: #f7f7f7; text-align: left; padding: 6px 8px; font-weight: 600; border-bottom: 2px solid #ddd; }
.print-table td       { padding: 5px 8px; border-bottom: 1px solid #f0f0f0; }
.print-table .tot-row td { font-weight: 700; background: #fff5f9; border-top: 2px solid #d63f7e; border-bottom: none; }
.print-table .r       { text-align: right; }

.print-summary {
  display: flex;
  gap: 12px;
  margin: 18px 0;
}
.print-sum-box {
  flex: 1;
  text-align: center;
  padding: 12px 8px;
  background: #f7f7f7;
  border-radius: 8px;
}
.print-sum-lbl { font-size: 10px; color: #999; margin-bottom: 4px; }
.print-sum-val { font-size: 18px; font-weight: 700; color: #222; }
.print-sum-val.pink { color: #d63f7e; }

.print-footer {
  text-align: center;
  font-size: 10px;
  color: #ccc;
  border-top: 1px solid #eee;
  padding-top: 12px;
  margin-top: 20px;
}

/* ──────────── TOOLTIP ──────────── */
.tooltip {
  display: none;
  position: fixed;
  width: 210px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 11px;
  color: var(--text2);
  line-height: 1.5;
  z-index: 9999;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  --arrow-left: 14px;
}

.tooltip.show {
  display: block;
}

.tooltip strong {
  color: var(--text);
  font-weight: 600;
}

/* Seta aponta para o botão i — posição controlada por --arrow-left */
.tooltip::before {
  content: '';
  position: absolute;
  top: -5px;
  left: var(--arrow-left);
  width: 8px;
  height: 8px;
  background: var(--surface);
  border-top: 1px solid var(--border2);
  border-left: 1px solid var(--border2);
  transform: rotate(45deg);
  margin-left: -4px;
}

/* Tooltip abre para cima: seta fica embaixo apontando para baixo */
.tooltip[data-tip-above="1"]::before {
  top: auto;
  bottom: -5px;
  transform: rotate(225deg);
}

/* ──────────── CONTROLES DE ACORDEÃO ──────────── */
.acc-controls {
  display: flex;
  gap: 8px;
  padding: 10px 14px 2px;
}

.acc-ctrl {
  flex: 1;
  padding: 7px;
  border: 1px solid var(--border2);
  border-radius: 8px;
  background: var(--surface);
  font-size: 11px;
  color: var(--text2);
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  font-weight: 500;
}

/* ──────────── ACORDEÃO ──────────── */
.cad-acc {
  margin: 8px 14px 0;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  overflow: hidden;
}

.cad-acc:last-child {
  margin-bottom: 14px;
}

.cad-head {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  cursor: pointer;
  background: var(--surface2);
  gap: 9px;
  user-select: none;
  border-radius: var(--r);
  transition: background 0.15s;
}

.cad-head:active {
  background: var(--pink-light);
}

.cad-ico {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: -0.3px;
}

.ico-pk { background: #FBEAF0; color: #993556; }
.ico-am { background: #FAEEDA; color: #854F0B; }
.ico-tl { background: #E1F5EE; color: #0F6E56; }
.ico-pp { background: #EEEDFE; color: #3C3489; }
.ico-bl { background: #E6F1FB; color: #185FA5; }
.ico-cfg { background: #F1EFE8; color: #444441; }
.ico-mo  { background: #FDE8F0; color: #72243E; }

.cad-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.cad-count {
  font-size: 10px;
  color: var(--text3);
  margin-right: 2px;
}

.cad-arr {
  font-size: 12px;
  color: var(--text3);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.cad-arr.open {
  transform: rotate(180deg);
}

.cad-add {
  padding: 9px 12px;
  background: var(--surface2);
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
}

.cad-items {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.cad-items.open {
  max-height: 1800px;
  border-top: 1px solid var(--border);
}

/* ──────────── INPUTS COMPARTILHADOS ──────────── */
.a-sel {
  flex: 1;
  min-width: 0;
  padding: 7px 5px;
  border: 1px solid var(--border2);
  border-radius: 7px;
  font-size: 11px;
  color: var(--text);
  background: var(--surface);
  font-family: inherit;
}

.a-qty {
  flex: 0 0 56px;
  width: 56px;
  padding: 7px 5px;
  border: 1px solid var(--border2);
  border-radius: 7px;
  font-size: 12px;
  text-align: center;
  color: var(--text);
  background: var(--surface);
  font-family: inherit;
  outline: none;
}

.a-btn {
  padding: 7px 12px;
  background: var(--pink);
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 16px;
  cursor: pointer;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

.a-btn-sm {
  padding: 6px 11px;
  background: var(--pink);
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
}

.a-inp {
  flex: 1;
  padding: 7px 9px;
  border: 1px solid var(--border2);
  border-radius: 7px;
  font-size: 12px;
  color: var(--text);
  background: var(--surface);
  font-family: inherit;
  outline: none;
}

.a-inp-sm {
  width: 90px;
  flex: none;
  padding: 7px 8px;
  border: 1px solid var(--border2);
  border-radius: 7px;
  font-size: 12px;
  color: var(--text);
  background: var(--surface);
  font-family: inherit;
  outline: none;
}

.a-sel-sm {
  padding: 7px 5px;
  border: 1px solid var(--border2);
  border-radius: 7px;
  font-size: 11px;
  color: var(--text);
  background: var(--surface);
  font-family: inherit;
}

/* ──────────── AUTOCOMPLETE ──────────── */
.ac-wrap {
  flex: 1;
  min-width: 0;
  position: relative;
}

.ac-inp {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--border2);
  border-radius: 7px;
  font-size: 12px;
  color: var(--text);
  background: var(--surface);
  font-family: inherit;
  outline: none;
}

.un-lbl {
  padding: 7px 8px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 7px;
  font-size: 11px;
  color: var(--text2);
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 500;
}

.ac-drop {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 9px;
  z-index: 200;
  display: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  max-height: 200px;
  overflow-y: auto;
}

.ac-opt {
  padding: 10px 13px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ac-opt:last-child {
  border-bottom: none;
}

.ac-opt:active {
  background: var(--surface2);
}

.ac-un {
  font-size: 10px;
  color: var(--text3);
}

/* ──────────── ITENS DA RECEITA ──────────── */
.it {
  display: flex;
  align-items: center;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  gap: 7px;
}

.it:last-of-type {
  border-bottom: none;
}

.it-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.it-name {
  font-size: 12px;
  color: var(--text);
  white-space: normal;
  line-height: 1.3;
}

.it-qty {
  font-size: 11px;
  color: var(--text3);
  white-space: nowrap;
}

.it-cost {
  font-family: 'DM Serif Display', serif;
  font-size: 13px;
  font-weight: 400;
  color: var(--pink-dark);
  min-width: 58px;
  text-align: right;
  letter-spacing: -0.1px;
}

.it-del {
  font-size: 17px;
  color: var(--text3);
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  flex-shrink: 0;
}

/* ──────────── TABELAS (ingredientes, cadastros) ──────────── */
.tbl-row {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}

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

.tbl-name {
  flex: 1;
  font-size: 13px;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tbl-unit {
  font-size: 11px;
  color: var(--text3);
  flex-shrink: 0;
}

.tbl-info {
  flex: 1;
  min-width: 0;
}
.tbl-info .tbl-name {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.3;
}
.tbl-sub {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text3);
  margin-top: 3px;
  flex-wrap: wrap;
}

.tbl-price {
  font-size: 12px;
  font-weight: 500;
  color: var(--pink-dark);
  min-width: 120px;
  text-align: right;
  flex-shrink: 0;
  white-space: nowrap;
}

.tbl-icons {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.equip-cat {
  padding: 7px 12px 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}

/* ──────────── LISTA INGREDIENTES (com scroll interno) ──────────── */
.ing-list-card {
  margin: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
  overflow: hidden;
}

.ing-list-head {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.ing-list-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  flex: 1;
}

.ing-list-count {
  font-size: 11px;
  color: var(--text3);
}

.ing-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.ing-scroll::-webkit-scrollbar {
  display: none;
}

/* ──────────── CONFIGURAÇÕES ──────────── */
.cfg-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}

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

.cfg-lbl {
  font-size: 13px;
  color: var(--text);
  flex: 1;
}

.cfg-inp {
  width: 110px;
  padding: 6px 8px;
  border: 1px solid var(--border2);
  border-radius: 7px;
  font-size: 12px;
  text-align: right;
  color: var(--text);
  background: var(--surface2);
  font-family: inherit;
  outline: none;
}

.cfg-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
}

.cfg-badge.on {
  background: var(--green-bg);
  color: var(--green);
}

.cfg-badge.off {
  background: var(--surface2);
  color: var(--text3);
}

.cfg-info {
  margin: 10px 14px 14px;
  background: var(--amber-bg);
  border-radius: var(--r);
  padding: 10px 13px;
  font-size: 11px;
  color: var(--amber);
  line-height: 1.6;
  font-weight: 500;
}

/* ──────────── BADGES ──────────── */
.badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
}

.badge-g { background: var(--green-bg); color: var(--green); }
.badge-a { background: var(--amber-bg); color: var(--amber); }
.badge-pk { background: var(--pink-light); color: var(--pink-dark); }

.badge-excluido {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  background: #fee2e2;
  color: #dc2626;
  vertical-align: middle;
  margin-left: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.it-deleted .it-name { color: var(--text3); text-decoration: line-through; }
.it-deleted .it-cost { color: var(--text3); }

/* ──────────── LOADING OVERLAY ──────────── */
#loading-overlay {
  position: absolute;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 9999;
}
.loading-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--pink-light);
  border-top-color: var(--pink);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-msg {
  font-size: 12px;
  color: var(--text3);
}

/* ──────────── TOAST ──────────── */
.toast {
  position: absolute;
  bottom: 96px;
  left: 50%;
  transform: translateX(-50%) translateY(16px) scale(0.94);
  background: #1A1A1A;
  color: #fff;
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 500;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

.toast svg {
  width: 14px;
  height: 14px;
  stroke: #4ade80;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  flex-shrink: 0;
}

/* ──────────── MODAIS ──────────── */
.modal-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 300;
  align-items: flex-end;
  justify-content: center;
}

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

.modal {
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 16px 16px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface2);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text3);
}

.modal-sub {
  padding: 4px 16px 10px;
  font-size: 13px;
  color: var(--text2);
  flex-shrink: 0;
}

.modal-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 16px;
}

.modal-scroll::-webkit-scrollbar {
  display: none;
}

.modal-btns {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-cancel {
  flex: 1;
  padding: 13px;
  border-radius: 10px;
  border: 1px solid var(--border2);
  background: var(--surface2);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}

.modal-del {
  flex: 1;
  padding: 13px;
  border-radius: 10px;
  border: none;
  background: var(--red);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
}

/* ──────────── VISÃO GERAL TABELA ──────────── */
.vg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin: 10px 0;
}

.vg-table th {
  background: var(--surface2);
  padding: 8px;
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--border);
}

.vg-table th:not(:first-child) {
  text-align: right;
}

.vg-table td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.vg-table td:not(:first-child) {
  text-align: right;
}

.vg-table tr:last-child td {
  border-bottom: none;
}

.vg-table .tot-row td {
  font-weight: 600;
  color: var(--pink-dark);
  background: var(--pink-light);
  border-top: 1px solid var(--pink-mid);
}

.vg-info {
  background: var(--green-bg);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 10px;
}

.vg-info-line {
  font-size: 12px;
  color: #0F6E56;
  margin-bottom: 4px;
  font-weight: 500;
}

.vg-info-line:last-child {
  margin-bottom: 0;
}

.vg-info-line strong {
  font-weight: 700;
}


/* ──────────── MODAL FIELD LABEL ──────────── */
.modal-field-lbl {
  font-size: 11px;
  color: var(--text2);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 6px;
}

/* ──────────── LISTA FILTRADA DE INGREDIENTES ──────────── */
.ing-lista-header {
  padding: 7px 12px;
  font-size: 10px;
  font-weight: 700;
  color: var(--pink-deep);
  background: var(--pink-light);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 1px solid var(--pink-mid);
}

.ing-lista-filtrada {
  border: 2px solid var(--pink);
  border-top: none;
  border-radius: 0 0 12px 12px;
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(212,83,126,0.12);
  max-height: 200px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.ing-lista-filtrada::-webkit-scrollbar { display: none; }

.ing-lista-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  gap: 8px;
}

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

.ing-lista-item:active,
.ing-lista-item.selected { background: var(--pink-light); }

.ing-lista-item-nome {
  flex: 1;
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}

.ing-lista-item-detalhe {
  font-size: 11px;
  color: var(--text3);
  text-align: right;
}

/* ═══════════════════════════════════════════════════
   DESKTOP — layout sidebar (≥ 960px)
   ═══════════════════════════════════════════════════ */
@media (min-width: 960px) {

  /* ── body / fundo ── */
  body { display: block; background: #ede8e4; min-height: 100vh; }

  /* ── Shell: grade 2 colunas ── */
  .shell {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    display: grid;
    grid-template-areas:
      "header  header"
      "sidebar main  ";
    grid-template-columns: 220px 1fr;
    grid-template-rows: auto 1fr;
  }

  /* ── Topbar ── */
  .topbar       { grid-area: header; padding: 10px 36px 12px; }
  .topbar--pad  { padding-top: 10px; }

  /* ── Sidebar ── */
  .bottom-nav {
    grid-area: sidebar;
    width: 220px;
    height: 100%;
    border-top: none;
    border-right: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 16px 0 20px;
    background: var(--surface);
  }

  .nav-item {
    flex-direction: row;
    gap: 12px;
    padding: 11px 18px;
    margin: 1px 10px;
    border-radius: 10px;
    justify-content: flex-start;
  }

  .nav-item:hover  { background: var(--surface2); }
  .nav-item.on     { background: var(--pink-light); }
  .nav-item:active { transform: none; }
  .nav-item svg    { width: 20px; height: 20px; flex-shrink: 0; }

  .nav-item span       { font-size: 13px; font-weight: 500; color: var(--text2); }
  .nav-item.on span    { color: var(--pink); font-weight: 600; }

  /* ── Conteúdo principal: padding horizontal uniforme ── */
  .content {
    grid-area: main;
    background: var(--bg);
    overflow: hidden;
    padding: 0 36px;         /* todo o conteúdo fica insetado da borda */
  }

  .scr.on { animation: none; }

  /* ── Reset de margens laterais (o padding do .content já posiciona) ── */
  .scroll-body,
  .search-frozen,
  .search-count,
  .acc-controls,
  .ing-list-card,
  .recipe-name-bar,
  .recipe-top-inner {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
  }

  /* Barra de busca */
  .search-frozen {
    padding-left: 0;
    padding-right: 0;
    padding-top: 16px;
    background: transparent;
    border-bottom: none;
  }

  .search-count  { padding-left: 0; padding-right: 0; }
  .acc-controls  { padding-left: 0; padding-right: 0; }
  .scroll-body   { padding-bottom: 40px; }
  #s-receitas .scroll-body { padding-bottom: 80px; }

  /* Acordeões: fill total (padding já está no .content) */
  .scroll-body .cad-acc { margin-left: 0; margin-right: 0; }
  .cfg-info              { margin-left: 0; margin-right: 0; }

  /* ── Minha Receita: name-bar + top-inner como card unificado ── */
  .recipe-name-bar {
    margin-top: 20px;
    padding: 14px 20px;
    border: 1px solid var(--pink-mid);
    border-bottom: none;
    border-radius: var(--r) var(--r) 0 0;
  }

  .recipe-top-inner {
    padding: 18px 20px 12px;
    border: 1px solid var(--pink-mid);
    border-top: none;
    border-radius: 0 0 var(--r) var(--r);
  }

  /* ── FAB ── */
  .fab { right: 28px; bottom: 28px; }

  /* ── Modais: centralizados, tamanho fixo ── */
  .modal-overlay { justify-content: center; align-items: center; }
  .modal         { border-radius: 16px; margin-bottom: 0; max-width: 480px; width: 100%; }

  /* ════════════════════════════════════════
     FONTES, CAMPOS E BOTÕES MAIORES NO DESKTOP
     ════════════════════════════════════════ */

  /* ── Topbar ── */
  .logo-mark     { width: 34px; height: 34px; font-size: 12px; border-radius: 9px; }
  .logo-name     { font-size: 22px; }
  .topbar-greeting { font-size: 14px; }
  .topbar-avatar { width: 40px; height: 40px; font-size: 14px; }
  .back-btn      { width: 38px; height: 38px; }
  .page-title    { font-size: 19px; }
  .action-btn    { font-size: 16px; }

  /* ── Nome da receita ── */
  .rname-inp { font-size: 22px; padding: 14px 16px; }

  /* ── Labels e unidades ── */
  .rt-lbl  { font-size: 12px; height: auto; margin-bottom: 6px; letter-spacing: 0.6px; }
  .rt-unit { font-size: 15px; }

  /* ── Inputs de rendimento / margem / perda ── */
  .rt-inp { font-size: 18px; padding: 12px 14px; }

  /* ── Cards de resultado (Custo / Preço / Lucro) ── */
  .rt-results    { gap: 12px; }
  .rt-res        { padding: 16px 18px; }
  .rt-res-lbl    { font-size: 12px; margin-bottom: 6px; }
  .rt-res-val    { font-size: 22px; }
  .rt-res-val.venda { font-size: 28px; }

  /* ── Botão visão geral ── */
  .visao-btn { font-size: 15px; padding: 12px 16px; }
  .visao-btn svg { width: 18px; height: 18px; }

  /* ── Card completude ── */
  .card-completude { font-size: 13px; padding: 12px 16px; }

  /* ── Controles de accordion ── */
  .acc-ctrl { font-size: 13px; padding: 9px 14px; }

  /* ── Cabeçalho de accordion ── */
  .cad-head  { padding: 14px 16px; }
  .cad-ico   { width: 30px; height: 30px; font-size: 11px; }
  .cad-title { font-size: 15px; }
  .cad-count { font-size: 12px; }
  .cad-arr   { font-size: 14px; }

  /* ── Área de adição (add forms) ── */
  .cad-add { padding: 12px 16px; gap: 10px; }

  /* ── Inputs gerais ── */
  .a-inp, .a-inp-sm { font-size: 15px; padding: 9px 11px; }
  .a-sel, .a-sel-sm { font-size: 15px; padding: 9px 8px; }
  .a-qty            { font-size: 15px; padding: 9px 6px; flex: 0 0 68px; width: 68px; }
  .ac-inp           { font-size: 15px; padding: 9px 11px; }
  .un-lbl           { font-size: 13px; padding: 9px 10px; }

  /* ── Botões de ação ── */
  .a-btn    { font-size: 20px; padding: 9px 16px; border-radius: 9px; }
  .a-btn-sm { font-size: 15px; padding: 9px 16px; border-radius: 9px; }

  /* ── Linhas de tabela (ingredientes / cadastros) ── */
  .tbl-row   { padding: 13px 16px; }
  .tbl-name  { font-size: 15px; }
  .tbl-sub   { font-size: 13px; margin-top: 4px; }
  .tbl-price { font-size: 14px; }
  .icon-btn  { width: 34px; height: 34px; border-radius: 9px; }
  .icon-btn svg { width: 16px; height: 16px; }

  /* ── Cabeçalho da lista de ingredientes ── */
  .ing-list-head  { padding: 13px 18px; }
  .ing-list-title { font-size: 13px; }
  .ing-list-count { font-size: 13px; }

  /* ── Itens dentro de receita ── */
  .it      { padding: 12px 16px; }
  .it-name { font-size: 14px; }
  .it-qty  { font-size: 13px; }
  .it-cost { font-size: 15px; }

  /* ── Lista de receitas ── */
  .recipe-item   { padding: 16px 18px; margin: 0 0 10px; border-radius: 12px; }
  .recipe-name   { font-size: 17px; margin-bottom: 4px; }
  .recipe-meta   { font-size: 13px; }
  .recipe-venda  { font-size: 20px; }
  .recipe-porcao { font-size: 12px; }
  .icon-btn.dup, .icon-btn.del { width: 34px; height: 34px; }

  /* ── Busca (receitas e ingredientes) ── */
  .search-box        { padding: 12px 16px; border-radius: 12px; }
  .search-box input  { font-size: 16px; }
  .search-box svg    { width: 18px; height: 18px; }
  .search-count      { font-size: 12px; padding-top: 6px; }

  /* ── Configurações ── */
  .cfg-row  { padding: 14px 18px; }
  .cfg-lbl  { font-size: 15px; }
  .cfg-inp  { font-size: 15px; padding: 8px 12px; width: 130px; border-radius: 9px; }
  .cfg-info { font-size: 13px; padding: 14px 18px; }
  .cfg-badge { font-size: 12px; padding: 5px 12px; border-radius: 7px; }

  /* ── Seletor de forma (dropdown) ── */
  .forma-sel-combo { font-size: 15px; padding: 12px 14px; margin-bottom: 12px; }

  /* ── Ing selector (busca na receita) ── */
  .ing-lista-item { padding: 13px 16px; }
  .ing-lista-item-nome    { font-size: 15px; }
  .ing-lista-item-detalhe { font-size: 13px; }
}

.ing-lista-vazio {
  padding: 14px 12px;
  font-size: 12px;
  color: var(--text3);
  text-align: center;
}

/* ═══════════════════════════════════════════════════
   TELA DE AUTENTICAÇÃO
   ═══════════════════════════════════════════════════ */
.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: linear-gradient(145deg, #fce8f0 0%, #fdf4f8 60%, #fef9fb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.auth-box {
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 8px 40px rgba(212,83,126,0.13), 0 2px 8px rgba(0,0,0,0.06);
  padding: 32px 28px 28px;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

/* Abas login / registro */
.auth-tabs {
  display: flex;
  background: var(--surface2);
  border-radius: 12px;
  padding: 3px;
  gap: 3px;
}

.auth-tab {
  flex: 1;
  padding: 9px 0;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text3);
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab.on {
  background: #fff;
  color: var(--pink);
  box-shadow: 0 1px 6px rgba(0,0,0,0.08);
}

/* Formulários */
.auth-form { display: flex; flex-direction: column; gap: 12px; }

.auth-field { display: flex; flex-direction: column; gap: 5px; }

.auth-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.auth-inp {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color 0.18s;
  box-sizing: border-box;
}

select.auth-inp {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.auth-inp:focus { border-color: var(--pink); background: #ffffff; }

.auth-error {
  font-size: 13px;
  color: #dc2626;
  min-height: 16px;
  text-align: center;
}

.auth-btn {
  width: 100%;
  padding: 13px;
  background: var(--pink);
  color: #fff;
  border: none;
  border-radius: 13px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(212,83,126,0.35);
  transition: transform 0.14s, box-shadow 0.14s;
}

.auth-btn:active { transform: scale(0.97); box-shadow: 0 2px 8px rgba(212,83,126,0.25); }

.auth-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text3);
  margin: 0;
}

.auth-btn-ghost {
  width: 100%;
  padding: 11px;
  background: transparent;
  color: var(--text3);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.auth-btn-ghost:hover { border-color: var(--text2); color: var(--text2); }

.auth-link {
  background: none;
  border: none;
  color: var(--pink);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.15s;
}
.auth-link:hover { text-decoration-color: var(--pink); }

/* ──────────── BANNER TRIAL ──────────── */
.trial-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff8e6;
  color: #7a4a00;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 14px;
  border-bottom: 1px solid #ffd27a;
  flex-shrink: 0;
}
.trial-banner-btn {
  margin-left: auto;
  background: var(--pink);
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.trial-banner-close {
  background: none;
  border: none;
  color: #7a4a00;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  flex-shrink: 0;
}

/* ──────────── BANNER PWA ──────────── */
.pwa-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  flex-shrink: 0;
}
.pwa-banner-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.pwa-banner-text strong { font-size: 13px; color: var(--text); font-weight: 600; }
.pwa-banner-text span   { font-size: 11px; color: var(--text3); }
.pwa-banner-btn {
  background: var(--pink);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.pwa-banner-close {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  flex-shrink: 0;
}

/* ── Tela de planos ── */
.plans-box { max-width: 480px; position: relative; }

.plans-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (min-width: 500px) { .plans-grid { flex-direction: row; } }

.plan-card {
  flex: 1;
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 18px 14px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.14s;
}

.plan-card:hover  { border-color: var(--pink); box-shadow: 0 4px 18px rgba(212,83,126,0.15); transform: translateY(-2px); }
.plan-card:active { transform: scale(0.97); }

.plan-destaque { border-color: var(--pink); background: var(--pink-light); }

.plan-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--pink);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.plan-nome    { font-size: 13px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.plan-preco   { font-size: 22px; font-weight: 700; color: var(--pink); font-family: 'DM Serif Display', serif; }
.plan-periodo { font-size: 11px; color: var(--text3); margin-top: 4px; }

/* ── Bloco de conta em Configurações ── */
.cfg-conta { margin: 0 14px 14px; }

.cfg-conta-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.cfg-conta-info { flex: 1; min-width: 0; }

.cfg-conta-nome  { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.cfg-conta-email { font-size: 12px; color: var(--text3); margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cfg-conta-status {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
}

.status-ativo  { background: #dcfce7; color: #15803d; }
.status-trial  { background: #fef3c7; color: #92400e; }
.status-alerta { background: #fee2e2; color: #dc2626; }

.cfg-logout-btn {
  padding: 8px 16px;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
  flex-shrink: 0;
}

.cfg-logout-btn:hover { border-color: #dc2626; color: #dc2626; }

.cfg-assinar-btn {
  margin-top: 8px;
  padding: 7px 14px;
  background: var(--pink);
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s;
}
.cfg-assinar-btn:hover { opacity: 0.85; }

/* Desktop: cfg-conta sem margem lateral */
@media (min-width: 960px) {
  .cfg-conta { margin-left: 0; margin-right: 0; }
}

/* ════════════════════════════════════════════════
   TUTORIAL DE BOAS-VINDAS
   ════════════════════════════════════════════════ */
#tutorial-overlay {
  position: absolute;
  inset: 0;
  z-index: 9998;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  backdrop-filter: blur(3px);
}

.tutorial-card {
  background: var(--surface);
  border-radius: 24px;
  width: 100%;
  max-width: 340px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  position: relative;
}

.tutorial-pular {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(0,0,0,0.15);
  border: none;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  font-family: inherit;
  z-index: 1;
  transition: background .15s;
}
.tutorial-pular:hover { background: rgba(0,0,0,0.28); }

.tutorial-topo {
  height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .3s;
}

.tutorial-icone {
  font-size: 72px;
  line-height: 1;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,0.12));
}

.tutorial-body {
  padding: 24px 24px 0;
  text-align: center;
  min-height: 110px;
}

.tutorial-titulo {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.3;
}

.tutorial-texto {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.65;
}

.tutorial-footer {
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.tutorial-dots { display: flex; gap: 6px; align-items: center; }

.tutorial-dot {
  height: 6px;
  width: 6px;
  border-radius: 3px;
  background: var(--border2);
  transition: width .25s, background .25s;
}
.tutorial-dot.on {
  width: 22px;
  background: var(--pink);
}

.tutorial-btn {
  width: 100%;
  padding: 14px;
  background: var(--pink);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 14px rgba(212,83,126,0.35);
  transition: opacity .15s, transform .12s;
}
.tutorial-btn:active { transform: scale(0.97); opacity: .9; }

/* ════════════════════════════════════════════════
   MODO ESCURO — automático pelo sistema
   ════════════════════════════════════════════════ */
@media (prefers-color-scheme: dark) {

  /* ── Variáveis ── */
  :root {
    --bg:         #131313;
    --surface:    #1E1E1E;
    --surface2:   #272727;
    --border:     rgba(255, 255, 255, 0.08);
    --border2:    rgba(255, 255, 255, 0.15);
    --text:       #F0F0F0;
    --text2:      #A0A0A0;
    --text3:      #5E5E5E;
    --pink-light: #2A1520;
    --pink-mid:   #5C2E42;
    --pink-deep:  #F0A0BF;
    --green-bg:   #0C2A1E;
    --amber-bg:   #2A1E08;
    --amber:      #D4952A;
  }

  /* ── Fundo externo (desktop e mobile) ── */
  html, body { background: #0E0E0E; }

  /* ── Tela de autenticação ── */
  .auth-screen {
    background: var(--bg);
  }
  .auth-box {
    background: var(--surface);
    box-shadow: 0 8px 40px rgba(0,0,0,0.5), 0 2px 8px rgba(0,0,0,0.4);
  }

  /* ── Overlay dos modais ── */
  .modal-overlay { background: rgba(0, 0, 0, 0.70); }

  /* ── Avatar menu ── */
  .avatar-menu {
    background: rgba(28, 28, 28, 0.94);
    border-color: rgba(255,255,255,0.10);
    box-shadow: 0 8px 28px rgba(0,0,0,0.55);
  }
  .avatar-menu-item { color: var(--text); }

  /* ── Inputs auth: fundo branco + rosa forte (contraste intencional) ── */
  .auth-inp {
    background: #ffffff !important;
    color: #C0305A;
    -webkit-text-fill-color: #C0305A;
    border-color: #D4537E;
    caret-color: #C0305A;
  }
  .auth-inp:focus {
    background: #ffffff !important;
    border-color: #C0305A;
    box-shadow: 0 0 0 3px rgba(212,83,126,0.18);
  }
  .auth-inp:-webkit-autofill,
  .auth-inp:-webkit-autofill:hover,
  .auth-inp:-webkit-autofill:focus,
  .auth-inp:-webkit-autofill:active {
    -webkit-text-fill-color: #C0305A !important;
    caret-color: #C0305A;
  }

  /* ── Aba ativa da tela de auth ── */
  .auth-tab.on { background: #fff; color: #C0305A; }

  /* ── Inputs e selects: placeholder mais visível ── */
  input::placeholder,
  textarea::placeholder { color: var(--text3); opacity: 1; }

  /* ── Scrollbar sutil ── */
  ::-webkit-scrollbar               { width: 4px; }
  ::-webkit-scrollbar-track         { background: transparent; }
  ::-webkit-scrollbar-thumb         { background: rgba(255,255,255,0.12); border-radius: 4px; }
  ::-webkit-scrollbar-thumb:hover   { background: rgba(255,255,255,0.22); }
}
