
:root{
  /* ── CORES — Stellar Light ──────────────────────────────────────── */
  --bg:#f8f7fc;
  --bg-2:#f0eef8;
  --surface:#ffffff;
  --surface-2:#f4f2fb;
  --surface-3:#ede9f7;
  --border:rgba(100,70,180,.14);
  --border-2:rgba(100,70,180,.17);
  --border-3:rgba(100,70,180,.30);
  --text:#1a1228;
  --text-2:#52406e;
  --text-3:#7263a0;

  /* ── ACCENT ──────────────────────────────────────────────────────── */
  --accent:#6b48d4;
  --accent-hover:#5636b8;
  --accent-soft:rgba(107,72,212,.10);
  --accent-softer:rgba(107,72,212,.05);

  /* ── DADOS SEMÂNTICOS ────────────────────────────────────────────── */
  --money:#1a6b45;      --money-bg:rgba(26,107,69,.08);
  --qty:#1a52a8;        --qty-bg:rgba(26,82,168,.08);
  --pct:#7040b8;        --pct-bg:rgba(112,64,184,.08);

  /* ── ESTADOS ─────────────────────────────────────────────────────── */
  --success:#1a6b45;    --success-soft:rgba(26,107,69,.10);
  --warn:#9a6200;       --warn-soft:rgba(154,98,0,.10);
  --danger:#b01a1a;     --danger-soft:rgba(176,26,26,.09);

  /* ── TIPOGRAFIA — ESCALA MODULAR ─────────────────────────────────── */
  --fs-2xs:11px;
  --fs-xs:11.5px;
  --fs-sm:12.5px;
  --fs-ui:13.5px;
  --fs-base:14.5px;
  --fs-md:15.5px;
  --fs-lg:19px;
  --fs-xl:22px;
  --fs-2xl:28px;
  --fs-3xl:34px;
  --fs-display-sm:42px;
  --fs-display:62px;

  /* ── LINE-HEIGHTS ────────────────────────────────────────────────── */
  --lh-tight:1.15;   /* headings, large display */
  --lh-snug:1.35;    /* compact UI elements */
  --lh-base:1.5;     /* body, ui text */
  --lh-relaxed:1.65; /* descriptions, help text */

  /* ── PESOS ───────────────────────────────────────────────────────── */
  --fw-regular:400;
  --fw-medium:500;
  --fw-semibold:600;
  --fw-bold:700;

  /* ── LETTER-SPACING ──────────────────────────────────────────────── */
  --ls-tight:-.025em;   /* large headings */
  --ls-normal:-.012em;  /* UI headings */
  --ls-none:0em;        /* body text */
  --ls-caps:.055em;     /* uppercase labels */

  /* ── ESPAÇAMENTO — grid 8px ──────────────────────────────────────── */
  --sp-1:4px;   --sp-2:8px;
  --sp-3:12px;  --sp-4:16px;
  --sp-5:20px;  --sp-6:24px;
  --sp-8:32px;  --sp-10:40px;
  --sp-12:48px;

  /* ── BORDAS / RAIOS ──────────────────────────────────────────────── */
  --r-sm:4px;  --r:6px;  --r-md:8px;  --r-lg:10px;  --r-xl:14px;  --r-2xl:20px;

  /* ── SOMBRAS ─────────────────────────────────────────────────────── */
  --shadow-xs:0 1px 2px rgba(80,50,160,.06),0 0 0 1px rgba(80,50,160,.04);
  --shadow-sm:0 2px 6px rgba(80,50,160,.08),0 1px 2px rgba(80,50,160,.04);
  --shadow:0 4px 16px rgba(80,50,160,.09),0 1px 4px rgba(80,50,160,.05);
  --shadow-md:0 8px 24px rgba(80,50,160,.11),0 2px 8px rgba(80,50,160,.06);
  --shadow-lg:0 16px 40px rgba(80,50,160,.13),0 4px 12px rgba(80,50,160,.07);
  --shadow-modal:0 24px 60px rgba(30,10,80,.18),0 8px 24px rgba(80,50,160,.10);
  --shadow-glow:0 0 0 3px var(--accent-soft);
  --scrim:rgba(20,15,40,.55); /* sobreposição sobre modais */

  /* ── EASE ────────────────────────────────────────────────────────── */
  --ease:cubic-bezier(.4,0,.2,1);
  --ease-out:cubic-bezier(0,0,.2,1);
  --ease-spring:cubic-bezier(.34,1.56,.64,1);
  --dur-fast:100ms;
  --dur-base:150ms;
  --dur-slow:250ms;

  /* ── ALTURAS DE CONTROLES ────────────────────────────────────────── */
  --h-lg:44px;
  --h-md:42px;
  --h-btn:42px;
  --h-sm:34px;
  --h-btn-sm:34px;
  --h-input:42px;
  --h-xs:26px;

  /* ── TIPOGRAFIA INPUT ── padrões pra um sistema lindo e legível ─── */
  --input-padding-x:14px;
  --input-padding-y:0;
  --input-textarea-padding:12px 14px;
  --input-border-width:1.5px;
  --input-radius:var(--r-md); /* 8px — mais friendly que 6 */
  --input-font-size:15px;
  --input-font-feature:"cv11", "ss01", "kern", "calt"; /* ligaduras e tabular nums quando precisar */

  /* ── FONTES ──────────────────────────────────────────────────────── */
  --f-sans:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  --f-serif:'Fraunces',Georgia,serif;   /* brand + display apenas */
  --f-mono:'JetBrains Mono',ui-monospace,'Cascadia Code',monospace;
}
*{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{
  background:var(--bg);
  background-image:
    radial-gradient(ellipse at 85% 0%,color-mix(in srgb,var(--accent) 8%,transparent) 0%,transparent 45%),
    radial-gradient(ellipse at 15% 95%,color-mix(in srgb,var(--accent) 5%,transparent) 0%,transparent 40%);
  color:var(--text);font-family:var(--f-sans);font-size:14px;line-height:1.55;
  -webkit-font-smoothing:antialiased;min-height:100vh;
  font-feature-settings:"ss01","cv11";
}
button{font-family:inherit;cursor:pointer;background:none;border:none;color:inherit}
input,select,textarea{font-family:inherit}
::selection{background:var(--accent);color:#fff}

#app{width:100%}

/* ========== HEADER ========== */
.hdr{
  padding:14px 28px;display:flex;justify-content:space-between;align-items:center;gap:16px;
  background:var(--bg);
  border-bottom:1px solid var(--border);
  position:sticky;top:0;z-index:30;
  transition:box-shadow .2s ease,background .2s ease;
}
.hdr.scrolled{
  background:var(--surface);
  box-shadow:0 1px 0 var(--border), 0 4px 12px color-mix(in srgb, var(--text) 6%, transparent);
}
.hdr-brand{display:flex;align-items:center;gap:14px}
.hdr-logo{
  width:42px;height:42px;border-radius:10px;
  background:transparent;
  display:flex;align-items:center;justify-content:center;
  overflow:hidden;
  line-height:1;
}
.hdr-title{font-family:var(--f-sans);font-size:var(--fs-xl);font-weight:var(--fw-semibold);letter-spacing:var(--ls-tight);color:var(--text);line-height:var(--lh-tight)}
.hdr-title em{font-style:italic;color:var(--accent);font-weight:500}
.hdr-sub{
  font-size:11px;color:var(--text-3);text-transform:uppercase;letter-spacing:.18em;
  font-weight:600;padding:4px 10px;background:var(--surface);border-radius:99px;border:1px solid var(--border);
}
.hdr-status{
  font-family:var(--f-mono);font-size:11px;color:var(--success);
  display:flex;align-items:center;gap:6px;opacity:0;transition:opacity .3s;
}
.hdr-status.show{opacity:1}
.hdr-status::before{content:'';width:6px;height:6px;border-radius:99px;background:currentColor}

/* ========== NAV ========== */
.nav{
  display:flex;gap:2px;padding:0 24px;
  background:var(--bg);
  border-bottom:1px solid var(--border);
  position:sticky;top:71px;z-index:29;overflow-x:auto;scrollbar-width:none;
}
.nav::-webkit-scrollbar{display:none}
.nav-tab{
  padding:13px 16px;font-size:13px;font-weight:500;
  color:var(--text-2);background:none;border:none;
  cursor:pointer;white-space:nowrap;position:relative;
  transition:color .15s var(--ease);
  letter-spacing:-.005em;
}
.nav-tab:hover{color:var(--text)}
.nav-tab.active{color:var(--accent);font-weight:600}
.nav-tab.active::after{
  content:'';position:absolute;left:12px;right:12px;bottom:-1px;height:2px;
  background:var(--accent);border-radius:2px 2px 0 0;
}

/* ========== MAIN ========== */
main{padding:32px 28px 120px;animation:fadeUp .4s var(--ease)}
@keyframes fadeUp{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}

.view-head{margin-bottom:28px;display:flex;justify-content:space-between;align-items:flex-end;gap:20px;flex-wrap:wrap}
.view-title{
  font-family:var(--f-sans);font-size:var(--fs-2xl);font-weight:var(--fw-semibold);
  letter-spacing:-.025em;line-height:1.1;color:var(--text);
  font-feature-settings:"ss01";
}
.view-title em{font-style:italic;color:var(--accent);font-weight:500}
.view-desc{color:var(--text-2);font-size:14px;margin-top:6px;max-width:640px;line-height:1.55}

/* ========== CARDS ========== */
.card{
  background:var(--surface);border:1px solid var(--border);
  border-radius:var(--r-lg);overflow:hidden;margin-bottom:14px;
  box-shadow:var(--shadow-xs);
  transition:border-color .2s var(--ease),box-shadow .2s var(--ease);
}
.card:hover{border-color:var(--border-2)}
.card-pad{padding:20px 22px}
.card-head{
  padding:16px 22px;border-bottom:1px solid var(--border);
  display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;
  background:var(--surface);
}
.card-title{font-weight:600;font-size:15px;letter-spacing:-.01em;color:var(--text)}
.card-sub{font-size:12px;color:var(--text-2);margin-top:3px}

/* ========== BUTTONS ========== */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:7px;
  padding:9px 16px;font-size:13px;font-weight:500;
  border:1px solid var(--border-2);border-radius:var(--r);
  background:var(--surface);color:var(--text);
  cursor:pointer;transition:all .15s var(--ease);
  white-space:nowrap;letter-spacing:-.005em;
}
.btn:hover{background:var(--surface-2);border-color:var(--border-3)}
.btn:active{transform:scale(.98)}
.btn:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

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

.btn-accent{
  background:var(--accent);color:#fff;border-color:var(--accent);font-weight:600;
  box-shadow:0 1px 2px color-mix(in srgb, var(--accent) 25%, transparent);
}
.btn-accent:hover{background:var(--accent-hover);border-color:var(--accent-hover);box-shadow:0 2px 8px color-mix(in srgb, var(--accent) 35%, transparent)}

.btn-ghost{background:transparent;border-color:transparent;color:var(--text-2);font-weight:500}
.btn-ghost:hover{background:var(--surface-2);color:var(--text);border-color:var(--border)}

.btn-danger{color:var(--danger);border-color:transparent;background:transparent;font-weight:500}
.btn-danger:hover{background:var(--danger-soft);border-color:rgba(166,36,36,.2)}

.btn-sm{padding:6px 12px;font-size:12px;gap:5px}
.btn-xs{padding:4px 9px;font-size:11px;gap:4px;font-weight:500}
.btn-icon{padding:6px;width:32px;height:32px;border-radius:var(--r);font-size:14px;font-weight:400}

/* ========== INPUTS ========== */
.input,.select,.textarea{
  font-family:inherit;font-size:14px;padding:10px 12px;
  border:1px solid var(--border-2);border-radius:var(--r);
  background:var(--surface);color:var(--text);width:100%;
  transition:border-color .15s,box-shadow .15s,background .15s;
  letter-spacing:-.005em;
}
.input:hover,.select:hover,.textarea:hover{border-color:var(--border-3)}
.input:focus,.select:focus,.textarea:focus{
  outline:none;border-color:var(--accent);
  box-shadow:0 0 0 3px var(--accent-soft);
}
.input-sm{padding:6px 10px;font-size:13px}
.input-num{text-align:right;font-family:var(--f-mono);font-variant-numeric:tabular-nums;font-weight:500}
.textarea{resize:vertical;min-height:64px;line-height:1.5}
.select{cursor:pointer}

.label{
  display:block;font-size:11px;font-weight:600;color:var(--text-2);
  margin-bottom:6px;letter-spacing:.02em;
}
.label-req::after{content:'*';color:var(--accent);margin-left:3px}
.field{margin-bottom:18px}
.field-help{font-size:12px;color:var(--text-3);margin-top:5px;line-height:1.5}
.field-row{display:flex;gap:12px}
.field-row>*{flex:1;min-width:0}

/* ========== TABLES ========== */
.tbl-wrap{overflow-x:auto;margin:0 -1px}
.tbl{width:100%;border-collapse:collapse;font-size:var(--fs-sm)}
.tbl th{
  font-size:11px;font-weight:600;color:var(--text-3);
  letter-spacing:.02em;
  background:var(--surface-2);padding:11px 16px;
  border-bottom:1px solid var(--border);text-align:left;
  white-space:nowrap;
}
.tbl td{
  padding:12px 16px;background:var(--surface);
  color:var(--text);border-bottom:1px solid var(--border);
  vertical-align:middle;
}
/* Subtle zebra */
.tbl tbody tr:nth-child(even) td{background:var(--surface-2)}
.tbl tr:last-child td{border-bottom:none}
.tbl tr.click{cursor:pointer;transition:background .12s var(--ease)}
.tbl tr.click:hover td{background:var(--accent-soft)!important}

/* Summary rows */
.tbl-sum td{
  background:var(--surface-3)!important;
  color:var(--text)!important;font-weight:600;
  border-top:2px solid var(--border-2)!important;
}

/* Inputs inside tables — inline edit */
.tbl input.input{
  padding:5px 9px;font-size:13px;max-width:110px;
  background:var(--surface);border-color:var(--border);
}

/* Data value columns with semantic colors */
.tbl td.num,.tbl th.num{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.tbl td.num{font-family:var(--f-mono);font-weight:600;color:var(--money);font-size:13px}
.tbl th.num{font-weight:600;color:var(--text-3)}

.tbl td.num-qty,.tbl th.num-qty{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.tbl td.num-qty{font-family:var(--f-mono);font-weight:500;color:var(--qty);font-size:13px}
.tbl th.num-qty{font-weight:600;color:var(--text-3)}

.tbl td.num-pct,.tbl th.num-pct{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.tbl td.num-pct{font-family:var(--f-mono);font-weight:600;color:var(--pct);font-size:13px}
.tbl th.num-pct{font-weight:600;color:var(--text-3)}

.tbl-act{text-align:right;white-space:nowrap}

/* ========== BADGES ========== */
.badge{
  display:inline-flex;align-items:center;gap:5px;
  font-size:var(--fs-2xs);padding:2px 7px;border-radius:99px;
  font-weight:500;white-space:nowrap;
}
.b-success{background:var(--success-soft);color:var(--success)}
.b-warn{background:var(--warn-soft);color:var(--warn)}
.b-danger{background:var(--danger-soft);color:var(--danger)}
.b-muted{background:var(--surface-2);color:var(--text-2);border:1px solid var(--border)}
.b-accent{background:var(--accent-soft);color:var(--accent)}
.b-mono{font-family:var(--f-mono);font-weight:600;font-size:11px}

/* ========== GRID ========== */
.grid{display:grid;gap:14px}
.grid-2{grid-template-columns:repeat(2,1fr)}
.grid-3{grid-template-columns:repeat(3,1fr)}
.grid-auto{grid-template-columns:repeat(auto-fit,minmax(200px,1fr))}

/* ========== METRICS ========== */
.metric-card{
  background:var(--surface);border:1px solid var(--border);
  border-radius:var(--r-lg);padding:18px 22px;
  box-shadow:var(--shadow-xs);
  transition:all .25s var(--ease);position:relative;overflow:hidden;
}
.metric-card:hover{border-color:var(--border-2);box-shadow:var(--shadow);transform:translateY(-1px)}
.metric-label{
  font-size:var(--fs-2xs);font-weight:var(--fw-medium);color:var(--text-2);
  margin-bottom:10px;letter-spacing:-.005em;
}
.metric-value{
  font-family:var(--f-serif);font-size:var(--fs-display-sm);font-weight:var(--fw-medium);
  letter-spacing:-.03em;line-height:1;color:var(--text);
}
.metric-value em{font-style:italic;color:var(--accent)}
.metric-sub{font-size:12px;color:var(--text-3);margin-top:8px;line-height:1.4}

/* Featured metric (hero) */
.metric-hero{
  grid-column:span 2;padding:24px 28px;
  background:linear-gradient(135deg,var(--surface) 0%,var(--surface-2) 100%);
  border-color:var(--border-2);
}
.metric-hero .metric-value{font-size:var(--fs-display);letter-spacing:-0.04em}
.metric-hero .metric-label{font-size:13px}

/* ========== MODAL ========== */
.mb{
  position:fixed;inset:0;background:var(--scrim);
  backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);
  display:flex;align-items:center;justify-content:center;z-index:100;padding:20px;
  animation:fadeIn .2s var(--ease);
}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
.modal{
  background:var(--surface);border:1px solid var(--border);
  border-radius:var(--r-xl);max-width:640px;width:100%;max-height:92vh;
  overflow-y:auto;box-shadow:var(--shadow-lg);
  animation:slideUp .25s var(--ease);
}
@keyframes slideUp{from{transform:translateY(16px) scale(.98);opacity:0}to{transform:none;opacity:1}}
.modal::-webkit-scrollbar{width:8px}
.modal::-webkit-scrollbar-track{background:transparent}
.modal::-webkit-scrollbar-thumb{background:var(--border-2);border-radius:99px}

.modal-head{
  padding:20px 24px;border-bottom:1px solid var(--border);
  display:flex;justify-content:space-between;align-items:center;
  position:sticky;top:0;background:var(--surface);z-index:2;
}
.modal-title{
  font-family:var(--f-sans);font-size:var(--fs-xl);font-weight:var(--fw-semibold);letter-spacing:-.02em;
  color:var(--text);
}
.modal-body{padding:24px}
.modal-foot{
  padding:16px 24px;border-top:1px solid var(--border);
  display:flex;justify-content:flex-end;gap:8px;
  background:var(--surface-2);position:sticky;bottom:0;
}
.modal-foot-left{margin-right:auto}

/* ========== ALERTS ========== */
.alert{
  padding:12px 16px;border-radius:var(--r);font-size:var(--fs-sm);display:flex;gap:12px;align-items:flex-start;margin-bottom:16px;line-height:1.55;
  border-left:3px solid;
}
.alert strong{font-weight:600}
.alert-warn{background:var(--warn-soft);color:var(--warn);border-left-color:var(--warn)}
.alert-danger{background:var(--danger-soft);color:var(--danger);border-left-color:var(--danger)}
.alert-info{background:var(--accent-soft);color:var(--accent);border-left-color:var(--accent)}
.alert-success{background:var(--success-soft);color:var(--success);border-left-color:var(--success)}

/* ========== SECTION TITLES ========== */
.sec-title{
  font-family:var(--f-serif);font-size:15px;font-weight:500;font-style:italic;
  color:var(--text-2);
  margin:28px 0 12px;display:flex;align-items:center;gap:12px;letter-spacing:-.01em;
}
.sec-title-small{color:var(--text-3)}
.sec-title::after{content:'';flex:1;height:1px;background:var(--border)}
.sec-count{
  font-family:var(--f-mono);font-size:11px;font-weight:500;
  color:var(--text-3);font-style:normal;
}

/* ========== EMPTY STATE ========== */
.empty{padding:64px 20px;text-align:center;color:var(--text-2)}
.empty-icon{
  width:56px;height:56px;margin:0 auto 16px;border-radius:50%;
  background:var(--surface-2);display:flex;align-items:center;justify-content:center;
  font-size:var(--fs-xl);color:var(--text-3);
}
.empty-title{
  font-family:var(--f-sans);font-size:var(--fs-xl);font-weight:var(--fw-semibold);font-style:italic;
  margin-bottom:8px;color:var(--text);letter-spacing:-.01em;
}
.empty-desc{font-size:13px;margin-bottom:20px;max-width:360px;margin-left:auto;margin-right:auto;line-height:1.55}

/* ========== SIMULATOR ========== */
.sim-price{
  font-family:var(--f-serif);font-size:var(--fs-display);font-weight:var(--fw-medium);
  letter-spacing:-0.04em;text-align:center;margin:18px 0 8px;
  color:var(--text);line-height:1;
}
.sim-price em{font-style:italic;color:var(--accent)}
input[type="range"]{
  -webkit-appearance:none;appearance:none;width:100%;height:6px;
  background:var(--border-2);border-radius:99px;outline:none;cursor:pointer;
}
input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance:none;appearance:none;width:22px;height:22px;
  background:var(--accent);border-radius:50%;border:3px solid var(--surface);
  box-shadow:0 2px 8px color-mix(in srgb, var(--accent) 40%, transparent);cursor:pointer;
  transition:transform .15s;
}
input[type="range"]::-webkit-slider-thumb:hover{transform:scale(1.1)}
input[type="range"]::-moz-range-thumb{
  width:22px;height:22px;background:var(--accent);border-radius:50%;
  border:3px solid var(--surface);cursor:pointer;
}
.mbar{
  height:42px;border-radius:var(--r);overflow:hidden;display:flex;margin:16px 0 8px;
  border:1px solid var(--border);
}
.mbar-cmv{
  background:linear-gradient(135deg,var(--danger),color-mix(in srgb, var(--danger) 70%, #000));
  display:flex;align-items:center;justify-content:center;color:#fff;
  font-size:12px;font-weight:600;min-width:50px;transition:width .3s var(--ease);
  font-family:var(--f-mono);letter-spacing:.02em;
}
.mbar-mg{
  background:linear-gradient(135deg,var(--success),color-mix(in srgb, var(--success) 70%, #000));
  flex:1;display:flex;align-items:center;justify-content:center;color:#fff;
  font-size:12px;font-weight:600;min-width:50px;
  font-family:var(--f-mono);letter-spacing:.02em;
}

/* ========== TOAST ========== */
.toast{
  position:fixed;bottom:32px;left:50%;transform:translateX(-50%);
  background:var(--text);color:var(--bg);
  padding:11px 22px;border-radius:99px;font-size:13px;font-weight:500;
  z-index:200;box-shadow:var(--shadow-lg);
  animation:toastIn .25s var(--ease);white-space:nowrap;
  display:flex;align-items:center;gap:8px;
}
@keyframes toastIn{from{transform:translate(-50%,16px);opacity:0}to{transform:translate(-50%,0);opacity:1}}
.toast::before{content:'✓';color:var(--accent);font-weight:700}

/* ========== SEARCH ========== */
.search-row{
  display:flex;gap:10px;margin-bottom:16px;align-items:center;flex-wrap:wrap;
  background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);
  padding:6px;box-shadow:var(--shadow-xs);
}
.search-row .input{
  flex:1;min-width:200px;border:none;box-shadow:none;background:transparent;
  padding:8px 12px;
}
.search-row .input:focus{box-shadow:none}
.search-row .select{max-width:200px;border:none;background:transparent}

/* ========== RECIPE BUILDER ========== */
.ingr-row{
  display:flex;gap:8px;align-items:center;padding:10px 0;
  border-bottom:1px solid var(--border);
}
.ingr-row:last-child{border-bottom:none}
.ingr-cost{
  font-family:var(--f-mono);font-size:var(--fs-mono-sm);font-weight:var(--fw-semibold);color:var(--money);
  min-width:70px;text-align:right;white-space:nowrap;
}

/* ========== QUICK ACTIONS ========== */
.quick-action{
  padding:20px;text-align:left;display:flex;flex-direction:column;
  align-items:flex-start;gap:6px;
  background:var(--surface);border:1px solid var(--border);
  border-radius:var(--r-lg);cursor:pointer;
  transition:all .2s var(--ease);color:var(--text);
  box-shadow:var(--shadow-xs);
  position:relative;overflow:hidden;
}
.quick-action::before{
  content:'';position:absolute;top:0;left:0;width:3px;height:0;
  background:var(--accent);transition:height .25s var(--ease);
}
.quick-action:hover{
  background:var(--surface);border-color:var(--border-2);
  box-shadow:var(--shadow);transform:translateY(-2px);
}
.quick-action:hover::before{height:100%}
.quick-action strong{font-size:15px;font-weight:600;letter-spacing:-.01em;color:var(--text)}
.quick-action span{font-size:12px;color:var(--text-2);line-height:1.5}

/* ========== DOTS ========== */
.dot{display:inline-block;width:7px;height:7px;border-radius:99px;margin-right:8px;vertical-align:middle}
.dot-success{background:var(--success)}
.dot-warn{background:var(--warn)}
.dot-danger{background:var(--danger)}
.dot-muted{background:var(--text-3)}
.dot-accent{background:var(--accent)}

/* ========== COLLAPSIBLE ========== */
details.collapsible{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);margin-bottom:10px;box-shadow:var(--shadow-xs);overflow:hidden;transition:border-color .2s}
details.collapsible[open]{border-color:var(--border-2)}
details.collapsible summary{
  padding:14px 20px;cursor:pointer;list-style:none;
  display:flex;justify-content:space-between;align-items:center;gap:12px;
  font-weight:500;
}
details.collapsible summary::-webkit-details-marker{display:none}
details.collapsible summary::after{
  content:'›';font-size:18px;color:var(--text-3);
  transition:transform .2s var(--ease);line-height:1;
}
details.collapsible[open] summary::after{transform:rotate(90deg)}
details.collapsible summary:hover{background:var(--surface-2)}

/* ========== PROGRESS BAR (margem visual) ========== */
.progress{
  width:100%;height:5px;background:var(--surface-3);border-radius:99px;overflow:hidden;
}
.progress-fill{height:100%;background:var(--success);border-radius:99px;transition:width .3s var(--ease)}
.progress-fill.warn{background:var(--warn)}
.progress-fill.danger{background:var(--danger)}

/* ========== RESPONSIVE ========== */
@media(max-width:900px){
  .metric-hero{grid-column:span 1}
  .metric-hero .metric-value{font-size:30px}
}
@media(max-width:720px){
  .hdr{padding:14px 18px}
  .hdr-title{font-size:18px}
  .hdr-sub{display:none}
  .hdr-logo{width:32px;height:32px;font-size:18px}
  main{padding:22px 16px 100px}
  .nav{top:61px;padding:0 10px}
  .nav-tab{padding:11px 12px;font-size:12px}
  .grid-auto{grid-template-columns:repeat(2,1fr)}
  .grid-3{grid-template-columns:1fr}
  .metric-value{font-size:28px}
  .metric-hero .metric-value{font-size:28px}
  .view-title{font-size:18px}
  .tbl th,.tbl td{padding:10px 12px;font-size:12px}
  .sim-price{font-size:44px}
  .field-row{flex-direction:column;gap:12px}
  .modal{max-height:95vh}
  .ingr-row{flex-wrap:wrap}
  .card-pad{padding:16px 18px}
  .card-head{padding:14px 18px}
  .modal-head,.modal-foot{padding:16px 18px}
  .modal-body{padding:18px}
}
@media(max-width:480px){
  .grid-auto{grid-template-columns:1fr}
  .hdr-status{display:none}
}

@media(max-width:720px){ .vovo-dash{ display:none !important } }
.menu-pill{
  padding:6px 14px;border-radius:99px;border:1.5px solid var(--border-2);
  background:var(--surface);color:var(--text-2);font-size:13px;font-weight:400;
  cursor:pointer;transition:all .15s;font-family:inherit;
}
.menu-pill.active{
  border-color:var(--accent);background:var(--accent);color:#fff;font-weight:600;
}
.menu-pill:hover:not(.active){
  border-color:var(--accent);color:var(--accent);
}

/* ══════════════════════════════════════════════════════════════════════
   UX/UI REFINEMENTS — Revisão completa
══════════════════════════════════════════════════════════════════════ */

/* ── Layout base — sidebar + conteúdo ── */
#app {
  display: flex;
  flex-direction: row;
  min-height: 100vh;
}

#app-shell {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; }

/* ── Header melhorado ── */
.hdr{
  height:var(--h-header);padding:0 24px;
  display:flex;justify-content:space-between;align-items:center;gap:16px;
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  backdrop-filter:saturate(200%) blur(20px);
  -webkit-backdrop-filter:saturate(200%) blur(20px);
  border-bottom:1px solid var(--border);
  position:sticky;top:0;z-index:30;
}
.hdr-logo { width: 38px; height: 38px; border-radius: 9px; background: transparent;
  display: flex; align-items: center; justify-content: center; overflow: hidden; }
.hdr-title { font-family: var(--f-serif); font-size: 20px; font-weight: 500;
  letter-spacing: -.02em; color: var(--text); }
.hdr-title em { font-style: italic; color: var(--accent); }
.hdr-right { display: flex; align-items: center; gap: 12px; }
.hdr-status {
  font-family: var(--f-mono); font-size: 11px; color: var(--success);
  display: flex; align-items: center; gap: 5px; opacity: 0;
  transition: opacity .4s; padding: 4px 10px; border-radius: 99px;
  background: var(--success-soft);
}
.hdr-status.show { opacity: 1; }
.hdr-status::before { content: ''; width: 5px; height: 5px;
  border-radius: 99px; background: currentColor; }

/* ── Nav refinada ── */
.nav {
  display: flex; gap: 0; padding: 0 22px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position:sticky;top:var(--h-header);z-index:29;
  overflow-x: auto; scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav-tab{padding:0 14px;height:var(--h-nav);display:flex;align-items:center;font-size:var(--fs-sm);font-weight:var(--fw-medium);color:var(--text-3);background:none;border:none;cursor:pointer;white-space:nowrap;position:relative;transition:color .15s var(--ease);letter-spacing:var(--ls-normal)}
.nav-tab:hover { color: var(--text-2); }
.nav-tab.active { color: var(--accent); font-weight: 600; }
.nav-tab.active::after {
  content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px;
  height: 2.5px; background: var(--accent); border-radius: 2px 2px 0 0;
}

/* ── Main content ── */
main{padding:28px 24px 100px;animation:fadeUp .3s var(--ease)}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ── View header melhorado ── */
.view-head{margin-bottom:24px;display:flex;justify-content:space-between;align-items:flex-end;gap:16px;flex-wrap:wrap;padding-bottom:20px;border-bottom:1px solid var(--border)}
.view-title {
  font-family:var(--f-sans);font-size:var(--fs-2xl);font-weight:var(--fw-semibold);
  letter-spacing:var(--ls-tight);line-height:var(--lh-tight);color:var(--text);
}
.view-title em{font-style:normal;color:var(--accent);font-weight:inherit}
.view-desc{color:var(--text-2);font-size:var(--fs-sm);margin-top:4px;max-width:560px;line-height:var(--lh-loose)}

/* ── Cards refinados ── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden; margin-bottom: 12px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.card:hover { border-color: var(--border-2); box-shadow: var(--shadow); }
.card-pad{padding:16px 20px}
.card-head {
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap; background: var(--surface-2);
}
.card-title{font-weight:var(--fw-semibold);font-size:var(--fs-md);letter-spacing:var(--ls-normal)}

/* ── Métricas revisadas ── */
.metric-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 16px 20px;
  box-shadow: var(--shadow-xs);
  transition: all .2s var(--ease);
}
.metric-card:hover { border-color: var(--border-2); box-shadow: var(--shadow); transform: translateY(-1px); }
.metric-label{font-size:var(--fs-2xs);font-weight:var(--fw-semibold);color:var(--text-3);margin-bottom:8px;letter-spacing:var(--ls-label);text-transform:uppercase}
.metric-value{font-family:var(--f-serif);font-size:var(--fs-display-sm);font-weight:var(--fw-medium);letter-spacing:var(--ls-tight);line-height:1;color:var(--text)}
.metric-value em{font-style:italic;color:var(--accent)}
.metric-sub{font-size:var(--fs-xs);color:var(--text-3);margin-top:6px;line-height:var(--lh-base)}

.metric-hero {
  padding: 22px 26px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--accent-soft) 100%); box-shadow:var(--shadow-glow);
  border-color: var(--border-2);
}
.metric-hero .metric-value{font-size:var(--fs-display)}
.metric-hero .metric-label{font-size:var(--fs-2xs)}
@media(min-width: 721px) { .metric-hero { grid-column: span 2; } }

/* ── Botões refinados ── */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:var(--h-btn);padding:0 14px;font-size:var(--fs-sm);font-weight:var(--fw-medium);border:1px solid var(--border-2);border-radius:var(--r);background:var(--surface);color:var(--text);cursor:pointer;transition:all .15s var(--ease);white-space:nowrap;letter-spacing:var(--ls-normal);-webkit-user-select:none;user-select:none}
.btn:hover { background: var(--surface-2); border-color: var(--border-3); }
.btn:active { transform: scale(.975); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-accent {
  background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600;
  box-shadow: 0 2px 12px color-mix(in srgb, var(--accent) 40%, transparent), 0 1px 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
.btn-accent:hover {
  background: var(--accent-hover); border-color: var(--accent-hover);
  box-shadow: 0 4px 20px color-mix(in srgb, var(--accent) 50%, transparent);
}
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-danger { color: var(--danger); border-color: transparent; background: transparent; }
.btn-danger:hover { background: var(--danger-soft); border-color: rgba(160,26,26,.2); }
.btn-sm{height:var(--h-btn-sm);padding:0 10px;font-size:var(--fs-xs)}
.btn-xs{height:20px;padding:0 8px;font-size:var(--fs-2xs);font-weight:var(--fw-medium)}
.btn-icon{padding:0;width:28px;height:28px;border-radius:var(--r);flex-shrink:0}

/* ── Inputs revisados ── */
.input,.select,.textarea{font-family:inherit;font-size:var(--fs-sm);height:var(--h-input);padding:0 12px;border:1px solid var(--border-2);border-radius:var(--r);background:var(--surface);color:var(--text);width:100%;transition:border-color .15s,box-shadow .15s;letter-spacing:var(--ls-normal)}
.textarea{height:auto;padding:9px 12px}
.input:hover, .select:hover { border-color: var(--border-3); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input-sm{height:28px;font-size:var(--fs-xs)}
.input-num {
  text-align: right; font-family: var(--f-mono);
  font-variant-numeric: tabular-nums; font-weight: 500;
}
.textarea { resize: vertical; min-height: 72px; line-height: 1.55; }
.select { cursor: pointer; }
.label{display:block;font-size:var(--fs-2xs);font-weight:var(--fw-semibold);color:var(--text-2);margin-bottom:5px;letter-spacing:var(--ls-label);text-transform:uppercase}
.label-req::after { content: '*'; color: var(--accent); margin-left: 2px; }
.field { margin-bottom: 18px; }
.field-help { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.field-row { display: flex; gap: 12px; }
.field-row > * { flex: 1; min-width: 0; }

/* ── Tabelas ── */
.tbl-wrap { overflow-x: auto; margin: 0 -1px; -webkit-overflow-scrolling: touch; }
.tbl{width:100%;border-collapse:collapse;font-size:var(--fs-sm)}
.tbl th{font-size:var(--fs-2xs);font-weight:var(--fw-semibold);color:var(--text-3);letter-spacing:var(--ls-meta);text-transform:uppercase;background:var(--surface-2);padding:8px 16px;border-bottom:1px solid var(--border-2);text-align:left;white-space:nowrap}
.tbl td{padding:10px 16px;height:var(--h-row);background:var(--surface);color:var(--text);border-bottom:1px solid var(--border);vertical-align:middle}
.tbl tbody tr:nth-child(even) td { background: var(--surface-2); }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--accent-soft) !important; }
.tbl-sum td {
  background: var(--surface-3) !important; font-weight: 600;
  border-top: 1.5px solid var(--border-2) !important; color: var(--text) !important;
}
.tbl input.input {
  padding: 4px 8px; font-size: 13px; max-width: 110px;
  border-color: var(--border); background: transparent;
}
.tbl input.input:focus { background: var(--surface); }

/* Data columns */
.tbl td.num, .tbl th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl td.num{font-family:var(--f-mono);font-weight:var(--fw-semibold);color:var(--money);font-size:var(--fs-mono)}
.tbl td.num-qty, .tbl th.num-qty { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl td.num-qty{font-family:var(--f-mono);font-weight:var(--fw-medium);color:var(--qty);font-size:var(--fs-mono)}
.tbl td.num-pct, .tbl th.num-pct { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl td.num-pct{font-family:var(--f-mono);font-weight:var(--fw-semibold);color:var(--pct);font-size:var(--fs-mono)}
.tbl th.num, .tbl th.num-qty, .tbl th.num-pct { font-weight: 600; color: var(--text-3); text-align: right; }
.tbl-act { text-align: right; white-space: nowrap; }

/* ── Badges ── */
.badge{display:inline-flex;align-items:center;gap:4px;font-size:var(--fs-2xs);font-weight:var(--fw-semibold);padding:2px 7px;border-radius:99px;white-space:nowrap;letter-spacing:0;line-height:1.6}
.b-success { background: var(--success-soft); color: var(--success); }
.b-warn { background: var(--warn-soft); color: var(--warn); }
.b-danger { background: var(--danger-soft); color: var(--danger); }
.b-muted { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.b-accent { background: var(--accent-soft); color: var(--accent); }
.b-mono { font-family: var(--f-mono); font-weight: 600; font-size: 11px; }

/* ── Grid ── */
.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* ── Modal melhorado ── */
.mb {
  position: fixed; inset: 0;
  background: var(--scrim);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 16px;
  animation: fadeIn .2s var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); max-width: 640px; width: 100%;
  max-height: 92vh; overflow-y: auto;
  box-shadow: var(--shadow-modal);
  animation: modalIn .25s var(--ease);
}
@keyframes modalIn {
  from { transform: translateY(12px) scale(.985); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.modal::-webkit-scrollbar { width: 6px; }
.modal::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; }
.modal-head{padding:14px 20px;border-bottom:1px solid var(--border);display:flex;justify-content:space-between;align-items:center;position:sticky;top:0;background:var(--surface);z-index:2}
.modal-title{font-family:var(--f-sans);font-size:var(--fs-xl);font-weight:var(--fw-semibold);letter-spacing:var(--ls-tight);color:var(--text);line-height:var(--lh-tight)}
.modal-body{padding:20px}
.modal-foot{padding:12px 20px;border-top:1px solid var(--border);display:flex;justify-content:flex-end;gap:8px;background:var(--surface-2);position:sticky;bottom:0;border-radius:0 0 var(--r-xl) var(--r-xl)}
.modal-foot-left { margin-right: auto; }

/* ── Alerts ── */
.alert{padding:10px 14px;border-radius:var(--r);font-size:var(--fs-sm);display:flex;gap:10px;align-items:flex-start;margin-bottom:12px;line-height:var(--lh-base);border:1px solid transparent;border-left-width:3px}
.alert strong { font-weight: 600; }
.alert-warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); border-left-color: var(--warn); }
.alert-danger { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); border-left-color: var(--danger); }
.alert-info { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 25%, transparent); border-left-color: var(--accent); }
.alert-success { background: var(--success-soft); color: #0f3d25; border-color: rgba(26,92,60,.2); border-left-color: var(--success); }

/* ── Section titles ── */
.sec-title{
  font-family:var(--f-sans);font-size:var(--fs-2xs);font-weight:var(--fw-semibold);
  color:var(--text-3);margin:28px 0 10px;
  display:flex;align-items:center;gap:10px;
  letter-spacing:var(--ls-meta);text-transform:uppercase;
}
.sec-title::after { content: ''; flex: 1; height: 1px; background: var(--border-2); }
.sec-count{font-family:var(--f-mono);font-size:var(--fs-mono-sm);font-weight:var(--fw-medium);color:var(--text-3);font-style:normal;text-transform:none;letter-spacing:0}

/* ── Empty state ── */
.empty { padding: 60px 20px; text-align: center; color: var(--text-2); }
.empty-icon {
  width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--text-3);
}
.empty-title{font-family:var(--f-sans);font-size:var(--fs-xl);font-weight:var(--fw-semibold);letter-spacing:var(--ls-tight);margin-bottom:6px;color:var(--text);line-height:var(--lh-tight)}
.empty-desc{font-size:var(--fs-sm);margin-bottom:20px;max-width:320px;margin-left:auto;margin-right:auto;line-height:var(--lh-loose);color:var(--text-2)}

/* ── Toast diferenciado por tipo ── */
.toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);padding:8px 16px;border-radius:var(--r-lg);font-size:var(--fs-sm);font-weight:var(--fw-medium);z-index:200;box-shadow:var(--shadow-lg);animation:toastIn .25s var(--ease);white-space:nowrap;display:flex;align-items:center;gap:8px;border:1px solid transparent}
@keyframes toastIn {
  from { transform: translate(-50%, 14px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}
.toast { background: var(--text); color: var(--bg); }
.toast::before { content: '✓'; color: var(--accent); font-weight: 700; }
.toast.warn { background: var(--warn-soft); color: var(--warn); border-color: rgba(154,98,0,.2); }
.toast.warn::before { content: '⚠'; color: var(--warn); }
.toast.error { background: var(--danger-soft); color: var(--danger); border-color: rgba(160,26,26,.2); }
.toast.error::before { content: '✕'; color: var(--danger); }
.toast.info { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.toast.info::before { content: 'ℹ'; color: var(--accent); }

/* ── Search row ── */
.search-row {
  display: flex; gap: 8px; margin-bottom: 14px; align-items: center; flex-wrap: wrap;
  background: var(--surface); border: 1.5px solid var(--border-2);
  border-radius: var(--r-lg); padding: 5px; box-shadow: var(--shadow-xs);
}
.search-row .input{flex:1;min-width:160px;border:none;box-shadow:none;background:transparent;padding:0 12px;font-size:var(--fs-sm);height:32px}
.search-row .input:focus { box-shadow: none; border: none; }
.search-row .select { max-width: 200px; border: 1px solid var(--border); border-radius: var(--r); }

/* ── Recipe builder ── */
.ingr-row {
  display: flex; gap: 8px; align-items: center; padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.ingr-row:last-child { border-bottom: none; }
.ingr-cost{font-family:var(--f-mono);font-size:var(--fs-mono-sm);font-weight:var(--fw-semibold);color:var(--money);min-width:68px;text-align:right;white-space:nowrap}

/* ── Quick actions ── */
.quick-action {
  padding: 18px 20px; text-align: left; display: flex; flex-direction: column;
  align-items: flex-start; gap: 5px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); cursor: pointer;
  transition: all .2s var(--ease); color: var(--text);
  box-shadow: var(--shadow-xs); position: relative; overflow: hidden;
}
.quick-action::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg,var(--accent),#b49bf0); transform: scaleX(0);
  transition: transform .25s var(--ease); transform-origin: left;
}
.quick-action:hover { border-color: var(--border-2); box-shadow: var(--shadow); transform: translateY(-2px); }
.quick-action:hover::before { transform: scaleX(1); }
.quick-action strong{font-size:var(--fs-md);font-weight:var(--fw-semibold);letter-spacing:var(--ls-normal)}
.quick-action span{font-size:var(--fs-xs);color:var(--text-2);line-height:var(--lh-base)}

/* ── Dots ── */
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 99px; flex-shrink: 0; }
.dot-success { background: var(--success); }
.dot-warn { background: var(--warn); }
.dot-danger { background: var(--danger); }
.dot-muted { background: var(--text-3); }
.dot-accent { background: var(--accent); }

/* ── Collapsible ── */
details.collapsible {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); margin-bottom: 8px;
  box-shadow: var(--shadow-xs); overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
details.collapsible[open] { border-color: var(--border-2); box-shadow: var(--shadow); }
details.collapsible summary{padding:12px 16px;cursor:pointer;list-style:none;display:flex;justify-content:space-between;align-items:center;gap:12px;font-size:var(--fs-sm);font-weight:var(--fw-medium);user-select:none;transition:background .15s}
details.collapsible summary::-webkit-details-marker { display: none; }
details.collapsible summary::after {
  content: '›'; font-size: 20px; color: var(--text-3);
  transition: transform .2s var(--ease); line-height: 1; flex-shrink: 0;
}
details.collapsible[open] summary::after { transform: rotate(90deg); }
details.collapsible summary:hover { background: var(--surface-2); }

/* ── Progress bar ── */
.progress { width: 100%; height: 5px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; transition: width .4s var(--ease); }
.progress-fill.ok { background: var(--success); }
.progress-fill.warn { background: var(--warn); }
.progress-fill.danger { background: var(--danger); }

/* ── Simulator ── */
.sim-price{font-family:var(--f-serif);font-size:var(--fs-display);font-weight:var(--fw-medium);letter-spacing:-0.04em;text-align:center;margin:14px 0 6px;color:var(--text);line-height:1}
.sim-price em { font-style: italic; color: var(--accent); }
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 5px;
  background: var(--border-2); border-radius: 99px; outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px;
  background: var(--accent); border-radius: 50%;
  border: 3px solid var(--surface); box-shadow: 0 2px 10px color-mix(in srgb, var(--accent) 55%, transparent);
  cursor: pointer; transition: transform .15s var(--ease-spring);
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }
input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px; background: var(--accent); border-radius: 50%;
  border: 3px solid var(--surface); cursor: pointer;
}
.mbar {
  height: 40px; border-radius: var(--r); overflow: hidden;
  display: flex; margin: 14px 0 8px; border: 1px solid var(--border);
}
.mbar-cmv {
  background: linear-gradient(135deg, var(--danger), color-mix(in srgb, var(--danger) 70%, #000));
  display: flex; align-items: center; justify-content: center;
  color:#fff;font-size:11px;font-weight:600;min-width:50px;
  transition: width .3s var(--ease); font-family: var(--f-mono);
}
.mbar-mg {
  background: linear-gradient(135deg, var(--success), color-mix(in srgb, var(--success) 70%, #000));
  flex: 1; display: flex; align-items: center; justify-content: center;
  color:#fff;font-size:11px;font-weight:600;min-width:50px;
  font-family: var(--f-mono);
}

/* ── Margem bar na tabela de produtos ── */
.num-pct-bar {
  display: flex; align-items: center; gap: 8px; justify-content: flex-end;
}
.num-pct-bar .bar-mini {
  width: 48px; height: 4px; background: var(--border-2);
  border-radius: 99px; overflow: hidden;
}
.num-pct-bar .bar-mini-fill { height: 100%; border-radius: 99px; }

/* ── Pills cardápio ── */
.menu-pill {
  padding: 5px 14px; border-radius: 99px; border: 1.5px solid var(--border-2);
  background: var(--surface); color: var(--text-2); font-size: 13px;
  cursor: pointer; transition: all .15s; font-family: inherit;
}
.menu-pill.active {
  border-color: var(--accent); background: var(--accent); color: #fff; font-weight: 600;
}
.menu-pill:hover:not(.active) { border-color: var(--accent); color: var(--accent); }

/* ── Confirmação ── */
.confirm-overlay {
  position: fixed; inset: 0; background: var(--scrim);
  backdrop-filter: blur(8px); z-index: 150;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.confirm-box {
  background: var(--surface); border-radius: var(--r-xl);
  max-width: 420px; width: 100%; padding: 28px;
  box-shadow: var(--shadow-modal); border: 1px solid var(--border);
  animation: modalIn .2s var(--ease);
}
.confirm-title { font-family: var(--f-serif); font-size: 20px; font-weight: 500;
  color: var(--text); margin-bottom: 10px; letter-spacing: -.02em; }
.confirm-msg { font-size: 14px; color: var(--text-2); line-height: 1.6; margin-bottom: 24px; }
.confirm-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ── Print ── */
@media print {
  .hdr, .nav, .btn, .quick-action, .search-row { display: none !important; }
  main { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; }
  body { background: white; color: black; }
}

/* ── Responsive ── */
@media(max-width: 900px) {
  .metric-hero .metric-value{font-size:32px}
}
@media(max-width: 720px) {
  .hdr { padding: 12px 16px; }
  .hdr-title { font-size:16px;}
  .hdr-sub { display: none; }
  .hdr-logo { width: 32px; height: 32px; }
  main { padding: 20px 16px 100px; }
  .nav{top:var(--h-header);padding:0 10px}
  .nav-tab { padding: 10px 12px; font-size:12px;}
  .view-title{font-size:18px}
  .view-head { padding-bottom: 16px; margin-bottom: 20px; }
  .grid-auto { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .metric-value{font-size:var(--fs-display-sm)}
  .metric-hero{padding:14px 16px}
  .metric-hero .metric-value{font-size:32px}
  .tbl th, .tbl td { padding: 9px 12px; font-size:12px;}
  .sim-price{font-size:44px}
  .field-row { flex-direction: column; }
  .modal { border-radius: var(--r-lg); max-height: 95vh; }
  .ingr-row { flex-wrap: wrap; }
  .card-pad { padding: 14px 16px; }
  .modal-head, .modal-foot { padding: 14px 18px; }
  .modal-body { padding: 16px 18px; }
  .vovo-dash { display: none !important; }
  .hdr-status { font-size: 10px; }
}
@media(max-width: 480px) {
  .grid-auto { grid-template-columns: 1fr; }
  .hdr-status { display: none; }
  .search-row { padding: 4px; }
}



/* ══════════════════════════════════════════════════════════════════
   DESIGN SYSTEM — TIPOGRAFIA COMPLETA (SaaS best practices)
   Syne (display) · DM Sans (UI) · JetBrains Mono (data)
══════════════════════════════════════════════════════════════════ */

/* ── Reset base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; text-size-adjust: 100%; }
body {
  font-family: var(--f-sans);
  font-size: var(--fs-base);
  font-weight: var(--fw-normal);
  line-height: var(--lh-normal);
  letter-spacing: var(--ls-normal);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
}
button, input, select, textarea {
  font-family: var(--f-sans);
  font-size: var(--fs-base);
}

/* ── Semantic text classes ── */
.text-display {
  font-family: var(--f-display);
  font-size: var(--fs-3xl);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
}
.text-heading-xl {
  font-family: var(--f-sans);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-snug);
}
.text-heading {
  font-family: var(--f-sans);
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-snug);
}
.text-subheading {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-snug);
}
.text-body { font-size: var(--fs-base); line-height: var(--lh-normal); }
.text-sm { font-size: var(--fs-sm); line-height: var(--lh-normal); }
.text-xs { font-size: var(--fs-xs); line-height: var(--lh-normal); }
.text-caption { font-size: var(--fs-2xs); line-height: var(--lh-normal); color: var(--text-3); }
.text-mono {
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}
.text-label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: var(--text-3);
}
.text-muted { color: var(--text-2); }
.text-accent { color: var(--accent); }
.text-money { font-family: var(--f-mono); color: var(--money); font-weight: var(--fw-semibold); }
.text-qty   { font-family: var(--f-mono); color: var(--qty);   font-weight: var(--fw-medium);  }
.text-pct   { font-family: var(--f-mono); color: var(--pct);   font-weight: var(--fw-semibold); }

/* ── Header ── */
.hdr {
  height: var(--h-xl);
  padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
}
.hdr-brand { display: flex; align-items: center; gap: 12px; }
.hdr-logo {
  width: 34px; height: 36px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; background: transparent;
}
.hdr-title {
  font-family: var(--f-display);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
  color: var(--text);
  line-height: 1;
}
.hdr-title em { font-style: normal; color: var(--accent); }
.hdr-sub {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: var(--ls-wider);
  padding: 3px 9px;
  background: var(--surface-2);
  border-radius: 99px;
  border: 1px solid var(--border);
}
.hdr-right { display: flex; align-items: center; gap: 10px; }
.hdr-status {
  font-family: var(--f-mono);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-medium);
  color: var(--success);
  display: flex; align-items: center; gap: 5px;
  opacity: 0; transition: opacity .4s;
  padding: 3px 9px; border-radius: 99px;
  background: var(--success-soft);
}
.hdr-status.show { opacity: 1; }
.hdr-status::before {
  content: ''; width: 5px; height: 5px;
  border-radius: 99px; background: currentColor; flex-shrink: 0;
}

/* ── Nav ── */
.nav {
  height: 40px;
  display: flex; gap: 0; padding: 0 24px;
  background: color-mix(in srgb, var(--surface) 97%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 48px; z-index: 29;
  overflow-x: auto; scrollbar-width: none;
  align-items: center;
}
.nav::-webkit-scrollbar { display: none; }
.nav-tab {
  height: 40px;
  padding: 0 14px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-3);
  background: none; border: none; cursor: pointer;
  white-space: nowrap; position: relative;
  transition: color .15s; letter-spacing: var(--ls-normal);
  display: flex; align-items: center;
}
.nav-tab:hover { color: var(--text-2); }
.nav-tab.active { color: var(--accent); font-weight: var(--fw-semibold); }
.nav-tab.active::after {
  content: ''; position: absolute; left: 8px; right: 8px; bottom: 0;
  height: 2px; background: var(--accent); border-radius: 2px 2px 0 0;
}

/* ── View head ── */
main { padding: 32px 28px 120px; animation: fadeUp .3s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.view-head {
  margin-bottom: 28px; padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 16px; flex-wrap: wrap;
}
.view-title {
  font-family: var(--f-display);
  font-size: var(--fs-3xl);
  font-weight: var(--fw-bold);
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--text);
  margin: 0;
}
.view-title em {
  font-style: normal;
  color: var(--accent);
  font-weight: var(--fw-bold);
}
.view-desc {
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: -0.003em;
  color: var(--text-2);
  margin-top: 8px;
  max-width: 620px;
}

/* ── Cards ── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden; margin-bottom: 10px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow .2s ease, border-color .2s ease;
}
.card:hover { border-color: var(--border-2); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card-head {
  padding: 12px 18px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap; background: var(--surface-2);
}
.card-title {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-snug);
  color: var(--text);
}
.card-sub { font-size: var(--fs-sm); color: var(--text-2); margin-top: 2px; }

/* ── Métricas ── */
.metric-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 16px 18px;
  box-shadow: var(--shadow-xs);
  transition: all .2s ease;
}
.metric-card:hover {
  border-color: rgba(107,72,212,.2);
  box-shadow: var(--shadow), 0 0 18px rgba(107,72,212,.06);
  transform: translateY(-1px);
}
.metric-label {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
}
.metric-value {
  font-family: var(--f-display);
  font-size: var(--fs-4xl);
  font-weight: var(--fw-bold);
  line-height: var(--lh-none);
  letter-spacing: var(--ls-tight);
  color: var(--text);
}
.metric-value em { font-style: normal; color: var(--accent); }
.metric-sub {
  font-size: var(--fs-xs);
  color: var(--text-3);
  margin-top: 8px;
  line-height: var(--lh-snug);
}
.metric-hero {
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border-color: var(--border-2);
  box-shadow: var(--shadow-glow);
}
.metric-hero .metric-label { font-size: var(--fs-xs); }
.metric-hero .metric-value { font-size: var(--fs-5xl); }
@media(min-width: 721px) { .metric-hero { grid-column: span 2; } }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: var(--h-md);
  padding: 0 16px;
  font-family: var(--f-sans);
  font-size: 13.5px;
  font-weight: var(--fw-semibold);
  line-height: 1;
  letter-spacing: -0.005em;
  border: 1.5px solid var(--border-2); border-radius: var(--input-radius);
  background: var(--surface); color: var(--text);
  cursor: pointer; transition: all .14s ease;
  white-space: nowrap; user-select: none;
}
/* ────────────────────────────────────────────────────────────────────
   SISTEMA DE BOTÕES — padronizado
   ────────────────────────────────────────────────────────────────────
   Variantes (hierarquia visual):
     .btn                  → secundário (border + fundo neutro)
     .btn-accent           → AÇÃO PRIMÁRIA (filled, accent)
     .btn-ghost            → terciário (transparente, sutil)
     .btn-danger           → destrutivo (vermelho, baixa ênfase)
     .btn-danger-solid     → destrutivo de confirmação (filled vermelho)
     .btn-primary          → ação primária dark (alta ênfase, usar com moderação)
   Tamanhos:
     .btn-xs               → 24px (chips, mini-actions)
     .btn-sm               → 32px (densidade alta, dentro de cards)
     .btn (default)        → 38px (padrão geral)
     .btn-lg               → 44px (CTAs principais, mobile-friendly)
   Modificadores:
     .btn-icon             → quadrado pra ícone single
     .btn-block            → 100% largura
     .is-loading           → spinner inline
   Estados:
     :hover, :focus-visible, :active, [disabled], .is-loading
   ──────────────────────────────────────────────────────────────────── */
