/* ==========================================================
   VINCII PEOPLES — DESIGN SYSTEM
   SaaS premium · neutro + Tiffany Green como destaque.
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ---------- TEMA CLARO (padrão) ---------- */
:root, [data-theme="light"] {
  --bg:          #ffffff;
  --bg-canvas:   #f7f8f8;
  --panel:       #ffffff;
  --panel-2:     #f1f2f2;
  --panel-3:     #e9ebea;
  --line:        #e6e8e7;
  --line-strong: #d7dad9;
  --line-faint:  #eef0ef;

  --ink:    #15181a;
  --ink-2:  #4a5153;
  --muted:  #7c8482;
  --faint:  #aeb4b2;

  --brand:        #0fb8a3;
  --brand-hover:  #0da391;
  --brand-strong: #0a8d7d;
  --brand-bright: #0a8d7d;
  --brand-deep:   #0a8d7d;
  --brand-soft:   rgba(15, 184, 163, 0.12);
  --brand-glow:   rgba(15, 184, 163, 0.12);

  --danger:  #e5484d;
  --ok:      #12a594;
  --warning: #d9a429;

  --shadow-sm: 0 1px 2px rgba(15, 23, 21, 0.04);
  --shadow:    0 8px 24px rgba(15, 23, 21, 0.06);
  --shadow-lg: 0 16px 40px rgba(15, 23, 21, 0.08);
  --shadow-brand: var(--shadow);

  --r-xs: 6px;
  --r-sm: 8px;
  --r:    10px;
  --r-lg: 14px;

  --font-display: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t: 0.18s var(--ease);
  --t-slow: 0.32s var(--ease);

  /* compat: telas ainda não migradas usam esses nomes — apontam para o sistema neutro novo */
  --gold: var(--warning);
  --sepia: var(--muted);
  --sepia-2: var(--faint);
  --font-note: var(--font-display);
  --rail-bottom: var(--bg);
  --grid-color: transparent;
}

/* ---------- TEMA ESCURO ---------- */
[data-theme="dark"] {
  --bg:          #111315;
  --bg-canvas:   #16181a;
  --panel:       #1d2023;
  --panel-2:     #23262a;
  --panel-3:     #2a2d31;
  --line:        rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --line-faint:  rgba(255, 255, 255, 0.05);

  --ink:    #f1f2f2;
  --ink-2:  #c7cbcc;
  --muted:  #8b9295;
  --faint:  #5c6265;

  --brand:        #1bc7b1;
  --brand-hover:  #2fd6c0;
  --brand-strong: #4fdfcd;
  --brand-bright: #4fdfcd;
  --brand-deep:   #0fb8a3;
  --brand-soft:   rgba(27, 199, 177, 0.14);
  --brand-glow:   rgba(27, 199, 177, 0.14);

  --danger:  #f2555a;
  --ok:      #1bc7b1;
  --warning: #e2b23f;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow:    0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-brand: var(--shadow);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
*::selection { background: var(--brand); color: #fff; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-display);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01', 'cv11';
  overflow: hidden;
}

img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

/* tracking utilities */
.eyebrow {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
}
.eyebrow .dot { color: var(--brand); }
.mono { font-family: var(--font-mono); font-feature-settings: 'tnum'; }

/* ==========================================================
   APP SHELL
   ========================================================== */
.app {
  display: grid;
  grid-template-columns: 236px 1fr;
  height: 100vh;
  background: var(--bg);
}
/* .layout-dashboard é o container real (ver styles.css:601); mantém especificidade/!important */
.layout-dashboard {
  transition: grid-template-columns var(--t-slow);
}
.layout-dashboard.sidebar-collapsed { grid-template-columns: 76px 1fr !important; }

/* ---------- SIDEBAR ---------- */
.rail {
  position: relative;
  background: var(--bg);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.rail-collapse-btn {
  position: absolute;
  top: 20px; right: 10px;
  z-index: 30;
  width: 26px; height: 26px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: color var(--t), border-color var(--t), transform var(--t);
}
.rail-collapse-btn svg { width: 13px; height: 13px; }
.rail-collapse-btn:hover { color: var(--ink); border-color: var(--brand); }
.sidebar-collapsed .rail-collapse-btn svg { transform: rotate(180deg); }

.rail-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
  padding: 1.6rem 3rem 1.5rem 1.25rem;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.rail-logo-full {
  height: 52px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  flex-shrink: 0;
}
.sidebar-collapsed .rail-head { justify-content: flex-start; }
.sidebar-collapsed .rail-logo-full {
  width: 30px;
  height: 30px;
  object-fit: cover;
  object-position: left center;
}

.rail-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0.6rem 1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.rail-nav::-webkit-scrollbar { width: 6px; }
.rail-nav::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; }

.nav-group-label {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 1rem 0.6rem 0.4rem;
  font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.02em; text-transform: uppercase;
  color: var(--faint);
}

.nav-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0.6rem;
  border-radius: var(--r-sm);
  color: var(--muted);
  font-size: 0.94rem; font-weight: 500; letter-spacing: -0.01em;
  text-decoration: none;
  position: relative;
  transition: color var(--t), background var(--t);
}
.nav-item svg { width: 25px; height: 25px; flex-shrink: 0; stroke-width: 1.6; }
.nav-item:hover { color: var(--ink); background: var(--panel-2); }
.nav-item.active {
  color: var(--brand-strong);
  background: var(--brand-soft);
  font-weight: 700;
}
.nav-item.active svg { color: var(--brand-strong); }
.nav-badge {
  margin-left: auto;
  font-size: 0.66rem; font-weight: 600;
  padding: 0.1rem 0.4rem; border-radius: 99px;
  background: var(--brand); color: #fff;
}

