/* ===========================================================
   Painel Sabrina · Design System V2
   Tokens + base components + layout shell + persona workspaces
   =========================================================== */

:root {
  /* Surfaces */
  --bg:        #faf9f7;
  --bg2:       #ffffff;
  --bg3:       #f4f1eb;
  --bg4:       #ebe7de;

  /* Lines */
  --line:      #e8e3d7;
  --line2:     #d9d3c3;

  /* Text */
  --text:      #1d1b17;
  --text2:     #5d574b;
  --text3:     #8e8777;

  /* Brand */
  --gold:      #cc785c;
  --gold2:     #b85c44;
  --gold-soft: #fdecdf;

  /* Status */
  --green:     #3f8361;
  --amber:     #b6843a;
  --red:       #b84a3b;
  --blue:      #3d6a7e;

  /* Radii */
  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  14px;
  --r-xl:  20px;

  /* Shadow */
  --shadow:    0 10px 40px -10px rgba(0,0,0,.12);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--text);
  font-family: -apple-system, system-ui, "SF Pro Text", Inter, sans-serif;
  font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  height: 100%;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

/* === SVG icons === */
.icon       { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; color: inherit; vertical-align: middle; }
.icon.sm    { width: 15px; height: 15px; }
.icon.lg    { width: 22px; height: 22px; }

/* === App shell === */
.app {
  display: grid;
  grid-template-columns: 240px 1fr 340px;
  height: 100vh; overflow: hidden;
  transition: grid-template-columns .25s cubic-bezier(.4,0,.2,1);
}
.app.no-cp        { grid-template-columns: 240px 1fr; }
.app.sb-collapsed { grid-template-columns: 64px 1fr 340px; }
.app.sb-collapsed.no-cp { grid-template-columns: 64px 1fr; }
.app.auth         { grid-template-columns: 1fr; place-items: center; }

/* === Topbar === */
.topbar {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg2);
  position: sticky; top: 0; z-index: 5;
}
/* Toggle dentro da sidebar (modelo Claude Console) */
.sb-toggle {
  position: absolute;
  top: 14px; right: 10px;
  width: 26px; height: 26px;
  border-radius: 6px;
  color: var(--text3);
  display: grid; place-items: center;
  transition: all .15s;
  z-index: 4;
}
.sb-toggle:hover { background: var(--bg3); color: var(--text); }
.sb-toggle .icon { width: 16px; height: 16px; transition: transform .25s; }
.sb-collapsed .sb-toggle { right: auto; left: 50%; transform: translateX(-50%); }
.sb-collapsed .sb-toggle .icon { transform: rotate(180deg); }
.logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 13px;
  padding-right: 12px;
  border-right: 1px solid var(--line);
  margin-right: 4px;
}
.logo-mark {
  width: 24px; height: 24px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 13px;
}
.ws { display: flex; gap: 4px; padding: 4px; background: var(--bg3); border: 1px solid var(--line); border-radius: var(--r-md); }
.ws button { padding: 6px 12px; font-size: 12px; font-weight: 500; border-radius: var(--r-sm); color: var(--text2); display: flex; align-items: center; gap: 6px; }
.ws button.on    { background: var(--bg2); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.ws button:hover:not(.on) { color: var(--text); }
.ws button .icon { width: 14px; height: 14px; }
.cmdk {
  flex: 1; max-width: 480px;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: var(--bg3); border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--text3); font-size: 13px; cursor: pointer;
}
.cmdk kbd { margin-left: auto; padding: 2px 6px; background: var(--bg2); border: 1px solid var(--line); border-radius: 4px; font-size: 11px; color: var(--text2); }
.tb-spacer { flex: 1; }
.tb-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--r-md); color: var(--text2); position: relative; }
.tb-icon:hover { background: var(--bg3); color: var(--text); }
.tb-icon .badge { position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); border: 2px solid var(--bg2); }
.tb-user { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--line); }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--bg4); display: grid; place-items: center; font-size: 11px; font-weight: 600; color: var(--text2); }
.muted { color: var(--text3); }

/* === Sidebar === */
.sb {
  padding: 14px 10px;
  border-right: 1px solid var(--line);
  background: var(--bg);
  overflow-y: auto; overflow-x: hidden;
  position: relative;
}
.persona-card { padding: 11px 12px; background: var(--bg3); border-radius: var(--r-md); margin: 8px 4px 12px 4px; padding-right: 40px; font-size: 12px; transition: all .25s; }
.persona-card .nm { font-weight: 600; font-size: 13px; margin-bottom: 2px; white-space: nowrap; }
.persona-card .role { color: var(--text3); font-size: 11px; white-space: nowrap; }
.sb-section { margin: 14px 4px 4px; padding: 0 8px; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text3); white-space: nowrap; }
.sb-item { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--r-sm); color: var(--text2); font-size: 13px; cursor: pointer; position: relative; white-space: nowrap; transition: all .15s; }
.sb-item:hover { background: var(--bg3); color: var(--text); }
.sb-item.active { background: var(--gold-soft); color: var(--gold2); font-weight: 500; }
.sb-item .icon { width: 17px; height: 17px; }
.sb-item .lbl { flex: 1; overflow: hidden; text-overflow: ellipsis; transition: opacity .15s; }
.sb-item .ct { font-size: 10.5px; color: var(--text3); background: var(--bg3); padding: 1px 7px; border-radius: 999px; font-weight: 600; transition: opacity .15s; }
.sb-item.active .ct { background: var(--bg2); color: var(--gold2); }
.sb-item .ct-dot { display: none; }