.btn:hover:not([disabled]):not(.is-loading) {
  background: var(--surface-2);
  border-color: var(--border-3);
  color: var(--text);
}
.btn:active:not([disabled]):not(.is-loading) { transform: scale(.975); }
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn[disabled], .btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
}
.btn.is-loading {
  cursor: wait;
  pointer-events: none;
  position: relative;
  color: transparent !important;
}
.btn.is-loading::after {
  content: "";
  position: absolute; top: 50%; left: 50%;
  width: 14px; height: 14px;
  margin: -7px 0 0 -7px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  color: var(--accent);
  animation: btnSpin .7s linear infinite;
}
.btn-accent.is-loading::after { color: #fff; }
@keyframes btnSpin { to { transform: rotate(360deg); } }

/* Variante: primária com accent */
.btn-accent {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: var(--fw-semibold);
  box-shadow: 0 1px 3px color-mix(in srgb, var(--accent) 30%, transparent),
              0 2px 8px color-mix(in srgb, var(--accent) 18%, transparent);
}
.btn-accent:hover:not([disabled]):not(.is-loading) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--accent) 40%, transparent),
              0 4px 14px color-mix(in srgb, var(--accent) 25%, transparent);
  transform: translateY(-1px);
}

/* Variante: ghost (transparente) */
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
  box-shadow: none;
}
.btn-ghost:hover:not([disabled]):not(.is-loading) {
  background: var(--surface-2);
  color: var(--text);
  border-color: transparent;
}

