/* Central Financeira — estilo validado (Zilla Slab + Schibsted Grotesk, acento cobalto) */

:root{
  --bg:#F7F5F1; --surface:#FFFFFF; --surface-sunken:#F1EEE7;
  --sidebar:#1D1B17; --sidebar-ink:#E9E6DF; --sidebar-ink-muted:#9C968A;
  --ink:#211F1B; --ink-muted:#6E685E; --ink-faint:#A39C8F;
  --border:#E5E0D7;
  --accent:#2E3F99; --accent-hover:#24316F; --accent-tint:#E7E9F6;
  --positive:#1F7A52; --positive-tint:#E4F1EA;
  --negative:#B5502E; --negative-tint:#F6E7E0;
}

*{ box-sizing:border-box; }

body{
  margin:0; background:var(--bg); color:var(--ink);
  font-family:'Schibsted Grotesk', system-ui, sans-serif;
}

h1,h2,h3,.serif{ font-family:'Zilla Slab', Georgia, serif; font-weight:700; }

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

.tab{ font-variant-numeric:tabular-nums; font-feature-settings:"tnum" 1; }

/* ---- layout ---- */
.app{ display:flex; min-height:100vh; }

.sidebar{
  width:236px; min-width:236px; background:var(--sidebar);
  display:flex; flex-direction:column; padding:26px 18px; box-sizing:border-box;
}
.sidebar .brand{ display:flex; align-items:center; gap:10px; margin-bottom:38px; padding:0 6px; }
.sidebar .brand .mark{
  width:32px; height:32px; border-radius:8px; background:var(--accent);
  display:flex; align-items:center; justify-content:center; color:#fff; font-size:14px; font-weight:700;
}
.sidebar .brand .name{ font-size:16px; line-height:1.1; color:#fff; }
.sidebar .brand .sub{ font-size:10.5px; color:var(--sidebar-ink-muted); letter-spacing:.03em; margin-top:2px; }

.nav{ display:flex; flex-direction:column; gap:3px; }
.nav a{
  display:flex; align-items:center; gap:11px; padding:10px 12px; border-radius:9px;
  color:var(--sidebar-ink-muted); font-size:14px; font-weight:500;
}
.nav a:hover{ background:rgba(255,255,255,.06); color:#fff; }
.nav a.active{ background:rgba(255,255,255,.09); color:#fff; font-weight:600; }
.nav svg{ width:17px; height:17px; flex:none; }

.sidebar .user{
  margin-top:auto; display:flex; align-items:center; gap:10px; padding-top:18px;
  border-top:1px solid rgba(255,255,255,.09);
}
.sidebar .user .avatar{
  width:28px; height:28px; border-radius:50%; background:rgba(255,255,255,.09);
  display:flex; align-items:center; justify-content:center; font-size:11px; color:#fff;
}
.sidebar .user .name{ font-size:13px; color:var(--sidebar-ink); }
.sidebar .user a{ color:var(--sidebar-ink-muted); font-size:11.5px; margin-left:auto; }

.main{ flex:1; padding:40px 44px; box-sizing:border-box; display:flex; flex-direction:column; gap:26px; min-width:0; }

.topbar{ display:flex; align-items:flex-end; justify-content:space-between; flex-wrap:wrap; gap:14px; }
.topbar h1{ font-size:30px; margin:0; color:var(--ink); }
.month-nav{ display:flex; align-items:center; gap:10px; margin-top:6px; color:var(--ink-muted); font-size:13.5px; }
.month-nav strong{ color:var(--ink); }
.month-nav a{ color:var(--ink-muted); display:flex; }

/* ---- botões ---- */
.btn{
  background:var(--accent); color:#fff; padding:11px 18px; border-radius:9px;
  font-size:13.5px; font-weight:600; display:inline-flex; align-items:center; gap:8px;
  cursor:pointer; border:none; font-family:inherit;
}
.btn:hover{ background:var(--accent-hover); }
.btn-secondary{
  background:transparent; border:1px solid var(--border); color:var(--ink);
  font-size:12.5px; font-weight:500; padding:7px 13px; border-radius:8px; cursor:pointer; font-family:inherit;
}

/* ---- cards ---- */
.card{ background:var(--surface); border:1px solid var(--border); border-radius:14px; padding:20px 22px; }
.card-lg{ padding:26px 30px; }

.eyebrow{ font-size:12.5px; color:var(--ink-muted); text-transform:uppercase; letter-spacing:.06em; }

.tag{ font-size:12.5px; font-weight:600; padding:4px 9px; border-radius:20px; }
.tag-positive{ background:var(--positive-tint); color:var(--positive); }
.tag-negative{ background:var(--negative-tint); color:var(--negative); }

/* ---- tabela simples ---- */
.rows{ display:flex; flex-direction:column; }
.rows .row{
  display:flex; align-items:center; justify-content:space-between; padding:11px 0;
  border-bottom:1px solid var(--border);
}
.rows .row:last-child{ border-bottom:none; }
.row .desc{ font-size:13.5px; color:var(--ink); font-weight:500; }
.row .meta{ font-size:12px; color:var(--ink-faint); margin-top:2px; }
.row .valor{ font-size:13.5px; font-weight:600; color:var(--ink); }

/* ---- formulário ---- */
.field{ margin-bottom:13px; }
.field label{ display:block; font-size:12px; color:var(--ink-muted); margin-bottom:6px; }
.field input, .field select{
  width:100%; border:1px solid var(--border); border-radius:8px; padding:10px 12px;
  font-size:13.5px; color:var(--ink); background:var(--surface-sunken); font-family:inherit;
}
.field input:focus, .field select:focus{ outline:2px solid var(--accent); outline-offset:1px; }
.field-row{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }

.seg{ display:grid; gap:6px; background:var(--surface-sunken); border:1px solid var(--border); border-radius:9px; padding:4px; }
.seg.cols-3{ grid-template-columns:repeat(3,1fr); }
.seg label{ font-size:12.5px; font-weight:600; padding:8px 0; text-align:center; border-radius:7px; cursor:pointer; color:var(--ink-muted); }
.seg input{ display:none; }
.seg input:checked + label{ background:var(--accent); color:#fff; }

/* ---- cartões (tiles) ---- */
.card-tiles{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
.card-tile{
  border-radius:14px; padding:20px 22px; color:#fff; display:flex; flex-direction:column;
  justify-content:space-between; height:150px; box-sizing:border-box;
}
.card-tile .barra{ height:5px; background:rgba(255,255,255,.15); border-radius:3px; margin-top:9px; overflow:hidden; }
.card-tile .barra span{ display:block; height:100%; }

/* ---- login ---- */
.login-wrap{ min-height:100vh; display:flex; align-items:center; justify-content:center; background:var(--bg); }
.login-box{ width:360px; background:var(--surface); border:1px solid var(--border); border-radius:14px; padding:34px 32px; }
.login-box h1{ font-size:22px; margin:0 0 4px; }
.login-box p{ font-size:13px; color:var(--ink-muted); margin:0 0 22px; }
.login-erro{ background:var(--negative-tint); color:var(--negative); font-size:12.5px; padding:9px 12px; border-radius:8px; margin-bottom:14px; }
.login-aviso{ background:var(--accent-tint); color:var(--accent); font-size:12.5px; padding:9px 12px; border-radius:8px; margin-bottom:14px; }

@media (max-width: 900px){
  .app{ flex-direction:column; }
  .sidebar{ width:100%; min-width:0; flex-direction:row; align-items:center; padding:14px 16px; }
  .sidebar .brand{ margin-bottom:0; }
  .nav{ flex-direction:row; overflow-x:auto; }
  .sidebar .user{ display:none; }
  .main{ padding:24px; }
  .card-tiles{ grid-template-columns:1fr; }
  .field-row{ grid-template-columns:1fr; }
}
