/* =====================================================================
   Katu — Painel de Gestão  ·  folha de estilo
   Identidade: azul escuro (autoridade) + azul intenso/ciano (ação)
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,600;12..96,700;12..96,800&family=Archivo:wght@400;500;600;700&display=swap');

:root {
  /* paleta Katu — azuis */
  --bg: #eef2f9;
  --bg-2: #e4ebf6;
  --surface: #ffffff;
  --surface-2: #f5f8fd;
  --ink: #0f1b33;
  --ink-soft: #46506a;
  --muted: #8791a8;
  --line: #e1e8f4;
  --line-2: #eef2f9;

  --navy: #0b1e47;          /* azul escuro de autoridade */
  --navy-2: #081634;        /* mais escuro (sidebar/hero) */
  --brand: #1e63ff;         /* azul intenso (primário/CTA) */
  --brand-deep: #1746b8;
  --brand-tint: #e4edff;
  --cyan: #12b6e8;          /* ciano (destaques/indicadores) */
  --cyan-tint: #def4fc;
  --amber: #d99a2b;         /* alerta/pendente */
  --amber-tint: #f8edd2;
  --green: #2f9469;         /* dinheiro entrando */
  --green-tint: #e0f1ea;
  --danger: #d6453f;
  --danger-tint: #fbe4e3;
  --warn: #d99a2b;
  --warn-tint: #f8edd2;

  --shadow-sm: 0 1px 2px rgba(11, 30, 71, .05), 0 1px 3px rgba(11, 30, 71, .06);
  --shadow-md: 0 4px 16px rgba(11, 30, 71, .09), 0 2px 6px rgba(11, 30, 71, .06);
  --shadow-lg: 0 20px 50px rgba(8, 22, 52, .18);

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --sidebar-w: 248px;

  --sans: 'Archivo', system-ui, sans-serif;
  --display: 'Bricolage Grotesque', 'Archivo', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  /* atmosfera azul sutil */
  background-image:
    radial-gradient(circle at 16% 10%, rgba(30, 99, 255, .05), transparent 42%),
    radial-gradient(circle at 90% 6%, rgba(18, 182, 232, .05), transparent 40%);
  background-attachment: fixed;
}
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; letter-spacing: -.015em; line-height: 1.12; }
.tnum { font-variant-numeric: tabular-nums; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
::selection { background: var(--brand); color: #fff; }

/* ===================== LAYOUT SHELL ===================== */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

/* --- Sidebar --- */
.sidebar {
  background: linear-gradient(172deg, #0b1e47 0%, #0a1a3e 55%, #081634 100%);
  color: #dde6f5;
  display: flex; flex-direction: column;
  padding: 20px 16px;
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid #060f24;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 4px 20px; }
.brand-plate {
  background: #fff; border-radius: 12px; padding: 9px 11px; flex: 0 0 auto;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
}
.brand-plate img { height: 34px; width: auto; display: block; }
.brand-meta b { font-family: var(--display); font-weight: 800; font-size: 17px; color: #fff; letter-spacing: -.01em; line-height: 1; display: block; }
.brand-meta span { font-size: 10px; letter-spacing: .13em; text-transform: uppercase; color: #7e93bf; margin-top: 3px; display: block; }

.nav-group-label { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: #6f85b3; padding: 16px 12px 7px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 12px; border-radius: 10px; color: #c2cfe6;
  font-weight: 500; font-size: 14.5px; text-align: left; position: relative;
  transition: background .16s, color .16s;
}
.nav-item svg { width: 19px; height: 19px; flex: 0 0 auto; opacity: .85; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active { background: rgba(30, 99, 255, .22); color: #fff; }
.nav-item.active::before { content: ''; position: absolute; left: -16px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--cyan); }
.nav-badge { margin-left: auto; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; min-width: 19px; height: 19px; border-radius: 10px; display: grid; place-items: center; padding: 0 5px; }

.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .09); }
.back-site { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 10px; color: #aebbd6; font-size: 13.5px; font-weight: 500; width: 100%; margin-bottom: 8px; transition: background .15s, color .15s; }
.back-site:hover { background: rgba(255,255,255,.06); color: #fff; }
.back-site svg { width: 17px; height: 17px; }
.company-card { display: flex; align-items: center; gap: 11px; padding: 10px; border-radius: 12px; background: rgba(255, 255, 255, .05); }
.company-ava { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(140deg, var(--cyan), var(--brand)); display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 14px; color: #fff; flex: 0 0 auto; }
.company-meta b { display: block; font-size: 13.5px; color: #fff; font-weight: 600; }
.company-meta span { font-size: 11.5px; color: #8ea1c6; }

/* --- Main --- */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 30px; background: rgba(245, 248, 253, .85);
  backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 30;
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 21px; }
.topbar .crumb { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.search {
  margin-left: auto; display: flex; align-items: center; gap: 9px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 11px;
  padding: 8px 13px; min-width: 230px; color: var(--muted);
}
.search input { border: none; outline: none; background: none; font-family: inherit; font-size: 14px; width: 100%; color: var(--ink); }
.search svg { width: 17px; height: 17px; flex: 0 0 auto; }
.icon-btn { width: 40px; height: 40px; border-radius: 11px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; position: relative; transition: border-color .15s, transform .1s; }
.icon-btn:hover { border-color: var(--brand); transform: translateY(-1px); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); border: 2px solid var(--surface); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(140deg, var(--cyan), var(--brand-deep)); color: #fff; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 15px; }

.view { padding: 26px 30px 60px; max-width: 1320px; width: 100%; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.view-head .lead { color: var(--ink-soft); font-size: 14.5px; max-width: 560px; margin-top: 6px; }
.eyebrow { font-size: 11px; letter-spacing: .15em; text-transform: uppercase; color: var(--brand); font-weight: 700; margin-bottom: 8px; }
.view-head h2 { font-size: 27px; }

/* ===================== COMPONENTES ===================== */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.card-head h3 { font-size: 16px; }
.card-head .sub { font-size: 12.5px; color: var(--muted); }

.grid { display: grid; gap: 18px; }
.kpi-grid { grid-template-columns: repeat(4, 1fr); }
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.span-2 { grid-column: span 2; }

/* KPI */
.kpi { position: relative; overflow: hidden; padding: 18px 18px 16px; }
.kpi .k-top { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.kpi .k-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; }
.kpi .k-ic svg { width: 18px; height: 18px; }
.kpi .k-label { font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.kpi .k-val { font-family: var(--display); font-weight: 700; font-size: 30px; letter-spacing: -.02em; line-height: 1; }
.kpi .k-foot { display: flex; align-items: center; gap: 8px; margin-top: 11px; font-size: 12.5px; color: var(--muted); }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; font-size: 12.5px; padding: 2px 7px; border-radius: 7px; }
.delta.up { color: var(--green); background: var(--green-tint); }
.delta.down { color: var(--danger); background: var(--danger-tint); }
.delta svg { width: 12px; height: 12px; }
.k-ic.red { background: var(--brand-tint); color: var(--brand); }
.k-ic.green { background: var(--green-tint); color: var(--green); }
.k-ic.amber { background: var(--amber-tint); color: var(--amber); }
.k-ic.cyan { background: var(--cyan-tint); color: var(--cyan); }
.k-ic.ink { background: var(--navy); color: #fff; }

/* tabela */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 11px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 13px 18px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl .strong { font-weight: 600; }
.tbl .right { text-align: right; }
.cell-main { display: flex; align-items: center; gap: 11px; }
.cell-ava { width: 32px; height: 32px; border-radius: 9px; background: var(--bg-2); display: grid; place-items: center; font-weight: 700; font-size: 12px; color: var(--ink-soft); flex: 0 0 auto; font-family: var(--display); }

/* pills / tags */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 20px; white-space: nowrap; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.pill.ok { color: var(--green); background: var(--green-tint); }
.pill.warn { color: var(--warn); background: var(--warn-tint); }
.pill.bad { color: var(--danger); background: var(--danger-tint); }
.pill.neutral { color: var(--ink-soft); background: var(--bg-2); }
.pill.brand { color: var(--brand); background: var(--brand-tint); }
.tag { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 7px; background: var(--bg-2); color: var(--ink-soft); }

/* progresso de estoque */
.stock-bar { width: 92px; height: 7px; border-radius: 5px; background: var(--line); overflow: hidden; }
.stock-bar i { display: block; height: 100%; border-radius: 5px; }

/* alertas */
.alert-feed { display: flex; flex-direction: column; }
.alert-row { display: flex; gap: 14px; padding: 15px 20px; border-bottom: 1px solid var(--line-2); align-items: flex-start; }
.alert-row:last-child { border-bottom: none; }
.alert-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 auto; }
.alert-ic svg { width: 19px; height: 19px; }
.alert-row.critico .alert-ic { background: var(--danger-tint); color: var(--danger); }
.alert-row.alerta .alert-ic { background: var(--warn-tint); color: var(--warn); }
.alert-row.info .alert-ic { background: var(--green-tint); color: var(--green); }
.alert-body { min-width: 0; flex: 1; }
.alert-body b { font-size: 14.5px; display: block; }
.alert-body p { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.alert-act { font-size: 12.5px; font-weight: 700; color: var(--brand); margin-top: 8px; display: inline-flex; align-items: center; gap: 4px; }
.alert-act svg { width: 13px; height: 13px; }
.alert-side { margin-left: auto; }

/* legenda chart */
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-soft); }
.legend i { width: 11px; height: 11px; border-radius: 3px; flex: 0 0 auto; }
.legend i.dash { width: 14px; height: 0; border-top: 2px dashed var(--green); border-radius: 0; }

/* charts */
.chart { width: 100%; display: block; }
.chart-area { height: 230px; }
.chart-axis { font-size: 10.5px; fill: var(--muted); font-family: var(--sans); }
.dot-brand { fill: var(--surface); stroke: var(--brand); stroke-width: 2; }
.spark { width: 110px; height: 34px; }
.donut-cap { font-size: 10px; fill: var(--muted); font-family: var(--sans); letter-spacing: .03em; }
.donut-val { font-size: 17px; fill: var(--ink); font-family: var(--display); font-weight: 700; }
.ring-txt { font-size: 15px; fill: var(--ink); font-family: var(--display); font-weight: 700; }

/* barras horizontais */
.barsh { display: flex; flex-direction: column; gap: 13px; }
.barsh-row { display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: 12px; }
.barsh-label { font-size: 13px; color: var(--ink-soft); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barsh-track { height: 9px; background: var(--line); border-radius: 6px; overflow: hidden; }
.barsh-fill { display: block; height: 100%; border-radius: 6px; transition: width .9s cubic-bezier(.22,1,.36,1); }
.barsh-val { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 56px; text-align: right; }

/* donut layout */
.donut-wrap { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.donut-legend { display: flex; flex-direction: column; gap: 11px; flex: 1; min-width: 180px; }
.dl-row { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.dl-row i { width: 11px; height: 11px; border-radius: 3px; flex: 0 0 auto; }
.dl-row b { margin-left: auto; font-variant-numeric: tabular-nums; }

/* vendedor card */
.seller { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--line-2); }
.seller:last-child { border-bottom: none; }
.seller-ava { width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(140deg, var(--amber-tint), var(--brand-tint)); color: var(--brand-deep); display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 15px; flex: 0 0 auto; }
.seller-main { min-width: 0; flex: 1; }
.seller-main b { font-size: 14.5px; }
.seller-main span { font-size: 12.5px; color: var(--muted); display: block; }
.seller-num { text-align: right; }
.seller-num b { font-family: var(--display); font-size: 16px; }

/* botões */
.btn { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; padding: 9px 16px; border-radius: 11px; transition: transform .1s, box-shadow .15s, background .15s; }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(30, 99, 255, .3); }
.btn-primary:hover { background: var(--brand-deep); transform: translateY(-1px); }
.btn-ghost { background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-sm { padding: 7px 12px; font-size: 13px; }

/* segmento / filtros */
.segment { display: inline-flex; background: var(--bg-2); border-radius: 11px; padding: 3px; gap: 2px; }
.segment button { padding: 6px 14px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.segment button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 30px 0 16px; }
.section-title h3 { font-size: 18px; }
.muted { color: var(--muted); }
.mini-label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }

/* hero banner (financeiro/relatórios) */
.hero {
  border-radius: var(--r-lg); padding: 26px 28px; color: #e9f0ff; position: relative; overflow: hidden;
  background: linear-gradient(150deg, #0b1e47 0%, #102a63 100%);
  border: 1px solid #081634;
}
.hero::after { content: ''; position: absolute; right: -40px; top: -60px; width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(circle, rgba(18, 182, 232, .32), transparent 65%); }
.hero h3 { color: #fff; font-size: 15px; font-weight: 600; opacity: .8; position: relative; }
.hero .big { font-family: var(--display); font-weight: 800; font-size: 40px; margin: 6px 0 2px; letter-spacing: -.02em; position: relative; }
.hero .hero-grid { display: flex; gap: 34px; flex-wrap: wrap; margin-top: 20px; position: relative; }
.hero-grid div span { display: block; font-size: 12px; opacity: .7; }
.hero-grid div b { font-family: var(--display); font-size: 19px; }

/* lista simples chave/valor */
.kv { display: flex; flex-direction: column; }
.kv-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.kv-row:last-child { border-bottom: none; }
.kv-row b { font-variant-numeric: tabular-nums; font-weight: 600; }
.kv-row.total { border-top: 2px solid var(--line); border-bottom: none; margin-top: 4px; padding-top: 14px; }
.kv-row.total b, .kv-row.total span { font-size: 16px; font-weight: 700; }

/* status banner topo dashboard */
.daystrip { display: flex; align-items: center; gap: 14px; background: linear-gradient(135deg, var(--brand-tint), var(--cyan-tint)); border: 1px solid #d4e2fb; border-radius: var(--r-md); padding: 14px 20px; margin-bottom: 20px; }
.daystrip .ds-ic { width: 40px; height: 40px; border-radius: 11px; background: #fff; display: grid; place-items: center; color: var(--brand); flex: 0 0 auto; }
.daystrip .ds-ic svg { width: 21px; height: 21px; }
.daystrip b { font-family: var(--display); font-size: 15.5px; }
.daystrip p { font-size: 13px; color: var(--ink-soft); }

/* mobile bottom nav (escondida no desktop) */
.botnav { display: none; }
.menu-btn { display: none; }
.backdrop { display: none; }

/* entrada animada */
.stagger > * { opacity: 0; transform: translateY(10px); animation: rise .5s cubic-bezier(.22,1,.36,1) forwards; }
.stagger > *:nth-child(1) { animation-delay: .02s; }
.stagger > *:nth-child(2) { animation-delay: .07s; }
.stagger > *:nth-child(3) { animation-delay: .12s; }
.stagger > *:nth-child(4) { animation-delay: .17s; }
.stagger > *:nth-child(5) { animation-delay: .22s; }
.stagger > *:nth-child(6) { animation-delay: .27s; }
.stagger > *:nth-child(7) { animation-delay: .32s; }
.stagger > *:nth-child(8) { animation-delay: .37s; }
@keyframes rise { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .stagger > * { animation: none; opacity: 1; transform: none; } .barsh-fill { transition: none; } }

/* ===================== RESPONSIVO ===================== */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .cols-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 980px) {
  :root { --sidebar-w: 0px; }
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 60; width: 264px; height: 100vh;
    transform: translateX(-100%); transition: transform .26s cubic-bezier(.4,0,.2,1);
  }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(30, 22, 14, .42); z-index: 50; }
  .menu-btn { display: grid; }
  .topbar { padding: 12px 16px; }
  .search { display: none; }
  .view { padding: 18px 16px 96px; }
  .cols-2, .cols-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .botnav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
    background: rgba(255, 253, 249, .94); backdrop-filter: blur(12px);
    border-top: 1px solid var(--line); padding: 7px 6px calc(7px + env(safe-area-inset-bottom));
    justify-content: space-around;
  }
  .botnav button { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 600; color: var(--muted); padding: 4px 8px; border-radius: 9px; flex: 1; max-width: 84px; }
  .botnav button svg { width: 21px; height: 21px; }
  .botnav button.active { color: var(--brand); }
}
@media (max-width: 560px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .grid { gap: 14px; }
  .kpi .k-val { font-size: 24px; }
  .view-head h2 { font-size: 22px; }
  .hero .big { font-size: 32px; }
  .topbar h1 { font-size: 18px; }
}

/* ===================== TOAST (painel) ===================== */
.app-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(calc(100% + 60px)); background: var(--navy); color: #fff; padding: 14px 20px; border-radius: 13px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 12px; z-index: 300; font-size: 14.5px; font-weight: 500; transition: transform .34s cubic-bezier(.22,1,.36,1); max-width: 92vw; pointer-events: none; }
.app-toast.show { transform: translateX(-50%) translateY(0); pointer-events: auto; }
.app-toast .t-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: 0 0 auto; background: var(--green); }
.app-toast .t-ic svg { width: 17px; height: 17px; color: #fff; }
.app-toast.info .t-ic { background: var(--brand); }
@media (max-width: 980px) { .app-toast { bottom: 86px; } }

/* ===================== MODAL ===================== */
.modal-overlay { position: fixed; inset: 0; background: rgba(8, 22, 52, .5); backdrop-filter: blur(3px); z-index: 200; display: grid; place-items: center; padding: 18px; opacity: 0; transition: opacity .2s; }
.modal-overlay.show { opacity: 1; }
.modal { background: var(--surface); border-radius: var(--r-lg); width: min(540px, 100%); max-height: 92vh; overflow: auto; box-shadow: var(--shadow-lg); transform: translateY(14px) scale(.98); transition: transform .24s cubic-bezier(.22,1,.36,1); }
.modal-overlay.show .modal { transform: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--line-2); position: sticky; top: 0; background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.modal-head h3 { font-size: 18px; }
.modal-head .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.modal-x { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--ink-soft); transition: background .15s; }
.modal-x:hover { background: var(--bg-2); }
.modal-x svg { width: 18px; height: 18px; }
.modal-body { padding: 22px; }

/* ===================== FORM (painel) ===================== */
.fld { margin-bottom: 15px; }
.fld label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink-soft); }
.fld input, .fld select { width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 10px; font-family: inherit; font-size: 14.5px; color: var(--ink); background: #fff; transition: border-color .15s, box-shadow .15s; }
.fld input:focus, .fld select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-tint); }
.fld-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.modal-actions { display: flex; gap: 10px; margin-top: 22px; }
.modal-actions .btn { flex: 1; justify-content: center; }
@media (max-width: 480px) { .fld-row { grid-template-columns: 1fr; } }