/* Variante: danger ghost (deletar com baixa ênfase) */
.btn-danger {
  color: var(--danger);
  border-color: transparent;
  background: transparent;
  font-weight: var(--fw-medium);
}
.btn-danger:hover:not([disabled]):not(.is-loading) {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 25%, transparent);
}

/* Variante: danger sólido (confirmar exclusão) */
.btn-danger-solid {
  background: var(--danger);
  color: var(--bg);
  border-color: var(--danger);
  font-weight: var(--fw-semibold);
}
.btn-danger-solid:hover:not([disabled]):not(.is-loading) {
  background: color-mix(in srgb, var(--danger) 85%, #000);
  border-color: color-mix(in srgb, var(--danger) 85%, #000);
  color: var(--bg);
}

/* Variante: success */
.btn-success {
  background: var(--success);
  color: var(--bg);
  border-color: var(--success);
  font-weight: var(--fw-semibold);
}
.btn-success:hover:not([disabled]):not(.is-loading) {
  background: color-mix(in srgb, var(--success) 85%, #000);
  border-color: color-mix(in srgb, var(--success) 85%, #000);
}

/* Tamanhos */
.btn-xs { height: 24px; padding: 0 9px; font-size: var(--fs-2xs); font-weight: var(--fw-semibold); border-radius: var(--r-sm); }
.btn-sm { height: var(--h-sm); padding: 0 13px; font-size: 12.5px; border-radius: var(--r); }
.btn-lg { height: 44px; padding: 0 20px; font-size: var(--fs-base); font-weight: var(--fw-semibold); }

/* Modificadores */
.btn-icon { width: var(--h-md); height: var(--h-md); padding: 0; border-radius: var(--r); }
.btn-icon.btn-sm { width: var(--h-sm); height: var(--h-sm); }
.btn-icon.btn-xs { width: 24px; height: 24px; }
.btn-block { width: 100%; }

/* Botão dentro de input group (sem border-radius duplicado) */
.btn-group { display: inline-flex; gap: 0; }
.btn-group .btn:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; }
.btn-group .btn:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }

/* Botão "travado" — mostra que ação existe mas usuário não tem permissão */
.btn-locked {
  opacity: .55;
  cursor: not-allowed;
  border-style: dashed;
  background: transparent;
  color: var(--text-3);
  font-style: italic;
}

/* Chip — botões pequenos sugestivos (ex: prompts de chat, atalhos) */
.btn-chip {
  height: auto;
  padding: 6px 12px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-normal);
  border-radius: 99px;
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text-2);
  white-space: normal;
  text-align: left;
  margin: 3px;
}
.btn-chip:hover:not([disabled]):not(.is-loading) {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* ────────────────────────────────────────────────────────────────────
   SISTEMA DE INPUTS — tipografia respirável e legível
   ──────────────────────────────────────────────────────────────────── */
.input, .select, .textarea {
  display: block;
  width: 100%;
  height: var(--h-md);
  padding: var(--input-padding-y) var(--input-padding-x);
  font-family: var(--f-sans);
  font-size: var(--input-font-size);
  font-weight: var(--fw-regular);
  font-feature-settings: var(--input-font-feature);
  letter-spacing: -0.005em;
  line-height: 1;
  color: var(--text);
  background: var(--surface);
  border: var(--input-border-width) solid var(--border-2);
  border-radius: var(--input-radius);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text) 2%, transparent);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
  appearance: none;
  -webkit-appearance: none;
}
.input::placeholder, .textarea::placeholder {
  color: var(--text-3);
  font-weight: var(--fw-regular);
  opacity: .85;
}
.input:hover:not([disabled]):not(:focus),
.select:hover:not([disabled]):not(:focus),
.textarea:hover:not([disabled]):not(:focus) {
  border-color: var(--border-3);
  background: color-mix(in srgb, var(--surface) 96%, var(--text));
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft),
              inset 0 1px 0 color-mix(in srgb, var(--text) 2%, transparent);
  background: var(--surface);
}
.input:disabled, .select:disabled, .textarea:disabled {
  opacity: .55;
  cursor: not-allowed;
  background: var(--surface-2);
}