/* Persistência do estado colapsado */
.sb-collapsed .sb { padding: 50px 8px 14px; }
.sb-collapsed .sb-item { justify-content: center; padding: 9px 0; gap: 0; }
.sb-collapsed .sb-item .lbl,
.sb-collapsed .sb-item .ct { opacity: 0; width: 0; padding: 0; margin: 0; pointer-events: none; }
.sb-collapsed .sb-section { opacity: 0; height: 1px; margin: 8px 8px 0; padding: 0; border-top: 1px solid var(--line); font-size: 0; }
.sb-collapsed .persona-card { display: none; }
.sb-collapsed .sb-item::after { content: attr(data-tip); position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%); background: var(--text); color: var(--bg); padding: 5px 10px; border-radius: 6px; font-size: 12px; font-weight: 500; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; z-index: 50; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.sb-collapsed .sb-item:hover::after { opacity: 1; }
.sb-collapsed .sb-item .ct-dot { display: block; position: absolute; top: 6px; right: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.sb-collapsed .sb-item:not(:has(.ct)) .ct-dot { display: none; }

/* === Main === */
.main { overflow-y: auto; padding: 24px 28px; }
.crumb { color: var(--text3); font-size: 12px; margin-bottom: 6px; }
.crumb b { color: var(--text2); font-weight: 500; }
.h1 { margin: 0 0 4px; font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.h1 .pill { display: inline-block; margin-left: 8px; padding: 3px 9px; font-size: 11px; font-weight: 600; background: var(--gold-soft); color: var(--gold2); border-radius: 999px; vertical-align: middle; }
.sub { color: var(--text2); font-size: 13px; margin-bottom: 20px; }
.head-row { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.head-row .actions { margin-left: auto; display: flex; gap: 6px; }

/* === Cards & primitives === */
.card { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px; margin-bottom: 16px; }
.card.flush { padding: 0; }
.card-h { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.card-h h3 { margin: 0; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.card-h h3 .icon { color: var(--gold2); width: 16px; height: 16px; }
.card-h .right { margin-left: auto; color: var(--text3); font-size: 12px; }

.btn { padding: 7px 13px; border-radius: var(--r-sm); font-size: 12.5px; font-weight: 500; border: 1px solid var(--line); background: var(--bg2); color: var(--text); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { background: var(--bg3); }
.btn.primary { background: var(--gold); color: #fff; border-color: var(--gold); }
.btn.primary:hover { background: var(--gold2); border-color: var(--gold2); }
.btn.ghost { border-color: transparent; color: var(--text2); }
.btn.sm { padding: 4px 9px; font-size: 11.5px; }
.btn.lg { padding: 10px 18px; font-size: 13.5px; }

.tag { display: inline-block; padding: 2px 8px; font-size: 10.5px; font-weight: 600; background: var(--bg3); color: var(--text2); border-radius: 999px; }
.tag.gold  { background: var(--gold-soft); color: var(--gold2); }
.tag.green { background: #dff1e6; color: var(--green); }
.tag.amber { background: #f6ead0; color: var(--amber); }
.tag.red   { background: #fde7e3; color: var(--red); }
.tag.blue  { background: #dde9ee; color: var(--blue); }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }

/* === KPI === */
.kpi { padding: 16px; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r-md); }
.kpi .lbl   { color: var(--text3); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.kpi .val   { margin: 6px 0 4px; font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.kpi .delta { font-size: 12px; color: var(--text2); }
.kpi .delta b      { color: var(--green); font-weight: 600; }
.kpi .delta b.bad  { color: var(--red); }
.kpi .bar    { margin-top: 10px; height: 4px; background: var(--bg4); border-radius: 2px; overflow: hidden; }
.kpi .bar i  { display: block; height: 100%; background: var(--gold); border-radius: 2px; }
a.kpi { text-decoration: none; color: inherit; transition: all .15s; cursor: pointer; }
a.kpi:hover { border-color: var(--line2); transform: translateY(-1px); }
a.kpi.kpi-on { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }

/* === Login (auth) === */
.auth-card {
  width: 380px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 32px;
  box-shadow: var(--shadow);
}
.auth-card .logo { padding: 0; border: 0; margin: 0 0 24px; font-size: 16px; }
.auth-card h1 { margin: 0 0 6px; font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.auth-card p.sub { margin: 0 0 24px; color: var(--text2); font-size: 13px; }
.auth-card .field { margin-bottom: 14px; }
.auth-card label { display: block; font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; margin-bottom: 6px; }
.auth-card input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg2); font-size: 14px; outline: none; transition: border .15s; }
.auth-card input:focus { border-color: var(--gold); }
.auth-card .btn-submit { width: 100%; margin-top: 8px; padding: 11px; font-size: 14px; font-weight: 600; }
.auth-card .err { background: #fde7e3; color: var(--red); padding: 10px 12px; border-radius: var(--r-sm); font-size: 12.5px; margin-bottom: 14px; }

/* === Misc === */
.danger { color: var(--red); }
.ok     { color: var(--green); }
.warn   { color: var(--amber); }
.row    { display: flex; gap: 12px; align-items: center; }

/* === DRA HOME · concierge === */
.dra-home { max-width: 1080px; margin: 0 auto; padding: 0 0 40px; }

.hero {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  margin: 8px 0 36px;
  min-height: 260px;
  box-shadow: 0 10px 40px -18px rgba(0,0,0,.18);
}
.hero-bg { position: absolute; inset: 0; overflow: hidden; }
.hero-aurora {
  position: absolute; inset: -30%;
  background:
    radial-gradient(ellipse at 20% 30%, #ffd7b3 0%, transparent 45%),
    radial-gradient(ellipse at 80% 20%, #f4b090 0%, transparent 50%),
    radial-gradient(ellipse at 60% 80%, #e8a4c4 0%, transparent 55%),
    radial-gradient(ellipse at 30% 90%, #b8d4e8 0%, transparent 50%),
    linear-gradient(135deg, #fde7c8 0%, #f4c4a0 35%, #e8b5a8 60%, #cfd9e8 100%);
  filter: blur(30px);
  animation: aurora 22s ease-in-out infinite alternate;
}
@keyframes aurora {
  0%   { transform: translate(0,0) scale(1);     filter: blur(30px) hue-rotate(0deg); }
  50%  { transform: translate(2%,-1%) scale(1.05); filter: blur(40px) hue-rotate(-8deg); }
  100% { transform: translate(-2%,1%) scale(1.02); filter: blur(32px) hue-rotate(6deg); }
}
.hero-waves {
  position: absolute; bottom: -10px; left: 0; right: 0;
  width: 100%; height: 80px;
  animation: wave 14s ease-in-out infinite alternate;
}
@keyframes wave {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-3%); }
}
.hero-particles { position: absolute; inset: 0; pointer-events: none; }
.hero-particles span {
  position: absolute; width: 6px; height: 6px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.9), rgba(255,255,255,0));
  animation: float 14s ease-in-out infinite;
}
.hero-particles span:nth-child(1) { top: 30%; left: 10%; animation-delay: 0s; }
.hero-particles span:nth-child(2) { top: 55%; left: 25%; animation-delay: -2s; width: 4px; height: 4px; }
.hero-particles span:nth-child(3) { top: 20%; left: 50%; animation-delay: -4s; width: 8px; height: 8px; }
.hero-particles span:nth-child(4) { top: 70%; left: 65%; animation-delay: -6s; }
.hero-particles span:nth-child(5) { top: 40%; left: 80%; animation-delay: -8s; width: 5px; height: 5px; }
.hero-particles span:nth-child(6) { top: 60%; left: 92%; animation-delay: -10s; }
@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); opacity: .6; }
  50%      { transform: translateY(-18px) scale(1.3); opacity: .95; }
}
.hero-content { position: relative; padding: 32px 36px 36px; color: var(--text); }
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; gap: 16px; }
.hero-content .hello-date { color: rgba(29,27,23,.72); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.hero-content .hello-h { font-size: 36px; margin: 0 0 14px; letter-spacing: -.02em; line-height: 1.1; font-weight: 600; text-shadow: 0 1px 2px rgba(255,255,255,.4); }
.hello-spark { color: var(--gold); font-weight: 400; margin-left: 4px; }
.hero-content .hello-msg { color: rgba(29,27,23,.78); font-size: 16px; max-width: 640px; font-weight: 300; line-height: 1.55; margin: 0; text-shadow: 0 1px 2px rgba(255,255,255,.3); }
.hero-content .hello-msg b { color: rgba(29,27,23,.95); font-weight: 600; }

.weather { display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: rgba(255,255,255,.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.6); border-radius: 16px; }
.w-ico   { line-height: 1; }
.w-temp  { font-size: 22px; font-weight: 600; letter-spacing: -.01em; line-height: 1; }
.w-loc   { font-size: 11px; color: var(--text2); margin-top: 4px; }

.widgets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 40px; }
.widget { padding: 22px; background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; transition: all .2s; }
.widget:hover { border-color: var(--line2); transform: translateY(-1px); }
.w-lbl { font-size: 10.5px; color: var(--gold2); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 12px; }
.widget p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--text); font-weight: 300; }
.widget p b { font-weight: 500; }
.widget-quote { background: linear-gradient(135deg, var(--gold-soft), #fef5ec); border-color: transparent; }
.widget-quote p { font-style: italic; font-size: 14px; line-height: 1.5; color: var(--text); }
.w-author { font-size: 11px; color: var(--text3); margin-top: 10px; }
.widget-pulse { background: linear-gradient(180deg, var(--bg3), var(--bg2)); }
.pulse-row { display: flex; justify-content: space-between; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.pulse-row:last-child { border-bottom: 0; }
.pulse-row span { color: var(--text2); font-weight: 300; }
.pulse-row b { font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.pulse-row b.ok { color: var(--green); }

.widget-fin { background: linear-gradient(135deg, var(--bg2), #fef7f1); border-color: #f4d8c4; }
.w-lbl-row  { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.w-lbl-row .w-lbl { margin-bottom: 0; }
.w-more     { font-size: 11px; color: var(--gold2); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.w-more:hover { text-decoration: underline; }
.fin-big    { font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.fin-sub    { font-size: 12px; color: var(--text2); margin-top: 4px; }
.fin-sub b  { color: var(--gold2); font-weight: 600; }
.fin-bar    { height: 5px; background: var(--bg4); border-radius: 3px; overflow: hidden; margin: 12px 0 14px; }
.fin-bar i  { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold2)); border-radius: 3px; }
.fin-actions{ display: flex; gap: 6px; flex-wrap: wrap; }

.day-h { font-size: 11.5px; color: var(--text3); text-transform: uppercase; letter-spacing: .1em; font-weight: 700; margin: 0 0 14px; padding: 0 4px; }
.day-list { display: flex; flex-direction: column; gap: 12px; }
.appt { display: grid; grid-template-columns: 80px 50px 1fr auto; gap: 14px; padding: 18px 20px; background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; align-items: center; transition: all .2s; }
.appt:hover { border-color: var(--line2); box-shadow: 0 4px 14px -8px rgba(0,0,0,.1); }
.appt.now { background: linear-gradient(135deg, var(--gold-soft), #fef7f1); border: 0; box-shadow: 0 4px 18px -6px rgba(204,120,92,.25); }
.appt .hr { font-size: 20px; font-weight: 600; color: var(--text); }
.appt .hr small { display: block; font-size: 10.5px; color: var(--text3); font-weight: 400; text-transform: uppercase; letter-spacing: .06em; }
.appt .av { width: 50px; height: 50px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; }
.av-1 { background: linear-gradient(135deg, #cc785c, #b85c44); }
.av-2 { background: linear-gradient(135deg, #3f8361, #2d6048); }
.av-3 { background: linear-gradient(135deg, #3d6a7e, #2a4d5f); }
.av-4 { background: linear-gradient(135deg, #b6843a, #8e6228); }
.av-5 { background: linear-gradient(135deg, #9a6ba8, #724d80); }
.appt .who { font-weight: 600; font-size: 15px; }
.appt .what { font-size: 12.5px; color: var(--text2); margin-top: 4px; }
.appt .story { font-size: 12.5px; color: var(--text3); margin-top: 6px; font-style: italic; font-weight: 300; line-height: 1.45; }
.appt .actions { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }

.end-note { margin-top: 28px; padding: 16px 20px; background: var(--bg3); border-radius: 12px; display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--text2); font-weight: 300; }
.end-note span { flex: 1; }

/* === Paciente 360º === */
.pf-page { max-width: 1280px; margin: 0 auto; }
.pf-head {
  background: linear-gradient(180deg, var(--bg3) 0%, var(--bg2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px 28px;
  margin-bottom: 0;
}
.pf-top { display: flex; align-items: center; gap: 16px; }
.pf-name-block { flex: 1; }
.pf-name { margin: 0 0 6px; font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.pf-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.pf-actions { display: flex; gap: 6px; align-items: center; }
.pf-stats { display: flex; gap: 28px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pf-stat-lbl { font-size: 10.5px; color: var(--text3); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.pf-stat-val { font-size: 16px; font-weight: 600; margin-top: 4px; letter-spacing: -.01em; }
.pf-stat-val.warn { color: var(--amber); }
.pf-stat-val.danger { color: var(--red); }

/* Tabs */
.pf-tabs-wrap {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-top: 0;
  margin: 0;
}
.pf-tabs {
  display: flex; gap: 0;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.pf-tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 14px 16px;
  font-size: 13px; color: var(--text2);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all .15s;
}
.pf-tab:hover { color: var(--text); }
.pf-tab.active { color: var(--text); font-weight: 500; border-bottom-color: var(--gold); }
.pf-tab .icon { color: var(--text3); }
.pf-tab.active .icon { color: var(--gold2); }

.pf-body {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  padding: 24px 28px;
}

/* Visão · grid duas colunas */
.pf-grid { display: grid; grid-template-columns: 260px 1fr; gap: 28px; }
.pf-grid-thin { grid-template-columns: 200px 1fr; gap: 24px; }
.pf-side { padding-right: 24px; border-right: 1px solid var(--line); }
.pf-side-thin { padding-right: 18px; border-right: 1px solid var(--line); }
.pf-side h4, .pf-side-thin h4 {
  margin: 18px 0 8px;
  font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text3); font-weight: 700;
}
.pf-side h4:first-child, .pf-side-thin h4:first-child { margin-top: 0; }
.pf-field { font-size: 12.5px; margin-bottom: 10px; }
.pf-field .k { color: var(--text3); font-size: 11px; margin-bottom: 2px; }
.pf-field .v { color: var(--text); font-weight: 500; }
.pf-alert {
  background: #fde7e3;
  border-left: 3px solid var(--red);
  padding: 10px 12px;
  border-radius: var(--r-sm);
  font-size: 12.5px;
  color: var(--text);
  margin-bottom: 8px;
}

.pf-main, .pf-main-thin { min-width: 0; }

.pf-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.pf-card.flush { padding: 0; }
.pf-card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.pf-card-h h3 { margin: 0; font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.pf-card-h h3 .icon { color: var(--gold2); width: 16px; height: 16px; }

.pf-card-ai {
  background: linear-gradient(135deg, var(--gold-soft), #fef7f1);
  border-color: transparent;
}

.pf-md {
  font-size: 13.5px; line-height: 1.6;
  color: var(--text);
}
.pf-md p { margin: 0 0 10px; }
.pf-md p:last-child { margin-bottom: 0; }
.pf-md ul { margin: 6px 0 10px; padding-left: 22px; }
.pf-md li { margin-bottom: 4px; font-size: 13px; }

/* Timeline interna */
.tl-year { margin-bottom: 18px; }
.tl-year-label {
  font-size: 11px; color: var(--text3);
  text-transform: uppercase; letter-spacing: .1em; font-weight: 700;
  margin-bottom: 8px;
}
.tl-event {
  display: grid; grid-template-columns: 32px 1fr;
  gap: 12px; align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.tl-event:last-child { border-bottom: 0; }
.tl-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--gold-soft);
  display: grid; place-items: center;
}
.tl-tt { font-size: 13.5px; font-weight: 500; color: var(--text); }
.tl-meta { font-size: 11.5px; color: var(--text3); margin-top: 2px; }
.tl-desc { font-size: 12.5px; color: var(--text2); margin-top: 6px; line-height: 1.5; font-style: italic; }

@media (max-width: 980px) {
  .pf-grid, .pf-grid-thin { grid-template-columns: 1fr; }
  .pf-side, .pf-side-thin { border-right: 0; padding-right: 0; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
}

/* === Agenda geral · grade semanal === */
.ag-grid {
  display: grid;
  grid-template-columns: 64px repeat(7, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 8px;
}
.ag-h {
  background: var(--bg2);
  padding: 12px 10px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.ag-h-time { background: var(--bg3); }
.ag-h-dia {
  font-size: 10.5px; color: var(--text3);
  text-transform: uppercase; letter-spacing: .08em; font-weight: 600;
}
.ag-h-num {
  font-size: 18px; font-weight: 600; letter-spacing: -.01em; color: var(--text);
}
.ag-h-hoje .ag-h-num,
.ag-h-hoje .ag-h-dia { color: var(--gold2); }
.ag-h-hoje { background: var(--gold-soft); }
.ag-h-atend .ag-h-dia::after { content: ' · atendimento'; color: var(--gold2); font-weight: 700; }

.ag-time {
  background: var(--bg3);
  padding: 6px 8px;
  text-align: right;
  font-size: 10.5px;
  color: var(--text3);
  font-weight: 600;
}
.ag-cell {
  background: var(--bg2);
  min-height: 56px;
  padding: 4px;
  cursor: pointer;
  transition: background .12s;
}
.ag-cell:hover { background: var(--bg3); }
.ag-cell:hover::after {
  content: '+';
  display: block;
  text-align: center;
  color: var(--text3);
  font-size: 14px;
  pointer-events: none;
}

.ag-ev {
  padding: 6px 9px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  margin: 1px 0;
  transition: transform .1s, box-shadow .1s;
  border-left: 3px solid;
  background: var(--bg2);
}
.ag-ev:hover { transform: translateX(1px); box-shadow: 0 2px 6px -3px rgba(0,0,0,.15); }
.ag-ev-tt { font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-ev-meta { font-size: 10px; color: var(--text3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-ev-pend { color: var(--amber); font-weight: 600; }

/* Nova consulta = verde · sempre */
.ag-ev-procedimento { background: #f0f8f3; border-left-color: var(--green); }
.ag-ev-procedimento .ag-ev-tt { color: #2d6048; }
/* Retorno = azul */
.ag-ev-consulta     { background: #eef4f7; border-left-color: var(--blue); }
.ag-ev-consulta .ag-ev-tt { color: var(--blue); }
.ag-ev-bloqueio     { background: #fbf3df; border-left-color: var(--amber); }
.ag-ev-bloqueio .ag-ev-tt { color: var(--amber); }
.ag-ev-admin,
.ag-ev-externo      { background: #f3faf6; border-left-color: var(--green); }
.ag-ev-admin .ag-ev-tt,
.ag-ev-externo .ag-ev-tt { color: var(--green); }
.ag-ev-pausa        { background: var(--bg3); border-left-color: var(--text3); }
.ag-ev-pausa .ag-ev-tt { color: var(--text3); font-style: italic; }

.ag-st-pendente { opacity: .85; }
.ag-st-cancelado { text-decoration: line-through; opacity: .5; }

/* Status icon dentro do card */
.ag-ev-tt { display: flex; align-items: center; gap: 5px; }
.ag-ev-st-icon {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--bg3);
  color: var(--text3);
  display: inline-grid; place-items: center;
  font-size: 9px;
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1;
}
.ag-ev-st-icon.ag-st-confirmado { background: var(--green); color: #fff; }
.ag-ev-st-icon.ag-st-agendado   { background: var(--bg4); color: var(--text2); }
.ag-ev-st-icon.ag-st-realizado  { background: var(--text2); color: #fff; }
.ag-ev-st-icon.ag-st-no-show    { background: var(--red); color: #fff; }
.ag-ev-st-icon.ag-st-cancelado  { background: var(--red); color: #fff; }

/* Linha "agora" */
.ag-now-line {
  position: absolute;
  height: 2px;
  background: var(--red);
  z-index: 5;
  pointer-events: none;
  box-shadow: 0 0 6px rgba(184, 74, 59, .4);
}
.ag-now-line::before {
  content: '';
  position: absolute;
  left: -5px; top: -3px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--red);
}
.ag-now-line[hidden] { display: none; }

/* Tooltip custom de evento */
.ag-tooltip {
  position: fixed;
  background: var(--text);
  color: var(--bg);
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 12px;
  z-index: 9000;
  box-shadow: 0 12px 32px -8px rgba(0,0,0,.4);
  pointer-events: none;
  max-width: 280px;
  line-height: 1.4;
}
.ag-tooltip[hidden] { display: none; }
.ag-tooltip .tt-h { font-size: 14px; font-weight: 700; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,.15); }
.ag-tooltip .tt-row { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
.ag-tooltip .tt-row > span { color: rgba(255,255,255,.6); font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; }
.ag-tooltip .tt-row b { color: var(--bg); font-weight: 600; text-align: right; }
.ag-tooltip .tt-obs {
  display: block; margin-top: 6px; padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,.1);
  font-style: italic; color: rgba(255,255,255,.85);
  font-size: 11.5px;
}

.ag-legend {
  display: flex; flex-wrap: wrap; gap: 16px;
  margin-top: 14px; padding: 12px 16px;
  background: var(--bg3); border-radius: 8px;
  font-size: 11.5px; color: var(--text2);
}
.ag-legend .ag-lg { display: flex; align-items: center; gap: 6px; }
.ag-legend i {
  width: 12px; height: 12px;
  border-radius: 3px;
  display: inline-block;
}

.btn.danger { color: var(--red); border-color: #f1d4cd; margin-right: auto; }
.btn.danger:hover { background: #fde7e3; }

/* Chips de serviço no modal */
.ev-svc-picker {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 10px;
  background: var(--bg3);
  border-radius: 8px;
  border: 1px solid var(--line);
  max-height: 120px; overflow-y: auto;
}
.ev-svc-chip {
  padding: 5px 11px;
  border: 1px solid var(--line2);
  background: var(--bg2);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  transition: all .12s;
}
.ev-svc-chip:hover { border-color: var(--gold); }
.ev-svc-chip.on {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
}
.ev-svc-chip.on::before { content: '✓ '; }

/* Card mostra serviços como tags · só no detalhe (futuro) */
.ag-ev-svcs {
  display: flex; gap: 3px; flex-wrap: wrap;
  margin-top: 4px;
}
.ag-ev-svc {
  font-size: 9.5px;
  padding: 1px 6px;
  background: rgba(255,255,255,.7);
  border-radius: 999px;
  color: var(--text2);
  font-weight: 500;
}

/* Status na agenda */
.ag-st-cancelado { opacity: .55; text-decoration: line-through; }
.ag-st-realizado { opacity: .85; }
.ag-st-no-show   { background: #fde7e3 !important; border-left-color: var(--red) !important; }
.ag-st-no-show .ag-ev-tt { color: var(--red); }

/* === Modo reagendamento · banner + grade highlight === */
.resched-banner[hidden] { display: none !important; }
.resched-banner {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 105;
  background: var(--gold);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
  box-shadow: 0 8px 24px -6px rgba(204, 120, 92, .5);
  animation: resched-slide .25s ease-out;
}
.resched-banner b { font-weight: 700; }
.resched-banner .icon { width: 16px; height: 16px; }
.resched-banner .btn {
  background: rgba(255,255,255,.2);
  border-color: rgba(255,255,255,.3);
  color: #fff;
}
.resched-banner .btn:hover { background: rgba(255,255,255,.3); }
@keyframes resched-slide {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

body.reschedule-mode .ag-cell:not(:has(.ag-ev)) {
  background: var(--gold-soft);
  cursor: copy;
}
body.reschedule-mode .ag-cell:not(:has(.ag-ev)):hover {
  background: var(--gold);
}
body.reschedule-mode .ag-cell:not(:has(.ag-ev)):hover::after {
  content: '↻ aqui';
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}
body.reschedule-mode .ag-ev { pointer-events: none; opacity: .5; }

/* === Banner de alerta crítico (cross-cutting) === */
.alert-banner {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  background: linear-gradient(90deg, #fde7e3 0%, #fbf0ec 100%);
  border-left: 4px solid var(--red);
  border-radius: var(--r-md);
  margin-bottom: 16px;
  animation: alert-pulse 2.4s ease-in-out infinite;
}
@keyframes alert-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(184, 74, 59, 0); }
  50%      { box-shadow: 0 0 0 4px rgba(184, 74, 59, .12); }
}
.alert-banner .icon { width: 22px; height: 22px; color: var(--red); flex-shrink: 0; }
.alert-banner b { display: block; color: var(--red); font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.alert-banner span { display: block; color: var(--text2); font-size: 12.5px; }

/* === Resumo executivo (TL;DR da IA) === */
.resumo-exec {
  background: linear-gradient(135deg, var(--gold-soft), #fef7f1);
  border: 1px solid #f4d8c4;
  border-radius: var(--r-md);
  padding: 16px 18px;
  margin: 14px 0 18px;
}
.resumo-h {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--gold2); margin-bottom: 8px;
}
.resumo-h .icon { width: 14px; height: 14px; }
.resumo-body {
  font-size: 14px; line-height: 1.55;
  color: var(--text);
  font-weight: 400;
}

/* Painel de cancelados / reagendados */
.ag-painel { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.ag-painel-card {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}
.ag-painel-h {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text3); margin-bottom: 10px;
}
.ag-painel-h .icon { width: 14px; height: 14px; }
.ag-painel-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.ag-painel-item:last-child { border-bottom: 0; }
.ag-painel-item .pi-tt { font-weight: 600; color: var(--text); }
.ag-painel-item .pi-meta { font-size: 11px; color: var(--text3); margin-top: 2px; }
.ag-painel-item .pi-motivo { font-size: 11.5px; color: var(--text2); margin-top: 4px; font-style: italic; }
.ag-painel-empty { font-size: 12px; color: var(--text3); font-style: italic; }

/* Autocomplete de paciente no modal de evento */
.ev-pac-dropdown {
  position: absolute;
  top: 100%; left: 0; right: 0;
  margin-top: 4px;
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: 8px;
  box-shadow: 0 8px 24px -8px rgba(0,0,0,.18);
  max-height: 240px;
  overflow-y: auto;
  z-index: 200;
}
.ev-pac-item {
  padding: 9px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  transition: background .1s;
}
.ev-pac-item:last-child { border-bottom: 0; }
.ev-pac-item:hover { background: var(--gold-soft); }
.ev-pac-nome { font-size: 13px; font-weight: 500; color: var(--text); }
.ev-pac-meta { font-size: 11px; color: var(--text3); margin-top: 1px; }
.ev-pac-empty {
  padding: 10px 12px; font-size: 12px; color: var(--text3); font-style: italic;
  border-bottom: 1px solid var(--line);
}
.ev-pac-cta {
  padding: 10px 12px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--gold2);
  font-weight: 600;
  display: flex; align-items: center; gap: 8px;
  transition: background .12s;
  background: var(--gold-soft);
}
.ev-pac-cta:hover { background: var(--gold); color: #fff; }
.ev-pac-cta-plus {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--gold);
  color: #fff;
  display: grid; place-items: center;
  font-size: 14px; font-weight: 700;
  flex-shrink: 0;
}
.ev-pac-cta:hover .ev-pac-cta-plus { background: #fff; color: var(--gold2); }

/* === Pipeline kanban · estilo HubSpot/Salesforce === */
.kanban {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr 1.1fr 1fr .85fr .85fr;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 12px;
  min-height: 60vh;
}
.kb-col {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex; flex-direction: column;
  min-height: 320px;
  transition: background .15s, border-color .15s;
}
.kb-col[data-key="ganho"], .kb-col[data-key="perdido"] { opacity: .92; }
.kb-col.drag-over {
  background: var(--gold-soft);
  border-color: var(--gold);
  opacity: 1;
}
.kb-col-h {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 10px;
}
.kb-col-tt { font-size: 12px; font-weight: 600; color: var(--text); letter-spacing: .005em; }
.kb-col-sub { display: none; }
.kb-col-stats { display: flex; align-items: center; gap: 8px; }
.kb-n { background: transparent; padding: 0; font-size: 11.5px; font-weight: 600; color: var(--text3); }
.kb-v { display: inline; font-size: 10.5px; color: var(--text3); margin: 0; font-weight: 500; }
.kb-col-body {
  flex: 1;
  padding: 0 10px 10px;
  display: flex; flex-direction: column; gap: 6px;
  overflow-y: auto;
}

/* Card · clean & quiet */
.kb-card {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s;
  position: relative;
  user-select: none;
}
.kb-card:hover {
  border-color: var(--line2);
  box-shadow: 0 2px 8px -4px rgba(0,0,0,.1);
  transform: translateY(-1px);
}
.kb-card.dragging {
  opacity: .35;
  cursor: grabbing;
  transform: rotate(1.5deg) scale(1.02);
  box-shadow: 0 12px 28px -8px rgba(0,0,0,.25);
  z-index: 10;
}

/* Tom do card · estilo HubSpot/Linear · branco com detalhe lateral
   Sem gradientes saturados · só uma borda esquerda fina e um ESMALTE no canto top-left */

.kb-card.kb-tipo-oportunidade {
  background: var(--bg2);
  border-left: 3px solid var(--gold);
  padding-left: 11px;
}
.kb-card.kb-tipo-oportunidade::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 60%; height: 40%;
  background: radial-gradient(ellipse at top left, rgba(204, 120, 92, .06), transparent 70%);
  pointer-events: none;
  border-radius: 8px 0 0 0;
}
.kb-card.kb-tipo-oportunidade:hover { border-left-color: var(--gold2); }
.kb-card.kb-tipo-oportunidade .kb-card-row3 { color: var(--gold2); font-weight: 600; }

.kb-card.kb-tipo-atraso {
  background: var(--bg2);
  border-left: 3px solid var(--amber);
  padding-left: 11px;
}
.kb-card.kb-tipo-atraso::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 60%; height: 40%;
  background: radial-gradient(ellipse at top left, rgba(182, 132, 58, .05), transparent 70%);
  pointer-events: none;
  border-radius: 8px 0 0 0;
}
.kb-card.kb-tipo-atraso:hover { border-left-color: #8a5e1e; }
.kb-card.kb-tipo-atraso .kb-card-row3 { color: #8a5e1e; font-weight: 500; }

.kb-card.kb-tipo-critico {
  background: var(--bg2);
  border-left: 3px solid var(--red);
  padding-left: 11px;
}
.kb-card.kb-tipo-critico::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 60%; height: 40%;
  background: radial-gradient(ellipse at top left, rgba(184, 74, 59, .07), transparent 70%);
  pointer-events: none;
  border-radius: 8px 0 0 0;
}
.kb-card.kb-tipo-critico:hover { border-left-color: #8a3b2e; }
.kb-card.kb-tipo-critico .kb-card-row3 { color: var(--red); font-weight: 600; }

/* Neutro · branco puro, sem detalhe */
.kb-card.kb-tipo-neutro { background: var(--bg2); }

/* Linha 1 · emoji + nome + valor */
.kb-card-row1 {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; color: var(--text);
}
.kb-emoji {
  flex-shrink: 0;
  width: 14px;                        /* largura fixa = simetria entre cards com/sem emoji */
  font-size: 11px;
  line-height: 1;
  text-align: center;
  display: inline-block;
}
.kb-nome {
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kb-valor {
  font-size: 12px; font-weight: 700; color: var(--text2);
  white-space: nowrap;
}
.kb-card.u-alta .kb-valor { color: var(--red); }

/* Linha 2 · contexto suave */
.kb-card-row2 {
  font-size: 11.5px; color: var(--text3);
  margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Linha 3 · sugestão IA */
.kb-card-row3 {
  display: flex; align-items: center; gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--gold2);
  letter-spacing: -.005em;
}
.kb-card-row3 .icon { width: 12px; height: 12px; flex-shrink: 0; }
.kb-card.u-alta  .kb-card-row3 { color: var(--red); }
.kb-card.u-media .kb-card-row3 { color: var(--amber); }

/* === Fase do script de atendimento (1-14) === */
.kb-fase {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px;
  font-size: 10.5px;
  color: var(--text3);
}
.kb-fase-bar {
  flex: 1;
  height: 3px;
  background: var(--bg3);
  border-radius: 2px;
  overflow: hidden;
}
.kb-fase-bar > div {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold2));
  border-radius: 2px;
  transition: width .3s;
}
.kb-fase-label {
  font-weight: 500;
  color: var(--text2);
  white-space: nowrap;
  letter-spacing: -.005em;
}
.kb-card.kb-tipo-critico .kb-fase-bar > div { background: linear-gradient(90deg, var(--red), #8a3b2e); }
.kb-card.kb-tipo-atraso  .kb-fase-bar > div { background: linear-gradient(90deg, var(--amber), #8a5e1e); }

/* Quick actions · só aparecem no hover */
.kb-quick {
  position: absolute;
  top: 8px; right: 8px;
  display: flex; gap: 4px;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity .12s, transform .12s;
  pointer-events: none;
}
.kb-card:hover .kb-quick {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.kb-q-btn {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text2);
  cursor: pointer;
  transition: all .1s;
  text-decoration: none;
}
.kb-q-btn:hover {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: var(--gold2);
}

/* Drop placeholder */
.kb-col.drag-over .kb-col-body::after {
  content: '';
  display: block;
  height: 60px;
  border: 2px dashed var(--gold);
  border-radius: 8px;
  background: rgba(204, 120, 92, .06);
  margin-top: 4px;
}

/* Cartões em colunas terminais ficam discretos sem afetar peso visual */
.kb-col[data-key="ganho"]   .kb-card .kb-dot { background: var(--green); }
.kb-col[data-key="perdido"] .kb-card { opacity: .65; }
.kb-col[data-key="perdido"] .kb-card .kb-card-row3 { display: none; }

.kb-empty {
  padding: 12px;
  text-align: center;
  font-size: 11px;
  color: var(--text3);
  font-style: normal;
}

@media (max-width: 1280px) {
  .kanban { grid-template-columns: repeat(3, 280px); }
}
@media (max-width: 760px) {
  .kanban { grid-template-columns: repeat(2, 260px); }
}

/* === Win overlay · celebração elegante (sentimento de vitória sem gritar) === */
.win-overlay {
  position: fixed; inset: 0;
  z-index: 9998;
  display: grid; place-items: center;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(254, 247, 241, .55) 0%, rgba(255, 255, 255, 0) 55%);
}
.win-overlay[hidden] { display: none !important; }

.win-content {
  text-align: center;
  animation: win-pop .8s cubic-bezier(.2, 1.2, .35, 1) forwards;
  pointer-events: auto;
  padding: 24px;
}

.win-headline {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--text);
  margin-bottom: 4px;
}

.win-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold2);
  margin-bottom: 10px;
}

.win-name {
  font-size: 64px;
  font-weight: 600;
  letter-spacing: -.025em;
  background: linear-gradient(105deg, #b85c44 0%, #cc785c 30%, #e8b574 50%, #cc785c 70%, #b85c44 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 6px 30px rgba(204, 120, 92, .25);
  animation: win-shimmer 3s linear infinite;
  line-height: 1.1;
  max-width: 80vw;
}
@keyframes win-shimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 220% 50%; }
}

.win-sub {
  margin-top: 12px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text2);
  letter-spacing: .02em;
  font-style: italic;
  opacity: .8;
}

.win-close {
  margin-top: 28px;
  padding: 11px 28px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  letter-spacing: .02em;
  box-shadow: 0 8px 24px -8px rgba(204, 120, 92, .5);
  pointer-events: auto;
}
.win-close:hover { transform: translateY(-1px); box-shadow: 0 10px 28px -8px rgba(204, 120, 92, .55); }

@keyframes win-pop {
  0%   { transform: scale(.85) translateY(20px); opacity: 0; }
  60%  { transform: scale(1.04); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.win-overlay.fade-out .win-content {
  animation: win-out 1.2s ease-out forwards;
}
@keyframes win-out {
  0%   { transform: scale(1) translateY(0); opacity: 1; }
  100% { transform: scale(1.06) translateY(-20px); opacity: 0; }
}

/* === Toast global (fade in/out) === */
.toast-stack {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex; flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: var(--text);
  color: var(--bg);
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 30px -8px rgba(0,0,0,.3);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .25s, transform .25s;
  pointer-events: auto;
  max-width: 360px;
  display: flex; align-items: center; gap: 9px;
}
.toast.on { opacity: 1; transform: translateY(0); }
.toast-success { background: var(--green); }
.toast-success::before { content: '✓'; font-weight: 700; font-size: 14px; }
.toast-error   { background: var(--red); }
.toast-error::before { content: '!'; font-weight: 700; font-size: 14px; }
.toast-info::before { content: 'ⓘ'; font-weight: 700; }
.toast b { font-weight: 700; }

/* === Top loading bar === */
.topbar-loading {
  position: fixed; top: 0; left: 0; right: 0;
  height: 2.5px;
  background: linear-gradient(90deg, transparent, var(--gold), var(--gold2), var(--gold), transparent);
  background-size: 50% 100%;
  z-index: 9999;
  animation: topload 1.4s linear infinite;
}
.topbar-loading[hidden] { display: none; }
@keyframes topload {
  0%   { background-position: -50% 0; }
  100% { background-position: 150% 0; }
}

/* === Modal genérico · usado pelo Ganho === */
.modal {
  position: fixed; inset: 0;
  z-index: 110;
  display: grid; place-items: center;
  padding: 20px;
}
.modal[hidden] { display: none !important; }
/* Sub-modais sobrepõem o main (sempre que abertos juntos) */
#cancel-modal,
#pac-novo-modal { z-index: 130; }
.modal-overlay {
  position: absolute; inset: 0;
  background: rgba(29, 27, 23, .45);
  backdrop-filter: blur(2px);
  animation: m-fade .2s ease-out;
}
.modal-panel {
  position: relative;
  width: 480px; max-width: 100%;
  max-height: 88vh;
  display: flex; flex-direction: column;
  background: var(--bg2);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  padding: 24px;
  animation: m-pop .25s cubic-bezier(.4, 0, .2, 1);
  overflow: hidden;
}
.modal-panel form { flex: 1; overflow-y: auto; min-height: 0; padding-right: 4px; margin-right: -4px; }
.modal-panel form .modal-actions { position: sticky; bottom: -24px; background: var(--bg2); margin: 22px -24px -24px; padding: 16px 24px 24px; border-top: 1px solid var(--line); }
@keyframes m-fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes m-pop  { from { opacity: 0; transform: translateY(8px) scale(.98) } to { opacity: 1; transform: none } }

.modal-h { margin-bottom: 18px; }
.modal-h h3 {
  margin: 0 0 6px; font-size: 18px; font-weight: 600;
  letter-spacing: -.01em; color: var(--text);
}
.modal-h p { margin: 0; font-size: 13px; color: var(--text2); }

.modal .field { margin-bottom: 14px; }
.modal .field label {
  display: block;
  font-size: 11px; color: var(--text3);
  text-transform: uppercase; letter-spacing: .06em;
  font-weight: 600; margin-bottom: 6px;
}
.modal .field input {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg2); font-size: 14px;
  outline: none; transition: border .15s;
}
.modal .field input:focus { border-color: var(--gold); }
.modal .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 22px; padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* === IA Drawer · análise pipeline / lead === */
.ia-drawer {
  position: fixed; inset: 0;
  z-index: 100;
}
.ia-drawer-overlay {
  position: absolute; inset: 0;
  background: rgba(29, 27, 23, .35);
  opacity: 0;
  transition: opacity .25s;
}
.ia-drawer.open .ia-drawer-overlay { opacity: 1; }
.ia-drawer-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 480px; max-width: 100vw;
  background: var(--bg);
  box-shadow: -10px 0 40px rgba(0,0,0,.12);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .25s cubic-bezier(.4, 0, .2, 1);
  overflow: hidden;
}
.ia-drawer.open .ia-drawer-panel { transform: translateX(0); }
.ia-drawer-h {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg2);
}
.ia-drawer-h h3 {
  margin: 0; font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 8px; color: var(--text);
}
.ia-drawer-h h3 .icon { width: 16px; height: 16px; color: var(--gold2); }
.ia-drawer-h > div { flex: 1; }
.ia-drawer-h .tb-icon { background: var(--bg3); width: 30px; height: 30px; font-size: 18px; color: var(--text2); }
.ia-drawer-body { flex: 1; overflow-y: auto; padding: 16px 18px 24px; }

.ia-loading {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; padding: 60px 20px;
  color: var(--text3); font-size: 13px;
}
.ia-loading .icon {
  animation: ia-spin 1.6s ease-in-out infinite;
}
@keyframes ia-spin {
  0%, 100% { transform: rotate(0deg) scale(1); opacity: .6; }
  50% { transform: rotate(180deg) scale(1.15); opacity: 1; }
}

.ia-summary {
  margin-bottom: 18px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--gold-soft), #fef7f1);
  border: 1px solid #f4d8c4;
  border-radius: 12px;
}
.ia-tldr { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--text); }
.ia-tldr b { font-weight: 600; }
.ia-tldr b.danger { color: var(--red); }

.ia-section {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
}
.ia-section-h {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 1px solid var(--line);
}
.ia-section-h .icon { width: 14px; height: 14px; }
.ia-h-op  { background: linear-gradient(90deg, #fef7f1, var(--bg2)); color: var(--gold2); }
.ia-h-cr  { background: linear-gradient(90deg, #fbf0ec, var(--bg2)); color: var(--red); }
.ia-h-at  { background: linear-gradient(90deg, #f7f4f2, var(--bg2)); color: var(--text2); }
.ia-h-msg { background: linear-gradient(90deg, var(--bg3), var(--bg2)); color: var(--text); }
.ia-count {
  margin-left: auto;
  background: var(--bg3); padding: 1px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0; text-transform: none;
  color: var(--text2);
}

.ia-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}
.ia-row:last-child { border-bottom: 0; }
.ia-row:hover { background: var(--bg3); }
.ia-row-nome {
  font-size: 13px; font-weight: 600; color: var(--text);
  flex-shrink: 0;
}
.ia-row-nome:hover { color: var(--gold2); }
.ia-row-meta { flex: 1; font-size: 11.5px; color: var(--text2); }
.ia-row-actions { display: flex; gap: 4px; }

.ia-msg {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.ia-msg:last-child { border-bottom: 0; }
.ia-msg-tom {
  font-size: 10.5px; color: var(--gold2);
  text-transform: uppercase; letter-spacing: .06em;
  font-weight: 700; margin-bottom: 4px;
}
.ia-msg-txt {
  font-size: 13px; line-height: 1.5;
  background: var(--bg3); padding: 10px 12px;
  border-radius: 8px; color: var(--text);
  margin-bottom: 8px; white-space: pre-wrap;
}
.ia-msg-actions { display: flex; gap: 6px; }

.ia-empty {
  text-align: center; padding: 60px 20px;
  color: var(--text2);
}
.ia-empty p { margin: 12px 0 0; font-size: 13px; line-height: 1.5; }

.ia-footer {
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--bg3);
  border-radius: 8px;
}
.ia-footer p { margin: 0; font-size: 11.5px; line-height: 1.5; color: var(--text3); }

/* === Termos & Consentimentos === */
.termos-list { display: flex; flex-direction: column; gap: 8px; }
.termo-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 14px; align-items: center;
  padding: 14px 16px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: all .15s;
}
.termo-item:hover { border-color: var(--line2); }
.termo-status-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: var(--bg3); color: var(--text3);
}
.termo-aceito   { background: linear-gradient(90deg, #f3faf6 0%, var(--bg2) 30%); border-color: #cce5d6; }
.termo-aceito   .termo-status-icon { background: #dff1e6; color: var(--green); }
.termo-pendente .termo-status-icon { background: #f6ead0; color: var(--amber); }
.termo-expirado { background: linear-gradient(90deg, #fef5f3 0%, var(--bg2) 30%); border-color: #f1d4cd; }
.termo-expirado .termo-status-icon { background: #fde7e3; color: var(--red); }
.termo-recusado .termo-status-icon { background: var(--bg3); color: var(--text3); }

.termo-tt { font-size: 13.5px; font-weight: 600; color: var(--text); }
.termo-desc { font-size: 12px; color: var(--text2); margin-top: 2px; line-height: 1.4; }
.termo-meta {
  font-size: 11.5px; color: var(--text3); margin-top: 6px; line-height: 1.5;
  font-family: -apple-system, system-ui, sans-serif;
}
.termo-meta b { color: var(--text2); font-weight: 600; }
.termo-meta.muted { font-style: italic; }
.termo-hash {
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 10.5px;
  background: var(--bg3); padding: 1px 6px; border-radius: 4px;
  color: var(--text2);
}

.termo-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; min-width: 120px; }
.termo-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; font-size: 10.5px; font-weight: 600;
  border-radius: 999px;
}
.termo-badge.ok       { background: #dff1e6; color: var(--green); }
.termo-badge.warn     { background: #fde7e3; color: var(--red); }
.termo-badge.pendente { background: #f6ead0; color: var(--amber); }

/* === Central de Termos v2 · cards expansíveis com saúde + sparkline === */
.termo-filters {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.chip {
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg2);
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
  text-decoration: none;
  transition: all .12s;
}
.chip:hover { border-color: var(--line2); color: var(--text); }
.chip.on {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
}

.termos-grid-v2 {
  display: flex; flex-direction: column;
  gap: 8px;
}

.termo-card-v2 {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color .15s;
}
.termo-card-v2:hover { border-color: var(--line2); }
.termo-card-v2[open] { border-color: var(--gold); }

/* Saúde: borda esquerda colorida sutil */
.termo-card-v2.saude-verde { border-left: 3px solid var(--green); }
.termo-card-v2.saude-amber { border-left: 3px solid var(--amber); }
.termo-card-v2.saude-red   { border-left: 3px solid var(--red); }
.termo-card-v2.saude-nunca { border-left: 3px solid var(--line2); opacity: .82; }

.termo-summary {
  display: grid;
  grid-template-columns: 40px 1fr 110px 18px;
  gap: 14px;
  padding: 14px 18px;
  align-items: center;
  cursor: pointer;
  list-style: none;
}
.termo-summary::-webkit-details-marker { display: none; }
.termo-summary::marker { display: none; }
.termo-summary:hover { background: var(--bg3); }

.termo-icon-v2 {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: grid; place-items: center;
}
.saude-verde .termo-icon-v2 { background: #dff1e6; color: var(--green); }
.saude-amber .termo-icon-v2 { background: #f6ead0; color: var(--amber); }
.saude-red   .termo-icon-v2 { background: #fde7e3; color: var(--red); }
.saude-nunca .termo-icon-v2 { background: var(--bg3); color: var(--text3); }

.termo-tt-v2 {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
}
.termo-desc-v2 { font-size: 12px; color: var(--text2); margin-top: 3px; }
.termo-stats-v2 {
  font-size: 11.5px; color: var(--text3);
  margin-top: 6px;
  display: flex; flex-wrap: wrap; gap: 4px;
}
.termo-stats-v2 b { font-weight: 700; color: var(--text2); }
.termo-stats-v2 .danger { color: var(--red); }
.termo-stats-v2 .warn { color: var(--amber); }
.termo-stats-v2 .muted { color: var(--text3); font-style: italic; }
.cobertura-verde { color: var(--green); font-weight: 600; }
.cobertura-amber { color: var(--amber); font-weight: 600; }
.cobertura-red   { color: var(--red); font-weight: 700; }

.termo-spark { color: var(--text3); width: 90px; }
.saude-verde .termo-spark { color: var(--green); }
.saude-amber .termo-spark { color: var(--amber); }
.saude-red   .termo-spark { color: var(--red); }

.termo-chev {
  color: var(--text3);
  font-size: 18px;
  transition: transform .2s;
  width: 18px;
  text-align: center;
}
.termo-card-v2[open] .termo-chev { transform: rotate(90deg); }

.termo-expand {
  border-top: 1px solid var(--line);
  padding: 10px 18px 16px;
  background: var(--bg);
}
.termo-aceites-h {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text3);
  font-weight: 700;
  margin: 8px 0 6px;
}
.termo-aceite-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 6px;
  border-radius: 6px;
  text-decoration: none; color: var(--text);
  transition: background .12s;
}
.termo-aceite-item:hover { background: var(--bg3); }
.termo-actions-row {
  display: flex; gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

/* Pendências críticas com avatar */
.pend-h {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0 4px;
  font-size: 12.5px;
}
.pend-h b { font-weight: 700; color: var(--text); }
.pend-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.pend-item:last-of-type { border-bottom: 0; }

/* === Showcase do sistema === */
.sc-bloco { margin-bottom: 24px; }
.sc-bloco-h {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 6px;
}
.sc-bloco-h h2 {
  margin: 0; font-size: 16px; font-weight: 600;
  letter-spacing: -.005em; color: var(--text);
}
.sc-status {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
}
.sc-status-verde { background: var(--green); box-shadow: 0 0 0 3px rgba(63, 131, 97, .2); }
.sc-status-amber { background: var(--amber); box-shadow: 0 0 0 3px rgba(182, 132, 58, .2); }
.sc-status-red   { background: var(--red);   box-shadow: 0 0 0 3px rgba(184, 74, 59, .2); }
.sc-bloco-desc { font-size: 12.5px; color: var(--text2); margin: 0 0 12px; }

.sc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 10px;
}
.sc-card {
  display: block;
  padding: 14px 16px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  transition: all .15s;
}
.sc-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px -8px rgba(204, 120, 92, .25);
}
.sc-card-tt { font-size: 13.5px; font-weight: 600; color: var(--text); }
.sc-card-desc {
  font-size: 11.5px; color: var(--text2);
  margin-top: 4px; line-height: 1.4;
}
.sc-card-url {
  font-size: 10.5px; color: var(--text3);
  margin-top: 8px;
  font-family: ui-monospace, "SF Mono", monospace;
  background: var(--bg3);
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
}

/* === Reativação · cards priorizados === */
.reat-list { display: flex; flex-direction: column; gap: 8px; }
.reat-card {
  display: grid;
  grid-template-columns: 46px 1fr auto auto;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 12px;
  align-items: center;
  transition: all .15s;
}
.reat-card:hover { border-color: var(--line2); transform: translateY(-1px); box-shadow: 0 4px 12px -6px rgba(0,0,0,.08); }
.reat-tt {
  font-size: 14px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.reat-tt a:hover { color: var(--gold2); }
.reat-meta {
  font-size: 11.5px; color: var(--text3);
  margin-top: 3px;
}
.reat-meta b { color: var(--text2); font-weight: 600; }
.reat-ctx {
  font-size: 11.5px;
  color: var(--text2);
  margin-top: 6px;
  font-style: italic;
  line-height: 1.45;
  max-width: 580px;
}
.reat-side {
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 8px; min-width: 90px;
}
.reat-ltv-lbl {
  font-size: 9.5px; color: var(--text3);
  text-transform: uppercase; letter-spacing: .08em; font-weight: 700;
  text-align: right;
}
.reat-ltv-val { font-size: 16px; font-weight: 700; color: var(--gold2); text-align: right; }
.reat-score {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: #fff;
}
.reat-score.score-verde { background: var(--green); }
.reat-score.score-amber { background: var(--amber); }
.reat-score.score-red   { background: var(--red); }

.reat-actions {
  display: flex; flex-direction: column;
  align-items: flex-end;
  gap: 8px; min-width: 230px;
}
.reat-gancho {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}
.reat-gancho .icon { width: 13px; height: 13px; }
.reat-gancho span { font-weight: 700; }
.reat-gancho small { font-weight: 400; opacity: .85; }
.gancho-gold  { background: var(--gold-soft); color: var(--gold2); }
.gancho-amber { background: #f6ead0; color: var(--amber); }
.gancho-red   { background: #fde7e3; color: var(--red); }
.gancho-blue  { background: #dde9ee; color: var(--blue); }

@media (max-width: 1080px) {
  .reat-card { grid-template-columns: 46px 1fr; gap: 10px; }
  .reat-side, .reat-actions { grid-column: 2; align-items: flex-start; }
}

/* === Central de Termos · catálogo grid (legado · removido) === */
.termos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 1px;
  background: var(--line);
}
.termo-cat-card {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 14px;
  padding: 16px 20px;
  background: var(--bg2);
  align-items: flex-start;
  cursor: pointer;
  transition: background .12s;
}
.termo-cat-card:hover { background: var(--bg3); }
.termo-cat-card.critico { border-left: 3px solid var(--red); padding-left: 17px; }
.termo-cat-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--gold-soft);
  display: grid; place-items: center;
  color: var(--gold2);
}
.termo-cat-card.critico .termo-cat-icon { background: #fde7e3; color: var(--red); }
.termo-cat-tt {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; flex-wrap: wrap;
}
.termo-cat-desc { font-size: 12px; color: var(--text2); margin-top: 3px; line-height: 1.4; }
.termo-cat-stats {
  font-size: 11.5px; color: var(--text3);
  margin-top: 8px;
  display: flex; gap: 14px; flex-wrap: wrap;
}
.termo-cat-stats b { font-weight: 700; }
.termo-cat-stats .ok { color: var(--green); }
.termo-cat-stats .warn { color: var(--amber); }
.termo-cat-stats .danger { color: var(--red); }
.termo-cat-key code {
  font-size: 10.5px;
  background: var(--bg3);
  padding: 2px 7px;
  border-radius: 4px;
  color: var(--text3);
  font-family: ui-monospace, "SF Mono", monospace;
}

/* Aceites recentes (linha) */
.aceite-row {
  display: grid; grid-template-columns: 26px 1fr auto; gap: 11px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
  text-decoration: none; color: var(--text);
  transition: padding .1s;
}
.aceite-row:last-child { border-bottom: 0; }
.aceite-row:hover { padding-left: 4px; }
.aceite-icon {
  width: 26px; height: 26px;
  border-radius: 6px;
  background: #dff1e6;
  color: var(--green);
  display: grid; place-items: center;
}
.aceite-tt { font-size: 12.5px; font-weight: 500; }
.aceite-meta { font-size: 11px; color: var(--text3); margin-top: 1px; }
.aceite-meta b { color: var(--text2); font-weight: 600; }

/* === HERO Admin · variant (mais sóbrio, profissional) === */
.hero-aurora-adm {
  background:
    radial-gradient(ellipse at 20% 25%, #d4ddec 0%, transparent 45%),
    radial-gradient(ellipse at 75% 30%, #e8d6c4 0%, transparent 50%),
    radial-gradient(ellipse at 60% 80%, #ddd8d0 0%, transparent 55%),
    radial-gradient(ellipse at 30% 95%, #c4cbd6 0%, transparent 50%),
    linear-gradient(135deg, #ebe3d6 0%, #d4cdc0 35%, #c0c5cd 60%, #b6bcc6 100%);
}

/* === HERO Comercial · variant === */
.hero-aurora-sec {
  background:
    radial-gradient(ellipse at 25% 30%, #cbe4f0 0%, transparent 45%),
    radial-gradient(ellipse at 80% 25%, #f4d0a8 0%, transparent 50%),
    radial-gradient(ellipse at 55% 80%, #f9e2cf 0%, transparent 55%),
    radial-gradient(ellipse at 30% 95%, #d4dbe6 0%, transparent 50%),
    linear-gradient(135deg, #fef5e8 0%, #f4d4b8 35%, #ddd4d0 60%, #c8d3e0 100%);
}
.mission-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: rgba(255,255,255,.7);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--text);
  text-shadow: 0 1px 1px rgba(255,255,255,.5);
}

/* === Inbox de IA · Lista de prioridades === */
.widget-priorities { padding: 22px; }
.pri-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.pri-item {
  display: grid;
  grid-template-columns: 4px 32px 1fr auto;
  gap: 12px; align-items: center;
  padding: 12px 14px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: all .15s;
}
.pri-item:hover { border-color: var(--line2); transform: translateX(2px); }
.pri-bar { height: 100%; border-radius: 2px; align-self: stretch; }
.pri-high .pri-bar { background: var(--red); }
.pri-med  .pri-bar { background: var(--amber); }
.pri-low  .pri-bar { background: var(--blue); }
.pri-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: grid; place-items: center;
}
.pri-high .pri-icon { background: #fde7e3; color: var(--red); }
.pri-med  .pri-icon { background: #f6ead0; color: var(--amber); }
.pri-low  .pri-icon { background: #dde9ee; color: var(--blue); }
.pri-tt { font-size: 13.5px; font-weight: 600; color: var(--text); }
.pri-desc { font-size: 12px; color: var(--text2); margin-top: 2px; line-height: 1.4; }

/* === Comissão extra === */
.comissao-meta { font-size: 11.5px; color: var(--text2); line-height: 1.5; margin-bottom: 6px; }
.comissao-meta b { color: var(--text); font-weight: 600; }
.comissao-next {
  font-size: 11.5px; color: var(--text2);
  padding: 8px 10px; background: var(--bg3);
  border-radius: 6px; margin-top: 4px;
}
.comissao-next b { color: var(--gold2); font-weight: 600; }
.comissao-next.ok { background: #dff1e6; color: var(--green); }
.comissao-next.ok b { color: var(--green); }

/* === Catálogo de SKUs · Bloco 5 Clínica === */
.sku-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.sku-card {
  display: block;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--cor, var(--gold));
  border-radius: var(--r-md);
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.sku-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(20, 14, 5, 0.06);
}
.sku-card-sel {
  box-shadow: 0 0 0 2px var(--cor, var(--gold)), 0 6px 24px rgba(20,14,5,.08);
  transform: translateY(-2px);
}
.sku-card-h {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 8px;
}
.sku-cat {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 600; padding: 3px 8px;
  border-radius: 999px; letter-spacing: 0.2px;
}
.sku-cat .icon { width: 12px; height: 12px; }
.sku-code {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 10.5px; color: var(--text3);
  background: var(--bg3); padding: 2px 7px;
  border-radius: 4px; letter-spacing: 0.3px;
}
.sku-nome {
  font-size: 14px; font-weight: 600; color: var(--text);
  line-height: 1.3; margin-bottom: 2px;
}
.sku-marca {
  font-size: 11.5px; color: var(--text3);
  margin-bottom: 6px;
}
.sku-preco {
  font-size: 17px; font-weight: 700; color: var(--text);
  margin: 6px 0 8px; display: flex; align-items: baseline; gap: 6px;
}
.sku-preco small { font-size: 11px; font-weight: 400; }
.sku-meta {
  display: flex; gap: 12px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--text2);
  margin-bottom: 10px;
}
.sku-meta span { display: inline-flex; align-items: center; gap: 4px; }
.sku-meta .icon { width: 12px; height: 12px; color: var(--text3); }
.sku-icp {
  display: flex; gap: 7px; align-items: flex-start;
  background: var(--bg3); border-radius: 6px;
  padding: 8px 10px; font-size: 11.5px;
  color: var(--text2); line-height: 1.45;
  margin-bottom: 8px;
}
.sku-icp .icon { width: 13px; height: 13px; flex-shrink: 0; margin-top: 2px; }
.sku-areas { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.sku-area {
  font-size: 10.5px; padding: 2px 8px;
  background: var(--bg3); border-radius: 999px;
  color: var(--text2);
}
.sku-area-more {
  background: transparent; border: 1px dashed var(--line);
  color: var(--text3);
}
.sku-area-tag {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 10px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text3);
}
.sku-meta-vendas {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--text2);
  margin-top: 6px;
}
.sku-meta-vendas .icon { width: 12px; height: 12px; }

/* Drawer lateral · ficha completa */
.sku-drawer-back {
  position: fixed; inset: 0;
  background: rgba(20, 14, 5, 0.28);
  backdrop-filter: blur(2px);
  z-index: 110; cursor: pointer;
  animation: sku-fade-in .18s ease;
}
.sku-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 460px; max-width: 92vw;
  background: var(--bg2);
  border-left: 4px solid var(--cor, var(--gold));
  z-index: 120;
  padding: 22px 26px 80px;
  overflow-y: auto;
  box-shadow: -10px 0 40px rgba(20, 14, 5, 0.1);
  animation: sku-slide-in .22s cubic-bezier(.2, .9, .2, 1);
}
@keyframes sku-fade-in { from { opacity: 0 } to { opacity: 1 } }
@keyframes sku-slide-in { from { transform: translateX(20px); opacity: 0 } to { transform: none; opacity: 1 } }
.sku-drawer-h {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.sku-drawer-close {
  margin-left: auto;
  font-size: 22px; line-height: 1;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 8px; cursor: pointer;
  color: var(--text3); text-decoration: none;
  transition: background .12s, color .12s;
}
.sku-drawer-close:hover { background: var(--bg3); color: var(--text); }
.sku-drawer-tt {
  font-size: 22px; font-weight: 700;
  color: var(--text); line-height: 1.2;
  margin: 0 0 4px; letter-spacing: -0.2px;
}
.sku-drawer-preco {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 14px;
  background-color: color-mix(in srgb, var(--cor, var(--gold)) 8%, var(--bg2));
  padding: 14px 16px;
  border-radius: var(--r-md);
  margin: 14px 0 18px;
}
.sku-preco-lbl {
  font-size: 10.5px; color: var(--text3);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.sku-preco-val {
  font-size: 19px; font-weight: 700; color: var(--text);
  line-height: 1.1;
}
.sku-preco-val small {
  font-size: 11.5px; font-weight: 400; color: var(--text3);
}
.sku-drawer-desc {
  font-size: 13px; color: var(--text2);
  line-height: 1.55; margin: 0 0 18px;
  padding: 12px 14px; background: var(--bg3);
  border-radius: 8px; border-left: 3px solid var(--line);
}
.sku-bloco {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.sku-bloco:last-of-type { border-bottom: 0; }
.sku-bloco-h {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.sku-bloco-h h3 {
  font-size: 13px; font-weight: 600;
  color: var(--text); margin: 0;
  letter-spacing: -0.1px;
}
.sku-bloco-row {
  font-size: 12.5px; color: var(--text2);
  line-height: 1.55; margin-bottom: 6px;
}
.sku-bloco-row b { color: var(--text); font-weight: 600; }
.sku-bloco-row:last-child { margin-bottom: 0; }
.sku-bloco-busca {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 11.5px; padding: 8px 10px;
  background: var(--bg3); border-radius: 6px;
  color: var(--text3); margin-top: 6px;
}
.sku-bloco-warn {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 18px;
  border-bottom: 0;
}
.sku-bloco-warn .sku-bloco-h h3 { color: #b91c1c; }
.sku-combo { display: flex; flex-wrap: wrap; gap: 6px; }
.sku-combo-chip {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 11px; padding: 5px 10px;
  background: var(--bg3); border: 1px solid var(--line);
  border-radius: 6px; color: var(--text);
  text-decoration: none;
  transition: background .12s, border-color .12s;
}
.sku-combo-chip:hover {
  background: var(--gold-soft);
  border-color: var(--gold);
}
.sku-proto-row {
  display: block;
  background: var(--bg3);
  border-left: 3px solid var(--cor, var(--gold));
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
  text-decoration: none;
  color: inherit;
  transition: transform .12s, background .12s;
}
.sku-proto-row:hover {
  background: var(--gold-soft);
  transform: translateX(2px);
}
.sku-proto-tt {
  font-size: 12.5px; font-weight: 600; color: var(--text);
}
.sku-proto-meta {
  font-size: 11px; color: var(--text2);
  margin-top: 3px; display: flex; align-items: center; gap: 6px;
}
.sku-proto-desc {
  background: var(--green); color: white;
  padding: 1px 6px; border-radius: 3px;
  font-size: 9.5px; font-weight: 600;
  letter-spacing: 0.3px;
}
.sku-drawer-actions {
  position: sticky; bottom: 0;
  background: var(--bg2); padding: 14px 0 0;
  margin: 16px -2px 0;
  border-top: 1px solid var(--line);
  display: flex; gap: 8px; flex-wrap: wrap;
}
.sku-drawer-actions .btn { flex: 1; min-width: 110px; justify-content: center; }

@media (max-width: 720px) {
  .sku-drawer { width: 100vw; padding: 18px 16px 60px; }
  .sku-drawer-preco { grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px 12px; }
}

/* === Financeiro · faturamento mensal · Bloco 6 === */
.kpi .delta.ok   { color: var(--green); font-weight: 500; }
.kpi .delta.warn { color: var(--red);   font-weight: 500; }
.kpi .val.ok     { color: var(--green); }
.kpi .val.warn   { color: var(--amber); }

/* Lançamento de venda · form */
.lanc-grid {
  display: grid; grid-template-columns: 1.6fr 1fr;
  gap: 14px; align-items: start;
}
.lanc-side { position: sticky; top: 78px; display: flex; flex-direction: column; gap: 12px; }
.lanc-row { display: flex; gap: 10px; flex-wrap: wrap; }
.lanc-lbl {
  display: block; font-size: 10.5px;
  text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--text3); margin-bottom: 4px; font-weight: 600;
}
.lanc-input {
  width: 100%; padding: 8px 11px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--bg2); font-size: 13px; color: var(--text);
  font-family: inherit;
  transition: border-color .12s, box-shadow .12s;
}
.lanc-input:focus {
  outline: 0; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(180,140,90,.15);
}
textarea.lanc-input { resize: vertical; min-height: 60px; }

.lanc-search-results {
  position: absolute;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: 0 8px 24px rgba(20,14,5,.08);
  max-width: 360px; max-height: 240px; overflow-y: auto;
  z-index: 50; margin-top: 2px;
}
.lanc-search-item {
  padding: 8px 12px; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12.5px; gap: 12px;
  border-bottom: 1px solid var(--line);
}
.lanc-search-item:last-child { border-bottom: 0; }
.lanc-search-item:hover { background: var(--gold-soft); }
.lanc-search-item small { font-size: 11px; }

.lanc-item {
  background: var(--bg3);
  border-left: 3px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 12px; margin-bottom: 8px;
  transition: border-color .15s;
}
.lanc-item:last-child { margin-bottom: 0; }
.lanc-item-row {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end;
}
.lanc-rm {
  border: 0; background: transparent;
  color: var(--text3); font-size: 18px; cursor: pointer;
  width: 28px; height: 32px;
  display: grid; place-items: center;
  border-radius: 6px;
  transition: background .12s, color .12s;
}
.lanc-rm:hover { background: #fde7e3; color: var(--red); }

.lanc-resumo .lanc-resumo-row {
  display: flex; justify-content: space-between;
  font-size: 12.5px; padding: 4px 0;
  color: var(--text2);
}
.lanc-resumo .lanc-resumo-row b { color: var(--text); font-weight: 500; }

@media (max-width: 1080px) {
  .lanc-grid { grid-template-columns: 1fr; }
  .lanc-side { position: static; }
}

/* === DRE · Demonstrativo de Resultado === */
.dre-grid {
  display: grid; grid-template-columns: 1.7fr 1fr;
  gap: 14px; align-items: start;
}
.dre-side { position: sticky; top: 78px; max-height: calc(100vh - 100px); overflow-y: auto; }

.dre-tbl {
  width: 100%; border-collapse: collapse;
  font-size: 12.5px;
}
.dre-tbl thead th {
  text-align: left; font-size: 10.5px;
  text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--text3); font-weight: 600;
  padding: 8px 10px; border-bottom: 1px solid var(--line);
}
.dre-tbl td {
  padding: 7px 10px;
  border-bottom: 1px solid #f3ede5;
  vertical-align: middle;
}
.dre-row { transition: background .12s; }
.dre-row:not(.dre-blank):hover { background: var(--bg3); }
.dre-row-active {
  background: var(--gold-soft) !important;
  outline: 1px solid rgba(180,140,90,.3);
}
.dre-blank td {
  padding: 4px 10px; border-bottom: 0;
}

.dre-lbl {
  position: relative; padding-right: 14px;
  color: var(--text);
  white-space: nowrap;
}
.dre-drill-icon {
  margin-left: 6px; color: var(--text3);
  font-size: 13px; opacity: 0.6;
}
.dre-row:hover .dre-drill-icon { opacity: 1; color: var(--gold2); }

.dre-val {
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 12px; text-align: right;
  white-space: nowrap; padding-left: 0;
}
.dre-pct {
  font-variant-numeric: tabular-nums;
  font-size: 11px; text-align: right;
  white-space: nowrap;
  min-width: 50px;
}
.dre-delta {
  font-variant-numeric: tabular-nums;
  font-size: 11px; text-align: right;
  white-space: nowrap; font-weight: 500;
  min-width: 60px;
}
.dre-delta.ok   { color: var(--green); }
.dre-delta.warn { color: var(--red); }
.dre-delta.muted { color: var(--text3); font-weight: 400; }

.dre-bar-cell { width: 100px; padding: 0 8px !important; }
.dre-bar {
  height: 4px; background: var(--bg3);
  border-radius: 99px; overflow: hidden;
}
.dre-bar-fill {
  height: 100%; border-radius: 99px;
  transition: width .8s cubic-bezier(.2,.9,.2,1);
}

.dre-h .dre-lbl { font-weight: 600; font-size: 13px; }
.dre-h .dre-val { font-weight: 600; font-size: 13.5px; }

.dre-s .dre-lbl { color: var(--text2); font-size: 12px; }
.dre-s .dre-val { color: var(--text2); }

.dre-d .dre-lbl { color: #b45309; }
.dre-d .dre-val { color: #b45309; font-weight: 500; }

.dre-t {
  background: linear-gradient(to right, transparent, rgba(180,140,90,.04));
}
.dre-t .dre-lbl { font-weight: 700; font-size: 13px; color: var(--text); }
.dre-t .dre-val { font-weight: 700; font-size: 14px; color: var(--text); }
.dre-t td {
  border-top: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
  padding-top: 9px; padding-bottom: 9px;
}

.dre-tot-final {
  background: linear-gradient(to right, transparent, rgba(16,185,129,.08));
}
.dre-tot-final .dre-lbl { font-weight: 700; font-size: 14.5px; color: #047857; }
.dre-tot-final .dre-val { font-weight: 700; font-size: 16px; color: #047857; }
.dre-tot-final td {
  border-top: 2px solid #10b981;
  border-bottom: 0;
  padding-top: 11px; padding-bottom: 11px;
}

.dre-pos-bold .dre-lbl { color: var(--text); font-weight: 600; }
.dre-neg .dre-val { color: #ea580c; }
.dre-neg-bold .dre-lbl { color: #b45309; font-weight: 600; }
.dre-neg-bold .dre-val { color: #b45309; font-weight: 600; }
.dre-subtot { background: rgba(180,140,90,.05); }

.dre-foot {
  display: flex; justify-content: space-between;
  padding: 12px 4px 4px;
  border-top: 1px dashed var(--line);
  margin-top: 10px;
}

.dre-drill-close {
  margin-left: auto;
  font-size: 22px; line-height: 1;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 6px;
  color: var(--text3); text-decoration: none;
  transition: background .12s, color .12s;
}
.dre-drill-close:hover { background: var(--bg3); color: var(--text); }

.dre-drill-list {
  display: flex; flex-direction: column;
  gap: 6px; max-height: 600px; overflow-y: auto;
}
.dre-drill-row {
  display: flex; justify-content: space-between;
  align-items: center; gap: 12px;
  padding: 8px 10px;
  background: var(--bg3); border-radius: 6px;
  border-left: 3px solid var(--gold);
}
.dre-drill-info { min-width: 0; flex: 1; }
.dre-drill-tt {
  font-size: 12px; font-weight: 500;
  color: var(--text); line-height: 1.3;
  white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis;
}
.dre-drill-meta {
  font-size: 10.5px; color: var(--text3);
  margin-top: 2px;
}
.dre-drill-val {
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 12px; font-weight: 600;
  color: var(--text); white-space: nowrap;
}

@media (max-width: 1280px) {
  .dre-bar-cell { display: none; }
}
@media (max-width: 1080px) {
  .dre-grid { grid-template-columns: 1fr; }
  .dre-side { position: static; max-height: none; }
  .dre-tbl thead th[colspan="2"]:not(:nth-child(2)),
  .dre-tbl tbody td:nth-child(5),
  .dre-tbl tbody td:nth-child(6) { display: none; }
}

/* === Notas Fiscais · Assistente de emissão === */
.nf-row-pend { background: rgba(254, 215, 170, 0.18); }
.nf-row-pend:hover { background: rgba(254, 215, 170, 0.30); }

.nf-drawer { width: 520px; max-width: 94vw; }

.nf-alerta {
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 12.5px;
  color: #92400e;
  line-height: 1.55;
}
.nf-alerta b { color: #78350f; }
.nf-alerta details summary { color: #b45309; }

.nf-roteiro {
  display: flex; flex-direction: column;
  gap: 6px;
}
.nf-roteiro-row {
  display: grid; grid-template-columns: 130px 1fr;
  gap: 10px; align-items: center;
  padding: 7px 10px;
  background: var(--bg3);
  border-radius: 6px;
  border-left: 2px solid var(--line);
  transition: border-color .15s, background .15s;
}
.nf-roteiro-row:hover {
  background: var(--gold-soft);
  border-left-color: var(--gold);
}
.nf-roteiro-row.nf-warn {
  background: #fef3c7;
  border-left-color: #f59e0b;
}
.nf-roteiro-lbl {
  font-size: 10.5px; color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.4px; font-weight: 600;
}
.nf-roteiro-val {
  display: flex; align-items: center; gap: 8px;
  min-width: 0;
}
.nf-roteiro-text {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 11.5px;
  color: var(--text);
  flex: 1;
  word-break: break-word;
  line-height: 1.4;
}
.nf-warn .nf-roteiro-text { color: #92400e; }

.nf-copy {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border: 0; background: var(--bg2);
  color: var(--text3);
  border-radius: 5px;
  cursor: pointer;
  display: grid; place-items: center;
  transition: background .15s, color .15s;
}
.nf-copy:hover { background: var(--gold-soft); color: var(--gold2); }
.nf-copy-ok {
  background: #d1fae5 !important;
  color: #047857 !important;
}
.nf-copy-ok::after {
  content: '✓';
  font-weight: 700;
}
.nf-copy-ok svg { display: none; }
.nf-copy svg { width: 12px; height: 12px; }

/* === Comissões · evolução 6 meses === */
.com-evolucao {
  display: flex; gap: 14px; align-items: flex-end;
  height: 140px; padding: 10px 0 0;
  border-bottom: 1px solid var(--line);
}
.com-evolucao-mes {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; height: 100%;
  position: relative;
}
.com-evolucao-bars {
  display: flex; align-items: flex-end;
  gap: 3px; width: 100%; max-width: 60px;
  height: 100%;
}
.com-bar {
  flex: 1; min-width: 8px;
  border-radius: 3px 3px 0 0;
  transition: opacity .15s, transform .15s;
}
.com-bar:hover { transform: scaleY(1.04); filter: brightness(1.1); cursor: pointer; }
.com-evolucao-lbl {
  position: absolute; bottom: -22px;
  font-size: 11px; color: var(--text3);
  white-space: nowrap;
}
.com-evolucao-lbl.is-active {
  color: var(--text); font-weight: 600;
}

/* === Cenários what-if === */
.cen-grid {
  display: grid; grid-template-columns: 1fr 1.2fr;
  gap: 14px; align-items: start;
}
.cen-side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 78px; }

.cen-input {
  margin-bottom: 18px;
}
.cen-input label {
  display: flex; justify-content: space-between;
  font-size: 12.5px; color: var(--text2);
  margin-bottom: 6px; font-weight: 500;
}
.cen-input .cen-val {
  font-family: ui-monospace, SFMono-Regular, monospace;
  color: var(--gold2); font-weight: 700;
}
.cen-input input[type=range] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: linear-gradient(90deg,#fed7aa 0%,#fed7aa 50%,#d1fae5 50%,#d1fae5 100%);
  border-radius: 99px;
  outline: none;
  cursor: pointer;
}
.cen-input input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px;
  background: var(--bg2);
  border: 2px solid var(--gold);
  border-radius: 50%; cursor: pointer;
  box-shadow: 0 2px 6px rgba(180,140,90,.35);
  transition: transform .12s;
}
.cen-input input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.15); }
.cen-input input[type=range]::-moz-range-thumb {
  width: 18px; height: 18px;
  background: var(--bg2); border: 2px solid var(--gold);
  border-radius: 50%; cursor: pointer;
}
.cen-anchors {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--text3);
  margin-top: 4px;
}

.cen-delta-badge {
  font-size: 11.5px; font-weight: 600;
  padding: 3px 8px; border-radius: 99px;
}
.cen-delta-badge.pos     { background: #d1fae5; color: #047857; }
.cen-delta-badge.neg     { background: #fecaca; color: #b91c1c; }
.cen-delta-badge.neutral { background: var(--bg3); color: var(--text3); }

.cen-tbl {
  width: 100%; border-collapse: collapse;
  font-size: 12px;
}
.cen-tbl thead th {
  text-align: left; font-size: 10.5px;
  text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--text3); font-weight: 600;
  padding: 6px 8px; border-bottom: 1px solid var(--line);
}
.cen-tbl tbody td {
  padding: 6px 8px;
  border-bottom: 1px solid #f3ede5;
  font-variant-numeric: tabular-nums;
}
.cen-tbl tbody td:first-child {
  color: var(--text); font-weight: 500;
}
.cen-row-neg td:first-child { color: #b45309; font-size: 11.5px; padding-left: 16px; }
.cen-row-neg td:nth-child(2) { color: #ea580c; }
.cen-row-sub { background: rgba(180,140,90,.04); }
.cen-row-sub td { font-weight: 600; }
.cen-row-final {
  background: linear-gradient(to right, transparent, rgba(16,185,129,.08));
}
.cen-row-final td:first-child { color: #047857; font-weight: 700; font-size: 13px; }
.cen-row-final td:nth-child(2) { color: #047857; font-weight: 700; font-size: 14px; }
.cen-row-final td { padding-top: 9px; padding-bottom: 9px; border-top: 2px solid #10b981; border-bottom: 0; }
.cen-row-big td { font-weight: 600; font-size: 12.5px; }

.cen-tbl .ok    { color: var(--green); font-weight: 500; }
.cen-tbl .warn  { color: var(--red); font-weight: 500; }
.cen-tbl .muted { color: var(--text3); }

@media (max-width: 1080px) {
  .cen-grid { grid-template-columns: 1fr; }
  .cen-side { position: static; }
}

/* === ⌘K Command Palette === */
.cmdk-back {
  position: fixed; inset: 0;
  background: rgba(20, 14, 5, 0.42);
  backdrop-filter: blur(3px);
  z-index: 200;
  animation: cmdk-fade .15s ease;
}
@keyframes cmdk-fade { from { opacity: 0 } to { opacity: 1 } }
.cmdk-modal {
  position: fixed; top: 14vh; left: 50%;
  transform: translateX(-50%);
  width: 92%; max-width: 620px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(20, 14, 5, .25), 0 0 0 1px rgba(180,140,90,.08);
  z-index: 201;
  overflow: hidden;
  display: flex; flex-direction: column;
  animation: cmdk-slide .18s cubic-bezier(.2,.9,.2,1);
}
@keyframes cmdk-slide { from { transform: translate(-50%, -10px); opacity: 0 } to { transform: translateX(-50%); opacity: 1 } }

.cmdk-input-wrap {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.cmdk-input-wrap .icon { width: 18px; height: 18px; color: var(--text3); }
#cmdk-input {
  flex: 1; border: 0; outline: 0; background: transparent;
  font-size: 16px; color: var(--text);
  font-family: inherit;
}
#cmdk-input::placeholder { color: var(--text3); }
.cmdk-input-wrap kbd {
  font-size: 10.5px; padding: 2px 6px;
  background: var(--bg3); border: 1px solid var(--line);
  border-radius: 4px; color: var(--text3);
  font-family: ui-monospace, SFMono-Regular, monospace;
}

.cmdk-results {
  max-height: 60vh; overflow-y: auto;
  padding: 6px 4px;
}
.cmdk-group-h {
  font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .5px; color: var(--text3);
  font-weight: 600; padding: 10px 16px 6px;
}

.cmdk-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 14px;
  margin: 0 4px; border-radius: 8px;
  cursor: pointer;
  transition: background .1s;
}
.cmdk-item.on { background: var(--gold-soft); }
.cmdk-item .icon {
  width: 16px; height: 16px;
  color: var(--text3); flex-shrink: 0;
}
.cmdk-item.on .icon { color: var(--gold2); }
.cmdk-text { flex: 1; min-width: 0; }
.cmdk-title {
  font-size: 13.5px; font-weight: 500;
  color: var(--text); line-height: 1.3;
  display: flex; align-items: center; gap: 7px;
}
.cmdk-title mark { background: rgba(180,140,90,.25); color: var(--text); border-radius: 2px; padding: 0 2px; }
.cmdk-grp {
  font-size: 10px; padding: 1px 6px;
  background: var(--bg3); color: var(--text3);
  border-radius: 99px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .3px;
}
.cmdk-sub {
  font-size: 11.5px; color: var(--text3);
  margin-top: 2px;
}
.cmdk-arrow {
  font-size: 13px; color: var(--text3);
  font-family: ui-monospace, SFMono-Regular, monospace;
  opacity: 0; transition: opacity .12s;
}
.cmdk-item.on .cmdk-arrow { opacity: 1; color: var(--gold2); }

.cmdk-empty {
  padding: 30px;
  text-align: center; color: var(--text3);
  font-size: 13px;
}
.cmdk-foot {
  display: flex; justify-content: flex-end;
  gap: 16px; padding: 8px 16px;
  border-top: 1px solid var(--line);
  background: var(--bg);
  font-size: 10.5px; color: var(--text3);
}
.cmdk-foot kbd {
  font-size: 9.5px; padding: 1px 5px;
  background: var(--bg3); border: 1px solid var(--line);
  border-radius: 3px; color: var(--text2);
  font-family: ui-monospace, SFMono-Regular, monospace;
  margin-right: 4px;
}

/* topbar cmdk button (não era button antes) */
button.cmdk {
  border: 0; cursor: pointer; font-family: inherit;
}

/* === Copiloto Claude · insight do mês === */
.copilot-card {
  background: linear-gradient(135deg, rgba(124,58,237,0.04), rgba(180,140,90,0.04));
  border: 1px solid var(--line);
  border-left: 4px solid #7c3aed;
  border-radius: var(--r-md);
  padding: 14px 18px;
  transition: border-left-color .3s;
}
.copilot-h {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--text2);
  margin-bottom: 10px;
}
.copilot-h .icon { width: 16px; height: 16px; }
.copilot-content { font-size: 13px; }
.copilot-loading {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0; color: var(--text3);
  font-size: 12.5px;
}
.copilot-spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(124,58,237,0.2);
  border-top-color: #7c3aed;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.copilot-tldr {
  font-size: 14px; font-weight: 500;
  color: var(--text); line-height: 1.45;
  margin: 0 0 14px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.5);
  border-radius: 7px;
}
.copilot-insights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}
.copilot-insight {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.65);
  border-radius: 7px;
  border-left: 3px solid #7c3aed;
}
.copilot-insight .icon {
  width: 18px; height: 18px;
  color: #7c3aed; flex-shrink: 0; margin-top: 2px;
}
.copilot-insight-tt {
  font-size: 12.5px; font-weight: 600;
  color: var(--text); line-height: 1.3;
  margin-bottom: 3px;
}
.copilot-insight-desc {
  font-size: 11.5px; color: var(--text2);
  line-height: 1.45; margin-bottom: 5px;
}
.copilot-insight-acao {
  font-size: 11px; color: #6d28d9;
  font-weight: 500; line-height: 1.4;
  font-style: italic;
}

@media (max-width: 720px) {
  .copilot-insights { grid-template-columns: 1fr; }
}

/* Bar chart diário */
.findb-bars {
  display: flex; align-items: flex-end;
  gap: 3px; height: 140px;
  padding: 8px 0 0;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.findb-bar-wrap {
  flex: 1; min-width: 8px;
  height: 100%;
  display: flex; flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  position: relative;
  cursor: default;
}
.findb-bar {
  width: 100%;
  border-radius: 3px 3px 0 0;
  transition: opacity .15s, transform .15s;
  position: relative;
}
.findb-bar-wrap:hover .findb-bar {
  transform: scaleY(1.04);
  filter: brightness(1.08);
}
.findb-bar-today {
  outline: 2px solid var(--text);
  outline-offset: 1px;
}
.findb-bar-empty { opacity: .35; min-height: 2px !important; }
.findb-bar-lbl {
  position: absolute; bottom: -16px;
  font-size: 9.5px; color: var(--text3);
  white-space: nowrap;
}

/* Top SKUs */
.fin-sku-row {
  display: block; padding: 8px 10px;
  border-radius: 7px; border-left: 3px solid var(--cor, var(--gold));
  background: var(--bg3);
  text-decoration: none; color: inherit;
  transition: transform .12s, background .12s;
}
.fin-sku-row:hover {
  background: var(--gold-soft);
  transform: translateX(2px);
}
.fin-sku-tt {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 500; color: var(--text);
  margin-bottom: 5px;
}
.fin-sku-rank {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 10.5px; color: var(--cor, var(--gold2));
  font-weight: 700; letter-spacing: 0.3px;
  background: color-mix(in srgb, var(--cor, var(--gold)) 12%, transparent);
  padding: 1px 5px; border-radius: 3px;
}
.fin-sku-code {
  margin-left: auto;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 9.5px; color: var(--text3);
  letter-spacing: 0.3px;
}
.fin-sku-progress {
  height: 4px; background: rgba(0,0,0,0.05);
  border-radius: 99px; overflow: hidden;
  margin-bottom: 5px;
}
.fin-sku-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cor, var(--gold)), color-mix(in srgb, var(--cor, var(--gold2)) 70%, white));
  border-radius: 99px;
  transition: width .8s cubic-bezier(.2,.9,.2,1);
}
.fin-sku-meta {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--text2);
}

@media (max-width: 1280px) {
  .app { grid-template-columns: 220px 1fr 300px; }
  .widgets { grid-template-columns: 1fr 1fr; }
  .widget-priorities { grid-column: span 2; }
}
@media (max-width: 1080px) {
  .app, .app.no-cp { grid-template-columns: 200px 1fr; }
  .copilot { display: none; }
  .widgets { grid-template-columns: 1fr; }
}
