/* MEMO — Crema Editorial design system (DopaBI) */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --cream:      #f6f1e9;
  --cream-2:    #efe8dc;
  --paper:      #fdfaf4;
  --ink:        #1d1a16;
  --ink-soft:   #4a443c;
  --muted:      #8a8175;
  --line:       #e4dccd;
  --line-soft:  #ece5d8;
  --accent:     #b4522d;  /* terracotta */
  --accent-2:   #2f6f5e;  /* deep green — positivo */
  --gold:       #b88a2b;
  --red:        #b23b2e;
  --red-soft:   #f6e3df;
  --green-soft: #e3efe7;
  --amber-soft: #f7eed6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(40,32,20,.04), 0 8px 30px rgba(40,32,20,.06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.serif { font-family: 'Fraunces', Georgia, serif; }
.mono  { font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; }
.num   { font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 28px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246,241,233,.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; gap: 24px; height: 62px; }
.brand { display: flex; align-items: baseline; gap: 10px; font-weight: 600; }
.brand .logo { font-family: 'Fraunces', serif; font-weight: 700; font-size: 22px; letter-spacing: -.02em; }
.brand .dot { color: var(--accent); }
.brand .sub { font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: .02em; }
.nav { margin-left: auto; display: flex; gap: 4px; }
.nav button, .nav a.tab {
  border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 500; color: var(--ink-soft);
  padding: 8px 15px; border-radius: 999px; transition: .15s;
}
.nav button:hover, .nav a.tab:hover { background: var(--cream-2); text-decoration: none; }
.nav button.active { background: var(--ink); color: var(--paper); }

/* ---------- Generic ---------- */
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
h1.title { font-family: 'Fraunces', serif; font-weight: 600; letter-spacing: -.02em; line-height: 1.05; margin: 10px 0; }
.section { padding: 30px 0; }
.muted { color: var(--muted); }
.row { display: flex; gap: 18px; flex-wrap: wrap; }
.grid { display: grid; gap: 18px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 14px; }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.pad { padding: 22px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; padding: 3px 11px; border-radius: 999px;
  border: 1px solid transparent;
}
.pill.green { background: var(--green-soft); color: var(--accent-2); }
.pill.red   { background: var(--red-soft); color: var(--red); }
.pill.amber { background: var(--amber-soft); color: var(--gold); }
.pill.ghost { background: var(--cream-2); color: var(--ink-soft); }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi { padding: 20px 22px; }
.kpi .label { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.kpi .value { font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; font-size: 30px; font-weight: 600; letter-spacing: -.02em; margin-top: 6px; }
.kpi .value.sm { font-size: 24px; }
.kpi .foot { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.kpi.accent { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.kpi.accent .label, .kpi.accent .foot { color: rgba(253,250,244,.6); }
.kpi.alert { border-color: #e9c6bf; }
.kpi.alert .value { color: var(--red); }

/* ---------- Bars ---------- */
.bar-row { display: grid; grid-template-columns: 160px 1fr 92px; align-items: center; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.bar-row:last-child { border-bottom: 0; }
.bar-name { font-size: 14px; font-weight: 500; }
.bar-track { height: 10px; background: var(--cream-2); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), #cf6b41); }
.bar-fill.green { background: linear-gradient(90deg, var(--accent-2), #3f8a75); }
.bar-val { text-align: right; font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; font-size: 13.5px; font-weight: 500; }

/* ---------- Client cards ---------- */
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.client { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.client .head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.client .cname { font-family: 'Fraunces', serif; font-size: 19px; font-weight: 600; line-height: 1.15; }
.client .ctype { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.client .money { display: flex; gap: 22px; padding: 12px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.client .money .blk .k { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.client .money .blk .v { font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; font-size: 19px; font-weight: 600; }
.client .money .blk .v.net { color: var(--accent-2); }
.client .meta-line { display: flex; justify-content: space-between; font-size: 12.5px; gap: 10px; }
.client .meta-line .k { color: var(--muted); }
.client .note { font-size: 12.5px; color: var(--ink-soft); line-height: 1.45; }

/* ---------- Table ---------- */
table.tbl { width: 100%; border-collapse: collapse; }
table.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.tbl td { padding: 13px 12px; border-bottom: 1px solid var(--line-soft); font-size: 14px; vertical-align: top; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl td.r, table.tbl th.r { text-align: right; }
.amt { font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- State machine ---------- */
.states { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.state-step { display: flex; align-items: center; gap: 6px; }
.state-dot { width: 22px; height: 22px; border-radius: 999px; display: grid; place-items: center; font-size: 11px; font-weight: 600; font-family: 'JetBrains Mono', monospace;
  background: var(--cream-2); color: var(--muted); border: 1px solid var(--line); }
.state-dot.done { background: var(--accent-2); color: #fff; border-color: var(--accent-2); }
.state-dot.cur { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 0 0 4px var(--amber-soft); }
.state-step .lbl { font-size: 11.5px; color: var(--muted); }
.state-arrow { color: var(--line); margin: 0 1px; }

/* ---------- Timeline ---------- */
.tl { position: relative; padding-left: 22px; }
.tl::before { content: ''; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 7px 0; }
.tl-item::before { content: ''; position: absolute; left: -22px; top: 13px; width: 10px; height: 10px; border-radius: 999px; background: var(--accent); border: 2px solid var(--paper); }
.tl-date { font-family: 'JetBrains Mono', monospace; font-size: 12.5px; font-weight: 600; }
.tl-body { font-size: 13.5px; color: var(--ink-soft); }

.foot-note { font-size: 12.5px; color: var(--muted); margin-top: 18px; line-height: 1.5; }
.divider { height: 1px; background: var(--line); margin: 26px 0; border: 0; }

@media (max-width: 860px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .section.grid { grid-template-columns: 1fr !important; }
  .bar-row[style] { grid-template-columns: 130px 1fr 84px !important; }
  .bar-row { grid-template-columns: 110px 1fr 78px; }
  .nav { gap: 0; }
  .nav button, .nav a.tab { padding: 8px 11px; font-size: 13px; }
  .brand .sub { display: none; }
}