/* Textarea — leitura confortável (line-height generoso) */
.textarea {
  height: auto;
  padding: var(--input-textarea-padding);
  min-height: 88px;
  line-height: 1.55;
  resize: vertical;
}

/* Tamanho compacto pra densidade alta */
.input-sm, .select.input-sm {
  height: var(--h-sm);
  padding: 0 11px;
  font-size: 13.5px;
  border-radius: var(--r);
}

/* Inputs numéricos — tabular nums + monospace, alinhado à direita */
.input-num {
  text-align: right;
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
  font-weight: var(--fw-medium);
  letter-spacing: 0;
  padding-right: 12px;
}

.select {
  cursor: pointer;
  /* seta customizada melhor que default do browser */
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%),
                    linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
}
.select:focus {
  background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%),
                    linear-gradient(135deg, var(--accent) 50%, transparent 50%);
}

/* Esconde os spinners feios do input number nos browsers */
.input-num::-webkit-outer-spin-button,
.input-num::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.input-num[type=number] { -moz-appearance: textfield; }

/* ── Labels e fields ── */
.label {
  display: block;
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 7px;
  line-height: 1.2;
}
.label-req::after {
  content: ' *';
  color: var(--accent);
  font-weight: var(--fw-bold);
}
.field { margin-bottom: 18px; }
.field-help {
  font-size: 12.5px;
  color: var(--text-3);
  margin-top: 7px;
  line-height: 1.5;
  letter-spacing: -0.002em;
}
.field-row { display: flex; gap: 14px; }
.field-row > * { flex: 1; min-width: 0; }

