/* AD Patrimonial — identidade: creme, bronze/dourado em degradê, linhas finas douradas, tipografia geométrica */
:root {
  --bg: #f7f2eb;
  --bg2: rgba(251, 248, 243, .92);
  --surface: rgba(255, 255, 255, .80);
  --surface2: #ffffff;
  --line: rgba(141, 81, 17, .13);
  --line-hi: rgba(141, 81, 17, .30);
  --gold-line: rgba(196, 140, 70, .55);
  --text: #2b2018;
  --muted: #7d6b59;
  --faint: #a8978a;
  --brass: #b5650f;          /* bronze do logo — texto e destaques */
  --brass-deep: #8d5111;
  --brass-soft: rgba(224, 138, 30, .10);
  --grad: linear-gradient(135deg, #f2a93f 0%, #d98420 45%, #a85b10 100%);
  --grad-soft: linear-gradient(135deg, rgba(242,169,63,.16), rgba(168,91,16,.06));
  --ok: #2f7d52;
  --warn: #b26a00;
  --bad: #b8402b;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(80, 50, 20, .05), 0 8px 28px rgba(80, 50, 20, .07);
  --shadow-hi: 0 2px 4px rgba(80, 50, 20, .06), 0 18px 44px rgba(80, 50, 20, .12);
  --display: "Montserrat", "Segoe UI", system-ui, sans-serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html { background: var(--bg); }
body {
  background: transparent;
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
::selection { background: rgba(224, 138, 30, .25); }

/* ---------- Plano de fundo (arte AD) ---------- */
.bg { position: fixed; inset: 0; z-index: -2; pointer-events: none; overflow: hidden; background: var(--bg); }
.bg-d { position: absolute; left: 50%; top: 50%; width: max(100vw, 177.7vh); height: max(100vh, 56.28vw); transform: translate(-50%, -50%); display: flex; }
.bg-d img { width: 50%; height: 100%; display: block; flex: none; }
.bg-d img + img { margin-left: -1px; width: calc(25% + 1px); }
.bg-m { display: none; position: absolute; left: 0; top: 0; width: 100%; height: auto; }
body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: transparent; transition: background .4s; }
body.in-app::after { background: linear-gradient(180deg, rgba(247,242,235,.93) 0%, rgba(247,242,235,.955) 40%, rgba(247,242,235,.975) 100%); }
@media (max-width: 760px) {
  .bg-d { display: none; }
  .bg-m { display: block; }
}

[hidden] { display: none !important; }
.num, .money { font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.card, .kpi, .irow, .tl-item, .login-card, .modal-box, .hero { -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
a { color: var(--brass); }
.t-brass { color: var(--brass); font-weight: 600; }
.t-bad { color: var(--bad); font-weight: 600; }
.grow { flex: 1; min-width: 0; }

/* ---------- Tipografia ---------- */
.eyebrow { font-family: var(--display); font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--brass); margin-bottom: 4px; }
h1 { font-family: var(--display); font-weight: 600; font-size: 30px; margin: 0; letter-spacing: -.01em; line-height: 1.15; }
h2 { font-family: var(--display); font-weight: 600; font-size: 15px; margin: 0 0 12px; letter-spacing: .01em; }
.sub { color: var(--muted); font-size: 13px; }

/* ---------- Login ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: grid; align-items: center; justify-items: end; padding: 24px clamp(20px, 6vw, 110px); }
.login-card {
  width: 100%; max-width: 400px; position: relative;
  background: rgba(255, 252, 247, .80);
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 30px 80px rgba(90, 55, 20, .22), inset 0 1px 0 rgba(255,255,255,.8);
  border-radius: 22px; padding: 34px 30px 26px; display: grid; gap: 14px; overflow: hidden;
}
.login-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--grad); }
.login-logo { display: none; width: 150px; height: auto; justify-self: center; }
.login-head h1 { font-size: 28px; }
.login-sub { margin: 4px 0 4px; color: var(--muted); }
.login-foot { text-align: center; color: var(--faint); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-family: var(--display); margin-top: 4px; }
.pw { position: relative; display: block; }
.pw input { padding-right: 78px; }
.pw-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--brass); font-size: 12px; font-weight: 600; cursor: pointer; padding: 6px 8px; }
@media (max-width: 760px) {
  .login { justify-items: center; align-items: end; padding: 16px 16px max(24px, env(safe-area-inset-bottom)); }
  .login-card { padding: 26px 22px 20px; max-width: 440px; background: rgba(255, 252, 247, .88); }
}
@media (max-width: 760px) and (max-height: 640px) { .login { align-items: center; } }

/* ---------- Topo ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(252, 249, 244, .86); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 1px 0 var(--line); }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-line) 20%, var(--gold-line) 80%, transparent); }
.topbar-in { max-width: 1200px; margin: 0 auto; padding: 12px 20px 6px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; }
.brand img { height: 50px; width: auto; display: block; }
.who { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; min-width: 0; }
.who #whoName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; color: var(--text); font-weight: 500; }
.role { border: 1px solid var(--gold-line); color: var(--brass); border-radius: 99px; padding: 1px 9px; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; font-family: var(--display); font-weight: 600; }
.owners { max-width: 1200px; margin: 0 auto; padding: 8px 20px 4px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.owners::-webkit-scrollbar { display: none; }
.owners button { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.7); border: 1px solid var(--line); color: var(--muted); padding: 7px 14px; border-radius: 999px; cursor: pointer; font-family: var(--display); font-weight: 600; font-size: 12.5px; letter-spacing: .06em; transition: all .15s; }
.owners button span { font-family: var(--sans); font-size: 11px; background: rgba(141,81,17,.07); border-radius: 99px; padding: 0 7px; color: var(--muted); letter-spacing: 0; }
.owners button:hover { border-color: var(--line-hi); color: var(--text); }
.owners button.on { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(181, 101, 15, .30); }
.owners button.on span { background: rgba(255,255,255,.25); color: #fff; }
.owners button.cons { border-style: dashed; }
.owners button.cons.on { border-style: solid; }
.tabs { max-width: 1200px; margin: 0 auto; padding: 0 12px; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { position: relative; background: none; border: 0; padding: 10px 12px 12px; color: var(--muted); cursor: pointer; white-space: nowrap; font-weight: 600; font-size: 14px; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); }
.tabs button.on::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--grad); }

main.wrap { padding-top: 30px; padding-bottom: 44px; }
.view { animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .view { animation: none; } }
.foot { color: var(--faint); font-size: 11px; padding-bottom: 28px; display: flex; gap: 8px; letter-spacing: .1em; text-transform: uppercase; font-family: var(--display); }
.loading { display: flex; align-items: center; gap: 12px; color: var(--muted); padding: 60px 0; justify-content: center; }
.loading span { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--brass); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Cabeçalho de página ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.print-head { display: none; }

/* ---------- Controles ---------- */
.btn { border: 1px solid var(--line-hi); background: rgba(255,255,255,.85); padding: 9px 15px; border-radius: 11px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--text); transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; }
.btn:hover { border-color: var(--brass); color: var(--brass-deep); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(181, 101, 15, .28); }
.btn-primary:hover { color: #fff; border-color: transparent; box-shadow: 0 8px 22px rgba(181, 101, 15, .38); filter: brightness(1.04); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(141,81,17,.06); border-color: transparent; }
.btn-danger { color: var(--bad); }
.btn-danger:hover { color: var(--bad); }
.btn-sm { padding: 5px 11px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; padding: 13px; font-size: 15px; letter-spacing: .02em; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 7px; cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 600; }
.seg button.on { background: var(--surface2); color: var(--text); box-shadow: 0 1px 3px rgba(80,50,20,.12); }
.fseg { background: rgba(255,255,255,.7) !important; }
.fseg button.on { background: var(--grad) !important; color: #fff !important; box-shadow: none !important; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .grow { flex: 1 1 220px; }

.field { display: grid; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.field input, .field select, .field textarea, .search, .socio-row input {
  background: #fff; border: 1px solid var(--line-hi); border-radius: 11px; padding: 11px 13px; color: var(--text); font-size: 15px; width: 100%; font-weight: 500;
}
.field input::placeholder, .search::placeholder { color: var(--faint); font-weight: 400; }
.field input:focus, .field select:focus, .field textarea:focus, .search:focus, .socio-row input:focus { outline: none; border-color: var(--brass); box-shadow: 0 0 0 3px rgba(224, 138, 30, .16); }
.search { background: rgba(255,255,255,.85) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23b5650f' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") 13px center no-repeat; padding-left: 38px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.err { color: var(--bad); font-size: 13px; font-weight: 500; }
.note { background: var(--brass-soft); border: 1px solid var(--gold-line); color: var(--brass-deep); padding: 10px 12px; border-radius: 11px; font-size: 13px; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

/* ---------- Cartões / KPI ---------- */
.card { background: var(--surface); border: 1px solid rgba(255,255,255,.9); box-shadow: var(--shadow); border-radius: var(--radius); padding: 20px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.card-head h2 { margin-bottom: 2px; }
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { position: relative; background: var(--surface); border: 1px solid rgba(255,255,255,.9); box-shadow: var(--shadow); border-radius: var(--radius); padding: 16px 18px; min-width: 0; overflow: hidden; }
.kpi .lbl, .hero .lbl { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em; font-family: var(--display); font-weight: 600; }
.kpi .val { font-family: var(--display); font-size: 23px; font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .hint { color: var(--faint); font-size: 12px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi.accent { background: var(--grad-soft), rgba(255,255,255,.88); border-color: rgba(224,138,30,.35); }
.kpi.accent::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--grad); }
.kpi.accent .val { color: var(--brass); }

/* Destaque do Painel */
.hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 14px; margin-bottom: 16px; }
.hero-grid .kpis { margin: 0; }
.kpis.k4 { grid-template-columns: 1fr 1fr; }
.hero {
  position: relative; overflow: hidden; border-radius: 20px; padding: 24px 26px 22px; color: #fff;
  background: linear-gradient(135deg, #e99b33 0%, #c9761a 48%, #8d5111 100%);
  box-shadow: 0 20px 50px rgba(141, 81, 17, .28); display: grid; align-content: space-between; gap: 18px; min-height: 230px;
}
/* linhas finas do "A" da marca */
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background:
    linear-gradient(118deg, transparent 49.6%, rgba(255,255,255,.55) 49.8%, rgba(255,255,255,.55) 50%, transparent 50.2%) right -40px top 0 / 60% 100% no-repeat,
    linear-gradient(62deg, transparent 49.6%, rgba(255,255,255,.35) 49.8%, rgba(255,255,255,.35) 50%, transparent 50.2%) right -150px top 0 / 60% 100% no-repeat; }
.hero::after { content: ""; position: absolute; right: -60px; top: -70px; width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(circle, rgba(255,214,140,.55), transparent 65%); pointer-events: none; }
.hero > * { position: relative; }
.hero .lbl { color: rgba(255,255,255,.85); }
.hero-val { font-family: var(--display); font-weight: 700; font-size: clamp(34px, 4.6vw, 50px); letter-spacing: -.02em; line-height: 1; margin-top: 8px; font-variant-numeric: tabular-nums; }
.hero-split { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: rgba(255,255,255,.88); }
.hero-split b { color: #fff; font-weight: 700; margin-left: 4px; }
.sw { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 7px; vertical-align: 1px; }
.sw-a { background: #fff; }
.sw-b { background: rgba(255,255,255,.5); }
.hero .overall { margin: 0; gap: 7px; }
.hero .overall-top { color: rgba(255,255,255,.85); }
.hero .overall-top b { color: #fff; }
.hero .progress { background: rgba(255,255,255,.22); border-color: transparent; }
.hero .progress > i { background: #fff; }

.progress { height: 8px; background: rgba(141,81,17,.08); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--grad); border-radius: 99px; }
.progress.sm { height: 5px; }
.overall { display: grid; gap: 8px; margin-bottom: 18px; }
.overall-top { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); gap: 10px; flex-wrap: wrap; }

.cols { display: grid; grid-template-columns: 1.25fr 1fr; gap: 14px; }
.stack { display: grid; gap: 14px; align-content: start; }

/* Atenção */
.alert-card { border-color: rgba(224,138,30,.25); }
.mini.alert { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }
.dot-st { width: 9px; height: 9px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 4px rgba(178,106,0,.12); }
.dot-st.bad { background: var(--bad); box-shadow: 0 0 0 4px rgba(184,64,43,.12); }
.more { color: var(--muted); font-size: 12px; padding-top: 10px; }
.ok-empty { color: var(--ok); }

/* Por empresa */
.emp-list { display: grid; gap: 8px; }
.emp { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; display: grid; gap: 2px; transition: border-color .15s, box-shadow .15s; }
.emp:hover { border-color: var(--gold-line); box-shadow: var(--shadow); }
.emp-top { display: flex; justify-content: space-between; gap: 10px; font-family: var(--display); }
.emp-top b { font-weight: 600; letter-spacing: .04em; }
.emp-top span { color: var(--brass); font-weight: 600; }

/* Gráfico de chaves */
.chart-card { position: relative; }
.bars { display: flex; align-items: stretch; gap: 2px; height: 190px; padding-top: 22px; border-bottom: 1px solid var(--line); }
.bar-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; outline: none; border-radius: 6px; }
.bar-track { flex: 1; position: relative; display: flex; align-items: flex-end; justify-content: center; }
.bar { width: min(26px, 70%); background: var(--grad); border-radius: 4px 4px 0 0; transition: filter .15s; }
.bar.dot { height: 3px; background: var(--gold-line); }
.bar-col.has { cursor: default; }
.bar-col.has:hover .bar, .bar-col.has:focus .bar { filter: brightness(1.1) saturate(1.1); }
.bar-col.has:focus-visible { box-shadow: 0 0 0 2px var(--brass); }
.bar-lbl { position: absolute; bottom: calc(100% + 0px); left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 700; color: var(--text); white-space: nowrap; top: -20px; bottom: auto; }
.bar-x { font-size: 10.5px; color: var(--muted); text-align: center; padding-top: 6px; line-height: 1.15; height: 32px; }
.bar-x b { font-weight: 500; }
.bar-x i { display: block; font-style: normal; color: var(--brass); font-weight: 700; }
.chart-tip { position: absolute; z-index: 3; max-width: 280px; background: #2b2018; color: #fff; font-size: 12px; line-height: 1.4; padding: 8px 10px; border-radius: 9px; box-shadow: 0 10px 24px rgba(0,0,0,.2); pointer-events: none; }

/* ---------- Tabelas ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; color: var(--muted); font-weight: 600; font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; padding: 8px 10px; border-bottom: 1px solid var(--line-hi); font-family: var(--display); }
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line); }
.tbl tbody tr:hover td { background: rgba(224,138,30,.04); }
.tbl .r, .tbl th.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tfoot td { font-weight: 700; border-bottom: 0; border-top: 1px solid var(--line-hi); }

/* ---------- Lista de imóveis / veículos ---------- */
.list { display: grid; gap: 8px; }
.irow { display: grid; grid-template-columns: minmax(200px, 2.2fr) 1fr 1fr 1fr 1fr 1fr; gap: 12px; align-items: center; background: var(--surface); border: 1px solid rgba(255,255,255,.9); box-shadow: 0 1px 2px rgba(80,50,20,.05); border-radius: 14px; padding: 13px 16px; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; text-align: left; width: 100%; color: var(--text); }
.irow:hover { border-color: var(--gold-line); box-shadow: var(--shadow-hi); transform: translateY(-1px); }
.irow.head { background: none; border: 0; box-shadow: none; cursor: default; padding: 0 16px 2px; color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; font-family: var(--display); font-weight: 600; backdrop-filter: none; -webkit-backdrop-filter: none; }
.irow.head:hover { transform: none; box-shadow: none; }
.irow.total { background: var(--grad-soft), rgba(255,255,255,.7); border-color: rgba(224,138,30,.3); cursor: default; font-weight: 700; }
.irow.total:hover { transform: none; box-shadow: 0 1px 2px rgba(80,50,20,.05); }
.irow .c { min-width: 0; font-variant-numeric: tabular-nums; }
.irow .c.r { text-align: right; }
.irow .c .k { display: none; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; font-family: var(--display); }
.iname { font-weight: 700; font-family: var(--display); font-size: 14px; letter-spacing: .01em; }
.iunit { color: var(--muted); font-size: 13px; }
.chip { display: inline-block; border: 1px solid var(--line-hi); border-radius: 99px; padding: 1px 9px; font-size: 11px; color: var(--muted); letter-spacing: .02em; margin-left: 6px; vertical-align: 1px; font-weight: 600; background: rgba(255,255,255,.7); font-family: var(--sans); }
.chip.gold { border-color: rgba(224,138,30,.5); color: var(--brass); background: var(--brass-soft); }
.chip.ok { border-color: rgba(47,125,82,.35); color: var(--ok); background: rgba(47,125,82,.07); }
.chip.warn { border-color: rgba(178,106,0,.38); color: var(--warn); background: rgba(178,106,0,.08); }
.chip.bad { border-color: rgba(184,64,43,.38); color: var(--bad); background: rgba(184,64,43,.07); }
.mini .right .chip { margin-left: 0; }
.pct-line { display: flex; align-items: center; gap: 8px; margin-top: 7px; font-size: 12px; color: var(--muted); }
.pct-line .progress { flex: 1; }
.placa { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .06em; }

/* ---------- Entregas ---------- */
.tl { display: grid; gap: 26px; }
.tl-year { font-family: var(--display); font-weight: 700; font-size: 26px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 6px; letter-spacing: .02em; }
.tl-month { display: grid; grid-template-columns: 120px 1fr; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.tl-month .m { color: var(--text); text-transform: capitalize; padding-top: 6px; font-weight: 600; }
.tl-month .m .sub { text-transform: none; font-weight: 500; }
.tl-items { display: grid; gap: 8px; }
.tl-item { display: flex; justify-content: space-between; gap: 12px; align-items: center; background: var(--surface); border: 1px solid rgba(255,255,255,.9); box-shadow: 0 1px 2px rgba(80,50,20,.05); border-radius: 13px; padding: 12px 16px; cursor: pointer; border-left: 3px solid var(--gold-line); transition: box-shadow .15s; }
.tl-item.is-bad { border-left-color: var(--bad); }
.tl-item.is-warn { border-left-color: var(--warn); }
.tl-item:hover { box-shadow: var(--shadow-hi); }
.tl-item .right { text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl-item .right b { color: var(--text); font-weight: 700; font-size: 14px; }

.mini-list { display: grid; }
.mini { display: flex; justify-content: space-between; gap: 10px; padding: 11px 6px; margin: 0 -6px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 8px; transition: background .12s; }
.mini:hover { background: rgba(224,138,30,.05); }
.mini:last-child { border-bottom: 0; }
.mini .right { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); white-space: nowrap; }
.mini .right b { color: var(--text); font-weight: 700; }
.empty { color: var(--faint); padding: 18px 0; text-align: center; }
.empty .btn { margin-left: 6px; }

/* ---------- Janela (detalhes e formulários) ---------- */
.modal { position: fixed; inset: 0; background: rgba(60, 40, 20, .38); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.modal-box { position: relative; width: 100%; max-width: 740px; background: rgba(255, 253, 249, .97); border: 1px solid #fff; border-radius: 20px; padding: 24px; box-shadow: 0 30px 80px rgba(60,40,20,.28); overflow: hidden; animation: rise .25s ease both; }
.modal-box::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--grad); }
.m-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.m-head h2 { margin: 0; font-size: 20px; }
.x { background: rgba(141,81,17,.06); border: 0; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto; }
.x:hover { background: rgba(141,81,17,.12); color: var(--text); }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin: 14px 0; }
.fact, .vfacts .fact { background: #fff !important; padding: 11px 13px; min-width: 0; }
.fact .k { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; font-family: var(--display); font-weight: 600; }
.fact .v { font-variant-numeric: tabular-nums; margin-top: 3px; font-weight: 600; overflow-wrap: anywhere; }
.section-t { font-family: var(--display); font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--brass); margin: 20px 0 8px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.section-t::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--gold-line), transparent); }
.form { display: grid; gap: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.socio-row { display: grid; grid-template-columns: 1fr 100px auto; gap: 8px; }
.help { color: var(--muted); font-size: 12px; }

/* Documentos (docs.js) */
.doc { background: #fff !important; border-color: var(--line) !important; }
.doc-ic { color: #fff !important; background: var(--grad); border: 0 !important; }
.doc-up select { background: #fff !important; }

.toast { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); background: #2b2018; color: #fff; border-left: 3px solid #e99b33; padding: 11px 18px; border-radius: 11px; z-index: 60; box-shadow: 0 14px 34px rgba(0,0,0,.22); max-width: calc(100% - 32px); font-weight: 500; }

/* Contador de pendências na aba Frota */
#tabs .fbadge { color: #fff; }

/* ---------- Responsivo ---------- */
@media (max-width: 1040px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpis:not(.k4) .kpi:first-child { grid-column: span 2; }
  .cols, .hero-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .wrap { padding: 0 14px; }
  .topbar-in { padding: 10px 14px 4px; }
  .owners { padding: 6px 14px 2px; }
  .brand img { height: 40px; }
  .owners button { padding: 6px 11px; font-size: 11.5px; letter-spacing: .04em; }
  .bar-col.alt .bar-x b { visibility: hidden; }
  h1 { font-size: 24px; }
  main.wrap { padding-top: 20px; }
  .page-head .row-actions { width: 100%; }
  .page-head .row-actions .btn { flex: 1 1 auto; }
  .hero { min-height: 0; padding: 20px; }
  .irow { grid-template-columns: 1fr 1fr; gap: 8px 12px; padding: 13px 14px; }
  .irow .c.name { grid-column: span 2; }
  .irow .c.r { text-align: left; }
  .irow .c .k { display: block; }
  .irow.head { display: none; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts .fact:last-child:nth-child(odd) { grid-column: span 2; }
  .modal-box .form-actions .row-actions { width: 100%; }
  .modal-box .form-actions .row-actions .btn-primary { flex: 1; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .tl-month { grid-template-columns: 1fr; gap: 6px; }
  .tl-month .m { display: flex; justify-content: space-between; align-items: baseline; }
  .modal { padding: 10px 8px; }
  .modal-box { padding: 20px 16px; border-radius: 18px; }
  .kpi { padding: 14px; }
  .kpi .val { font-size: 19px; }
  .who #whoName { display: none; }
  .bars { height: 160px; gap: 1px; }
  .bar-x { font-size: 9px; }
  .tbl.resp thead { display: none; }
  .tbl.resp tr { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .tbl.resp td { border: 0; padding: 2px 0; text-align: left !important; }
  .tbl.resp td[data-k]::before { content: attr(data-k); display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
  .tbl.resp td.first { grid-column: span 2; font-weight: 600; }
  .tbl.resp tfoot tr { border-bottom: 0; }
}

.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- Impressão / PDF ---------- */
@media print {
  @page { margin: 14mm 12mm; }
  html, body { background: #fff !important; }
  body::after, .bg, .topbar, .foot, .toolbar, .btn, .seg, .fseg, .modal, .toast, .chart-tip { display: none !important; }
  .print-head { display: flex !important; align-items: center; gap: 16px; padding: 0 0 12px; margin: 0 0 16px; border-bottom: 2px solid #c9761a; }
  .print-head img { height: 54px; }
  .print-head b { display: block; font-family: var(--display); font-size: 18px; }
  .print-head span { color: #7d6b59; font-size: 12px; }
  .page-head .eyebrow { display: none; }
  main { padding: 0 !important; }
  .wrap { max-width: none; padding: 0; }
  .view { animation: none; }
  .card, .kpi, .irow, .tl-item, .hero, .emp { box-shadow: none !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; break-inside: avoid; border: 1px solid #e3d6c6 !important; background: #fff !important; transform: none !important; }
  .hero { color: #2b2018; }
  .hero .lbl, .hero .overall-top, .hero-split { color: #7d6b59 !important; }
  .hero-val, .hero-split b, .hero .overall-top b { color: #8d5111 !important; }
  .hero::before, .hero::after { display: none; }
  .hero .progress { background: #f0e6d8 !important; }
  .hero .progress > i, .progress > i, .bar { background: #c9761a !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .cols, .hero-grid { grid-template-columns: 1fr 1fr; }
  .kpis { grid-template-columns: repeat(4, 1fr) !important; }
  .kpis.k4 { grid-template-columns: 1fr 1fr !important; }
}