/* ---------- SIDEBAR RECOLHIDA ---------- */
.sidebar-collapsed .nav-group-label,
.sidebar-collapsed .nav-badge,
.sidebar-collapsed .rail-user-info {
  display: none;
}
.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 0.6rem;
  font-size: 0;
  gap: 0;
}
.sidebar-collapsed .rail-user {
  justify-content: center;
  font-size: 0;
}
.sidebar-collapsed #btn-logout {
  font-size: 0;
  justify-content: center;
  padding: 0.55rem;
}
.sidebar-collapsed #btn-logout svg { margin: 0; }

.rail-foot {
  border-top: 1px solid var(--line);
  padding: 0.7rem;
}
.rail-user {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.45rem 0.5rem; border-radius: var(--r-sm);
  cursor: pointer; transition: background var(--t);
}
.rail-user:hover { background: var(--panel-2); }
.rail-ava {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.72rem; color: #fff;
}
.rail-user-info { display: flex; flex-direction: column; min-width: 0; }
.rail-user-info strong { font-size: 0.8rem; font-weight: 600; color: var(--ink); }
.rail-user-info span { font-size: 0.68rem; color: var(--faint); }

/* ==========================================================
   MAIN
   ========================================================== */
.main {
  position: relative;
  overflow-y: auto;
  background: var(--bg-canvas);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.main::-webkit-scrollbar { width: 9px; }
.main::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; }