/* Em mobile: font-size 16px nos inputs pra prevenir zoom automático do iOS */
@media(max-width: 768px) {
  .input, .select, .textarea { font-size: 16px; }
  .input-sm { font-size: 14.5px; }
}

/* ── Tables ── */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  font-family: var(--f-sans);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: var(--text-3);
  background: var(--surface-2);
  padding: 9px 14px;
  border-bottom: 1.5px solid var(--border-2);
  text-align: left; white-space: nowrap;
}
.tbl td {
  font-size: var(--fs-sm);
  padding: 10px 14px;
  background: var(--surface);
  color: var(--text);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  line-height: var(--lh-snug);
}
.tbl td strong { font-weight: var(--fw-semibold); font-size: var(--fs-base); }
.tbl tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--accent) 4%, var(--surface)); }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--accent-soft) !important; }
.tbl-sum td {
  background: var(--surface-3) !important;
  font-size: var(--fs-base); font-weight: var(--fw-semibold);
  border-top: 1.5px solid var(--border-2) !important;
}
.tbl input.input {
  height: 30px; max-width: 110px;
  background: transparent; border-color: var(--border);
}
.tbl input.input:focus { background: var(--surface); border-color: var(--accent); }

/* Numeric cols */
.tbl td.num, .tbl th.num,
.tbl td.num-qty, .tbl th.num-qty,
.tbl td.num-pct, .tbl th.num-pct { text-align: right; white-space: nowrap; }
.tbl td.num     { font-family: var(--f-mono); font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--money); font-variant-numeric: tabular-nums; }
.tbl td.num-qty { font-family: var(--f-mono); font-size: var(--fs-sm); font-weight: var(--fw-medium);   color: var(--qty);   font-variant-numeric: tabular-nums; }
.tbl td.num-pct { font-family: var(--f-mono); font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--pct);   font-variant-numeric: tabular-nums; }
.tbl th.num, .tbl th.num-qty, .tbl th.num-pct { font-family: var(--f-sans); font-weight: var(--fw-semibold); color: var(--text-3); }
.tbl-act { text-align: right; white-space: nowrap; }

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--fs-2xs); font-weight: var(--fw-semibold);
  letter-spacing: .01em;
  padding: 2px 8px; border-radius: 99px; white-space: nowrap; line-height: 1.5;
}
.b-success { background: var(--success-soft); color: var(--success); }
.b-warn    { background: var(--warn-soft);    color: var(--warn); }
.b-danger  { background: var(--danger-soft);  color: var(--danger); }
.b-muted   { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border-2); }
.b-accent  { background: var(--accent-soft); color: var(--accent); }
.b-mono    { font-family: var(--f-mono); font-weight: var(--fw-semibold); font-size: var(--fs-2xs); font-variant-numeric: tabular-nums; }
.badge.b-success, .badge.b-warn, .badge.b-danger { font-variant-numeric: tabular-nums; }
.num, .num-qty, .num-pct, .ingr-cost, .metric-value { font-variant-numeric: tabular-nums; }

/* ── Grid ── */
.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(188px, 1fr)); }

/* ── Modal ── */
.mb {
  position: fixed; inset: 0;
  background: rgba(20,10,50,.32);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 16px;
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--r-xl); max-width: 640px; width: 100%;
  max-height: 92vh; overflow-y: auto;
  box-shadow: var(--shadow-modal);
  animation: modalIn .22s cubic-bezier(.34,1.2,.64,1);
}
@keyframes modalIn { from { transform: translateY(10px) scale(.982); opacity: 0; } to { transform: none; opacity: 1; } }
.modal::-webkit-scrollbar { width: 5px; }
.modal::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; }
.modal-head {
  padding: 16px 22px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: 0; background: var(--surface-2); z-index: 2;
}
.modal-title {
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-snug);
  color: var(--text);
  line-height: var(--lh-snug);
}
.modal-body { padding: 20px 22px; }
.modal-foot {
  padding: 14px 22px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
  background: var(--surface-2); position: sticky; bottom: 0;
}
.modal-foot-left { margin-right: auto; }

/* ── Alerts ── */
.alert {
  padding: 11px 14px; border-radius: var(--r);
  font-size: var(--fs-sm); font-weight: var(--fw-normal);
  line-height: var(--lh-relaxed);
  display: flex; gap: 10px; align-items: flex-start;
  margin-bottom: 14px;
  border: 1px solid transparent; border-left-width: 3px;
}
.alert strong { font-weight: var(--fw-semibold); }
.alert-warn    { background: var(--warn-soft);    color: var(--warn);    border-color: color-mix(in srgb, var(--warn) 25%, transparent);    border-left-color: var(--warn); }
.alert-danger  { background: var(--danger-soft);  color: var(--danger);  border-color: color-mix(in srgb, var(--danger) 25%, transparent);  border-left-color: var(--danger); }
.alert-info    { background: var(--accent-soft);  color: var(--accent);  border-color: color-mix(in srgb, var(--accent) 25%, transparent);  border-left-color: var(--accent); }
.alert-success { background: var(--success-soft); color: #0d4025; border-color: rgba(26,107,69,.2);   border-left-color: var(--success); }

/* ── Section titles ── */
.sec-title {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: var(--text-3);
  margin: 28px 0 10px;
  display: flex; align-items: center; gap: 10px;
}
.sec-title::after { content: ''; flex: 1; height: 1px; background: var(--border-2); }
.sec-count { font-family: var(--f-mono); font-size: var(--fs-2xs); font-weight: var(--fw-medium); color: var(--text-3); }

/* ── Empty state ── */
.empty { padding: 56px 20px; text-align: center; color: var(--text-2); }
.empty-icon {
  width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: var(--text-3);
}
.empty-title {
  font-family: var(--f-display);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-snug);
  color: var(--text); margin-bottom: 8px;
}
.empty-desc {
  font-size: var(--fs-sm); color: var(--text-2);
  margin-bottom: 20px; line-height: var(--lh-relaxed);
  max-width: 320px; margin-left: auto; margin-right: auto;
}

/* ── Toast ── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  padding: 9px 18px; border-radius: var(--r-lg);
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  z-index: 200; box-shadow: var(--shadow-lg);
  animation: toastIn .22s ease; white-space: nowrap;
  display: flex; align-items: center; gap: 8px;
  border: 1px solid transparent; max-width: 90vw;
}
@keyframes toastIn { from { transform: translate(-50%, 12px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.toast { background: var(--surface-3); color: var(--text); border-color: var(--border-2); }
.toast::before { content: '✓'; color: var(--accent); font-weight: 800; }
.toast.warn  { background: var(--warn-soft);    color: var(--warn);    border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.toast.warn::before  { content: '!'; }
.toast.error { background: var(--danger-soft);  color: var(--danger);  border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.toast.error::before { content: '✕'; }
.toast.info  { background: var(--accent-soft);  color: var(--accent);  border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.toast.info::before  { content: 'i'; }

/* ── Search ── */
.search-row {
  display: flex; gap: 8px; margin-bottom: 14px;
  align-items: center; flex-wrap: wrap;
  background: var(--surface); border: 1.5px solid var(--border-2);
  border-radius: var(--r-lg); padding: 5px;
  box-shadow: var(--shadow-xs);
  transition: border-color .15s, box-shadow .15s;
}
.search-row:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-row .input {
  flex: 1; min-width: 180px; height: 36px;
  border: none; box-shadow: none; background: transparent;
  padding: 0 12px; font-size: var(--fs-base);
}
.search-row .input:focus { box-shadow: none; border: none; }
.search-row .select { height: 30px; max-width: 200px; font-size: var(--fs-sm); border: 1px solid var(--border); background: var(--surface-2); }

/* ── Recipe builder ── */
.ingr-row {
  display: flex; gap: 8px; align-items: center;
  padding: 9px 0; border-bottom: 1px solid var(--border);
}
.ingr-row:last-child { border-bottom: none; }
.ingr-cost {
  font-family: var(--f-mono); font-size: var(--fs-sm);
  font-weight: var(--fw-semibold); color: var(--money);
  min-width: 70px; text-align: right; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ── Quick actions ── */
.quick-action {
  padding: 16px 18px; text-align: left;
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); cursor: pointer;
  transition: all .18s ease; color: var(--text);
  box-shadow: var(--shadow-xs); position: relative; overflow: hidden;
}
.quick-action::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--accent); transform: scaleX(0) translateZ(0);
  transition: transform .22s ease; transform-origin: left;
}
.quick-action:hover { border-color: rgba(107,72,212,.22); box-shadow: var(--shadow), 0 0 14px rgba(107,72,212,.07); transform: translateY(-1px); }
.quick-action:hover::before { transform: scaleX(1) translateZ(0); }
.quick-action strong { font-size: var(--fs-md); font-weight: var(--fw-semibold); letter-spacing: var(--ls-normal); }
.quick-action span { font-size: var(--fs-xs); color: var(--text-2); line-height: var(--lh-relaxed); }

