/* Mina-mole · Gestão
   Estética: app clara de cartões suaves, um cartão preto de destaque, ícones em quadrados
   arredondados e barra de navegação flutuante. Cores e letras da marca:
   bege #EEEAE5 · preto · vermelho #E02A12 · lilás #C4A3E0
   Inter Tight (grotesca) + Instrument Serif (serifa condensada). */
:root {
  color-scheme: light;
  --bg: #eeeae5;            /* fundo bege Mina-mole */
  --surface: #f8f6f2;       /* cartões claros */
  --tint: #e6e1da;          /* fundos secundários */
  --dark: #121110;          /* cartão de destaque */
  --ink: #0e0e0e;
  --ink-2: #57524b;
  --ink-3: #8d887f;
  --line: #e2ddd5;
  --accent: #e02a12;        /* vermelho */
  --accent-soft: #f7d6ce;
  --lilac: #c4a3e0;         /* lilás */
  --lilac-soft: #ebe0f5;
  --good: #1f7a45;
  --good-soft: #dcefe2;
  --warn: #b5300f;
  --warn-soft: #f7d6ce;
  --bad: #c7260d;
  --bad-soft: #f7d6ce;
  --in: #0e0e0e;            /* barras de receita */
  --out: #c4a3e0;           /* barras de despesa */
  --font: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Instrument Serif", "Bodoni 72", Didot, "Times New Roman", serif;
  --radius: 24px;
  --radius-sm: 16px;
  --shadow: 0 1px 2px rgba(20, 16, 10, .04), 0 6px 24px rgba(20, 16, 10, .05);
  --sidebar: 248px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; padding-top: env(safe-area-inset-top); background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); letter-spacing: -0.01em; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.block { display: block; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.neg { color: var(--accent); }
.loading { display: grid; place-items: center; min-height: 100vh; color: var(--ink-2); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Estrutura ---------- */
#app { min-height: 100vh; }
.sidebar {
  position: fixed; top: 12px; bottom: 12px; left: 12px; width: calc(var(--sidebar) - 24px); background: var(--surface);
  border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; padding: 22px 12px; z-index: 5;
}
.sidebar ul { list-style: none; margin: 22px 0; padding: 0; display: grid; gap: 4px; }
.sidebar a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 14px; text-decoration: none; color: var(--ink-2); font-weight: 500; }
.sidebar a:hover { background: var(--bg); color: var(--ink); }
.sidebar a.active { background: var(--ink); color: #fff; }
.sidebar a.active .nav-ico { background: var(--lilac); color: var(--ink); }
.nav-ico { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--bg); font-size: 14px; flex: none; }
.soon { margin-left: auto; font-size: 11px; color: var(--ink-3); font-weight: 400; white-space: nowrap; }
.sidebar-foot { margin-top: auto; display: grid; gap: 6px; padding: 0 10px; }
.brand { display: flex; align-items: center; padding: 0 10px; text-decoration: none; }
.brand img { display: block; height: 24px; width: auto; }
.content { margin-left: var(--sidebar); padding: 30px 32px 56px 24px; max-width: 1280px; }
.bottom-nav, .more-sheet { display: none; }

/* ---------- Cabeçalhos e barras ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-weight: 400; line-height: 1; }
.t-heavy { font-weight: 800; font-size: 38px; letter-spacing: -0.05em; }
.t-serif { font-family: var(--serif); font-size: 38px; letter-spacing: -0.015em; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.total-line { margin: 0 0 10px; font-size: 13px; color: var(--ink-2); }
.month-picker { display: inline-flex; align-items: center; gap: 2px; background: var(--surface); border-radius: 999px; padding: 4px; box-shadow: var(--shadow); }
.mp-label { min-width: 140px; text-align: center; font-weight: 600; text-transform: capitalize; font-size: 14.5px; }
.segmented { display: inline-flex; background: var(--surface); border-radius: 999px; padding: 4px; gap: 2px; flex-wrap: wrap; box-shadow: var(--shadow); }
.segmented button { border: 0; background: none; padding: 7px 15px; border-radius: 999px; cursor: pointer; color: var(--ink-2); font-weight: 500; }
.segmented button.on { background: var(--ink); color: #fff; }
.search { width: min(440px, 100%); padding: 11px 16px; border: 0; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); }

/* ---------- Botões ---------- */
.btn { border: 0; background: var(--surface); padding: 10px 16px; border-radius: 14px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); }
.btn:hover { background: #fff; }
.btn:disabled { opacity: .55; cursor: progress; }
.btn-primary { background: var(--ink); color: #fff; box-shadow: none; }
.btn-primary:hover { background: #2a2826; }
.btn-danger { background: var(--accent); color: #fff; box-shadow: none; }
.btn-ghost-danger { color: var(--accent); background: none; box-shadow: none; }
.btn-small { padding: 6px 12px; font-size: 13px; border-radius: 11px; }
.btn-block { width: 100%; padding: 13px; }
.icon-btn { border: 0; background: none; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 18px; color: var(--ink-2); }
.icon-btn:hover { background: var(--bg); color: var(--ink); }

/* ---------- Cartões ---------- */
.card { background: var(--surface); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); min-width: 0; }
.card-title { font-size: 15px; font-weight: 600; color: var(--ink-2); margin-bottom: 12px; letter-spacing: -0.01em; }
.card p { margin: 8px 0 0; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; margin-bottom: 14px; align-items: start; }
.stack { display: grid; gap: 14px; align-content: start; }
.big-num { font-size: 32px; font-weight: 600; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.big-num small { font-size: 14px; font-weight: 500; color: var(--ink-2); letter-spacing: -0.01em; }
.mini-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 12px 0 4px; }
.mini-kpis > div { background: var(--bg); border-radius: 14px; padding: 11px 13px; display: grid; gap: 2px; }
.mini-kpis span { font-size: 12.5px; color: var(--ink-2); }
.mini-kpis b { font-size: 18px; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.link { display: inline-block; margin-top: 12px; font-size: 14px; color: var(--ink); text-decoration: none; font-weight: 600; }
.link:hover { text-decoration: underline; }

/* Cartões de destaque do dashboard */
.top-cards { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-bottom: 14px; }
.balance { border-radius: 28px; padding: 22px 24px 20px; position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 6px; min-height: 196px; }
.balance-dark { background: var(--dark); color: #fff; }
.balance-lilac { background: var(--lilac); color: var(--ink); }
.balance-label { font-size: 14.5px; font-weight: 500; opacity: .8; }
.balance-label i { font-family: var(--serif); font-style: normal; font-size: 18px; opacity: .9; }
.balance-num { font-size: 46px; font-weight: 600; letter-spacing: -0.055em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 5px 11px; border-radius: 10px; background: var(--lilac); color: var(--ink); }
.chip-red { background: var(--accent); color: #fff; }
.chip-light { background: rgba(255,255,255,.55); color: var(--ink); }
.chip-ghost { background: rgba(255,255,255,.12); color: #fff; }
.balance-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: auto; padding-top: 14px; }
.balance-row div { display: grid; gap: 1px; }
.balance-row span { font-size: 12px; opacity: .65; }
.balance-row b { font-size: 17px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.balance-deco { position: absolute; right: 18px; top: 16px; width: 54px; height: 54px; pointer-events: none; }

/* ---------- Alertas e etiquetas ---------- */
.alerts { display: grid; gap: 8px; margin-bottom: 14px; }
.alert { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px 11px 16px; border-radius: var(--radius-sm); font-size: 14px; flex-wrap: wrap; margin-bottom: 12px; font-weight: 500; }
.alerts .alert { margin: 0; }
.alert-info { background: var(--lilac-soft); }
.alert-warn { background: var(--accent-soft); }
.alert-danger { background: var(--accent); color: #fff; }
.alert .btn { background: rgba(255,255,255,.7); box-shadow: none; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 8px; background: var(--bg); color: var(--ink-2); white-space: nowrap; }
.badge-good { background: var(--good-soft); color: var(--good); }
.badge-warn { background: var(--accent-soft); color: var(--warn); }
.badge-bad { background: var(--accent); color: #fff; }
.badge-accent { background: var(--lilac-soft); color: #5b3c7a; }

/* ---------- Listas (estilo "Transaction") ---------- */
.list { background: var(--surface); border-radius: var(--radius); padding: 6px 18px; box-shadow: var(--shadow); }
.item { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.item:last-child { border-bottom: 0; }
.item:hover .item-title { text-decoration: underline; text-underline-offset: 3px; }
.item-ico { width: 44px; height: 44px; border-radius: 14px; background: var(--ink); color: #fff; display: grid; place-items: center; flex: none; font-size: 17px; font-weight: 700; letter-spacing: -0.03em; }
.item-ico.ico-in { background: var(--ink); }
.item-ico.ico-out { background: var(--lilac); color: var(--ink); }
.item-ico.ico-warn { background: var(--accent); }
.item-main { min-width: 0; flex: 1; }
.item-title { font-weight: 600; overflow-wrap: anywhere; letter-spacing: -0.02em; }
.item-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.item-side { display: grid; justify-items: end; gap: 5px; }
.item-value { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: -0.03em; }
.item-side small { font-size: 12px; color: var(--ink-3); }
.empty { text-align: center; padding: 40px 20px; background: var(--surface); border-radius: var(--radius); color: var(--ink-2); box-shadow: var(--shadow); }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.mini-list li:last-child { border-bottom: 0; }

/* ---------- Balanço ---------- */
.pl { width: 100%; border-collapse: collapse; }
.pl td { padding: 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.pl tr:last-child td { border-bottom: 0; }
.row-strong td { font-weight: 700; }
.row-strong td:first-child { padding-top: 12px; }

/* ---------- Gráficos ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); }
.chart .axis { stroke: var(--ink-3); }
.chart .tick { font-size: 11px; fill: var(--ink-3); font-variant-numeric: tabular-nums; }
.chart .tick-strong { fill: var(--ink); font-weight: 700; }
.chart .bar-in { fill: var(--in); }
.chart .bar-out { fill: var(--out); }
.chart .line-res { stroke: var(--accent); stroke-width: 2; }
.chart .dot-res { fill: var(--accent); }
.chart .dot-neg { fill: var(--accent); stroke: #fff; stroke-width: 1.5; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--ink-2); margin: -4px 0 8px; }
.lg::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.lg-in::before { background: var(--in); }
.lg-out::before { background: var(--out); }
.lg-res::before { background: var(--accent); height: 3px; vertical-align: 3px; }
.hbars { display: grid; gap: 12px; }
.hbar-label { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; margin-bottom: 5px; }
.hbar-label b { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbar-track { height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.hbar-fill { height: 100%; background: var(--ink); border-radius: 999px; }
.hbars-lilac .hbar-fill { background: var(--lilac); }
.progress { position: relative; height: 10px; background: var(--bg); border-radius: 999px; margin: 12px 0 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--ink); border-radius: 999px; }
.progress-aviso .progress-fill, .progress-excedido .progress-fill, .progress-critico .progress-fill { background: var(--accent); }
.progress-mark { position: absolute; left: 80%; top: 0; bottom: 0; width: 2px; background: var(--surface); }
.stat-ico { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; font-size: 17px; margin-bottom: 10px; }
.stat-ico.lilac { background: var(--lilac); }
.stat-ico.red { background: var(--accent); color: #fff; }
.stat-ico.dark { background: var(--ink); color: #fff; }

/* ---------- Formulários e janelas ---------- */
.modal-wrap { position: fixed; inset: 0; background: rgba(18, 16, 14, .4); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--surface); border-radius: 28px; width: min(620px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 24px 70px rgba(0, 0, 0, .22); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px 10px; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.04em; }
.modal-body { padding: 8px 22px 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.field { display: grid; gap: 6px; }
.field.full, .full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink); }
.field small { font-size: 12px; color: var(--ink-3); }
.req { color: var(--accent); }
.field input, .field select, .field textarea { width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 14px; background: #fff; min-height: 46px; color: var(--ink); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px var(--lilac-soft); }
.field-check { display: flex; align-items: center; gap: 8px; align-self: end; min-height: 46px; }
.field-check input { width: 20px; height: 20px; min-height: 0; accent-color: var(--ink); }
.form-section { font-size: 15px; font-weight: 700; margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--line); letter-spacing: -0.02em; }
.form-grid > .form-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.form-actions { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.spacer { flex: 1; }
.cliente-hist { margin-bottom: 8px; }
.form-note { margin: 2px 0 4px; }
.equipa-nota { display: block; font-size: 13.5px; margin: 0; background: var(--lilac-soft); border-radius: var(--radius-sm); padding: 14px 16px; font-weight: 400; }
.equipa-nota ul { margin: 6px 0 8px; padding-left: 18px; }
.equipa-nota li { margin-bottom: 3px; }
.equipa-resumo { margin: 8px 0 0; padding-top: 8px; border-top: 1px solid rgba(0,0,0,.12); font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 14px; z-index: 100; transition: .25s; font-size: 14px; font-weight: 600; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-bad { background: var(--accent); }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { background: var(--surface); border-radius: 30px; padding: 32px 28px; width: min(410px, 100%); box-shadow: var(--shadow); display: grid; gap: 14px; }
.login-form { display: grid; gap: 12px; margin-top: 4px; }
.login-msg { color: var(--accent); margin: 0; min-height: 1em; font-size: 14px; }
.brand-lg { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 0; }
.sym-wrap { position: relative; width: 170px; height: 150px; display: grid; place-items: center; }
.sym-wrap .blob { position: absolute; width: 150px; height: 150px; left: 6px; top: 0; transform: rotate(-8deg); }
.sym-wrap .squiggle { position: absolute; width: 170px; left: -10px; bottom: -14px; }
.sym-wrap .sym { position: relative; height: 104px; width: auto; }
.brand-lg .wm { height: 32px; width: auto; }
.brand-sub { font-size: 22px; letter-spacing: -0.03em; }
.brand-sub b { font-weight: 800; letter-spacing: -0.05em; }
.brand-sub i { font-family: var(--serif); font-style: normal; font-size: 25px; }

/* ---------- Ecrãs médios ---------- */
@media (max-width: 1100px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Telemóvel ---------- */
@media (max-width: 760px) {
  .sidebar { display: none; }
  .content { margin: 0; padding: 18px 14px calc(112px + env(safe-area-inset-bottom)); }
  .t-heavy, .t-serif { font-size: 30px; }
  .page-head { margin-bottom: 16px; }
  .top-cards { grid-template-columns: 1fr; gap: 12px; }
  .balance { min-height: 0; padding: 20px 20px 18px; border-radius: 26px; }
  .balance-num { font-size: 40px; }
  .card { padding: 18px; border-radius: 22px; }
  .list { padding: 4px 14px; border-radius: 22px; }
  .item-ico { width: 40px; height: 40px; border-radius: 13px; }
  .mp-label { min-width: 120px; }
  .form-grid { grid-template-columns: 1fr; }
  .modal-wrap { place-items: end center; padding: 0; }
  .modal { border-radius: 28px 28px 0 0; max-height: 92vh; }

  /* Barra de navegação flutuante: só ícones, o ativo num quadrado de cor */
  .bottom-nav {
    display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; z-index: 20;
    left: 14px; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom));
    padding: 8px; border-radius: 26px; background: rgba(248, 246, 242, .94);
    -webkit-backdrop-filter: blur(20px) saturate(1.3); backdrop-filter: blur(20px) saturate(1.3);
    box-shadow: 0 10px 30px rgba(20, 16, 10, .14), 0 1px 3px rgba(20, 16, 10, .06);
  }
  .bn-item { display: grid; place-items: center; text-decoration: none; color: var(--ink-3); border: 0; background: none; cursor: pointer; padding: 0; height: 48px; }
  .bn-item span { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 19px; }
  .bn-item small { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .bn-item.active { color: var(--ink); }
  .bn-item.active span { background: var(--lilac); }
  .more-sheet:not([hidden]) {
    display: grid; position: fixed; left: 14px; right: 14px; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 21;
    background: var(--surface); border-radius: 24px; padding: 8px; box-shadow: 0 12px 34px rgba(20,16,10,.16);
  }
  .more-sheet a { display: flex; gap: 12px; align-items: center; padding: 12px; text-decoration: none; border-radius: 14px; font-weight: 600; }
  .more-sheet a:hover { background: var(--bg); }
  .toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
  /* conteúdo desvanece por trás da barra */
  #app::after {
    content: ""; position: fixed; left: 0; right: 0; bottom: 0; z-index: 19; pointer-events: none;
    height: calc(110px + env(safe-area-inset-bottom));
    background: linear-gradient(to bottom, rgba(238,234,229,0) 0%, rgba(238,234,229,.8) 50%, rgba(238,234,229,.97) 100%);
  }
}

/* ---------- Orçamentos ---------- */
.modal.modal-wide { width: min(1080px, 100%); }
.orc-editor { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 22px; align-items: start; }
.orc-main { display: grid; gap: 12px; min-width: 0; }
.orc-main > .form-section { margin-top: 6px; }
.orc-side { position: sticky; top: 64px; display: grid; gap: 12px; }
.orc-resumo { background: var(--dark); color: #fff; border-radius: 22px; padding: 18px; display: grid; gap: 8px; }
.or-total { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,.15); }
.or-total span { font-size: 14px; opacity: .75; }
.or-total b { font-size: 30px; letter-spacing: -0.05em; }
.or-row { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; }
.or-row span { opacity: .7; }
.or-row b { font-weight: 600; font-variant-numeric: tabular-nums; }
.or-note { margin: 2px 0 0; font-size: 12.5px; opacity: .7; }
.or-alert { color: #ffb4a6; opacity: 1; }
.orc-actions { display: grid; gap: 8px; }
.row-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row-inline select { flex: 1; min-width: 160px; }
.row-inline select, .add-servico { padding: 9px 11px; border: 1px solid var(--line); border-radius: 12px; background: #fff; min-height: 38px; }
.desc-label { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 600; }
.desc-input { width: 80px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.orc-linhas, .orc-plano { display: grid; gap: 10px; }
.orc-linha, .orc-prest { display: grid; gap: 8px; align-items: end; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 10px 10px 10px 12px; }
.orc-linha { grid-template-columns: 76px 130px 120px 140px 90px 1fr; position: relative; padding-right: 44px; }
.orc-linha .ol-desc { grid-column: 1 / -1; }
.orc-linha .ol-del { position: absolute; top: 10px; right: 8px; }
.orc-prest { grid-template-columns: minmax(0, 2fr) 70px 150px 100px 32px; }
.orc-linha label, .orc-prest label { display: block; font-size: 11.5px; font-weight: 600; color: var(--ink-3); margin-bottom: 4px; }
.orc-linha input, .orc-linha select, .orc-prest input { width: 100%; padding: 8px 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); min-height: 38px; }
.orc-linha .ol-int input { background: var(--lilac-soft); border-color: transparent; }
.op-val span { display: block; padding: 9px 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.pdf-preview { display: grid; gap: 12px; }
.pdf-preview iframe { width: 100%; height: 70vh; border: 0; border-radius: 16px; background: var(--bg); }
.ficha { display: grid; gap: 12px; }
.ficha-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.ficha-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.ficha-titulo { font-size: 22px; letter-spacing: -0.04em; }
.ficha-total { font-size: 30px; font-weight: 700; letter-spacing: -0.05em; white-space: nowrap; }
.acoes { display: flex; flex-wrap: wrap; gap: 8px; }
.pay-side { display: flex; gap: 10px; align-items: center; }
.rate-bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; align-items: end; }
.rate-col { display: grid; justify-items: center; gap: 4px; }
.rate-track { width: 100%; max-width: 30px; height: 140px; background: var(--bg); border-radius: 10px; display: flex; align-items: flex-end; overflow: hidden; }
.rate-fill { width: 100%; background: var(--ink); border-radius: 10px; }
.rate-col:last-child .rate-fill { background: var(--accent); }
.rate-pct { font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rate-m { font-size: 11px; color: var(--ink-3); }
@media (max-width: 900px) {
  .orc-editor { grid-template-columns: 1fr; }
  .orc-side { position: static; }
  .orc-linha { grid-template-columns: 1fr 1fr 1fr; }
  .orc-prest { grid-template-columns: 1fr 1fr; }
  .orc-prest .op-desc { grid-column: 1 / -1; }
  .ficha-top { flex-direction: column; }
  .rate-track { height: 100px; }
  .rate-pct { font-size: 9.5px; }
}

/* ---------- Aulas ---------- */
.group-title { font-size: 17px; font-weight: 700; letter-spacing: -0.03em; margin: 6px 4px 10px; }
.group-title .muted { font-weight: 400; font-size: 14px; }
.item-static { cursor: default; }
.item-static:hover .item-title { text-decoration: none; }
.matriz-wrap { overflow-x: auto; }
.matriz { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.matriz th { font-weight: 600; color: var(--ink-3); font-size: 12px; text-align: center; padding: 6px 4px; }
.matriz th:first-child, .matriz td:first-child { text-align: left; white-space: nowrap; padding-right: 14px; }
.matriz td { text-align: center; padding: 7px 4px; border-top: 1px solid var(--line); }
.matriz .on { background: var(--lilac-soft); }
.dot { font-size: 14px; }
.dot-ok { color: var(--ink); }
.dot-no { color: var(--accent); }
.dot-none { color: var(--ink-3); }
.stack + .card { margin-top: 14px; }