/* ---------- TOPBAR ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 1.2rem;
  padding: 0 1.75rem; height: 60px;
  background: var(--bg-canvas);
  border-bottom: 1px solid var(--line);
}
.crumb {
  display: flex; align-items: center; gap: 0.55rem;
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted);
  letter-spacing: 0.04em;
}
.crumb b { color: var(--ink); font-weight: 600; }
.crumb .sep { color: var(--faint); }

.topbar-search {
  margin-left: auto;
  display: flex; align-items: center; gap: 0.55rem;
  width: 280px; max-width: 30vw;
  padding: 0.5rem 0.85rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--muted);
  transition: border-color 0.18s;
}
.topbar-search:focus-within { border-color: var(--line-strong); }
.topbar-search svg { width: 16px; height: 16px; flex-shrink: 0; }
.topbar-search input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--ink); font-size: 0.84rem; font-family: var(--font-display);
}
.topbar-search input::placeholder { color: var(--faint); }
.topbar-search kbd {
  font-family: var(--font-mono); font-size: 0.62rem;
  padding: 0.1rem 0.34rem; border-radius: 4px;
  background: var(--panel-3); border: 1px solid var(--line); color: var(--muted);
}

/* ---------- BUSCA GLOBAL DROPDOWN ---------- */
.global-search-wrap {
  position: relative;
  margin-left: auto;
}
.global-search-wrap .topbar-search {
  margin-left: 0;
  width: 280px; max-width: 30vw;
}
#global-search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  z-index: 9999;
  max-height: 380px;
  overflow-y: auto;
}
#global-search-dropdown.open { display: block; }
.gsd-group-label {
  padding: 0.5rem 0.9rem 0.25rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.gsd-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  font-size: 0.84rem;
  color: var(--ink);
  border-radius: 0;
  transition: background 0.1s;
}
.gsd-item:hover, .gsd-item.gsd-active {
  background: var(--panel-2);
}
.gsd-item-icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--panel-3);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
}
.gsd-item-icon.colab { background: color-mix(in oklab, var(--tiffany) 15%, var(--panel)); color: var(--tiffany-dark, var(--tiffany)); }
.gsd-item-main { display: flex; flex-direction: column; }
.gsd-item-name { font-weight: 600; line-height: 1.3; }
.gsd-item-sub { font-size: 0.73rem; color: var(--muted); }
.gsd-empty {
  padding: 1.1rem 0.9rem;
  font-size: 0.84rem;
  color: var(--muted);
  text-align: center;
}
.gsd-divider { height: 1px; background: var(--line); margin: 0.25rem 0; }

.icon-btn {
  width: 38px; height: 38px; border-radius: var(--r-sm);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--panel); border: 1px solid var(--line);
  color: var(--muted); transition: var(--t); position: relative;
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-strong); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; stroke-width: 1.7; }
.icon-btn .ping {
  position: absolute; top: 8px; right: 9px; width: 6px; height: 6px;
  border-radius: 99px; background: var(--brand-bright);
  box-shadow: 0 0 0 3px var(--bg-canvas), 0 0 10px var(--brand);
}

/* ---------- CONTENT ---------- */
.content {
  position: relative; z-index: 1;
  padding: 2.4rem 2.4rem 4rem;
  max-width: 1380px; margin: 0 auto;
}

/* page header — bold + da vinci ruler */
.page-head {
  position: relative;
  margin-bottom: 2.2rem;
  padding-bottom: 1.6rem;
  border-bottom: 1px solid var(--line);
}
.page-head .eyebrow { margin-bottom: 0.9rem; display: inline-flex; gap: 0.5rem; }
.page-title {
  font-size: clamp(2.6rem, 5.2vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.94;
  color: var(--ink);
}
.page-title .thin { font-weight: 400; color: var(--muted); }
.page-head-row {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; flex-wrap: wrap;
}
.page-sub {
  margin-top: 0.85rem; max-width: 46ch;
  color: var(--muted); font-size: 0.96rem; line-height: 1.5;
}

/* ==========================================================
   PANELS
   ========================================================== */
.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  transition: border-color var(--t), box-shadow var(--t);
}
.panel.lift:hover { box-shadow: var(--shadow); border-color: var(--line-strong); }
.panel.ticked::before,
.panel.ticked::after { content: none; }

.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.15rem 1.35rem 0.9rem;
}
.panel-head h3 {
  font-size: 1.02rem; font-weight: 700; letter-spacing: -0.02em; color: var(--ink);
  display: flex; align-items: center; gap: 0.6rem;
}
.panel-head .eyebrow { font-size: 0.6rem; }
.panel-body { padding: 0 1.35rem 1.35rem; }

/* ---------- GRID ---------- */
.grid { display: grid; gap: 18px; }
.kpis { grid-template-columns: repeat(4, 1fr); }
.cols-2-1 { grid-template-columns: 1.55fr 1fr; }
.cols-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 1080px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .cols-2-1, .cols-2 { grid-template-columns: 1fr; }
}

/* ==========================================================
   KPI — readout instrument
   ========================================================== */