/* ── Dots ── */
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 99px; flex-shrink: 0; }
.dot-success { background: var(--success); } .dot-warn { background: var(--warn); }
.dot-danger  { background: var(--danger); }  .dot-muted { background: var(--text-3); }
.dot-accent  { background: var(--accent); }

/* ── Collapsible ── */
details.collapsible {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); margin-bottom: 8px;
  box-shadow: var(--shadow-xs); overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
details.collapsible[open] {
  border-color: rgba(107,72,212,.22);
  box-shadow: var(--shadow), 0 0 16px rgba(107,72,212,.05);
}
details.collapsible summary {
  height: 52px; padding: 0 18px;
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  user-select: none; transition: background .14s;
}
details.collapsible summary::-webkit-details-marker { display: none; }
details.collapsible summary::after {
  content: '›'; font-size: 18px; color: var(--text-3);
  transition: transform .2s ease; line-height: 1; flex-shrink: 0;
}
details.collapsible[open] summary::after { transform: rotate(90deg); }
details.collapsible summary:hover { background: var(--surface-2); }

/* ── Progress ── */
.progress { width: 100%; height: 4px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; transition: width .4s ease; }
.progress-fill.ok { background: var(--success); } .progress-fill.warn { background: var(--warn); }
.progress-fill.danger { background: var(--danger); }

/* ── Simulator ── */
.sim-price {
  font-family: var(--f-display);
  font-size: var(--fs-display);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
  text-align: center; line-height: 1;
  color: var(--text); margin: 16px 0 8px;
}
.sim-price em { font-style: normal; color: var(--accent); }
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 4px;
  background: var(--surface-3); border-radius: 99px; outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px;
  background: var(--accent); border-radius: 50%;
  border: 2.5px solid var(--surface); cursor: pointer;
  box-shadow: 0 2px 8px rgba(107,72,212,.35);
  transition: transform .15s cubic-bezier(.34,1.56,.64,1);
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }
.mbar {
  height: 38px; border-radius: var(--r); overflow: hidden;
  display: flex; margin: 12px 0 8px; border: 1px solid var(--border);
}
.mbar-cmv {
  background: linear-gradient(135deg, var(--danger), color-mix(in srgb, var(--danger) 70%, #000));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: var(--f-mono); font-size: var(--fs-xs);
  font-weight: var(--fw-semibold); min-width: 50px; transition: width .3s ease;
}
.mbar-mg {
  background: linear-gradient(135deg, var(--success), color-mix(in srgb, var(--success) 70%, #000));
  flex: 1; display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: var(--f-mono); font-size: var(--fs-xs);
  font-weight: var(--fw-semibold); min-width: 50px;
}

/* ── Pills ── */
.menu-pill {
  padding: 0 14px; height: var(--h-sm);
  border-radius: 99px; border: 1.5px solid var(--border-2);
  background: var(--surface); color: var(--text-2);
  font-size: var(--fs-sm); font-weight: var(--fw-medium);
  cursor: pointer; transition: all .14s; font-family: var(--f-sans);
  display: inline-flex; align-items: center;
}
.menu-pill.active {
  border-color: var(--accent); background: var(--accent); color: #fff;
  font-weight: var(--fw-semibold);
}
.menu-pill:hover:not(.active) { border-color: var(--accent); color: var(--accent); }

/* ── Scrollbar global ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; }

/* ══════════════════════════════════════════════════════════════════════
   TEMAS — override de CSS variables via body[data-theme="X"]
   Pra criar um tema novo: copia um bloco abaixo e troca as cores.
   ══════════════════════════════════════════════════════════════════════ */

/* ── TEMA: Stellar Dark — versão escura do tema padrão ── */
body[data-theme="stellar-dark"] {
  --bg:#15101f;
  --bg-2:#1c1530;
  --surface:#1e1733;
  --surface-2:#251c3d;
  --surface-3:#2e2249;
  --border:rgba(180,150,240,.18);
  --border-2:rgba(180,150,240,.20);
  --border-3:rgba(180,150,240,.34);
  --text:#ede9f7;
  --text-2:#bbb0d8;
  --text-3:#a89cd0;
  --accent:#8a6fe8;
  --accent-hover:#a489f0;
  --accent-soft:rgba(138,111,232,.18);
  --accent-softer:rgba(138,111,232,.10);
  --money:#52d4a0;       --money-bg:rgba(82,212,160,.12);
  --qty:#5bb4f8;         --qty-bg:rgba(91,180,248,.12);
  --pct:#c19af0;         --pct-bg:rgba(193,154,240,.12);
  --success:#52d4a0;     --success-soft:rgba(82,212,160,.14);
  --warn:#f0b955;        --warn-soft:rgba(240,185,85,.14);
  --danger:#ff7070;      --danger-soft:rgba(255,112,112,.14);
  --shadow-xs:0 1px 2px rgba(0,0,0,.4),0 0 0 1px rgba(255,255,255,.04);
  --shadow-sm:0 2px 6px rgba(0,0,0,.5),0 1px 2px rgba(0,0,0,.4);
  --shadow:0 4px 16px rgba(0,0,0,.55),0 1px 4px rgba(0,0,0,.4);
  --shadow-md:0 8px 24px rgba(0,0,0,.6),0 2px 8px rgba(0,0,0,.45);
  --shadow-lg:0 16px 40px rgba(0,0,0,.65),0 4px 12px rgba(0,0,0,.5);
  --shadow-modal:0 24px 60px rgba(0,0,0,.7),0 8px 24px rgba(0,0,0,.55);
  --shadow-glow:0 0 0 3px var(--accent-soft);
  --scrim:rgba(0,0,0,.72);
}

/* ── TEMA: Bistrot — tons quentes, cara de bar/restô aconchegante ── */
body[data-theme="bistrot"] {
  --bg:#faf6f1;
  --bg-2:#f4ecdf;
  --surface:#ffffff;
  --surface-2:#f7efe2;
  --surface-3:#f0e4ce;
  --border:rgba(160,90,40,.16);
  --border-2:rgba(160,90,40,.20);
  --border-3:rgba(160,90,40,.34);
  --text:#2a1f15;
  --text-2:#5c4938;
  --text-3:#7e6c54;
  --accent:#b8512c;
  --accent-hover:#9c3f1f;
  --accent-soft:rgba(184,81,44,.12);
  --accent-softer:rgba(184,81,44,.06);
  --money:#2d6b3a;       --money-bg:rgba(45,107,58,.10);
  --qty:#2a5285;         --qty-bg:rgba(42,82,133,.10);
  --pct:#7a4520;         --pct-bg:rgba(122,69,32,.10);
  --success:#2d6b3a;     --success-soft:rgba(45,107,58,.12);
  --warn:#a86200;        --warn-soft:rgba(168,98,0,.12);
  --danger:#a01818;      --danger-soft:rgba(160,24,24,.10);
  --shadow-xs:0 1px 2px rgba(120,60,20,.08),0 0 0 1px rgba(120,60,20,.04);
  --shadow-sm:0 2px 6px rgba(120,60,20,.10),0 1px 2px rgba(120,60,20,.06);
  --shadow:0 4px 16px rgba(120,60,20,.12),0 1px 4px rgba(120,60,20,.07);
  --shadow-md:0 8px 24px rgba(120,60,20,.14),0 2px 8px rgba(120,60,20,.08);
  --shadow-lg:0 16px 40px rgba(120,60,20,.16),0 4px 12px rgba(120,60,20,.09);
  --shadow-modal:0 24px 60px rgba(60,30,10,.22),0 8px 24px rgba(120,60,20,.12);
  --shadow-glow:0 0 0 3px var(--accent-soft);
  --scrim:rgba(35,20,10,.55);
}

/* ── TEMA: Espresso — escuro + caramelo, vibe cafeteria noturna ── */
body[data-theme="espresso"] {
  --bg:#1a120c;
  --bg-2:#221912;
  --surface:#251c14;
  --surface-2:#2f2418;
  --surface-3:#3a2c1e;
  --border:rgba(220,170,100,.18);
  --border-2:rgba(220,170,100,.20);
  --border-3:rgba(220,170,100,.34);
  --text:#f5e8d4;
  --text-2:#cbb89a;
  --text-3:#b59c7d;
  --accent:#d4a26a;
  --accent-hover:#e5b884;
  --accent-soft:rgba(212,162,106,.18);
  --accent-softer:rgba(212,162,106,.10);
  --money:#7ed694;       --money-bg:rgba(126,214,148,.14);
  --qty:#8fc8f5;         --qty-bg:rgba(143,200,245,.14);
  --pct:#e8b46e;         --pct-bg:rgba(232,180,110,.14);
  --success:#7ed694;     --success-soft:rgba(126,214,148,.14);
  --warn:#f0b955;        --warn-soft:rgba(240,185,85,.14);
  --danger:#ff8080;      --danger-soft:rgba(255,128,128,.14);
  --shadow-xs:0 1px 2px rgba(0,0,0,.5),0 0 0 1px rgba(255,255,255,.04);
  --shadow-sm:0 2px 6px rgba(0,0,0,.55),0 1px 2px rgba(0,0,0,.4);
  --shadow:0 4px 16px rgba(0,0,0,.6),0 1px 4px rgba(0,0,0,.5);
  --shadow-md:0 8px 24px rgba(0,0,0,.65),0 2px 8px rgba(0,0,0,.5);
  --shadow-lg:0 16px 40px rgba(0,0,0,.7),0 4px 12px rgba(0,0,0,.55);
  --shadow-modal:0 24px 60px rgba(0,0,0,.75),0 8px 24px rgba(0,0,0,.6);
  --shadow-glow:0 0 0 3px var(--accent-soft);
  --scrim:rgba(0,0,0,.75);
}

/* ── TEMA: Nave-Mãe — galáctico neon, central de comando espacial ── */
body[data-theme="nave-mae"] {
  --bg:#0a0a18;
  --bg-2:#0e0e22;
  --surface:#14142e;
  --surface-2:#1c1c3d;
  --surface-3:#26264f;
  --border:rgba(140,150,255,.16);
  --border-2:rgba(140,150,255,.21);
  --border-3:rgba(160,120,255,.38);
  --text:#e9ebfb;
  --text-2:#b4b8e0;
  --text-3:#8a8fc4;
  --accent:#a06bff;
  --accent-hover:#b78fff;
  --accent-soft:rgba(160,107,255,.18);
  --accent-softer:rgba(160,107,255,.10);
  --money:#36e8b0;       --money-bg:rgba(54,232,176,.13);
  --qty:#4fb8ff;         --qty-bg:rgba(79,184,255,.13);
  --pct:#c79bff;         --pct-bg:rgba(199,155,255,.13);
  --success:#36e8b0;     --success-soft:rgba(54,232,176,.15);
  --warn:#ffc94d;        --warn-soft:rgba(255,201,77,.15);
  --danger:#ff6b8e;      --danger-soft:rgba(255,107,142,.15);
  --shadow-xs:0 1px 2px rgba(0,0,0,.5),0 0 0 1px rgba(160,107,255,.07);
  --shadow-sm:0 2px 8px rgba(0,0,0,.55),0 1px 2px rgba(0,0,0,.4);
  --shadow:0 4px 18px rgba(0,0,0,.6),0 0 24px rgba(160,107,255,.06);
  --shadow-md:0 8px 28px rgba(0,0,0,.65),0 0 32px rgba(160,107,255,.08);
  --shadow-lg:0 16px 44px rgba(0,0,0,.7),0 0 40px rgba(160,107,255,.10);
  --shadow-modal:0 24px 64px rgba(0,0,0,.78),0 0 60px rgba(160,107,255,.12);
  --shadow-glow:0 0 0 3px var(--accent-soft);
  --scrim:rgba(3,3,14,.80);
}

/* ══════════════════════════════════════════════════════════════════════
   MÓDULO FINANCEIRO
   ══════════════════════════════════════════════════════════════════════ */
.fin-toolbar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;margin:18px 0 14px}
.fin-mesnav{display:flex;align-items:center;gap:4px;background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);padding:3px}
.fin-mesnav button{width:30px;height:30px;border-radius:var(--r-md);font-size:13px;color:var(--text-2)}
.fin-mesnav button:hover{background:var(--surface-2);color:var(--text)}
.fin-mesnav .fin-mes-label{font-weight:var(--fw-semibold);font-size:13.5px;min-width:128px;text-align:center}
.fin-mesnav .fin-hoje{width:auto;padding:0 10px;font-size:11.5px;font-weight:var(--fw-semibold);color:var(--accent)}

.fin-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(168px,1fr));gap:12px;margin-bottom:16px}
.fin-stat{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);padding:14px 15px}
.fin-stat-label{font-size:10.5px;color:var(--text-3);text-transform:uppercase;letter-spacing:.06em;display:flex;align-items:center;gap:5px}
.fin-stat-value{font-size:23px;font-weight:var(--fw-bold);margin-top:5px;line-height:1.1;font-variant-numeric:tabular-nums}
.fin-stat-sub{font-size:11px;color:var(--text-3);margin-top:3px}
.fin-stat-bar{height:5px;border-radius:99px;background:var(--surface-2);margin-top:9px;overflow:hidden}
.fin-stat-bar>div{height:100%;border-radius:99px;transition:width .4s var(--ease)}

.fin-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(290px,1fr));gap:14px}
.fin-panel{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);padding:15px 16px}
.fin-panel-title{font-weight:var(--fw-semibold);font-size:13px;margin-bottom:10px;display:flex;align-items:center;gap:7px}