.kpi {
  position: relative;
  padding: 1.35rem 1.4rem 1.25rem;
  overflow: hidden;
}
.kpi-label {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-display); font-size: 0.86rem; font-weight: 500;
  letter-spacing: 0; color: var(--muted);
}
.kpi-label .idx { color: var(--faint); }
.kpi-val {
  margin-top: 0.85rem;
  font-size: 2.9rem; font-weight: 800; letter-spacing: -0.045em; line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  display: flex; align-items: baseline; gap: 0.25rem;
}
.kpi-val .unit { font-size: 1rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.kpi-foot {
  margin-top: 0.9rem; display: flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-mono); font-size: 0.68rem; color: var(--muted);
}
.delta { display: inline-flex; align-items: center; gap: 0.2rem; font-weight: 600; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--danger); }
.kpi-spark { position: absolute; right: 1.1rem; bottom: 1.1rem; width: 72px; height: 30px; opacity: 0.9; }
.kpi-bg-glyph {
  position: absolute; top: -22px; right: -18px; width: 120px; height: 120px;
  color: var(--brand); opacity: 0.05; pointer-events: none;
}

/* ==========================================================
   DISC RING (anatomical diagram style)
   ========================================================== */
.disc-wrap { display: flex; align-items: center; gap: 1.6rem; flex-wrap: wrap; }
.disc-ring { position: relative; width: 220px; height: 220px; flex-shrink: 0; }
.disc-ring .center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
}
.disc-ring .center b { font-size: 2.1rem; font-weight: 800; letter-spacing: -0.04em; color: var(--ink); }
.disc-ring .center span { font-family: var(--font-display); font-size: 0.78rem; color: var(--muted); }
.disc-legend { display: flex; flex-direction: column; gap: 0.55rem; flex: 1; min-width: 180px; }
.disc-leg-row {
  display: grid; grid-template-columns: 14px 1fr auto; align-items: center; gap: 0.7rem;
  padding: 0.5rem 0; border-bottom: 1px solid var(--line-faint);
}
.disc-leg-row:last-child { border-bottom: 0; }
.disc-dot { width: 12px; height: 12px; border-radius: 3px; }
.disc-leg-row .nm { font-size: 0.86rem; color: var(--ink-2); font-weight: 500; }
.disc-leg-row .nm small { display: block; color: var(--faint); font-size: 0.68rem; font-family: var(--font-mono); }
.disc-leg-row .pc { font-family: var(--font-mono); font-weight: 700; color: var(--ink); font-size: 0.92rem; }

/* ==========================================================
   PLOT (trend, engineering)
   ========================================================== */
.plot { width: 100%; height: 230px; }
.plot-legend { display: flex; gap: 1.2rem; align-items: center; }
.plot-legend span { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.74rem; color: var(--muted); font-family: var(--font-mono); }
.plot-legend i { width: 14px; height: 2px; border-radius: 2px; display: inline-block; }

/* ==========================================================
   LIST / TIMELINE / RANK
   ========================================================== */
.list { display: flex; flex-direction: column; }
.list-row {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.8rem 0; border-bottom: 1px solid var(--line-faint);
}
.list-row:last-child { border-bottom: 0; }
.av {
  width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.78rem; color: #fff;
  background: var(--brand);
}
.list-row .who { flex: 1; min-width: 0; }
.list-row .who strong { display: block; font-size: 0.86rem; font-weight: 600; color: var(--ink); }
.list-row .who span { font-size: 0.72rem; color: var(--muted); }

.chip {
  font-family: var(--font-mono); font-size: 0.64rem; font-weight: 600;
  padding: 0.2rem 0.55rem; border-radius: 99px;
  border: 1px solid var(--line-strong); color: var(--muted);
  white-space: nowrap;
}
.chip.brand { color: var(--brand-strong); background: var(--brand-soft); border-color: transparent; }
.chip.gold { color: var(--warning); border-color: transparent; background: color-mix(in oklab, var(--warning) 12%, transparent); }
.chip.danger { color: var(--danger); border-color: transparent; background: color-mix(in oklab, var(--danger) 10%, transparent); }