.fin-list{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);overflow:hidden}
.fin-row{display:flex;align-items:center;gap:12px;padding:11px 14px;border-bottom:1px solid var(--border);transition:background .12s}
.fin-row:last-child{border-bottom:none}
.fin-row:hover{background:var(--surface-2)}
.fin-ico{width:36px;height:36px;border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:17px;flex-shrink:0;background:var(--surface-2)}
.fin-row-main{flex:1;min-width:0}
.fin-row-nome{font-size:13.5px;font-weight:var(--fw-medium);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fin-row-meta{font-size:11.5px;color:var(--text-3);margin-top:1px}
.fin-row-val{text-align:right;flex-shrink:0;font-variant-numeric:tabular-nums}
.fin-row-acoes{display:flex;gap:5px;flex-shrink:0}

.fin-pill{font-size:9.5px;font-weight:var(--fw-bold);text-transform:uppercase;letter-spacing:.05em;padding:3px 8px;border-radius:99px;white-space:nowrap;display:inline-block}
.fin-pill.pago{background:rgba(31,157,87,.14);color:#1f9d57}
.fin-pill.atrasado{background:rgba(192,57,43,.14);color:#e0584a}
.fin-pill.pendente{background:rgba(184,134,11,.16);color:#d3a02a}

.fin-sec-head{display:flex;align-items:center;gap:9px;font-size:11px;font-weight:var(--fw-bold);color:var(--text-3);margin:18px 2px 8px;text-transform:uppercase;letter-spacing:.06em}
.fin-sec-head::after{content:"";flex:1;height:1px;background:var(--border)}
.fin-sec-head:first-child{margin-top:4px}

.fin-alert{display:flex;align-items:center;gap:10px;border-radius:var(--r-lg);padding:11px 14px;font-size:12.5px;margin-bottom:12px}
.fin-alert.danger{background:rgba(192,57,43,.10);border:1px solid rgba(192,57,43,.28);color:#e0584a}
.fin-alert.warn{background:rgba(184,134,11,.10);border:1px solid rgba(184,134,11,.30);color:#d3a02a}
.fin-alert .fin-alert-act{margin-left:auto;flex-shrink:0}

.fin-catbar{margin-bottom:9px}
.fin-catbar-top{display:flex;justify-content:space-between;font-size:12px;margin-bottom:4px;align-items:center;gap:8px}
.fin-catbar-track{height:7px;background:var(--surface-2);border-radius:99px;overflow:hidden}
.fin-catbar-track>div{height:100%;border-radius:99px;background:var(--accent)}

/* ── Feedback visual de save ── */
@keyframes flashSaved {
  0%   { background: var(--success-soft); box-shadow: 0 0 0 2px var(--success); }
  100% { background: transparent; box-shadow: 0 0 0 0 transparent; }
}
.flash-saved {
  animation: flashSaved 1.2s ease-out;
}
.status-synced { color: var(--success); font-weight: 600; }
.status-pending { color: var(--warn); font-weight: 500; }

/* ── Permissões por role ── */
/* Botões de ação são removidos via JS (helpers roleBtnNovo/Editar/Excluir/Salvar).
   CSS aqui só trata: desabilitar inputs (defesa em profundidade) e banner visual. */
body[data-role="viewer"] .input,
body[data-role="viewer"] .input-num,
body[data-role="viewer"] .select,
body[data-role="viewer"] .textarea {
  pointer-events: none;
  background: var(--surface-2);
  opacity: .85;
}
/* Banner permanente no topo pra viewer não esquecer que está em modo leitura */
body[data-role="viewer"] #app::before {
  content: "👁 MODO CONSULTA — você não pode editar. Faça logout e entre como Gerente ou Admin para alterar dados.";
  display: block;
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 600;
  padding: 8px 16px;
  text-align: center;
  letter-spacing: .02em;
  border-bottom: 2px solid var(--accent);
}

/* ── Responsive ── */
@media(max-width: 900px) {
  .metric-hero .metric-value { font-size: var(--fs-5xl); }
}
@media(max-width: 720px) {
  .hdr { padding: 10px 14px; gap: 10px; }
  .hdr-title { font-size: var(--fs-md); }
  .hdr-sub { display: none; }
  .hdr-logo { width: 36px; height: 36px; }
  .nav { padding: 0 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
  .nav::-webkit-scrollbar { height: 2px; }
  .nav-tab { height: 38px; padding: 0 10px; font-size: var(--fs-xs); flex: 0 0 auto; }
  main { padding: 20px 16px 100px; }
  .view-title { font-size: var(--fs-2xl); }
  .view-head { padding-bottom: 16px; margin-bottom: 20px; flex-wrap: wrap; }
  .grid-auto { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .metric-value { font-size: var(--fs-3xl); }
  .metric-hero { padding: 14px 16px; }
  .metric-hero .metric-value { font-size: var(--fs-4xl); }
  .sim-price { font-size: 44px; }
  .field-row { flex-direction: column; }
  .modal { border-radius: var(--r-lg); max-height: 92vh; }
  .ingr-row { flex-wrap: wrap; }
  .tbl th, .tbl td { padding: 9px 11px; }
  .vovo-dash { display: none !important; }
  .hdr-status { font-size: 10px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* Esconde nome de usuário em telas pequenas — só ícone de sair */
  #hdr-user { display: none; }
}
@media(max-width: 480px) {
  .grid-auto { grid-template-columns: 1fr; }
  .hdr-status { display: none; }
  .hdr { padding: 8px 10px; }
  .hdr-logo { width: 32px; height: 32px; }
  /* Hint visual de que tabela rola horizontal */
  .tbl-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* sombra interna pra indicar mais conteúdo à direita */
    background: linear-gradient(to right, var(--surface) 30%, transparent),
                linear-gradient(to right, transparent, var(--surface) 70%) 100% 0,
                linear-gradient(to right, color-mix(in srgb, var(--accent) 12%, transparent), transparent),
                linear-gradient(to right, transparent, color-mix(in srgb, var(--accent) 12%, transparent)) 100% 0;
    background-repeat: no-repeat;
    background-size: 20px 100%, 20px 100%, 10px 100%, 10px 100%;
    background-attachment: local, local, scroll, scroll;
  }
  .tbl { min-width: 580px; }
  .tbl th, .tbl td { padding: 7px 9px; font-size: var(--fs-sm); }
  .view-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .view-head .btn { width: 100%; }
  /* Modais ocupam toda a tela em mobile pequeno pra evitar scroll horizontal */
  .modal { width: 100%; max-width: 100%; border-radius: 0; max-height: 100vh; min-height: 100vh; }
  .modal-body { padding: 14px 16px; }
  .modal-foot { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .modal-foot .btn { flex: 1; min-width: 0; }
  .modal-foot-left { order: 99; width: 100%; }
}
@media print {
  .hdr, .nav, .btn, .quick-action, .search-row { display: none !important; }
  main { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ── Markdown rendering no chat do assistente ────────────────────── */
.msg-ai h1, .msg-ai h2, .msg-ai h3, .msg-ai h4 {
  margin: 12px 0 6px;
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  color: var(--text);
}
.msg-ai h1 { font-size: 17px; }
.msg-ai h2 { font-size: 15px; }
.msg-ai h3, .msg-ai h4 { font-size: 14px; }
.msg-ai p { margin: 4px 0; }
.msg-ai strong { font-weight: var(--fw-bold); color: var(--text); }
.msg-ai em { font-style: italic; }
.msg-ai code {
  background: rgba(80,50,160,.08);
  border-radius: 3px;
  padding: 1px 5px;
  font-family: var(--f-mono);
  font-size: 12.5px;
  color: var(--accent);
}
.msg-ai pre {
  background: rgba(20,15,40,.06);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 12px;
  overflow-x: auto;
  margin: 8px 0;
}
.msg-ai pre code { background: none; padding: 0; font-size: 12px; color: var(--text-2); }
.msg-ai ul, .msg-ai ol { margin: 4px 0; padding-left: 20px; }
.msg-ai li { margin: 2px 0; }
.msg-ai blockquote {
  border-left: 3px solid var(--accent);
  padding: 4px 10px;
  margin: 8px 0;
  background: var(--accent-softer);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  color: var(--text-2);
  font-style: italic;
}
.msg-ai hr { border: none; border-top: 1px solid var(--border-2); margin: 12px 0; }
.msg-ai a { color: var(--accent); text-decoration: underline; }
.msg-ai a:hover { color: var(--accent-hover); }
.msg-ai table { border-collapse: collapse; width: 100%; margin: 8px 0; font-size: 12.5px; }
.msg-ai th, .msg-ai td { padding: 6px 10px; text-align: left; border: 1px solid var(--border); }
.msg-ai th {
  background: var(--accent-soft);
  color: var(--text);
  font-weight: var(--fw-semibold);
  font-size: 12px;
  text-transform: uppercase;
}
.msg-ai td { background: var(--surface); color: var(--text-2); }
.msg-ai tr:nth-child(even) td { background: var(--surface-2); }

/* ── Mobile enhancements ──────────────────────────────────────────── */
@media(max-width: 720px) {
  .nav-pills .btn-pill { min-height: 44px; padding: 10px 16px; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 36px; }
  .hdr-actions .btn-icon { min-height: 44px; min-width: 44px; }
  .card-pad { padding: 14px; }
  .card { margin-bottom: 10px; }
  .grid-auto { gap: 10px; }
  .metric { padding: 14px; }
  .metric-value { font-size: var(--fs-xl) !important; }
  #chat-msgs { height: 320px !important; }
  #chat-input { font-size: 16px; }
  .search-row { flex-wrap: wrap; gap: 8px; }
  .search-row .input { width: 100%; }
  .nav-pills { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; gap: 4px; }
}
@media(max-width: 480px) {
  .hdr-logo { width: 28px; height: 28px; }
  .card-pad { padding: 10px; }
  .metric { padding: 10px; }
  .tbl th, .tbl td { padding: 6px 8px; font-size: 11px; }
  .badge { font-size: 9.5px; padding: 2px 6px; }
  #chat-msgs { height: 280px !important; }
  .login-card { padding: 24px 20px !important; }
}

/* ══════════════════════════════════════════════════════════════════════
   MÓDULO COZINHA — v2.0 "Cozinha da Vó"
   ══════════════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════════
   HERO HEADER — módulos com identidade visual reforçada (Cozinha, Compras)
   Aplica via `<div class="view-head view-head-hero">`. Convive com .view-head normal.
   ══════════════════════════════════════════════════════════════════ */
.view-head-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 22px;
  padding: 22px 26px;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--accent) 8%, var(--surface)) 0%,
    var(--surface) 60%);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
  border-radius: 14px;
  margin-bottom: 16px;
  overflow: hidden;
}
.view-head-hero::before {
  content: '';
  position: absolute;
  top: -40%; right: -10%;
  width: 280px; height: 280px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 18%, transparent) 0%, transparent 70%);
  pointer-events: none;
}
.view-head-hero .vh-main {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  flex: 1 1 320px;
  position: relative;
}
.view-head-hero .vh-icon {
  flex-shrink: 0;
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  border-radius: 12px;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--accent) 12%, transparent);
}
.view-head-hero .vh-text { min-width: 0; flex: 1 }
.view-head-hero .view-title { margin: 0; font-size: 26px; line-height: 1.15 }
.view-head-hero .view-desc  { margin-top: 4px; max-width: 480px }
.view-head-hero .vh-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  position: relative;
}
.view-head-hero .vh-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  min-width: 90px;
  text-align: center;
  transition: transform .12s, border-color .12s;
}
.view-head-hero .vh-stat:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)) }
.view-head-hero .vh-stat-val {
  font-size: 20px; font-weight: 700; line-height: 1.1; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.view-head-hero .vh-stat-val.is-warn   { color: #d3a02a }
.view-head-hero .vh-stat-val.is-danger { color: #e0584a }
.view-head-hero .vh-stat-val.is-ok     { color: #1f9d57 }
.view-head-hero .vh-stat-lab {
  font-size: 10.5px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
  font-weight: 600;
}

@media (max-width: 640px) {
  .view-head-hero { padding: 18px 18px; gap: 14px }
  .view-head-hero .vh-icon { width: 44px; height: 44px; font-size: 22px }
  .view-head-hero .view-title { font-size: 22px }
  .view-head-hero .vh-stat { min-width: 80px; padding: 8px 10px }
  .view-head-hero .vh-stat-val { font-size: 17px }
}

/* ── Sub-navegação de abas (módulos Cozinha e Compras) ────────────── */
.ck-subnav, .mod-subnav {
  display: flex;
  gap: 2px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.ck-tab, .mod-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  font-family: var(--font);
  cursor: pointer;
  border-radius: 8px;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s, transform 0.1s;
}

.ck-tab:hover, .mod-tab:hover {
  color: var(--text);
  background: var(--surface-2);
}

.ck-tab.active, .mod-tab.active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  font-weight: var(--fw-semibold);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--accent) 30%, transparent) inset,
              0 2px 4px color-mix(in srgb, var(--accent) 8%, transparent);
}
.ck-tab.active:hover, .mod-tab.active:hover {
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
}

.ck-tab-count, .mod-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 19px;
  padding: 0 6px;
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: var(--fw-semibold);
  border-radius: 99px;
  font-variant-numeric: tabular-nums;
  transition: background 0.15s, color 0.15s;
}
.ck-tab.active .ck-tab-count, .mod-tab.active .mod-tab-count {
  background: var(--accent);
  color: #fff;
}
.ck-tab.is-alert .ck-tab-count, .mod-tab.is-alert .mod-tab-count {
  background: #e0584a;
  color: #fff;
}

/* ── Grid de cards ───────────────────────────────────────────────── */
.ck-grid, .mod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  padding: 20px 0;
}

.ck-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.ck-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

/* ── Foto do card ────────────────────────────────────────────────── */
.ck-card-foto {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

.ck-foto-placeholder {
  width: 100%;
  height: 160px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--text-3);
  flex-shrink: 0;
}

/* Drop zone no modal de edição */
.ck-foto-drop {
  width: 100%;
  height: 100px;
  background: var(--surface-2);
  border: 2px dashed var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.ck-foto-drop:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface-2)); }

/* Título de seção no modal de edição de ficha (v5.3.1+) */
.ck-edit-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Grid responsivo dos campos de métrica */
.ck-edit-grid {
  display: grid;
  gap: 12px;
}
@media (max-width: 520px) {
  .ck-edit-grid { grid-template-columns: 1fr !important; }
}

/* ── Barra de filtros das abas do módulo Cozinha (Receitas/Pratos/Bar/Fichas) ── */
.ck-filtro-barra {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 14px 0 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ck-filtro-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ck-filtro-search {
  flex: 1;
  min-width: 200px;
  font-size: 14px;
}
.ck-filtro-count {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ck-filtro-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}
.ck-filtro-chiplab {
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-right: 4px;
}
.ck-filtro-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  font-size: 12.5px;
  font-weight: 500;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: 99px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s, transform 0.08s;
  font-family: var(--f-sans, inherit);
  white-space: nowrap;
}
.ck-filtro-chip:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  color: var(--text);
  background: var(--surface);
}
.ck-filtro-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--accent) 30%, transparent);
}
.ck-filtro-chip.active:hover {
  background: color-mix(in srgb, var(--accent) 90%, #000);
}

/* Textarea do modo de preparo — mais respirável pro cozinheiro */
.ck-modo-textarea {
  resize: vertical;
  font-size: 14.5px;
  line-height: 1.85;
  font-family: inherit;
  padding: 14px 16px;
  min-height: 240px;
  letter-spacing: 0.005em;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.15s, background 0.15s;
}
.ck-modo-textarea:focus {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 4%, var(--surface));
  outline: none;
}
.ck-modo-textarea::placeholder {
  color: var(--text-3);
  opacity: 0.7;
  font-style: italic;
}

/* ── Corpo e rodapé do card ──────────────────────────────────────── */
.ck-card-body {
  padding: 12px 14px 8px;
  flex: 1;
}

.ck-card-nome {
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.3;
}

.ck-card-meta {
  font-size: 11.5px;
  color: var(--text-3);
  margin-bottom: 8px;
}

.ck-card-alerg {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
  min-height: 18px;
}

.ck-card-steps {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
}

.ck-card-actions {
  display: flex;
  gap: 6px;
  padding: 8px 14px 12px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* ── Badges de alergênicos ───────────────────────────────────────── */
.ck-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 99px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.5;
}

/* ── Toggle de alergênicos no modal de edição ────────────────────── */
.ck-alerg-toggle {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  user-select: none;
}

.ck-alerg-toggle:hover { opacity: 0.85; }

/* ── Métricas no modal de detalhe ────────────────────────────────── */
.ck-ficha-metricas {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 14px;
}

.ck-metrica {
  flex: 1;
  text-align: center;
  padding: 10px 8px;
  border-right: 1px solid var(--border);
}

.ck-metrica:last-child { border-right: none; }

.ck-metrica-val {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--text);
  line-height: 1.2;
}

.ck-metrica-label {
  font-size: 10px;
  color: var(--text-3);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Lista de fichas ─────────────────────────────────────────────── */
.ck-ficha-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.12s;
}

.ck-ficha-row:hover { border-color: var(--accent); }

.ck-ficha-nome {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text);
}

/* ── Indicador de ficha incompleta ───────────────────────────────── */
.ck-card-incompleto {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: #f59e0b;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  z-index: 2;
  cursor: help;
}

/* Faz o card ser position:relative para o ⚠ posicionar corretamente */
.ck-card { position: relative; }

/* ── Chat do Agente Culinário ────────────────────────────────────── */
.ck-msg-user {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: var(--r-md);
  background: var(--accent);
  color: #fff;
  font-size: 13.5px;
  line-height: 1.6;
  word-break: break-word;
  white-space: pre-wrap;
}

.ck-msg-ia {
  max-width: 92%;
  padding: 10px 14px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.6;
  word-break: break-word;
}

/* Indicador "pensando" — três pontos pulsantes */
.ck-thinking {
  color: var(--text-3);
  font-style: italic;
  font-size: 13px;
}

.ck-thinking span {
  display: inline-block;
  animation: ck-blink 1.4s infinite both;
}

.ck-thinking span:nth-child(2) { animation-delay: 0.2s; }
.ck-thinking span:nth-child(3) { animation-delay: 0.4s; }

@keyframes ck-blink {
  0%, 80%, 100% { opacity: 0.2; }
  40%           { opacity: 1; }
}

/* ── Combobox com busca (aprimora os <select> longos) ────────────── */
.ss-cb { display: contents; }

.ss-pop {
  position: fixed;
  z-index: 9999;
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  max-height: 264px;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.22);
}
.ss-pop.show { display: block; }

.ss-pop-opt {
  padding: 7px 11px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ss-pop-opt.hi    { background: var(--surface-2); }
.ss-pop-opt.sel   { font-weight: var(--fw-semibold); color: var(--accent); }
.ss-pop-opt:hover { background: var(--surface-2); }

.ss-pop-empty {
  padding: 9px 11px;
  font-size: 12px;
  color: var(--text-3);
}

/* ── Simulador — preço editável ──────────────────────────────────── */
.sim-hero { text-align: center; margin: 24px 0 16px; }
.sim-hero-label {
  font-size: 11px;
  color: var(--text-3);
  font-weight: var(--fw-semibold);
  letter-spacing: .05em;
  margin-bottom: 6px;
}
.sim-price-wrap { display: inline-flex; align-items: baseline; gap: 4px; }
.sim-price-rs {
  font-size: 26px;
  font-weight: var(--fw-bold);
  color: var(--accent);
}
.sim-price-input {
  font-family: var(--f-mono);
  font-size: 54px;
  font-weight: var(--fw-bold);
  color: var(--accent);
  background: transparent;
  border: none;
  border-bottom: 2px dashed var(--border-3);
  width: 240px;
  text-align: center;
  padding: 0 4px 4px;
  outline: none;
  transition: border-color var(--dur-base);
}
.sim-price-input:hover { border-bottom-color: var(--accent); }
.sim-price-input:focus { border-bottom-style: solid; border-bottom-color: var(--accent); }
.sim-targets {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 18px;
}

/* ── Painel — pendências e rankings ──────────────────────────────── */
.dash-pend {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--border);
}
.dash-pend:last-child { border-bottom: none; }

.dash-rank {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 2px;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: color var(--dur-base);
}
.dash-rank:last-child { border-bottom: none; }
.dash-rank:hover { color: var(--accent); }
.dash-rank > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Cardápio como menu vivo ──────────────────────────────────────── */
.cm-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 12px;
}
.cm-nome {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  margin: 0;
}
.cm-health {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  padding: 9px 20px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-sm);
  color: var(--text-2);
}
.cm-health strong { color: var(--text); }
.cm-body { padding: 6px 0 8px; }
.cm-cat { padding: 6px 0; }
.cm-cat-label {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  color: var(--text-3);
  padding: 5px 20px;
}
.cm-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 20px;
  cursor: pointer;
  transition: background var(--dur-base);
}
.cm-item:hover { background: var(--surface-2); }
.cm-item-nome { flex: 1; min-width: 0; font-size: var(--fs-ui); }
.cm-item-preco {
  font-family: var(--f-mono);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text);
  min-width: 64px;
  text-align: right;
}

/* ── Card de receita (visão geral em cards) ──────────────────────── */
.rec-card {
  cursor: pointer;
  transition: border-color var(--dur-base), box-shadow var(--dur-base), transform var(--dur-base);
}
.rec-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.rec-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.rec-card-nums {
  display: flex;
  gap: 24px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.rec-card-nums > div { display: flex; flex-direction: column; gap: 2px; }

/* ── Chip de insumo vinculado (aba Fornecedores) ─────────────────── */
.forn-ins-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-size: var(--fs-sm);
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--dur-base), background var(--dur-base);
}
.forn-ins-chip:hover { border-color: var(--accent); background: var(--accent-soft); }
.forn-ins-chip.is-pref { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }

/* ── Card de sugestão da IA (Agente Culinário) ───────────────────── */
.ck-sugestao-card {
  margin-top: 8px;
  padding: 10px 14px;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Responsivo mobile ───────────────────────────────────────────── */
@media(max-width: 720px) {
  .ck-grid, .mod-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
  .ck-card-foto, .ck-foto-placeholder { height: 130px; }
  .ck-tab, .mod-tab { padding: 6px 12px; font-size: var(--fs-xs); }
  .ck-subnav, .mod-subnav { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .ck-sugestao-card { flex-direction: column; align-items: stretch; }
  .ck-msg-user, .ck-msg-ia { max-width: 94%; }
}

/* ══════════════════════════════════════════════════════════════════
   RODAPÉ GLOBAL
   ══════════════════════════════════════════════════════════════════ */
.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  flex-shrink: 0;
  user-select: none;
}

.app-footer strong {
  color: var(--text);
  font-weight: var(--fw-semibold);
}

.app-footer em {
  font-style: italic;
  opacity: 0.85;
}

.app-footer-sep {
  margin: 0 4px;
  opacity: 0.4;
}

.app-footer-brand {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.app-footer-version {
  flex: 1;
  text-align: center;
  opacity: 0.7;
}

.app-footer-credit {
  flex-shrink: 0;
  text-align: right;
  opacity: 0.7;
}

.app-footer-credit strong {
  color: var(--accent);
}

@media(max-width: 600px) {
  .app-footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    padding: 12px 16px;
  }
  .app-footer-version { text-align: center; }
  .app-footer-credit  { text-align: center; }
}

/* ══════════════════════════════════════════════════════════════════════
   FUNDAÇÃO — utilitários e componentes (v3.1 "Acabamento")
   Camada para os módulos usarem o design system em vez de estilo inline.
   Todos os valores derivam dos tokens — adaptam-se aos 4 temas.
   ══════════════════════════════════════════════════════════════════════ */

/* ── Layout (flex) ───────────────────────────────────────────────── */
.u-row     { display: flex; align-items: center; }
.u-row-top { display: flex; align-items: flex-start; }
.u-row-end { display: flex; align-items: flex-end; }
.u-col     { display: flex; flex-direction: column; }
.u-wrap    { flex-wrap: wrap; }
.u-grow    { flex: 1; min-width: 0; }
.u-between { justify-content: space-between; }
.u-center  { justify-content: center; }
.u-gap-1   { gap: 4px; }
.u-gap-2   { gap: 8px; }
.u-gap-3   { gap: 12px; }
.u-gap-4   { gap: 16px; }

/* ── Tipografia ──────────────────────────────────────────────────── */
.t-2xs { font-size: var(--fs-2xs); }
.t-xs  { font-size: var(--fs-xs); }
.t-sm  { font-size: var(--fs-sm); }
.t-ui  { font-size: var(--fs-ui); }
.t-md  { font-size: var(--fs-md); }
.t-muted    { color: var(--text-3); }
.t-soft     { color: var(--text-2); }
.t-money    { color: var(--money); }
.t-qty      { color: var(--qty); }
.t-danger   { color: var(--danger); }
.t-accent   { color: var(--accent); }
.t-medium   { font-weight: var(--fw-medium); }
.t-semibold { font-weight: var(--fw-semibold); }

/* ── Espaçamento (grid 8px) ──────────────────────────────────────── */
.mt-2 { margin-top: 8px; }    .mb-2 { margin-bottom: 8px; }
.mt-3 { margin-top: 12px; }   .mb-3 { margin-bottom: 12px; }
.mt-4 { margin-top: 16px; }   .mb-4 { margin-bottom: 16px; }
.mt-5 { margin-top: 20px; }   .mb-5 { margin-bottom: 20px; }
.mt-6 { margin-top: 24px; }   .mb-6 { margin-bottom: 24px; }

/* ── Componentes recorrentes dos módulos ─────────────────────────── */
/* Barra de filtros / ações numa linha */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.toolbar-between { justify-content: space-between; }

/* Linha de meta-informação (texto pequeno e suave sob um título) */
.metaline {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: var(--fs-sm);
  color: var(--text-3);
}

/* Barra de estatísticas-resumo no topo de uma seção */
.statbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: var(--fs-sm);
  color: var(--text-3);
}
.statbar strong { color: var(--text); font-weight: var(--fw-semibold); }

/* Cabeçalho de card de módulo: título à esquerda, ações à direita */
.modcard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

/* ══════════════════════════════════════════════════════════════════════
   DIÁRIO DE BORDO — timeline de versões
   ══════════════════════════════════════════════════════════════════════ */
.db-timeline {
  position: relative;
  padding: 6px 0 24px;
  margin-left: 7px;
}
.db-timeline::before {
  content: '';
  position: absolute;
  left: 7px; top: 10px; bottom: 24px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--border));
}

.db-entry {
  position: relative;
  padding-left: 34px;
  margin-bottom: 18px;
}

.db-node {
  position: absolute;
  left: 0; top: 6px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--border-3);
}
.db-entry.db-atual .db-node {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft), 0 0 14px var(--accent);
}

.db-card { padding: 16px 18px; }

.db-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.db-ver {
  font-family: var(--f-mono);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: var(--r);
}
.db-nome {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  color: var(--text);
}
.db-badge {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 99px;
  padding: 2px 9px;
}
.db-data {
  margin-left: auto;
  font-family: var(--f-mono);
  font-size: var(--fs-xs);
  color: var(--text-3);
}
.db-resumo {
  font-size: var(--fs-sm);
  color: var(--text-2);
  line-height: var(--lh-relaxed);
  margin-bottom: 10px;
}
.db-feats {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.db-feats li {
  position: relative;
  padding-left: 18px;
  font-size: var(--fs-sm);
  color: var(--text);
  line-height: var(--lh-snug);
}
.db-feats li::before {
  content: '▸';
  position: absolute;
  left: 2px;
  color: var(--accent);
}

/* ══════════════════════════════════════════════════════════════════════
   NAVEGAÇÃO LATERAL — sidebar (v3.1 "Acabamento")
   ══════════════════════════════════════════════════════════════════════ */
#sidebar {
  width: 214px;
  flex-shrink: 0;
  align-self: flex-start;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 40;
  overflow-y: auto;
}

.sb-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 18px 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
}
.sb-brand .hdr-logo { width: 84px; height: 84px; overflow: visible; border-radius: 0; }
.sb-brand .hdr-title { font-size: var(--fs-lg); }

.sb-nav {
  flex: 1;
  padding: 8px 10px 16px;
  display: flex;
  flex-direction: column;
}

.sb-group:first-child .sb-group-label { padding-top: 8px; }

.sb-group-label {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  color: var(--text-3);
  padding: 14px 12px 5px;
}

.sb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  margin: 1px 0;
  border: none;
  background: transparent;
  border-radius: var(--r-md);
  font-family: var(--f-sans);
  font-size: var(--fs-ui);
  font-weight: var(--fw-medium);
  color: var(--text-2);
  text-align: left;
  cursor: pointer;
  transition: background var(--dur-base), color var(--dur-base);
}
.sb-item:hover { background: var(--surface-2); color: var(--text); }
.sb-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: var(--fw-semibold);
}
.sb-item-ico { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }

/* Hambúrguer — visível só no mobile */
.sb-hamburger {
  display: none;
  font-size: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 9px;
  color: var(--text-2);
  border-radius: var(--r);
  line-height: 1;
}
.sb-hamburger:hover { background: var(--surface-2); }

/* Scrim do drawer mobile */
#sidebar-scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--scrim);
  z-index: 39;
}

@media print {
  #sidebar, #sidebar-scrim, .sb-hamburger { display: none !important; }
}

/* ── Drawer no mobile ────────────────────────────────────────────── */
@media (max-width: 880px) {
  #sidebar {
    position: fixed;
    left: 0; top: 0;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform var(--dur-slow) var(--ease);
    box-shadow: var(--shadow-lg);
    z-index: 50;
  }
  body.sb-open #sidebar { transform: translateX(0); }
  body.sb-open #sidebar-scrim { display: block; }
  .sb-hamburger { display: inline-flex; align-items: center; }
}