.rank-num {
  font-family: var(--font-mono); font-size: 0.74rem; font-weight: 700;
  width: 22px; text-align: center; color: var(--faint);
}
.rank-num.top { color: var(--warning); }
.score-pill {
  font-family: var(--font-mono); font-size: 0.8rem; font-weight: 700;
  color: var(--brand-strong); padding: 0.25rem 0.5rem;
  border-radius: var(--r-xs); background: var(--brand-soft); border: 1px solid transparent;
}

/* timeline */
.tl { position: relative; padding-left: 1.3rem; }
.tl::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1px; background: var(--line-strong); }
.tl-row { position: relative; padding: 0 0 1.05rem; }
.tl-row:last-child { padding-bottom: 0; }
.tl-row::before {
  content: ''; position: absolute; left: -1.3rem; top: 4px; width: 11px; height: 11px;
  border-radius: 99px; background: var(--bg-canvas); border: 2px solid var(--brand);
}
.tl-row.done::before { background: var(--brand); }
.tl-row .t { font-family: var(--font-display); font-size: 0.78rem; color: var(--faint); }
.tl-row .h { font-size: 0.88rem; font-weight: 600; color: var(--ink); margin: 0.15rem 0; }
.tl-row .d { font-size: 0.78rem; color: var(--muted); line-height: 1.45; }

/* progress meter */
.meter { height: 6px; border-radius: 99px; background: var(--panel-3); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 99px; background: var(--brand); }

/* segmented control / theme toggle */
.seg {
  display: inline-flex; padding: 3px; gap: 3px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm);
}
.seg button {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.4rem 0.65rem; border: none; background: none; border-radius: 5px;
  color: var(--muted); font-size: 0.74rem; font-weight: 600; transition: var(--t);
}
.seg button svg { width: 15px; height: 15px; }
.seg button.on { background: var(--panel-3); color: var(--ink); box-shadow: var(--shadow-sm); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.55rem 1rem; border-radius: var(--r-sm);
  font-size: 0.84rem; font-weight: 600; letter-spacing: -0.01em;
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink);
  transition: var(--t);
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { border-color: var(--muted); }
.btn.primary {
  background: var(--brand);
  color: #fff; border-color: transparent;
}
.btn.primary:hover { background: var(--brand-hover); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); background: var(--panel-2); }

/* entrance — opacity stays 1 always; only a small slide is animated,
   so a frozen animation timeline never leaves content invisible. */
@keyframes rise { from { transform: translateY(10px); } to { transform: none; } }
.rise { animation: rise 0.4s var(--ease) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; }
  .rise { animation: none !important; transform: none !important; }
}

/* ==========================================================
   MODULE / EDITORIAL COMPONENTS (shared across views)
   ========================================================== */

/* folio header — every module opens like a manuscript page */
.folio-head { position: relative; margin-bottom: 2rem; padding-bottom: 1.3rem; border-bottom: 2px solid var(--ink); }
.folio-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.folio-fig { font-family: var(--font-display); font-size: 0.8rem; color: var(--brand-strong); font-weight: 600; }
.folio-no { font-family: var(--font-display); font-size: 0.8rem; color: var(--faint); }
.folio-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.folio-row > div:first-child { flex: 1 1 420px; min-width: 0; }
.folio-actions { display: flex; gap: 0.6rem; align-items: center; flex: 0 0 auto; }
.folio-title { font-size: clamp(2.2rem, 4.2vw, 3.4rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.04; color: var(--ink); text-wrap: balance; overflow-wrap: break-word; }
.folio-title em { font-family: var(--font-note); font-style: italic; font-weight: 500; color: var(--sepia); }
.folio-sub { margin-top: 0.95rem; max-width: 56ch; color: var(--muted); font-size: 0.96rem; line-height: 1.5; }
.folio-actions { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }

/* toolbar (filter / search row) */
.toolbar { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.toolbar .grow { flex: 1; }
.field { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.85rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--muted); }
.field:focus-within { border-color: var(--line-strong); }
.field svg { width: 15px; height: 15px; }
.field input { background: none; border: none; outline: none; color: var(--ink); font-size: 0.84rem; font-family: var(--font-display); min-width: 160px; }
.field input::placeholder { color: var(--faint); }
.filter-pill { font-family: var(--font-mono); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.04em;
  padding: 0.45rem 0.8rem; border-radius: 99px; border: 1px solid var(--line-strong); color: var(--muted);
  background: var(--panel); cursor: pointer; transition: var(--t); }
.filter-pill:hover { color: var(--ink); border-color: var(--brand); }
.filter-pill.on { background: var(--ink); color: var(--bg-canvas); border-color: var(--ink); }
[data-theme="light"] .filter-pill.on { color: #fff; }

/* tabs (underline) */
.tabs { display: flex; gap: 1.6rem; border-bottom: 1px solid var(--line); margin-bottom: 1.6rem; }
.tab { padding: 0.7rem 0; font-size: 0.88rem; font-weight: 600; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: var(--t); letter-spacing: -0.01em; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--ink); border-color: var(--brand); }
.tab .c { font-family: var(--font-mono); font-size: 0.66rem; color: var(--faint); margin-left: 0.35rem; }

/* ledger — editorial data table */
.ledger-wrap { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--panel); }
.ledger { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.ledger thead th { text-align: left; padding: 0.85rem 1.1rem; background: var(--panel-2);
  font-family: var(--font-display); font-size: 0.8rem; font-weight: 600;
  color: var(--muted); border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.ledger tbody td { padding: 0.8rem 1.1rem; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: middle; }
.ledger tbody tr:last-child td { border-bottom: 0; }
.ledger tbody tr { transition: background 0.14s; }
.ledger tbody tr:hover td { background: var(--panel-2); }
.ledger .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.ledger .rn { font-family: var(--font-mono); color: var(--faint); font-size: 0.74rem; }
.ledger .nm { font-weight: 600; color: var(--ink); }
.cell-person { display: flex; align-items: center; gap: 0.7rem; }

/* small avatar + person */
.av-sm { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.72rem; color: #fff; background: var(--brand); }
.av-sm.sepia { background: var(--panel-3); color: var(--ink-2); }
.av-sm.gold { background: var(--warning); color: #fff; }
.av-sm.ink { background: var(--ink); color: var(--bg); }

/* status dot + label */
.st { display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--font-mono); font-size: 0.68rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.st::before { content: ''; width: 7px; height: 7px; border-radius: 99px; background: var(--muted); }
.st.ok { color: var(--brand-strong); } .st.ok::before { background: var(--brand); }
.st.warn { color: var(--warning); } .st.warn::before { background: var(--warning); }
.st.bad { color: var(--danger); } .st.bad::before { background: var(--danger); }

/* DISC badge letter */
.disc-badge { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 7px;
  font-family: var(--font-mono); font-weight: 700; font-size: 0.78rem; }
.disc-D { background: color-mix(in oklab, #6366f1 16%, transparent); color: #6366f1; }
.disc-I { background: color-mix(in oklab, var(--warning) 16%, transparent); color: var(--warning); }
.disc-S { background: var(--brand-soft); color: var(--brand-strong); }
.disc-C { background: var(--panel-3); color: var(--ink-2); }

/* horizontal bar */
.bar-track { height: 7px; border-radius: 99px; background: var(--panel-3); overflow: hidden; min-width: 90px; }
.bar-track > i { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.bar-track.gold > i { background: var(--warning); }
.bar-track.bad > i { background: var(--danger); }

/* definition rows */
.def { display: grid; grid-template-columns: 1fr auto; gap: 0.6rem 1rem; }
.def dt { font-family: var(--font-display); font-size: 0.84rem; color: var(--muted); padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.def dd { text-align: right; font-weight: 600; color: var(--ink); padding: 0.55rem 0; border-bottom: 1px solid var(--line); }

/* kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 0.5rem; }
.kcol { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r); padding: 0.9rem; }
.kcol-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.8rem; }
.kcol-head h4 { font-family: var(--font-display); font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.kcol-head .c { font-family: var(--font-mono); font-size: 0.66rem; color: var(--faint); }
.kcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0.8rem 0.9rem; margin-bottom: 0.6rem; cursor: grab; transition: var(--t); }
.kcard:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.kcard:last-child { margin-bottom: 0; }
.kcard .kt { font-weight: 600; font-size: 0.86rem; color: var(--ink); margin-bottom: 0.3rem; }
.kcard .km { display: flex; align-items: center; gap: 0.5rem; }

/* month calendar */
.month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.month .dow { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); text-align: center; padding-bottom: 0.3rem; }
.day { aspect-ratio: 1.1 / 1; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0.4rem 0.5rem; position: relative; background: var(--panel); }
.day.out { opacity: 0.35; }
.day .dn { font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted); }
.day .pt { position: absolute; bottom: 0.4rem; left: 0.5rem; right: 0.5rem; font-family: var(--font-mono); font-size: 0.6rem; }
.day.full .pt { color: var(--brand-deep); } [data-theme="dark"] .day.full .pt { color: var(--brand-bright); }
.day.miss { background: color-mix(in oklab, var(--danger) 7%, transparent); border-color: color-mix(in oklab, var(--danger) 30%, transparent); }
.day.miss .pt { color: var(--danger); }
.day.today { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }

/* profile header */
.profile { display: flex; align-items: center; gap: 1.3rem; flex-wrap: wrap; }
.profile .pa { width: 84px; height: 84px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.8rem; color: #fff; background: var(--brand);
  box-shadow: 0 0 0 3px var(--bg-canvas); flex-shrink: 0; }
.profile .pi h3 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.profile .pi .role { color: var(--muted); font-size: 0.92rem; margin-top: 0.15rem; }
.profile .pi .tags { display: flex; gap: 0.45rem; margin-top: 0.6rem; flex-wrap: wrap; }

/* gauge (big radial percent) */
.gauge { position: relative; width: 132px; height: 132px; flex-shrink: 0; }
.gauge .gv { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gauge .gv b { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.03em; color: var(--ink); }
.gauge .gv span { font-family: var(--font-display); font-size: 0.74rem; color: var(--muted); }

/* stat line (inline editorial figures, NOT cards) */
.statline { display: flex; gap: 2.4rem; flex-wrap: wrap; padding: 1.2rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.statline .s b { display: block; font-size: 1.9rem; font-weight: 800; letter-spacing: -0.03em; color: var(--ink); line-height: 1; font-variant-numeric: tabular-nums; }
.statline .s span { font-family: var(--font-display); font-size: 0.82rem; color: var(--muted); margin-top: 0.4rem; display: block; }

/* misc */
.muted { color: var(--muted); } .faint { color: var(--faint); }
.empty { padding: 3rem 1rem; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--r); background: var(--panel-2); }
.split { display: grid; gap: 18px; } .split.s2 { grid-template-columns: 1fr 1fr; } .split.s3 { grid-template-columns: 1fr 1fr 1fr; } .split.s21 { grid-template-columns: 1.6fr 1fr; }
@media (max-width: 1000px) { .split.s2, .split.s3, .split.s21 { grid-template-columns: 1fr; } }

/* responsive: collapse rail on narrow */
@media (max-width: 880px) {
  .app { grid-template-columns: 1fr; }
  .rail { display: none; }
  .topbar-search { display: none; }
  .global-search-wrap { display: none; }
  .content, .codex-wrap { padding: 1.5rem 1.2rem 3rem; }
}


/* ---- Tab bar (Comunicados / Agendamentos) ---- */
.tab-bar {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0;
}
.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--tiffany); border-bottom-color: var(--tiffany); }

/* ---- Day-of-week chips (agendamento modal) ---- */
.day-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  user-select: none;
}
.day-chip input[type="checkbox"] { display: none; }
.day-chip:hover { border-color: var(--tiffany); color: var(--tiffany); }
.day-chip:has(input:checked) {
  background: var(--tiffany);
  border-color: var(--tiffany);
  color: #000;
}
