:root {
  --red: #e2312f;
  --red-dark: #aa1e22;
  --yellow: #f4c431;
  --graphite: #252525;
  --black: #111111;
  --muted: #6f7882;
  --line: #d9dde2;
  --bg: #f2f3f5;
  --white: #ffffff;
  --green: #1f9d55;
  --blue: #2563eb;
  --shadow: 0 18px 42px rgba(17,17,17,.12);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, Arial, Helvetica, sans-serif; color: var(--graphite); background: var(--bg); }
.login-page { min-height: 100vh; background: linear-gradient(135deg, var(--black), #333); }
.login-shell { min-height: 100vh; width: min(100% - 32px, 430px); margin: 0 auto; display: grid; place-items: center; }
.login-card { width: 100%; background: white; border-radius: 18px; padding: 30px; box-shadow: var(--shadow); border-top: 7px solid var(--red); }
.login-card img { width: 180px; margin-bottom: 24px; }
.login-card h1 { color: var(--black); font-size: 34px; margin: 0 0 8px; }
.login-subtitle { color: var(--muted); margin: 0 0 20px; }
.login-card label { display: grid; gap: 6px; color: var(--graphite); font-weight: 900; margin-bottom: 14px; }
.login-card .btn { width: 100%; cursor: pointer; }
.login-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; padding: 10px 12px; border-radius: 10px; font-weight: 800; margin-bottom: 14px; }
.back-link { display: block; text-align: center; color: var(--muted); font-weight: 800; margin-top: 16px; }
a { color: inherit; text-decoration: none; }
.app-header { height: 76px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; background: white; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand img { width: 150px; }
.brand strong { display: block; font-size: 16px; }
.brand span { display: block; color: var(--muted); font-size: 13px; }
.header-actions { display: flex; gap: 8px; align-items: center; font-weight: 800; font-size: 13px; flex-wrap: wrap; justify-content: flex-end; }
.header-actions a { min-width: 132px; min-height: 40px; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line); background: white; display: inline-flex; align-items: center; justify-content: center; text-align: center; line-height: 1.1; }
.header-actions .primary { background: var(--red); color: white; border-color: var(--red); }
.header-actions a.is-active,
.app-menu-panel a.is-active { background: var(--red); color: white; border-color: var(--red); }
.header-actions a.is-active:hover,
.app-menu-panel a.is-active:hover { background: var(--red-dark); color: white; border-color: var(--red-dark); transform: none; }
main { width: min(1380px, calc(100% - 32px)); margin: 24px auto 48px; }
.hero-panel { display: flex; justify-content: space-between; gap: 24px; align-items: stretch; padding: 28px; border-radius: 18px; background: linear-gradient(135deg, var(--black), #333); color: white; box-shadow: var(--shadow); border-top: 6px solid var(--red); }
.eyebrow { margin: 0 0 8px; color: var(--yellow); text-transform: uppercase; letter-spacing: .12em; font-weight: 1000; font-size: 12px; }
h1 { margin: 0 0 8px; font-size: clamp(30px, 5vw, 52px); letter-spacing: -.04em; line-height: 1; }
.hero-panel p { margin: 0; color: #d9dde2; }
.source-box { min-width: 320px; padding: 18px; border-radius: 14px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); display: grid; align-content: center; }
.source-box strong { color: var(--yellow); }
.source-box span { font-size: 13px; word-break: break-all; color: #edf0f2; }
.metrics { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin: 18px 0; }
.metric { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: 0 8px 20px rgba(17,17,17,.05); }
.metric strong { display: block; font-size: 28px; line-height: 1; color: var(--black); }
.metric span { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; font-weight: 900; margin-top: 8px; }
.toolbar { display: grid; grid-template-columns: 1fr 220px; gap: 12px; margin-bottom: 18px; }
input, select { height: 46px; border-radius: 10px; border: 1px solid var(--line); background: white; padding: 0 14px; font: inherit; font-weight: 700; }
.map-panel { background: white; border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin: 14px 0; box-shadow: 0 8px 24px rgba(17,17,17,.06); }
.map-info { display: flex; justify-content: space-between; gap: 14px; align-items: center; margin-bottom: 10px; }
.map-info h2 { margin: 0 0 4px; font-size: 20px; color: var(--black); }
.map-info p:not(.eyebrow), .map-status { margin: 0; color: var(--muted); font-weight: 700; font-size: 13px; }
.map-info .eyebrow { margin-bottom: 4px; }
.map-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.map-actions button { height: 34px; border: 1px solid var(--line); background: var(--black); color: white; border-radius: 8px; padding: 0 10px; font-weight: 900; cursor: pointer; font-size: 12px; }
.map-actions button:hover { background: var(--red); border-color: var(--red); }
.service-map { width: 100%; height: 360px; min-height: 360px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #e5e7eb; }
.map-panel:not(.has-points) .service-map { display: none; }
.map-panel:not(.has-points) .map-actions { display: none; }
.map-panel:not(.has-points) { padding: 12px 14px; }
.map-status { margin-top: 8px; font-size: 12px; }
.map-panel:not(.has-points) .map-status { margin-top: 0; padding: 8px 10px; border-radius: 10px; background: #f2f3f5; }
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.column { background: #e8ebef; border: 1px solid var(--line); border-radius: 18px; min-height: 420px; overflow: hidden; }
.column > header { display: flex; align-items: center; justify-content: space-between; padding: 16px; background: white; border-bottom: 1px solid var(--line); }
.column h2 { margin: 0; font-size: 18px; }
.column header span { background: var(--black); color: white; border-radius: 999px; min-width: 30px; height: 30px; display: grid; place-items: center; font-weight: 1000; }
.column[data-col="pendente"] header { border-top: 5px solid var(--yellow); }
.column[data-col="execucao"] header { border-top: 5px solid var(--blue); }
.column[data-col="concluido"] header { border-top: 5px solid var(--green); }
.column-note { display: none; margin: 12px 12px 0; padding: 10px; border-radius: 10px; background: #f8fafc; color: var(--muted); font-size: 12px; font-weight: 800; }
.column-note.is-visible { display: block; }
.cards { padding: 12px; display: grid; gap: 12px; }
.card { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: 0 8px 24px rgba(17,17,17,.08); }

/* Lembretes */
.card.card-lembrete {
  border-left: 4px solid #7c3aed;
  background: linear-gradient(135deg, rgba(124,58,237,.06), rgba(124,58,237,.02));
}
.card.card-lembrete .ticket::before {
  content: '📌 ';
}
.card.card-lembrete h3::after {
  content: ' [Lembrete]';
  font-size: 11px;
  font-weight: 700;
  color: #7c3aed;
  vertical-align: middle;
}
.card-lembrete-field { font-size: 13px; color: var(--muted, #6f7882); margin: 3px 0; }
.card-lembrete-field strong { color: var(--graphite, #3f454b); font-weight: 700; }

.show-more { display: none; width: calc(100% - 24px); margin: 0 12px 12px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: white; color: var(--red); font-weight: 1000; cursor: pointer; }
.show-more.is-visible { display: block; }
.show-more:hover { border-color: var(--red); background: #fff5f5; }
.analytics-panel, .history-panel, .contracts-panel { background: white; border: 1px solid var(--line); border-radius: 18px; padding: 18px; margin: 18px 0; box-shadow: 0 8px 24px rgba(17,17,17,.06); }
.section-title-row { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin-bottom: 14px; }
.section-title-row h2 { margin: 0; font-size: 24px; color: var(--black); }
.section-title-row > span { color: var(--muted); font-size: 13px; font-weight: 900; }
.analytics-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.analytics-filters button { border: 1px solid var(--line); background: white; color: var(--graphite); height: 34px; padding: 0 12px; border-radius: 999px; font-weight: 1000; cursor: pointer; }
.analytics-filters button.is-active { background: var(--red); border-color: var(--red); color: white; }
.kpi-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 14px; }
.kpi-card { border: 1px solid var(--line); border-radius: 14px; background: #fbfcfd; padding: 14px; }
.kpi-card strong { display: block; font-size: 25px; line-height: 1; color: var(--black); }
.kpi-card span { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; text-transform: uppercase; font-weight: 1000; }
.analytics-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.contracts-metrics { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 14px; }
.contract-metric { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: #fbfcfd; }
.contract-metric strong { display: block; font-size: 24px; color: var(--black); line-height: 1; }
.contract-metric span { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; font-weight: 1000; text-transform: uppercase; }
.filter-metric-button, .fleet-metric-button { text-align: left; cursor: pointer; font: inherit; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease, background .15s ease; }
.filter-metric-button:hover, .fleet-metric-button:hover { transform: translateY(-1px); border-color: var(--red); box-shadow: 0 10px 24px rgba(17,17,17,.08); }
.filter-metric-button.is-active, .fleet-metric-button.is-active { background: linear-gradient(135deg, var(--red), var(--red-dark)); border-color: var(--red-dark); box-shadow: inset 0 0 0 2px rgba(255,255,255,.16), 0 14px 30px rgba(226,49,47,.24); transform: translateY(-1px); }
.filter-metric-button.is-active strong, .filter-metric-button.is-active span, .fleet-metric-button.is-active strong, .fleet-metric-button.is-active span { color: white; }
.filter-metric-button.is-active::after, .fleet-metric-button.is-active::after { content: 'Filtro ativo'; display: inline-flex; margin-top: 8px; min-height: 20px; align-items: center; padding: 0 7px; border-radius: 999px; background: rgba(255,255,255,.18); color: white; font-size: 10px; font-weight: 1000; text-transform: uppercase; }
.fleet-toolbar { grid-template-columns: minmax(220px, 1.4fr) 180px minmax(220px, 1fr) 190px 230px 130px; align-items: center; }
.contracts-toolbar { grid-template-columns: minmax(220px, 1.4fr) minmax(200px, 1fr) 180px 210px 130px; align-items: center; }
.contracts-toolbar > *, .toolbar > * { min-width: 0; }
.fleet-toolbar > * { width: 100%; min-width: 0; }
.fleet-toolbar button, .contracts-toolbar button, .toolbar button { height: 46px; border-radius: 10px; border: 1px solid var(--line); background: var(--black); color: white; padding: 0 14px; font: inherit; font-weight: 1000; cursor: pointer; }
.fleet-toolbar button:hover, .contracts-toolbar button:hover, .toolbar button:hover { background: var(--red); border-color: var(--red); }
.toolbar button.is-active { background: #7c3aed; border-color: #7c3aed; color: white; }
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -6px 0 18px; min-height: 34px; }
.filter-summary { color: var(--muted); font-size: 13px; font-weight: 900; }
.filter-chip { display: inline-flex; align-items: center; min-height: 30px; padding: 0 10px; border-radius: 999px; background: #fff5f5; border: 1px solid #fecaca; color: var(--red); font-size: 12px; font-weight: 1000; }
.active-filters button { min-height: 30px; border-radius: 999px; border: 1px solid var(--line); background: white; color: var(--graphite); padding: 0 10px; font-weight: 1000; cursor: pointer; }
.active-filters button:hover { border-color: var(--red); color: var(--red); }
.contracts-grid, .contracts-dashboard { display: grid; grid-template-columns: 1.3fr .9fr; gap: 14px; }
.contracts-dashboard.single-column { grid-template-columns: 1fr; }
.contracts-metrics.standalone { margin: 18px 0; }
.contracts-list { border: 1px solid var(--line); border-radius: 14px; background: #fbfcfd; padding: 14px; }
.contracts-list.highlight { background: white; box-shadow: 0 8px 24px rgba(17,17,17,.06); }
.section-title-row.compact { margin-bottom: 10px; }
.contracts-list h3 { margin: 0 0 12px; color: var(--black); font-size: 17px; }
.preventiva-card, .contract-row { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; box-shadow: 0 6px 16px rgba(17,17,17,.05); }
.preventiva-card header, .contract-row header { display: flex; justify-content: space-between; gap: 10px; align-items: start; margin-bottom: 8px; }
.preventiva-card strong, .contract-row strong { color: var(--black); }
.preventiva-card p, .contract-row p { margin: 5px 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.urgency.ativo, .urgency.vigente, .urgency.ok, .urgency.concluida { background: var(--green); color: white; }
.urgency.em-analise, .urgency.em-an-lise, .urgency.hoje, .urgency.dias-7, .urgency.dias-15, .urgency.dias-30, .urgency.vence-em-90-dias { background: var(--yellow); color: var(--black); }
.urgency.vence-em-30-dias { background: #f97316; color: white; }
.urgency.vencida, .urgency.vencido { background: var(--red); color: white; }
.card-more { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.card-more summary { list-style: none; display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff5f5; color: var(--red); cursor: pointer; font-size: 12px; font-weight: 1000; }
.card-more summary::-webkit-details-marker { display: none; }
.card-more summary::after { content: '+'; margin-left: 8px; font-size: 15px; line-height: 1; }
.card-more[open] summary::after { content: '–'; }
.card-more[open] summary { margin-bottom: 6px; background: var(--red); border-color: var(--red); color: white; }
.card-more[open] summary { font-size: 0; }
.card-more[open] summary::before { content: 'Ver menos'; font-size: 12px; }
.contract-master-card { margin-bottom: 14px; }
.badge-renew { display: inline-block; border-radius: 999px; padding: 4px 8px; font-weight: 1000; font-size: 10px; text-transform: uppercase; background: #059669; color: #fff; margin-right: 4px; }
.badge-renew-link { display: inline-block; border-radius: 999px; padding: 4px 8px; font-weight: 1000; font-size: 10px; text-transform: uppercase; background: #7c3aed; color: #fff; margin-right: 4px; }
.contract-scope { margin: 4px 0 12px; padding: 10px; border-radius: 10px; background: #fbfcfd; border: 1px solid var(--line); }
.contract-scope strong, .preventiva-timeline > strong { display: block; color: var(--black); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 6px; }
.contract-scope p { margin: 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.preventiva-timeline { margin: 0 0 10px; }
.timeline-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 8px; }
.timeline-item { border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: white; display: grid; gap: 4px; }
.timeline-date-row { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.timeline-date-row small { color: var(--muted); font-weight: 900; font-size: 11px; white-space: nowrap; }
.timeline-date { font-weight: 1000; color: var(--black); font-size: 13px; }
.timeline-status { width: fit-content; border-radius: 999px; padding: 3px 7px; font-size: 10px; font-weight: 1000; text-transform: uppercase; background: #edf0f2; color: var(--graphite); }
.timeline-status.vencida { background: var(--red); color: white; }
.timeline-status.ok, .timeline-status.concluida { background: var(--green); color: white; }
.timeline-item small { color: var(--muted); font-weight: 800; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty.mini { padding: 10px; text-align: left; }
.contract-link { display: inline-block; margin-top: 4px; color: var(--red); font-weight: 1000; text-decoration: underline; }
.recommendation { margin: 8px 0; padding: 9px 10px; border-radius: 10px; background: white; border: 1px solid var(--line); color: var(--muted); font-weight: 800; font-size: 13px; }
.recommendation strong { color: var(--black); }
.renewal-destaque-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.renewal-destaque-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; box-shadow: 0 6px 16px rgba(17,17,17,.05); }
.renewal-destaque-card strong { display: block; color: var(--black); font-size: 15px; margin-bottom: 4px; }
.renewal-destaque-card span { display: block; color: var(--muted); font-weight: 800; font-size: 12px; }
.renewal-destaque-card small { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; font-weight: 700; }
.renewal-destaque-card.destaque-vencido { border-left: 4px solid var(--red); background: #fff5f5; }
.renewal-destaque-card.destaque-urgente { border-left: 4px solid #f97316; background: #fff7ed; }
.renewal-destaque-card.destaque-atencao { border-left: 4px solid var(--yellow); background: #fffbeb; }
.status-pill { border-radius: 999px; padding: 4px 8px; font-size: 11px; font-weight: 1000; text-transform: uppercase; background: #edf0f2; color: var(--graphite); white-space: nowrap; }
.status-pill.vencida { background: var(--red); color: white; }
.status-pill.hoje, .status-pill.dias-7, .status-pill.dias-15, .status-pill.dias-30 { background: var(--yellow); color: var(--black); }
.status-pill.ok, .status-pill.em-dia { background: var(--green); color: white; }
.status-pill.proxima, .status-pill.pr-xima, .status-pill.media, .status-pill.m-dia, .status-pill.cadastro { background: var(--yellow); color: var(--black); }
.status-pill.alta, .status-pill.sem-horimetro, .status-pill.sem-hor-metro, .status-pill.sem-proxima-preventiva, .status-pill.sem-pr-xima-preventiva { background: var(--red); color: white; }
.status-pill[class*="sem-hor"], .status-pill[class*="sem-proxima"], .status-pill[class*="sem-pr-xima"] { background: var(--red); color: white; }
.status-pill.baixa, .status-pill.nao-se-aplica, .status-pill.n-o-se-aplica { background: #edf0f2; color: var(--graphite); }
.fleet-tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin: -2px 0 10px; }
.chart-card { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: #fbfcfd; }
.chart-card h3 { margin: 0 0 12px; font-size: 16px; color: var(--black); }
.stat-row { display: grid; grid-template-columns: 105px 1fr 34px; gap: 10px; align-items: center; margin: 10px 0; font-size: 13px; font-weight: 900; }
.stat-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--graphite); }
.stat-bar { height: 9px; border-radius: 999px; background: #e5e7eb; overflow: hidden; }
.stat-bar span { display: block; height: 100%; background: var(--red); border-radius: inherit; }
.stat-value { text-align: right; color: var(--muted); }
.history-table-wrap { max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: 14px; }
.history-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.history-table th { position: sticky; top: 0; z-index: 1; background: var(--black); color: white; text-align: left; padding: 11px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.history-table td { padding: 11px; border-top: 1px solid var(--line); vertical-align: top; }
.history-table tr:nth-child(even) td { background: #fafafa; }
.history-table td:first-child { font-weight: 1000; color: var(--red); }
.card-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 10px; }
.ticket { background: var(--graphite); color: white; border-radius: 6px; padding: 4px 8px; font-weight: 1000; font-size: 12px; }
.urgency { border-radius: 999px; padding: 4px 8px; font-weight: 1000; font-size: 11px; text-transform: uppercase; background: #edf0f2; color: var(--graphite); }
.tag { border-radius: 999px; padding: 4px 8px; font-weight: 900; font-size: 11px; background: #dbeafe; color: #1d4ed8; }
.urgency.alta, .urgency.crítica, .urgency.critica { background: var(--red); color: white; }
.urgency.média, .urgency.media { background: var(--yellow); color: var(--black); }
.card h3 { margin: 0 0 8px; font-size: 18px; line-height: 1.1; color: var(--black); }
.problem { color: var(--muted); margin: 0 0 14px; font-size: 14px; }
dl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 12px; }
dt { font-size: 11px; color: var(--muted); text-transform: uppercase; font-weight: 1000; }
dd { margin: 2px 0 0; font-weight: 800; font-size: 13px; }
details { border-top: 1px solid var(--line); padding-top: 10px; }
summary { cursor: pointer; color: var(--red); font-weight: 900; font-size: 13px; }
details p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
details strong { color: var(--graphite); }
.rat-number-link { color: var(--red); font-weight: 1000; text-decoration: underline; text-underline-offset: 2px; }
.rat-separator { color: var(--line); margin: 0 2px; }
.empty { color: var(--muted); text-align: center; padding: 30px 10px; font-weight: 800; }
@media (max-width: 1180px) { .fleet-toolbar { grid-template-columns: 1fr 1fr 1fr; } }
@media (max-width: 1050px) { .metrics, .kanban, .analytics-grid, .kpi-grid, .contracts-metrics, .contracts-grid, .contracts-dashboard { grid-template-columns: 1fr 1fr; } .column[data-col="concluido"] { grid-column: 1 / -1; } }
@media (max-width: 760px) { .app-header { height: auto; padding: 14px; display: grid; gap: 12px; } .hero-panel, .toolbar, .metrics, .kanban, .analytics-grid, .kpi-grid, .contracts-metrics, .contracts-grid, .contracts-dashboard { grid-template-columns: minmax(0, 1fr); display: grid; } input, select, button { max-width: 100%; min-width: 0; } .fleet-toolbar { gap: 8px; } .fleet-toolbar button { width: 100%; } .active-filters { margin-top: -4px; } .filter-chip, .filter-summary { max-width: 100%; overflow-wrap: anywhere; } .map-info, .section-title-row { display: grid; align-items: start; } .service-map { height: 300px; min-height: 300px; } .source-box { min-width: 0; } .column[data-col="concluido"] { grid-column: auto; } }

/* Painel O.S. Oficina - Gestão Click */
.integration-alert { margin: 0 0 16px; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; font-weight: 900; background: #fbfcfd; color: var(--graphite); }
.integration-alert.warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.integration-alert.error { background: #fff5f5; border-color: #fecaca; color: var(--red); }
.integration-alert.ok { background: #ecfdf5; border-color: #bbf7d0; color: #047857; }
.os-toolbar { grid-template-columns: 1.2fr .7fr .7fr .9fr auto auto; }
.toolbar .secondary, .settings-modal .secondary { background: #fff; color: var(--graphite); border: 1px solid var(--line); }
.os-column-config { display: grid; grid-template-columns: minmax(180px, .7fr) minmax(0, 2fr) auto; gap: 12px; align-items: center; margin: 0 0 16px; border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 12px; box-shadow: var(--shadow-soft); }
.os-column-config strong { display: block; color: var(--black); font-size: 13px; }
.os-column-config span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; }
.os-column-config button { min-height: 36px; padding: 8px 12px; }
.os-column-toggles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 360px; overflow: auto; padding-right: 4px; }
.os-column-toggle { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 9px 10px; font-size: 12px; font-weight: 900; color: var(--graphite); cursor: pointer; box-shadow: 0 4px 10px rgba(17,17,17,.04); }
.os-column-toggle:hover { border-color: var(--red); background: #fffafa; }
.os-column-toggle input { width: 16px; height: 16px; min-width: 16px; accent-color: var(--red); }
.os-column-toggle span { overflow: hidden; text-overflow: ellipsis; }
.os-kanban { grid-template-columns: repeat(var(--os-column-count, auto-fit), minmax(clamp(150px, calc((100vw - 96px) / var(--os-column-count, 4)), 260px), 1fr)); align-items: start; gap: 10px; }
.os-column { min-width: 0; border-radius: 14px; padding: 10px; }
.os-column.is-config-only { background: #f8fafc; border-style: dashed; opacity: .86; }
.os-column header { margin-bottom: 8px; }
.os-column header h2 { font-size: clamp(12px, 1vw, 15px); line-height: 1.05; }
.os-column header span { padding: 4px 7px; font-size: 11px; }
.os-card { cursor: grab; }
.os-card:active { cursor: grabbing; }
.os-card.is-dragging { opacity: .55; transform: rotate(1deg); }
.os-card .situation { background: #edf0f2; color: var(--graphite); }
.os-card { padding: 10px; border-radius: 12px; }
.os-card .card-top { margin-bottom: 7px; gap: 5px; }
.os-card .ticket, .os-card .situation { font-size: 10px; padding: 3px 6px; }
.os-card h3 { font-size: clamp(12px, 1.05vw, 15px); margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.os-card .problem { font-size: 11px; line-height: 1.25; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.os-card dl { gap: 6px; margin-bottom: 8px; }
.os-card dt { font-size: 9px; }
.os-card dd { font-size: 11px; }
.os-card details { padding-top: 7px; }
.os-card summary { font-size: 11px; }
.os-card details p { font-size: 11px; line-height: 1.3; }
.os-kanban.is-many-columns .os-card dl { grid-template-columns: 1fr; }
.os-kanban.is-many-columns .os-card .situation { display: none; }
.os-hide-values .os-card .amount-row { display: none; }
.modal-open { overflow: hidden; }
.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(15, 23, 42, .55); backdrop-filter: blur(3px); }
.modal-backdrop[hidden] { display: none; }
.settings-modal { width: min(980px, 100%); max-height: min(820px, calc(100vh - 40px)); overflow: auto; background: #fff; border-radius: 24px; box-shadow: 0 24px 80px rgba(15,23,42,.28); border: 1px solid rgba(255,255,255,.35); }
.settings-modal > header { display: flex; align-items: start; justify-content: space-between; gap: 16px; padding: 22px 24px 16px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, #111, #333); border-radius: 24px 24px 0 0; }
.settings-modal h2 { margin: 0; color: var(--black); font-size: 22px; }
.settings-modal > header h2 { color: #fff; }
/* === Form grid & fields (edit modals) === */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 20px 24px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.form-group.full-width {
  grid-column: 1 / -1;
}
.form-group label {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--graphite);
  transition: border-color .18s ease, box-shadow .18s ease;
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(226,49,47,.12);
}
.form-group textarea {
  min-height: 90px;
  resize: vertical;
}
.modal-field {
  font-weight: 700;
  color: var(--graphite);
  padding: 9px 12px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid var(--line);
  min-height: 42px;
  display: flex;
  align-items: center;
  font-size: 14px;
  word-break: break-word;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
  border-radius: 0 0 24px 24px;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 9px 18px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--graphite);
  font: inherit;
  font-weight: 900;
  font-size: 13px;
  cursor: pointer;
  transition: all .18s ease;
  text-decoration: none;
}
.btn:hover {
  border-color: var(--red);
  color: var(--red);
  background: #fffafa;
  transform: translateY(-1px);
}
.btn-primary {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.btn-primary:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
  color: #fff;
  transform: translateY(-1px);
}
.btn-small {
  min-height: 32px;
  padding: 5px 12px;
  font-size: 11px;
  border-radius: 8px;
}
.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.ghost:hover {
  background: #f2f3f5;
  border-color: var(--line);
  color: var(--graphite);
  transform: none;
}
.ghost.dark {
  color: var(--graphite);
}
.ghost.dark:hover {
  background: #e8ebef;
}

/* === Modal animations === */
.modal-backdrop {
  animation: modal-fade-in .22s ease;
}
.modal-backdrop:not([hidden]) .settings-modal {
  animation: modal-slide-up .28s cubic-bezier(.2,.8,.2,1);
}
@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modal-slide-up {
  from { opacity: 0; transform: translateY(32px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Icon button for close */
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.1);
  color: #fff;
  font-size: 22px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
  flex-shrink: 0;
}
.icon-btn:hover {
  background: rgba(255,255,255,.2);
  border-color: rgba(255,255,255,.4);
}

.settings-modal h3 { margin: 0 0 6px; color: var(--black); font-size: 16px; }
.settings-modal p { margin: 0 0 12px; color: var(--muted); font-weight: 700; font-size: 13px; }
.icon-btn { width: 38px; height: 38px; border-radius: 999px; padding: 0; display: inline-grid; place-items: center; font-size: 24px; background: #f8fafc; color: var(--graphite); border: 1px solid var(--line); }
.settings-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 16px; padding: 20px 24px; }
.settings-block { border: 1px solid var(--line); border-radius: 18px; padding: 16px; background: #fbfcfd; box-shadow: 0 8px 20px rgba(17,17,17,.05); }
.settings-check { display: flex; align-items: center; gap: 8px; margin: 10px 0; font-weight: 900; color: var(--graphite); }
.settings-check input { width: 16px; height: 16px; min-width: 16px; }
.settings-block label:not(.settings-check) { display: grid; gap: 6px; margin-top: 12px; font-weight: 900; color: var(--graphite); }
.settings-modal footer { display: flex; justify-content: flex-end; padding: 14px 24px 22px; border-top: 1px solid var(--line); background: #fbfcfd; border-radius: 0 0 24px 24px; }
@media (max-width: 900px) { .os-toolbar { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) { .os-column-config, .settings-grid, .os-column-toggles { grid-template-columns: 1fr; } }
@media (max-width: 620px) { .os-toolbar { grid-template-columns: 1fr; } .os-kanban { grid-template-columns: 1fr; } }

/* Refinamento visual geral - 2026-05-13 */
:root {
  --bg: #f6f7f9;
  --soft-shadow: 0 6px 18px rgba(17,17,17,.055);
  --soft-shadow-hover: 0 10px 24px rgba(17,17,17,.08);
}
body { font-size: 14px; line-height: 1.42; }
.app-header { height: 68px; padding: 0 22px; box-shadow: 0 2px 10px rgba(17,17,17,.035); }
.brand { gap: 12px; min-width: 250px; }
.brand img { width: 132px; }
.brand strong { font-size: 14px; letter-spacing: -.01em; }
.brand span { font-size: 11px; }
.header-actions { gap: 7px; font-size: 12px; }
.header-actions a { min-width: 118px; min-height: 34px; padding: 7px 10px; border-radius: 999px; background: #fbfcfd; transition: border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease; }
.header-actions a:hover { border-color: var(--red); color: var(--red); background: #fffafa; transform: translateY(-1px); }
main { width: min(1440px, calc(100% - 28px)); margin: 18px auto 40px; }
.hero-panel { padding: 20px 22px; border-radius: 16px; border-top-width: 4px; box-shadow: 0 12px 30px rgba(17,17,17,.09); }
.eyebrow { font-size: 10px; letter-spacing: .11em; margin-bottom: 6px; }
h1 { font-size: clamp(24px, 3vw, 38px); letter-spacing: -.035em; line-height: 1.03; margin-bottom: 6px; }
.hero-panel p { font-size: 13px; line-height: 1.38; max-width: 760px; }
.source-box { min-width: 260px; padding: 14px; border-radius: 12px; }
.source-box strong { font-size: 12px; }
.source-box span { font-size: 11px; }
.metrics, .contracts-metrics { gap: 9px; margin: 14px 0; }
.metric, .contract-metric, .kpi-card { border-radius: 12px; padding: 12px; box-shadow: var(--soft-shadow); }
.metric strong { font-size: 22px; }
.contract-metric strong, .kpi-card strong { font-size: 21px; }
.metric span, .contract-metric span, .kpi-card span { font-size: 10px; margin-top: 6px; line-height: 1.2; }
.toolbar { gap: 9px; margin-bottom: 14px; }
input, select, .fleet-toolbar button, .contracts-toolbar button, .toolbar button { height: 38px; border-radius: 9px; padding: 0 11px; font-size: 12px; font-weight: 800; }
.toolbar button { letter-spacing: .01em; }
.map-panel, .analytics-panel, .history-panel, .contracts-panel { border-radius: 14px; padding: 13px; margin: 12px 0; box-shadow: var(--soft-shadow); }
.map-info h2, .section-title-row h2 { font-size: 18px; }
.map-info p:not(.eyebrow), .map-status, .section-title-row > span { font-size: 12px; }
.map-actions button, .analytics-filters button { height: 30px; font-size: 11px; }
.service-map { height: 320px; min-height: 320px; }
.kanban { gap: 12px; }
.column { border-radius: 15px; min-height: 360px; background: #eef1f4; }
.column > header { padding: 12px; }
.column h2 { font-size: 15px; line-height: 1.15; }
.column header span { min-width: 24px; height: 24px; font-size: 12px; }
.cards { padding: 10px; gap: 9px; }
.card, .preventiva-card, .contract-row, .chart-card, .contracts-list { border-radius: 12px; box-shadow: var(--soft-shadow); }
.card { padding: 12px; }
.card:hover, .preventiva-card:hover, .contract-row:hover { box-shadow: var(--soft-shadow-hover); }
.card-top { margin-bottom: 8px; }
.ticket { font-size: 10px; padding: 3px 7px; border-radius: 999px; }
.urgency, .status-pill, .timeline-status { font-size: 9px; padding: 3px 7px; letter-spacing: .02em; }
.card h3 { font-size: 15px; line-height: 1.18; margin-bottom: 6px; }
.problem { font-size: 12px; line-height: 1.35; margin-bottom: 10px; }
dl { gap: 7px; margin-bottom: 9px; }
dt { font-size: 9px; letter-spacing: .035em; }
dd { font-size: 11px; font-weight: 800; }
details { padding-top: 8px; }
summary { font-size: 11px; }
details p, .preventiva-card p, .contract-row p, .contract-scope p, .recommendation { font-size: 11px; line-height: 1.35; }
.empty { padding: 20px 8px; font-size: 12px; }
.show-more { height: 34px; font-size: 12px; }
.analytics-panel, .history-panel { padding: 14px; }
.section-title-row { margin-bottom: 10px; }
.analytics-grid { gap: 10px; }
.chart-card { padding: 12px; }
.chart-card h3, .contracts-list h3 { font-size: 14px; margin-bottom: 9px; }
.stat-row { grid-template-columns: 95px 1fr 28px; gap: 8px; margin: 8px 0; font-size: 11px; }
.stat-bar { height: 7px; }
.history-table { font-size: 12px; }
.history-table th { padding: 9px; font-size: 10px; }
.history-table td { padding: 9px; }
.os-toolbar { grid-template-columns: 1.15fr .62fr .62fr .86fr auto auto; }
.os-kanban { gap: 8px; }
.os-column { padding: 8px; border-radius: 13px; }
.os-column header h2 { font-size: clamp(11px, .85vw, 13px); }
.os-card { padding: 9px; }
.os-card h3 { font-size: clamp(11px, .9vw, 13px); }
.os-card .problem, .os-card dd, .os-card details p { font-size: 10px; }
.settings-modal h2 { font-size: 19px; }
.settings-modal h3 { font-size: 14px; }
.settings-modal p { font-size: 12px; }
.settings-block { padding: 13px; }
.os-column-toggle { font-size: 11px; padding: 8px 9px; }
@media (max-width: 1050px) { .app-header { height: auto; padding: 12px 16px; display: grid; gap: 10px; } .header-actions { justify-content: start; } .brand img { width: 120px; } }
@media (max-width: 760px) { main { width: min(100% - 20px, 720px); margin-top: 12px; } .hero-panel { padding: 16px; } .service-map { height: 280px; min-height: 280px; } .header-actions a { min-width: 0; flex: 1 1 130px; } }

/* Modos globais de visualização - 2026-05-13 */
.ui-view-controls { display: inline-flex; align-items: center; gap: 6px; padding-left: 4px; }
.ui-view-btn { min-width: 78px; min-height: 34px; border-radius: 999px; border: 1px solid var(--line); background: #f8fafc; color: var(--graphite); font: inherit; font-size: 11px; font-weight: 900; cursor: pointer; padding: 6px 10px; transition: border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease; }
.ui-view-btn:hover { border-color: var(--red); color: var(--red); background: #fffafa; transform: translateY(-1px); }


/* Filtros rápidos/métricas sempre em uma linha */
.metrics,
.contracts-metrics,
.kpi-grid { display: flex !important; flex-wrap: nowrap !important; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; align-items: stretch; }
.metric,
.contract-metric,
.kpi-card { flex: 1 1 0; min-width: 0; }
.metric span,
.contract-metric span,
.kpi-card span { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* Tema escuro */
html.ui-theme-dark {
  --graphite: #d7dce2;
  --black: #f8fafc;
  --muted: #9aa5b1;
  --line: #27313d;
  --bg: #0d1117;
  --white: #151b23;
  --soft-shadow: 0 8px 22px rgba(0,0,0,.22);
  --soft-shadow-hover: 0 12px 28px rgba(0,0,0,.3);
}
html.ui-theme-dark body { background: var(--bg); color: var(--graphite); }
html.ui-theme-dark .app-header,
html.ui-theme-dark .metric,
html.ui-theme-dark .contract-metric,
html.ui-theme-dark .kpi-card,
html.ui-theme-dark .card,
html.ui-theme-dark .map-panel,
html.ui-theme-dark .analytics-panel,
html.ui-theme-dark .history-panel,
html.ui-theme-dark .contracts-panel,
html.ui-theme-dark .contracts-list,
html.ui-theme-dark .chart-card,
html.ui-theme-dark .preventiva-card,
html.ui-theme-dark .contract-row,
html.ui-theme-dark .settings-modal,
html.ui-theme-dark input,
html.ui-theme-dark select,
html.ui-theme-dark .header-actions a,
html.ui-theme-dark .ui-view-btn,
html.ui-theme-dark .show-more,
html.ui-theme-dark .active-filters button,
html.ui-theme-dark .analytics-filters button,
html.ui-theme-dark .os-column-toggle { background: #151b23; color: var(--graphite); border-color: var(--line); }
html.ui-theme-dark .hero-panel,

html.ui-theme-dark .form-group input,
html.ui-theme-dark .form-group select,
html.ui-theme-dark .form-group textarea {
  background: #151b23;
  border-color: #2d343f;
  color: #e5e7eb;
}
html.ui-theme-dark .form-group input:focus,
html.ui-theme-dark .form-group select:focus,
html.ui-theme-dark .form-group textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(226,49,47,.18);
}
html.ui-theme-dark .modal-field {
  background: #101720;
  border-color: #2d343f;
  color: #e5e7eb;
}
html.ui-theme-dark .form-actions,
html.ui-theme-dark .settings-modal footer {
  background: #101720;
  border-color: var(--line);
}
html.ui-theme-dark .btn {
  background: #151b23;
  border-color: #2d343f;
  color: #e5e7eb;
}
html.ui-theme-dark .btn:hover {
  background: #1b2430;
  border-color: var(--red);
  color: var(--red);
}
html.ui-theme-dark .btn-primary {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
html.ui-theme-dark .btn-primary:hover {
  background: var(--red-dark);
  color: #fff;
}
html.ui-theme-dark .ghost {
  background: transparent;
  border-color: transparent;
  color: #8b95a1;
}
html.ui-theme-dark .ghost:hover {
  background: #1b2430;
  color: #e5e7eb;
}
html.ui-theme-dark .settings-modal > header { background: linear-gradient(135deg, #090c10, #1b2430); }
html.ui-theme-dark .column { background: #101720; border-color: var(--line); }
html.ui-theme-dark .column > header { background: #151b23; border-color: var(--line); }
html.ui-theme-dark .column header span { background: #e2312f; color: #fff; }
html.ui-theme-dark .source-box { background: rgba(255,255,255,.055); border-color: rgba(255,255,255,.12); }
html.ui-theme-dark .source-box span,
html.ui-theme-dark .hero-panel p { color: #b8c1cc; }
html.ui-theme-dark .map-panel:not(.has-points) .map-status,
html.ui-theme-dark .column-note,
html.ui-theme-dark .settings-block,
html.ui-theme-dark .settings-modal footer { background: #101720; border-color: var(--line); }
html.ui-theme-dark .filter-chip { background: rgba(226,49,47,.12); border-color: rgba(226,49,47,.35); }
html.ui-theme-dark .service-map { border-color: var(--line); filter: saturate(.9) brightness(.9); }
html.ui-theme-dark .history-table th { background: #101720; }
html.ui-theme-dark .history-table td,
html.ui-theme-dark .history-table th { border-color: var(--line); }
html.ui-theme-dark .stat-bar { background: #253040; }
html.ui-theme-dark .os-card .situation { background: #253040; color: #d7dce2; }
html.ui-theme-dark .ui-view-btn:hover,
html.ui-theme-dark .header-actions a:hover { background: rgba(226,49,47,.12); }

/* Dark mode: lembretes */
html.ui-theme-dark .card.card-lembrete {
  background: linear-gradient(135deg, rgba(124,58,237,.10), rgba(124,58,237,.04)), #151b23;
  border-left-color: #8b5cf6;
}
html.ui-theme-dark .card.card-lembrete h3::after {
  color: #a78bfa;
}

/* Ajustes UI login/header/mapa - 2026-05-13 */
.app-header { z-index: 1200; }
.leaflet-container { z-index: 0; }
.leaflet-pane { z-index: 1; }
.leaflet-top, .leaflet-bottom { z-index: 2; }
.map-panel { position: relative; z-index: 1; }
.header-actions .ui-view-controls { display: none !important; }
.ui-login-view-controls { display: grid; gap: 8px; margin: 0 0 14px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfd; }
.ui-login-view-controls > span { color: var(--muted); font-size: 11px; font-weight: 1000; text-transform: uppercase; letter-spacing: .08em; }
.ui-login-view-controls .ui-view-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0; }
.ui-login-view-controls .ui-view-btn { width: 100%; min-height: 38px; min-width: 0; }
html.ui-theme-dark .login-card,
html.ui-theme-dark .ui-login-view-controls { background: #151b23; color: var(--graphite); border-color: var(--line); }
html.ui-theme-dark .login-page { background: linear-gradient(135deg, #070a0e, #17202b); }
html.ui-theme-dark .login-card h1 { color: #f8fafc; }

/* Indicadores estratégicos Oficina - 2026-05-13 */
.os-kpi { border-left: 3px solid var(--red); }
.os-kpi strong { font-size: clamp(14px, 1.4vw, 20px); white-space: nowrap; }
.os-insights { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; margin: 0 0 12px; }
.os-insight-card { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 11px; box-shadow: var(--soft-shadow); min-width: 0; }
.os-insight-card h3 { margin: 0 0 8px; font-size: 12px; color: var(--black); letter-spacing: -.01em; }
.os-insight-card ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.os-insight-card li { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; color: var(--muted); font-size: 10px; line-height: 1.25; border-bottom: 1px dashed rgba(111,120,130,.22); padding-bottom: 5px; }
.os-insight-card li:last-child { border-bottom: 0; padding-bottom: 0; }
.os-insight-card li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.os-insight-card li strong { color: var(--black); font-size: 11px; white-space: nowrap; }
html.ui-theme-dark .os-insight-card { background: #151b23; border-color: var(--line); }
@media (max-width: 1180px) { .os-insights { display: flex; overflow-x: auto; flex-wrap: nowrap; } .os-insight-card { flex: 0 0 220px; } }
@media (max-width: 760px) { .os-insight-card { flex-basis: 200px; } }

/* Oficina: KPI ativo e limpeza de filtros - 2026-05-13 */
.os-toolbar { grid-template-columns: 1.1fr .58fr .58fr .78fr auto auto auto; }
.os-kpi.is-active { background: linear-gradient(135deg, var(--red), var(--red-dark)); border-color: var(--red-dark); color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.16), 0 12px 24px rgba(226,49,47,.2); }
.os-kpi.is-active strong,
.os-kpi.is-active span { color: #fff; }
.os-kpi.is-active::after { content: 'Filtro ativo'; display: inline-flex; margin-top: 5px; min-height: 17px; align-items: center; padding: 0 6px; border-radius: 999px; background: rgba(255,255,255,.2); color: #fff; font-size: 9px; font-weight: 1000; text-transform: uppercase; }
@media (max-width: 900px) { .os-toolbar { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .os-toolbar { grid-template-columns: 1fr; } }

/* Padronização visual baseada na página Oficina - 2026-05-13 */
.intranet-standard-panel,
.analytics-panel,
.history-panel,
.contracts-panel,
.map-panel,
.contracts-list,
.chart-card,
.preventiva-card,
.contract-row,
.fleet-card,
.os-insight-card {
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--soft-shadow);
}
.metric,
.contract-metric,
.kpi-card,
.filter-metric-button,
.fleet-metric-button {
  border-left: 3px solid var(--red);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
}
.metric:hover,
.contract-metric:hover,
.kpi-card:hover,
.filter-metric-button:hover,
.fleet-metric-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--soft-shadow-hover);
  border-color: rgba(226,49,47,.55);
}
.filter-metric-button.is-active,
.fleet-metric-button.is-active,
.analytics-filters button.is-active {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  border-color: var(--red-dark);
  color: #fff;
}
.filter-metric-button.is-active strong,
.filter-metric-button.is-active span,
.fleet-metric-button.is-active strong,
.fleet-metric-button.is-active span { color: #fff; }
.toolbar button,
.map-actions button,
.analytics-filters button,
.show-more,
.active-filters button {
  border-radius: 999px;
  letter-spacing: .01em;
}
.toolbar .secondary,
.settings-modal .secondary,
.show-more,
.active-filters button,
.analytics-filters button:not(.is-active) {
  background: #fbfcfd;
  color: var(--graphite);
  border-color: var(--line);
}
.toolbar .secondary:hover,
.settings-modal .secondary:hover,
.show-more:hover,
.active-filters button:hover,
.analytics-filters button:hover {
  border-color: var(--red);
  color: var(--red);
  background: #fffafa;
}
.section-title-row h2,
.map-info h2,
.contracts-list h3,
.chart-card h3 {
  letter-spacing: -.02em;
}
.column,
.contracts-list,
.chart-card,
.preventiva-card,
.contract-row,
.fleet-card,
.os-insight-card {
  overflow: hidden;
}
.column > header,
.section-title-row.compact {
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.72));
}
.card,
.preventiva-card,
.contract-row,
.fleet-card {
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.card:hover,
.preventiva-card:hover,
.contract-row:hover,
.fleet-card:hover {
  transform: translateY(-1px);
  border-color: rgba(226,49,47,.35);
}
.history-table-wrap,
.contracts-list,
.chart-card {
  background: var(--white);
}
.history-table th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}
.history-table td {
  color: var(--graphite);
}
.stat-row,
.contract-row,
.preventiva-card,
.fleet-card {
  font-size: 11px;
}
.stat-value,
.stat-label,
.contract-row strong,
.preventiva-card strong,
.fleet-card strong {
  font-weight: 900;
}
.active-filters {
  margin-top: -4px;
  margin-bottom: 12px;
}
.filter-chip {
  min-height: 26px;
  font-size: 10px;
}

/* Cards analíticos de Contratos/Frota no padrão Oficina */
.contracts-dashboard .chart-card,
.analytics-grid .chart-card,
.contracts-list,
.fleet-card,
.preventiva-card,
.contract-row {
  padding: 11px;
}
.contracts-dashboard .chart-card h3,
.analytics-grid .chart-card h3,
.contracts-list h3 {
  font-size: 12px;
  margin-bottom: 8px;
}

/* Tema escuro padronizado */
html.ui-theme-dark .column > header,
html.ui-theme-dark .section-title-row.compact {
  background: linear-gradient(180deg, rgba(21,27,35,.98), rgba(16,23,32,.92));
}
html.ui-theme-dark .toolbar .secondary,
html.ui-theme-dark .settings-modal .secondary,
html.ui-theme-dark .show-more,
html.ui-theme-dark .active-filters button,
html.ui-theme-dark .analytics-filters button:not(.is-active) {
  background: #151b23;
  color: var(--graphite);
  border-color: var(--line);
}
html.ui-theme-dark .toolbar .secondary:hover,
html.ui-theme-dark .settings-modal .secondary:hover,
html.ui-theme-dark .show-more:hover,
html.ui-theme-dark .active-filters button:hover,
html.ui-theme-dark .analytics-filters button:hover {
  background: rgba(226,49,47,.12);
  color: #fff;
}
html.ui-theme-dark .history-table-wrap,
html.ui-theme-dark .contracts-list,
html.ui-theme-dark .chart-card {
  background: #151b23;
}

/* Tema escuro: correções de contraste e preferência do sistema - 2026-05-14 */
html.ui-theme-dark { color-scheme: dark; }
html.ui-theme-light { color-scheme: light; }
html.ui-theme-dark .login-card,
html.ui-theme-dark .ui-login-view-controls,
html.ui-theme-dark .metric,
html.ui-theme-dark .contract-metric,
html.ui-theme-dark .kpi-card,
html.ui-theme-dark .card,
html.ui-theme-dark .contract-scope,
html.ui-theme-dark .timeline-item,
html.ui-theme-dark .recommendation,
html.ui-theme-dark .history-table-wrap,
html.ui-theme-dark .settings-modal,
html.ui-theme-dark .settings-block,
html.ui-theme-dark .settings-modal footer,
html.ui-theme-dark .os-column-config,
html.ui-theme-dark .os-column-toggle,
html.ui-theme-dark .integration-alert,
html.ui-theme-dark .column-note,
html.ui-theme-dark .contracts-list.highlight {
  background: #151b23;
  color: var(--graphite);
  border-color: var(--line);
}
html.ui-theme-dark .contracts-list,
html.ui-theme-dark .chart-card,
html.ui-theme-dark .analytics-panel,
html.ui-theme-dark .history-panel,
html.ui-theme-dark .contracts-panel,
html.ui-theme-dark .map-panel {
  background: #101720;
  color: var(--graphite);
  border-color: var(--line);
}
html.ui-theme-dark .column,
html.ui-theme-dark .cards {
  background: #0f1620;
}
html.ui-theme-dark input,
html.ui-theme-dark select,
html.ui-theme-dark textarea {
  background: #101720;
  color: var(--graphite);
  border-color: var(--line);
}
html.ui-theme-dark input::placeholder,
html.ui-theme-dark textarea::placeholder { color: #7f8b98; }
html.ui-theme-dark .history-table { background: #151b23; color: var(--graphite); }
html.ui-theme-dark .history-table th {
  background: #0f1620;
  color: #d7dce2;
  border-color: var(--line);
}
html.ui-theme-dark .history-table td {
  background: #151b23;
  color: var(--graphite);
  border-color: var(--line);
}
html.ui-theme-dark .history-table tr:nth-child(even) td { background: #101720; }
html.ui-theme-dark .history-table tr:hover td { background: rgba(226,49,47,.08); }
html.ui-theme-dark .stat-row,
html.ui-theme-dark .timeline-date,
html.ui-theme-dark dd,
html.ui-theme-dark details strong,
html.ui-theme-dark .recommendation strong,
html.ui-theme-dark .preventiva-card strong,
html.ui-theme-dark .contract-row strong,
html.ui-theme-dark .fleet-card strong,
html.ui-theme-dark .settings-check,
html.ui-theme-dark .settings-block label:not(.settings-check) { color: var(--graphite); }
html.ui-theme-dark .contract-scope p,
html.ui-theme-dark .recommendation,
html.ui-theme-dark details p,
html.ui-theme-dark .problem,
html.ui-theme-dark .timeline-date-row small,
html.ui-theme-dark .timeline-item small,
html.ui-theme-dark .column-note,
html.ui-theme-dark .integration-alert { color: var(--muted); }
html.ui-theme-dark .status-pill:not(.vencida):not(.ok):not(.em-dia):not(.proxima):not(.pr-xima):not(.media):not(.m-dia):not(.cadastro):not(.alta):not([class*="sem-hor"]):not([class*="sem-proxima"]):not([class*="sem-pr-xima"]) {
  background: #253040;
  color: #d7dce2;
}
html.ui-theme-dark .timeline-status:not(.vencida):not(.ok):not(.concluida),
html.ui-theme-dark .urgency:not(.ativo):not(.vigente):not(.ok):not(.concluida):not(.em-analise):not(.em-an-lise):not(.hoje):not(.dias-7):not(.dias-15):not(.dias-30):not(.vence-em-90-dias):not(.vence-em-30-dias):not(.vencida):not(.vencido):not(.alta):not(.critica):not(.crítica):not(.media):not(.média) {
  background: #253040;
  color: #d7dce2;
}
html.ui-theme-dark .filter-chip,
html.ui-theme-dark .card-more summary {
  background: rgba(226,49,47,.12);
  border-color: rgba(226,49,47,.35);
  color: #ff7b7b;
}
html.ui-theme-dark .show-more:hover,
html.ui-theme-dark .active-filters button:hover,
html.ui-theme-dark .analytics-filters button:hover,
html.ui-theme-dark .header-actions a:hover,
html.ui-theme-dark .ui-view-btn:hover,
html.ui-theme-dark .os-column-toggle:hover {
  background: rgba(226,49,47,.12);
  border-color: rgba(226,49,47,.5);
  color: #fff;
}
html.ui-theme-dark .integration-alert.warn { background: rgba(244,196,49,.12); border-color: rgba(244,196,49,.35); color: #f8d76a; }
html.ui-theme-dark .integration-alert.error { background: rgba(226,49,47,.12); border-color: rgba(226,49,47,.38); color: #ff8585; }
html.ui-theme-dark .integration-alert.ok { background: rgba(31,157,85,.14); border-color: rgba(31,157,85,.38); color: #7ee2a8; }
html.ui-theme-dark .settings-modal h2,
html.ui-theme-dark .settings-modal h3,
html.ui-theme-dark .login-card h1,
html.ui-theme-dark .chart-card h3,
html.ui-theme-dark .contracts-list h3,
html.ui-theme-dark .section-title-row h2,
html.ui-theme-dark .map-info h2,
html.ui-theme-dark .card h3,
html.ui-theme-dark .os-insight-card h3 { color: var(--black); }

/* Painel financeiro executivo - 2026-05-14 */
.finance-toolbar { grid-template-columns: minmax(220px, 1.3fr) minmax(150px, .65fr) minmax(270px, 1.1fr) minmax(160px, .8fr) minmax(160px, .8fr) minmax(150px, .75fr) minmax(150px, .75fr) 135px 135px 126px 110px; align-items: center; }
.finance-grid { margin: 18px 0; }
.finance-recommendations { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px; }
.finance-store-toggle { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; min-height: 38px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: #f3f5f7; }
.finance-store-toggle button { height: 30px; min-width: 0; border: 0; border-radius: 999px; background: transparent; color: var(--graphite); padding: 0 10px; font-size: 11px; font-weight: 1000; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: none; }
.finance-store-toggle button:hover { background: #fff; color: var(--red); }
.finance-store-toggle button.is-active { background: var(--black); color: #fff; box-shadow: 0 8px 18px rgba(17,17,17,.13); }
.finance-metric.is-negative { border-left-color: var(--red); }
.finance-metric.is-negative strong { color: var(--red); }
.finance-metric { text-align: left; appearance: none; font: inherit; }
.finance-metric.is-filterable { cursor: pointer; }
.finance-metric.is-filterable:hover, .finance-metric.is-active { border-color: var(--red); box-shadow: 0 10px 24px rgba(226,49,47,.14); }
.finance-metric.is-active { background: #fff6f6; }
.finance-metric:disabled { cursor: default; opacity: 1; }
.finance-stat-row { grid-template-columns: minmax(110px, 1fr) 1fr 96px; }
.finance-stat-row small { grid-column: 1 / -1; color: var(--muted); font-weight: 800; margin-top: -4px; }
.finance-table small { color: var(--muted); font-weight: 800; }
html.ui-theme-dark .finance-table small { color: var(--muted); }
@media (max-width: 760px) { .finance-toolbar { grid-template-columns: 1fr; } .finance-recommendations { grid-template-columns: 1fr; } }

/* Layout responsivo único - 2026-05-14
   Remove dependência de modo compacto/normal e mantém tudo dentro da largura útil. */
html, body { max-width: 100%; overflow-x: clip; }
body { font-size: clamp(12px, .9vw, 14px); }
img, svg, video, canvas, iframe { max-width: 100%; }
main { width: min(1480px, calc(100% - clamp(16px, 3vw, 32px))); margin: clamp(12px, 1.6vw, 24px) auto clamp(28px, 4vw, 48px); }
.app-header { min-height: 64px; height: auto; padding: 10px clamp(12px, 2vw, 24px); gap: 12px; }
.brand, .header-actions, .hero-panel, .source-box, .toolbar, .metrics, .analytics-grid, .contracts-grid, .contracts-dashboard, .history-table-wrap, .card, .chart-card, .column, .os-column, .os-card, .settings-modal { min-width: 0; }
.brand img { width: clamp(112px, 10vw, 150px); }
.header-actions { flex: 1 1 auto; }
.header-actions a { min-width: 0; flex: 0 1 132px; padding-inline: 10px; }
.hero-panel { padding: clamp(16px, 2vw, 28px); align-items: stretch; }
.source-box { min-width: min(320px, 100%); }
h1 { font-size: clamp(24px, 3.3vw, 46px); }

.toolbar,
.os-toolbar,
.fleet-toolbar,
.contracts-toolbar,
.finance-toolbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 10px; align-items: center; }
.toolbar > *, .fleet-toolbar > *, .contracts-toolbar > *, .finance-toolbar > *, .os-toolbar > * { width: 100%; min-width: 0; }
input, select, button { max-width: 100%; }

.metrics,
.contracts-metrics,
.kpi-grid { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 10px; overflow: visible; }
.metric,
.contract-metric,
.kpi-card { min-width: 0; padding: clamp(10px, 1vw, 14px); }
.metric strong,
.contract-metric strong,
.kpi-card strong { font-size: clamp(18px, 1.7vw, 26px); overflow-wrap: anywhere; }
.metric span,
.contract-metric span,
.kpi-card span { font-size: clamp(9px, .75vw, 12px); }

.kanban { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: clamp(10px, 1.1vw, 16px); }
.os-kanban { grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: clamp(8px, .8vw, 12px); }
.os-kanban.is-many-columns { grid-template-columns: repeat(auto-fit, minmax(min(175px, 100%), 1fr)); }
.column { min-height: 320px; }
.column > header { padding: clamp(10px, 1vw, 16px); gap: 8px; }
.column h2, .os-column header h2 { overflow-wrap: anywhere; }
.cards { padding: clamp(8px, .9vw, 12px); gap: clamp(8px, .8vw, 12px); }
.card, .os-card { padding: clamp(10px, .9vw, 14px); }
.card-top { align-items: flex-start; }
.ticket, .urgency, .status-pill { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
dl { grid-template-columns: repeat(auto-fit, minmax(94px, 1fr)); }
.card h3, .problem, dd, details p { overflow-wrap: anywhere; }

.analytics-grid,
.finance-grid { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.contracts-grid,
.contracts-dashboard { grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); }
.os-insights { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: 10px; overflow: visible; }
.os-insight-card { min-width: 0; }

.history-table-wrap { overflow: auto; max-width: 100%; }
.history-table { min-width: 720px; }
.finance-table { min-width: 860px; }
.stat-row { grid-template-columns: minmax(90px, 1fr) minmax(80px, 1.2fr) minmax(54px, auto); }
.finance-stat-row { grid-template-columns: minmax(110px, 1fr) minmax(90px, 1fr) minmax(82px, auto); }
.stat-value { overflow-wrap: anywhere; }

.settings-grid { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.ui-login-view-controls .ui-view-controls { grid-template-columns: 1fr; }

@media (max-width: 900px) {
  .app-header { display: grid; align-items: start; }
  .header-actions { justify-content: stretch; }
  .header-actions a { flex: 1 1 120px; }
  .hero-panel, .map-info, .section-title-row { display: grid; align-items: start; }
}
@media (max-width: 620px) {
  main { width: min(100% - 16px, 620px); }
  .app-header { padding: 10px; }
  .header-actions a { flex-basis: calc(50% - 6px); min-height: 36px; font-size: 12px; }
  .hero-panel { padding: 14px; border-radius: 14px; }
  .source-box { padding: 12px; }
  .metrics, .contracts-metrics, .kpi-grid, .analytics-grid, .finance-grid, .contracts-grid, .contracts-dashboard, .kanban, .os-kanban { grid-template-columns: 1fr; }
  .service-map { height: 280px; min-height: 280px; }
}

/* Menu superior, correções mobile e dark mode - 2026-05-14 */
.app-header { display: grid; grid-template-columns: auto minmax(0, 1fr); justify-content: start; align-items: center; }
.app-menu { position: relative; z-index: 1300; }
.app-menu summary { list-style: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--black); color: #fff; cursor: pointer; font-weight: 1000; font-size: 13px; }
.app-menu summary::-webkit-details-marker { display: none; }
.app-menu[open] summary { background: var(--red); border-color: var(--red); }
.app-menu-panel { position: absolute; top: calc(100% + 8px); left: 0; width: min(260px, calc(100vw - 20px)); padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); box-shadow: var(--shadow); display: grid; gap: 6px; }
.app-menu-panel a { min-height: 40px; display: flex; align-items: center; padding: 0 12px; border-radius: 10px; color: var(--graphite); font-weight: 900; }
.app-menu-panel a:hover { background: #fff5f5; color: var(--red); }
.brand { justify-self: end; }
.header-actions { display: none !important; }

input[type="date"] { width: 100%; min-width: 0; max-width: 100%; appearance: none; -webkit-appearance: none; }
input[type="date"]::-webkit-date-and-time-value { min-width: 0; text-align: left; }
input[type="date"]::-webkit-calendar-picker-indicator { margin-left: 2px; }

html.ui-theme-dark .app-menu summary { background: #151b23; color: var(--graphite); border-color: var(--line); }
html.ui-theme-dark .app-menu[open] summary { background: var(--red); color: #fff; border-color: var(--red); }
html.ui-theme-dark .app-menu-panel { background: #151b23; border-color: var(--line); box-shadow: 0 18px 42px rgba(0,0,0,.42); }
html.ui-theme-dark .app-menu-panel a { color: var(--graphite); }
html.ui-theme-dark .app-menu-panel a:hover { background: rgba(226,49,47,.12); color: #fff; }
html.ui-theme-dark .timeline-list,
html.ui-theme-dark .timeline-item,
html.ui-theme-dark .contract-scope,
html.ui-theme-dark .column-note,
html.ui-theme-dark .map-panel:not(.has-points) .map-status,
html.ui-theme-dark .empty,
html.ui-theme-dark .active-filters,
html.ui-theme-dark .filter-summary,
html.ui-theme-dark .card-more,
html.ui-theme-dark details,
html.ui-theme-dark summary { border-color: var(--line); color: var(--graphite); }
html.ui-theme-dark .stat-bar { background: #253040; }
html.ui-theme-dark .filter-metric-button:not(.is-active),
html.ui-theme-dark .fleet-metric-button:not(.is-active),
html.ui-theme-dark .toolbar .secondary,
html.ui-theme-dark .settings-modal .secondary,
html.ui-theme-dark .show-more,
html.ui-theme-dark .active-filters button,
html.ui-theme-dark .analytics-filters button:not(.is-active) { background: #151b23; color: var(--graphite); border-color: var(--line); }
html.ui-theme-dark input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1) opacity(.8); }

@media (max-width: 760px) {
  .app-header { grid-template-columns: auto minmax(0, 1fr); padding: 10px; gap: 10px; }
  .brand { justify-self: end; gap: 8px; }
  .brand img { width: clamp(92px, 30vw, 118px); }
  .brand strong { font-size: 12px; }
  .brand span { font-size: 10px; }
  .app-menu summary { min-height: 38px; padding-inline: 12px; }
  .toolbar,
  .os-toolbar,
  .finance-toolbar,
  .fleet-toolbar,
  .contracts-toolbar { grid-template-columns: minmax(0, 1fr) !important; width: 100%; overflow: hidden; }
  .toolbar > *, .os-toolbar > *, .finance-toolbar > *, .fleet-toolbar > *, .contracts-toolbar > * { min-width: 0 !important; width: 100% !important; max-width: 100% !important; }
  input, select, button { min-width: 0 !important; width: 100%; }
}

/* Menu no canto superior direito apenas com ícone - 2026-05-14 */
.app-header { grid-template-columns: minmax(0, 1fr) auto; }
.brand { justify-self: start; grid-column: 1; grid-row: 1; }
.app-menu { justify-self: end; grid-column: 2; grid-row: 1; }
.app-menu summary { width: 42px; min-width: 42px; padding: 0; font-size: 20px; line-height: 1; }
.app-menu summary span { display: none; }
.app-menu-panel { left: auto; right: 0; }
@media (max-width: 760px) {
  .app-header { grid-template-columns: minmax(0, 1fr) auto; }
  .brand { justify-self: start; }
  .app-menu { justify-self: end; }
  .app-menu summary { width: 40px; min-width: 40px; padding: 0; }
}

/* Navegação adaptativa: botões quando couber, menu quando faltar espaço - 2026-05-14 */
.app-header { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; }
.brand { grid-column: 1; justify-self: start; }
.header-actions { grid-column: 2; justify-self: end; display: flex !important; flex-wrap: nowrap; gap: 6px; min-width: 0; overflow: hidden; }
.header-actions a { flex: 0 1 auto; min-width: 92px; max-width: 132px; min-height: 36px; padding: 7px 9px; border-radius: 999px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-menu { grid-column: 3; justify-self: end; display: none; }
@media (max-width: 1120px) {
  .app-header { grid-template-columns: minmax(0, 1fr) auto; }
  .brand { grid-column: 1; }
  .header-actions { display: none !important; }
  .app-menu { display: block; grid-column: 2; }
}
@media (max-width: 760px) {
  .app-header { grid-template-columns: minmax(0, 1fr) auto; }
  .brand { justify-self: start; }
  .app-menu { justify-self: end; }
}

/* Painel financeiro executivo - gráficos e áreas */
.finance-executive-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 14px; align-items: stretch; }
.finance-executive-grid .analytics-panel { margin-top: 0; }
.finance-result-summary { display: grid; gap: 10px; }
.finance-result-summary > div { border: 1px solid var(--line); border-radius: 14px; background: #fbfcfd; padding: 14px; }
.finance-result-summary strong { display: block; font-size: clamp(22px, 2.4vw, 34px); color: var(--black); line-height: 1; }
.finance-result-summary span { display: block; margin-top: 7px; color: var(--muted); font-weight: 1000; font-size: 11px; text-transform: uppercase; }
.finance-result-summary .is-positive strong { color: var(--green); }
.finance-result-summary .is-negative strong, .finance-metric.is-negative strong, .finance-area-card.is-negative dd { color: var(--red); }
.finance-area-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.finance-area-card { border: 1px solid var(--line); border-radius: 16px; background: #fbfcfd; padding: 14px; box-shadow: 0 7px 18px rgba(17,17,17,.045); }
.finance-area-card header { display: flex; justify-content: space-between; gap: 8px; align-items: start; margin-bottom: 12px; }
.finance-area-card header strong { color: var(--black); font-size: 17px; }
.finance-area-card header span { border-radius: 999px; background: #edf0f2; color: var(--graphite); padding: 4px 8px; font-size: 11px; font-weight: 1000; white-space: nowrap; }
.finance-area-card dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.finance-area-card dt { font-size: 10px; }
.finance-area-card dd { font-size: 15px; font-weight: 1000; color: var(--black); }
.finance-area-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.finance-grid .chart-card.wide { grid-column: span 2; }
.finance-grouped-bars { display: grid; gap: 13px; }
.finance-bar-group { border-bottom: 1px solid var(--line); padding-bottom: 11px; }
.finance-bar-group:last-child { border-bottom: 0; padding-bottom: 0; }
.finance-bar-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 8px; }
.finance-bar-head strong { color: var(--black); }
.finance-bar-head span { font-weight: 1000; color: var(--muted); }
.finance-bar-line { display: grid; grid-template-columns: 58px minmax(0, 1fr) 96px; gap: 8px; align-items: center; margin: 6px 0; }
.finance-bar-line em { font-style: normal; color: var(--muted); font-size: 11px; font-weight: 1000; text-transform: uppercase; }
.finance-bar-line b { color: var(--graphite); font-size: 12px; text-align: right; }
.finance-bar-line .bar { height: 11px; border-radius: 999px; min-width: 3px; }
.finance-bar-line .revenue { background: var(--green); }
.finance-bar-line .expense { background: var(--red); }
.finance-bar-group small { display: block; margin-top: 6px; color: var(--muted); font-weight: 800; font-size: 11px; }
.finance-chart-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; color: var(--muted); font-size: 12px; font-weight: 1000; }
.finance-chart-legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 999px; margin-right: 5px; vertical-align: -1px; }
.finance-chart-legend .rev::before { background: rgba(31,157,85,.45); }
.finance-chart-legend .exp::before { background: rgba(226,49,47,.32); }
.finance-chart-legend .bal::before { background: var(--blue); }
.finance-cashflow-svg { width: 100%; height: 260px; display: block; background: linear-gradient(180deg, #fff, #fbfcfd); border: 1px solid var(--line); border-radius: 12px; }
.finance-cashflow-svg .axis { stroke: #cbd5e1; stroke-width: 1; }
.finance-cashflow-svg .cash-receber { fill: rgba(31,157,85,.42); }
.finance-cashflow-svg .cash-pagar { fill: rgba(226,49,47,.28); }
.finance-cashflow-svg .cash-balance,
.finance-cashflow-svg .cash-balance-positive,
.finance-cashflow-svg .cash-balance-negative { stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 2px 3px rgba(37,99,235,.18)); }
.finance-cashflow-svg .cash-balance,
.finance-cashflow-svg .cash-balance-positive { stroke: var(--green); }
.finance-cashflow-svg .cash-balance-negative { stroke: var(--red); filter: drop-shadow(0 2px 3px rgba(226,49,47,.2)); }
.finance-cashflow-svg .cash-profit-zone { fill: rgba(31,157,85,.055); }
.finance-cashflow-svg .cash-loss-zone { fill: rgba(226,49,47,.06); }
.finance-cashflow-svg .zero-axis { stroke: #94a3b8; stroke-dasharray: 5 5; }
.finance-cashflow-svg .cash-axis-label { fill: var(--green); font-size: 11px; font-weight: 1000; text-transform: uppercase; }
.finance-cashflow-svg .cash-axis-label.loss { fill: var(--red); }
.finance-cashflow-result { margin-left: auto; font-size: 12px; }
.finance-cashflow-result.is-positive { color: var(--green); }
.finance-cashflow-result.is-negative { color: var(--red); }
.finance-stat-row { grid-template-columns: minmax(86px, 1fr) 1.2fr minmax(92px, auto); }
.finance-stat-row small { grid-column: 1 / -1; color: var(--muted); font-size: 11px; font-weight: 800; margin-top: -5px; }
@media (max-width: 1050px) { .finance-executive-grid, .finance-area-charts, .finance-area-cards { grid-template-columns: 1fr 1fr; } .finance-grid .chart-card.wide { grid-column: 1 / -1; } }
@media (max-width: 760px) { .finance-executive-grid, .finance-area-charts, .finance-area-cards { grid-template-columns: 1fr; } .finance-bar-line { grid-template-columns: 54px minmax(0, 1fr); } .finance-bar-line b { grid-column: 2; text-align: left; } .finance-cashflow-svg { height: 220px; } }
.finance-period-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -6px 0 18px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 7px 18px rgba(17,17,17,.045); }
.finance-period-tools > div { display: grid; gap: 2px; margin-right: auto; min-width: min(100%, 280px); }
.finance-period-tools strong { color: var(--black); font-size: 13px; }
.finance-period-tools span { color: var(--muted); font-size: 12px; font-weight: 800; }
.finance-period-tools button { min-height: 34px; border-radius: 999px; border: 1px solid var(--line); background: #fbfcfd; color: var(--graphite); padding: 0 12px; font-weight: 1000; cursor: pointer; }
.finance-period-tools button:hover, .finance-period-tools button.is-active { background: var(--red); border-color: var(--red); color: white; }
@media (max-width: 760px) { .finance-period-tools { align-items: stretch; } .finance-period-tools > div { width: 100%; } .finance-period-tools button { flex: 1 1 calc(50% - 8px); } }
.finance-period-warning { margin: -6px 0 18px; }
.finance-hero { margin-bottom: 12px; }
.finance-command-bar { display: grid; grid-template-columns: minmax(280px, 1fr) auto; gap: 10px; align-items: center; margin: 0 0 14px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--soft-shadow); }
.finance-command-main, .finance-command-period { display: grid; gap: 6px; min-width: 0; }
.finance-command-main > span, .finance-command-period > span { color: var(--muted); font-size: 11px; font-weight: 1000; text-transform: uppercase; }
.finance-command-period { grid-template-columns: 1fr auto auto auto; align-items: end; }
.finance-command-period > span { align-self: center; text-transform: none; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finance-command-bar > button, .finance-command-period button { height: 38px; border-radius: 999px; border: 1px solid var(--line); background: var(--black); color: #fff; padding: 0 13px; font-weight: 1000; cursor: pointer; }
.finance-command-bar .secondary { background: #fbfcfd; color: var(--graphite); }
.finance-command-period button { background: #fbfcfd; color: var(--graphite); }
.finance-command-period button:hover, .finance-command-period button.is-active { background: var(--red); border-color: var(--red); color: #fff; }
.finance-toolbar { grid-template-columns: minmax(260px, 1fr) auto !important; }
.finance-toolbar > input[type="search"] { min-height: 42px; }
.finance-toolbar > .secondary { min-height: 42px; border-radius: 999px; border: 1px solid var(--line); background: #fbfcfd; color: var(--graphite); padding: 0 14px; font-weight: 1000; cursor: pointer; }
.finance-toolbar > .secondary:hover,
.finance-toolbar > .secondary.is-active { background: var(--black); color: #fff; border-color: var(--black); }
.finance-advanced-filters { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(165px, 100%), 1fr)); gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfd; }
.finance-advanced-filters[hidden] { display: none !important; }
.finance-advanced-filters button { min-height: 38px; border-radius: 999px; border: 1px solid var(--line); background: var(--black); color: #fff; padding: 0 13px; font-weight: 1000; cursor: pointer; }
.finance-advanced-filters .secondary { background: #fff; color: var(--graphite); }
.finance-forecast-hero { display: grid; grid-template-columns: minmax(320px, 1.08fr) minmax(0, 1.35fr); gap: 12px; margin: 0 0 14px; align-items: stretch; }
.finance-forecast-main, .finance-forecast-breakdown button { border: 1px solid var(--line); background: #fff; text-align: left; cursor: pointer; box-shadow: var(--soft-shadow); }
.finance-forecast-main { min-height: 176px; border-radius: 18px; padding: 20px; background: linear-gradient(135deg, #101820, #24313f); border-color: rgba(255,255,255,.1); color: #fff; display: flex; flex-direction: column; justify-content: center; }
.finance-forecast-hero.is-negative .finance-forecast-main { background: linear-gradient(135deg, #5f1515, #20242b); }
.finance-forecast-main span { font-size: 12px; font-weight: 1000; text-transform: uppercase; color: rgba(255,255,255,.72); }
.finance-forecast-main strong { display: block; margin-top: 9px; font-size: clamp(34px, 4.2vw, 58px); line-height: .96; letter-spacing: 0; color: #fff; white-space: nowrap; font-variant-numeric: tabular-nums; }
.finance-forecast-main small { display: block; margin-top: 12px; color: rgba(255,255,255,.72); font-weight: 850; line-height: 1.35; max-width: 620px; }
.finance-forecast-breakdown { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.finance-forecast-breakdown button { min-height: 104px; border-radius: 14px; padding: 13px; }
.finance-forecast-breakdown button:hover, .finance-forecast-main:hover { transform: translateY(-1px); }
.finance-forecast-breakdown span { display: block; color: var(--muted); font-size: 10px; font-weight: 1000; text-transform: uppercase; }
.finance-forecast-breakdown strong { display: block; margin-top: 7px; color: var(--black); font-size: clamp(18px, 1.55vw, 24px); line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; font-variant-numeric: tabular-nums; }
.finance-forecast-breakdown button small { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; font-weight: 850; line-height: 1.25; }
.finance-forecast-progress { grid-column: 1 / -1; align-self: end; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfd; padding: 12px 13px; }
.finance-forecast-progress > span { display: block; height: 12px; border-radius: 999px; background: #e8edf3; overflow: hidden; }
.finance-forecast-progress b { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green), var(--blue)); min-width: 2px; transition: width .8s cubic-bezier(.2,.8,.2,1); }
.finance-forecast-progress.is-expense-progress b { background: linear-gradient(90deg, #f59e0b, var(--red)); }
.finance-forecast-progress small { display: block; margin-top: 7px; color: var(--muted); font-weight: 900; font-size: 12px; }
.finance-decision-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.finance-decision-alerts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 10px; margin: 0 0 14px; }
.finance-alert-card { text-align: left; min-height: 72px; border: 1px solid var(--line); border-left: 5px solid var(--blue); border-radius: 14px; background: #fff; padding: 12px 13px; box-shadow: var(--soft-shadow); cursor: pointer; }
.finance-alert-card strong { display: block; color: var(--black); font-size: 13px; margin-bottom: 5px; }
.finance-alert-card span { color: var(--muted); font-weight: 800; font-size: 12px; }
.finance-alert-card.high { border-left-color: var(--red); background: #fffafa; }
.finance-alert-card.medium { border-left-color: #d97706; background: #fffbeb; }
.finance-alert-card.low { border-left-color: var(--blue); }
.finance-alert-card.ok { border-left-color: var(--green); background: #f0fdf4; cursor: default; }
.finance-main-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, .85fr); gap: 14px; align-items: stretch; }
.finance-main-grid .analytics-panel { margin-top: 0; }
.finance-sector-board { display: grid; gap: 10px; }
.finance-sector-card { width: 100%; text-align: left; border: 1px solid var(--line); border-left-width: 5px; border-radius: 14px; background: #fbfcfd; padding: 12px; cursor: pointer; font: inherit; }
.finance-sector-card:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(17,17,17,.1); }
.finance-sector-card.is-positive { border-left-color: var(--green); }
.finance-sector-card.is-negative { border-left-color: var(--red); background: #fffafa; }
.finance-sector-card.is-neutral { border-left-color: #94a3b8; }
.finance-sector-card header { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 10px; }
.finance-sector-card header strong { color: var(--black); font-size: 15px; }
.finance-sector-card header span { color: var(--muted); font-size: 11px; font-weight: 1000; }
.finance-sector-card dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.finance-sector-card dt { color: var(--muted); font-size: 10px; font-weight: 1000; text-transform: uppercase; }
.finance-sector-card dd { color: var(--black); font-size: 13px; font-weight: 1000; }
.finance-sector-card footer { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 900; }
.finance-sector-card dd.is-positive,
.finance-sector-card dd.is-revenue,
.finance-forecast-breakdown .is-revenue strong,
.finance-forecast-breakdown .is-positive strong,
.finance-metric.is-revenue strong,
.finance-metric.is-positive strong { color: var(--green); }
.finance-sector-card dd.is-negative,
.finance-sector-card dd.is-expense,
.finance-forecast-breakdown .is-expense strong,
.finance-forecast-breakdown .is-negative strong,
.finance-metric.is-expense strong,
.finance-metric.is-negative strong { color: var(--red); }
.finance-actions-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 14px 0; }
.finance-sector-alerts { display: grid; gap: 8px; margin-top: 10px; }
.finance-sector-alert { min-height: 58px; text-align: left; border: 1px solid var(--line); border-left: 5px solid var(--green); border-radius: 12px; background: #fbfcfd; padding: 10px 12px; cursor: pointer; }
.finance-sector-alert strong { display: block; color: var(--black); font-size: 12px; margin-bottom: 4px; }
.finance-sector-alert span { color: var(--muted); font-weight: 850; font-size: 11px; }
.finance-sector-alert.high { border-left-color: var(--red); background: #fffafa; }
.finance-sector-alert.medium { border-left-color: #d97706; background: #fffbeb; }
.finance-sector-alert.ok { border-left-color: var(--green); background: #f0fdf4; }
.finance-sector-note { margin: 0; border: 1px dashed var(--line); border-radius: 12px; padding: 10px 12px; color: var(--muted); font-size: 12px; font-weight: 850; background: #fbfcfd; }
.finance-settings-dialog { width: min(820px, calc(100vw - 28px)); border: 0; border-radius: 18px; padding: 0; background: transparent; color: var(--graphite); }
.finance-settings-dialog::backdrop { background: rgba(10, 16, 24, .55); backdrop-filter: blur(2px); }
.finance-settings-panel { display: grid; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.finance-settings-panel header,
.finance-settings-panel footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.finance-settings-panel h2 { margin: 2px 0 0; color: var(--black); font-size: 20px; }
.finance-icon-button { width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--line); background: #fbfcfd; color: var(--graphite); font-size: 22px; line-height: 1; cursor: pointer; }
.finance-setting-toggle { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfd; color: var(--graphite); font-weight: 850; }
.finance-setting-toggle input { width: 18px; height: 18px; margin-top: 1px; }
.finance-allocation-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.finance-allocation-grid label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 1000; text-transform: uppercase; }
.finance-allocation-grid input { min-height: 40px; }
.finance-settings-section { display: grid; gap: 10px; padding-top: 2px; }
.finance-settings-section h3 { margin: 0; color: var(--black); font-size: 14px; }
.finance-target-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.finance-target-grid label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 1000; text-transform: uppercase; }
.finance-target-grid input { min-height: 38px; }
.finance-settings-section textarea { width: 100%; min-height: 128px; resize: vertical; border: 1px solid var(--line); border-radius: 12px; padding: 10px; font: inherit; background: #fbfcfd; color: var(--black); }
.finance-settings-section small { color: var(--muted); font-size: 11px; font-weight: 850; }
.finance-plan-sector-map { display: grid; max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfd; }
.finance-plan-sector-row { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.finance-plan-sector-row:last-child { border-bottom: 0; }
.finance-plan-sector-row span { min-width: 0; }
.finance-plan-sector-row strong { display: block; color: var(--black); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finance-plan-sector-row small { display: block; margin-top: 2px; }
.finance-plan-sector-row select { width: 100%; min-height: 38px; }
.finance-allocation-total { margin: -4px 0 0; color: var(--muted); font-size: 12px; font-weight: 850; }
.finance-allocation-total.is-warning { color: #b45309; }
.finance-settings-panel footer button { min-height: 38px; border-radius: 999px; border: 1px solid var(--line); background: var(--black); color: #fff; padding: 0 16px; font-weight: 1000; cursor: pointer; }
.finance-settings-panel footer .secondary { background: #fbfcfd; color: var(--graphite); }
.finance-expense-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(90px, .5fr) auto; gap: 10px; align-items: center; width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; padding: 10px 0; cursor: pointer; }
.finance-expense-row:last-child { border-bottom: 0; }
.finance-expense-row strong { display: block; color: var(--black); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finance-expense-row small { display: block; color: var(--muted); font-weight: 800; margin-top: 3px; }
.finance-expense-row em { color: var(--red); font-style: normal; font-weight: 1000; font-size: 12px; white-space: nowrap; }
.finance-expense-bar { height: 8px; border-radius: 999px; background: #fee2e2; overflow: hidden; }
.finance-expense-bar b { display: block; height: 100%; border-radius: inherit; background: var(--red); }
.finance-priority-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 10px 0; cursor: pointer; }
.finance-priority-row:last-child { border-bottom: 0; }
.finance-priority-row strong { display: block; color: var(--black); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finance-priority-row small { display: block; color: var(--muted); font-weight: 800; margin-top: 3px; }
.finance-priority-row b { color: var(--red); font-size: 12px; white-space: nowrap; }
.finance-quality-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.finance-quality-row:last-child { border-bottom: 0; }
.finance-quality-row strong { color: var(--black); font-size: 18px; }
.finance-quality-row span { color: var(--muted); font-weight: 900; font-size: 12px; }
@media (max-width: 1180px) { .finance-command-bar, .finance-forecast-hero, .finance-main-grid, .finance-actions-grid { grid-template-columns: 1fr; } .finance-command-period { grid-template-columns: 1fr 1fr 1fr; } .finance-command-period > span { grid-column: 1 / -1; } }
@media (max-width: 760px) { .finance-decision-cards, .finance-forecast-breakdown, .finance-toolbar, .finance-allocation-grid, .finance-target-grid, .finance-plan-sector-row { grid-template-columns: 1fr !important; } .finance-command-bar > button { width: 100%; } .finance-forecast-main { min-height: 150px; } .finance-settings-panel header, .finance-settings-panel footer { align-items: stretch; } }

/* Movimento visual - cards mais chamativos sem perder legibilidade */
.app-animate {
  opacity: 0;
  transform: translateY(24px) scale(.965);
  filter: saturate(.86);
  transition: opacity .62s ease, transform .62s cubic-bezier(.2,.8,.2,1), filter .62s ease;
  transition-delay: calc(var(--stagger, 0) * 55ms);
}
.app-animate.is-visible { opacity: 1; transform: translateY(0) scale(1); filter: saturate(1); }
.card, .metric, .kpi-card, .contract-metric, .preventiva-card, .contract-row, .timeline-item, .chart-card, .finance-area-card, .source-box, .analytics-panel, .history-panel, .contracts-panel, .map-panel {
  transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease, background .24s ease;
}
.card, .preventiva-card, .contract-row, .timeline-item, .finance-area-card { position: relative; overflow: hidden; }
.card::after, .preventiva-card::after, .contract-row::after, .timeline-item::after, .finance-area-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(244,196,49,.16) 45%, transparent 72%);
  transform: translateX(-120%);
  pointer-events: none;
}
.card:hover, .preventiva-card:hover, .contract-row:hover, .timeline-item:hover, .finance-area-card:hover {
  transform: translateY(-6px) scale(1.01);
  border-color: rgba(226,49,47,.36);
  box-shadow: 0 18px 38px rgba(17,17,17,.14);
}
.card:hover::after, .preventiva-card:hover::after, .contract-row:hover::after, .timeline-item:hover::after, .finance-area-card:hover::after { animation: app-shine-sweep .75s ease; }
/* Drag-and-drop no Kanban */
.card[draggable="true"] { cursor: grab; }
.card[draggable="true"]:active { cursor: grabbing; }
.card.is-dragging { opacity: .45; transform: scale(.96); filter: grayscale(.3); }
.cards.drop-target { background: rgba(226,49,47,.08); border-radius: 14px; outline: 2px dashed rgba(226,49,47,.35); outline-offset: -4px; }

.metric:hover, .kpi-card:hover, .contract-metric:hover, .chart-card:hover, .analytics-panel:hover, .contracts-panel:hover, .map-panel:hover {
  transform: translateY(-3px);
  border-color: rgba(226,49,47,.25);
  box-shadow: 0 14px 30px rgba(17,17,17,.1);
}
.column header span, .ticket, .urgency, .tag, .status-pill, .filter-chip, .timeline-status {
  transition: transform .2s ease, box-shadow .2s ease;
}
.column header span:hover, .ticket:hover, .urgency:hover, .tag:hover, .status-pill:hover, .filter-chip:hover, .timeline-status:hover {
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 8px 18px rgba(17,17,17,.12);
}
.urgency.alta, .urgency.crítica, .urgency.critica, .urgency.vencida, .urgency.vencido, .status-pill.vencida, .status-pill.alta, .status-pill.sem-horimetro, .status-pill[class*="sem-hor"], .status-pill[class*="sem-proxima"] {
  animation: app-attention-pulse 2.8s ease-in-out infinite;
}
.stat-bar span, .finance-bar-line .bar { animation: app-bar-grow .8s ease both; transform-origin: left center; }
@keyframes app-shine-sweep { to { transform: translateX(120%); } }
@keyframes app-attention-pulse { 0%, 100% { box-shadow: 0 0 0 rgba(226,49,47,0); } 50% { box-shadow: 0 0 0 7px rgba(226,49,47,.1); } }
@keyframes app-bar-grow { from { transform: scaleX(.08); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .app-animate { opacity: 1; transform: none; filter: none; }
  .electric-cursor { display: none; }
}

/* Template Supravel tech aplicado à intranet */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(circle at 10% 16%, rgba(226,49,47,.075), transparent 28%),
    radial-gradient(circle at 88% 8%, rgba(244,196,49,.09), transparent 24%),
    linear-gradient(rgba(17,17,17,.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17,17,17,.022) 1px, transparent 1px);
  background-size: auto, auto, 44px 44px, 44px 44px;
}
html.ui-theme-dark body::before {
  background:
    radial-gradient(circle at 10% 16%, rgba(226,49,47,.12), transparent 28%),
    radial-gradient(circle at 88% 8%, rgba(244,196,49,.12), transparent 24%),
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: auto, auto, 44px 44px, 44px 44px;
}
.electric-cursor {
  position: fixed;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
  opacity: .13;
  background: radial-gradient(circle, rgba(244,196,49,.55), rgba(226,49,47,.18) 38%, transparent 68%);
  transform: translate(-50%, -50%);
  mix-blend-mode: screen;
}
.app-header::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background-image: linear-gradient(90deg,
    transparent 0%,
    transparent 42%,
    rgba(226,49,47,.35) 47%,
    var(--yellow) 50%,
    rgba(226,49,47,.35) 53%,
    transparent 58%,
    transparent 100%);
  background-repeat: repeat-x;
  background-size: 200% 100%;
  animation: app-scanline 8s linear infinite;
}
.hero-panel { position: relative; overflow: hidden; }
.hero-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0 28px, rgba(226,49,47,.08) 28px 30px, transparent 30px 58px),
    linear-gradient(0deg, transparent 0 28px, rgba(244,196,49,.10) 28px 30px, transparent 30px 58px);
  background-size: 58px 58px;
  opacity: .35;
  mask-image: linear-gradient(135deg, transparent, #000 28%, transparent 78%);
  pointer-events: none;
}
.source-box, .metric, .kpi-card, .contract-metric { position: relative; overflow: hidden; }
.source-box::after, .metric::after, .kpi-card::after, .contract-metric::after {
  content: '';
  position: absolute;
  inset: auto 14px 0 14px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--yellow), var(--red), transparent);
  opacity: 0;
  transition: opacity .22s ease;
}
.source-box:hover::after, .metric:hover::after, .kpi-card:hover::after, .contract-metric:hover::after { opacity: 1; }
.header-actions a, .app-menu summary, .app-menu-panel a, .toolbar button, .fleet-toolbar button, .contracts-toolbar button, .finance-period-tools button {
  position: relative;
  overflow: hidden;
}
.header-actions a::after, .app-menu summary::after, .app-menu-panel a::after, .toolbar button::after, .fleet-toolbar button::after, .contracts-toolbar button::after, .finance-period-tools button::after {
  content: '';
  position: absolute;
  top: -45%;
  bottom: -45%;
  width: 28px;
  left: -46px;
  background: rgba(255,255,255,.42);
  transform: rotate(24deg);
  transition: left .42s ease;
}
.header-actions a:hover::after, .app-menu summary:hover::after, .app-menu-panel a:hover::after, .toolbar button:hover::after, .fleet-toolbar button:hover::after, .contracts-toolbar button:hover::after, .finance-period-tools button:hover::after { left: calc(100% + 46px); }
@keyframes app-scanline { 0% { background-position: 0% 0; } 100% { background-position: 200% 0; } }
@media (max-width: 760px) { .electric-cursor { display: none; } }
/* Oficina O.S. compacta - 2026-05-19 */
.os-kanban {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(168px, 10.6vw, 205px);
  grid-template-columns: none !important;
  align-items: start;
  gap: 8px;
  overflow-x: auto;
  overflow-y: visible;
  padding: 2px 2px 12px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}
.os-kanban.is-many-columns { grid-template-columns: none !important; }
.os-column {
  scroll-snap-align: start;
  min-height: 420px;
  max-height: none;
  display: flex;
  flex-direction: column;
  padding: 7px;
  border-radius: 10px;
}
.os-column header {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 46px;
  margin: -7px -7px 6px;
  padding: 8px 7px;
  border-radius: 10px 10px 0 0;
  background: inherit;
  border-bottom: 1px solid var(--line);
}
.os-column[data-color="azul"] header { border-top: 3px solid #2563eb; }
.os-column[data-color="laranja"] header { border-top: 3px solid #f97316; }
.os-column[data-color="verde"] header { border-top: 3px solid #16a34a; }
.os-column[data-color="preto"] header { border-top: 3px solid #111827; }
.os-column[data-color="azul"] header span { background: rgba(37,99,235,.12); color: #1d4ed8; }
.os-column[data-color="laranja"] header span { background: rgba(249,115,22,.14); color: #c2410c; }
.os-column[data-color="verde"] header span { background: rgba(22,163,74,.13); color: #15803d; }
.os-column[data-color="preto"] header span { background: rgba(17,24,39,.12); color: #111827; }
.os-column header h2 { font-size: 11px; line-height: 1.12; letter-spacing: 0; overflow-wrap: anywhere; }
.os-column header span { min-width: 24px; padding: 3px 6px; font-size: 10px; }
.os-column .cards { flex: 1; overflow-y: visible; padding: 0 1px 2px; gap: 6px; scrollbar-width: auto; }
.os-card {
  height: 108px;
  min-height: 108px;
  max-height: 108px;
  display: grid;
  grid-template-rows: 18px 25px 24px 18px;
  gap: 4px;
  padding: 7px;
  border-radius: 8px;
  cursor: pointer;
  outline: none;
}
.os-card:hover, .os-card:focus-visible { border-color: rgba(226,49,47,.45); box-shadow: 0 8px 22px rgba(17,17,17,.12); transform: translateY(-1px); }
.os-card:active { cursor: pointer; }
.os-card.is-dragging { opacity: .55; transform: rotate(1deg); }
.os-card .card-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(62px, auto); gap: 5px; align-items: center; margin: 0; min-height: 0; }
.os-card .ticket, .os-card .situation { min-width: 0; padding: 2px 5px; font-size: 9px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.os-card .card-top .amount { min-width: 0; padding: 2px 5px; border-radius: 999px; background: rgba(226,49,47,.08); color: var(--red); font-size: 9px; font-weight: 950; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.os-card h3 { margin: 0; font-size: 11px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.os-card .equipment { margin: 0; color: var(--muted); font-size: 10px; font-weight: 800; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.os-card-meta { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 5px; align-items: center; min-height: 0; }
.os-card-meta span { min-width: 0; padding: 2px 5px; border-radius: 999px; background: #f2f4f7; color: var(--graphite); font-size: 9px; font-weight: 900; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.os-hide-values .os-card .amount-row { display: none; }
.os-column-toggle.is-locked { cursor: default; opacity: .82; }
.os-column-toggle.is-locked:hover { background: #fff; border-color: var(--line); color: var(--graphite); }
.os-column-toggle small {
  display: inline-block;
  margin-left: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
}

.os-detail-backdrop { place-items: stretch end; padding: 0; }
.os-detail-panel {
  width: min(560px, 100%);
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 70px rgba(15,23,42,.24);
}
.os-detail-panel > header { display: flex; justify-content: space-between; gap: 16px; padding: 20px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, #111, #333); }
.os-detail-panel > header h2 { margin: 2px 0 8px; color: #fff; font-size: 22px; line-height: 1.15; }
.os-detail-panel > header .eyebrow { margin: 0; color: #f4c431; }
.os-detail-panel > header .urgency { display: inline-flex; max-width: 100%; background: rgba(255,255,255,.14); color: #fff; }
.os-detail-body { overflow: auto; padding: 14px; }
.os-detail-section { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 10px; background: #fff; }
.os-detail-section h3 { margin: 0 0 10px; color: var(--black); font-size: 15px; }
.os-detail-section p { margin: 8px 0 0; color: var(--muted); font-size: 13px; font-weight: 750; line-height: 1.45; }
.os-detail-section p strong { color: var(--graphite); }
.os-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.os-detail-field { min-width: 0; padding: 8px; border-radius: 7px; background: #f7f8fa; }
.os-detail-field dt { margin: 0 0 3px; color: var(--muted); font-size: 10px; font-weight: 950; text-transform: uppercase; }
.os-detail-field dd { margin: 0; color: var(--graphite); font-size: 13px; font-weight: 850; overflow-wrap: anywhere; }
.os-detail-percent, .os-detail-list { display: grid; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.os-detail-percent li, .os-detail-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px; border-radius: 7px; background: #f7f8fa; color: var(--graphite); font-size: 12px; font-weight: 850; }
.os-detail-list li { display: grid; }
.os-detail-list span + span { margin-top: 4px; }
.os-detail-panel > footer { display: flex; justify-content: space-between; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); background: #fbfcfd; }
.os-detail-panel > footer button:disabled { opacity: .45; cursor: not-allowed; }

html.ui-theme-dark .os-card-meta span, html.ui-theme-dark .os-detail-field, html.ui-theme-dark .os-detail-percent li, html.ui-theme-dark .os-detail-list li { background: #101720; color: var(--graphite); }
html.ui-theme-dark .os-detail-panel, html.ui-theme-dark .os-detail-section { background: #151b23; border-color: var(--line); }
html.ui-theme-dark .os-detail-panel > footer { background: #101720; border-color: var(--line); }
html.ui-theme-dark .os-column-toggle.is-locked:hover { background: #151b23; border-color: var(--line); color: var(--graphite); }
html.ui-theme-dark .os-column[data-color="azul"] header span { color: #93c5fd; }
html.ui-theme-dark .os-column[data-color="laranja"] header span { color: #fdba74; }
html.ui-theme-dark .os-column[data-color="verde"] header span { color: #86efac; }
html.ui-theme-dark .os-column[data-color="preto"] header span { color: #d1d5db; }

@media (max-width: 760px) {
  .os-kanban { grid-auto-columns: min(76vw, 260px); padding-bottom: 14px; }
  .os-column { max-height: none; }
  .os-detail-backdrop { place-items: stretch; }
  .os-detail-panel { width: 100%; height: 100dvh; border-left: 0; }
  .os-detail-grid { grid-template-columns: 1fr; }
}

/* Oficina Kanban Pro - 2026-05-19 */
body.is-authenticated main:has(#os-kanban) {
  width: min(1880px, calc(100% - clamp(12px, 2vw, 28px)));
}
body.is-authenticated main:has(#os-kanban) .hero-panel {
  padding: 14px 18px;
  margin-bottom: 12px;
}
body.is-authenticated main:has(#os-kanban) .hero-panel h1 {
  font-size: clamp(22px, 2vw, 32px);
}
body.is-authenticated main:has(#os-kanban) .hero-panel p:not(.eyebrow) {
  max-width: 820px;
  font-size: 13px;
}
body.is-authenticated main:has(#os-kanban) .metrics {
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 8px;
  margin: 10px 0;
}
body.is-authenticated main:has(#os-kanban) .metric {
  padding: 9px 10px;
  border-radius: 8px;
}
body.is-authenticated main:has(#os-kanban) .metric strong {
  font-size: 18px;
}
body.is-authenticated main:has(#os-kanban) .metric span {
  font-size: 10px;
}
body.is-authenticated main:has(#os-kanban) .os-insights {
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 8px;
  margin: 8px 0 12px;
}
body.is-authenticated main:has(#os-kanban) .os-insight-card {
  padding: 9px;
  border-radius: 8px;
}
body.is-authenticated main:has(#os-kanban) .os-insight-card h3 {
  font-size: 11px;
}
body.is-authenticated main:has(#os-kanban) .os-insight-card li,
body.is-authenticated main:has(#os-kanban) .os-insight-card p {
  font-size: 10px;
}
.os-kanban {
  grid-auto-columns: clamp(190px, 10.8vw, 230px);
  gap: 10px;
  padding: 26px 4px 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.42), transparent);
  border-radius: 12px;
}
.os-column {
  position: relative;
  min-height: 460px;
  max-height: none;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(15,23,42,.06);
}
.os-column[data-area-label]::before {
  content: attr(data-area-label);
  position: absolute;
  left: 2px;
  top: -24px;
  height: 18px;
  padding: 2px 8px;
  border-radius: 999px;
  color: #fff;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.os-column[data-color="azul"] { background: linear-gradient(180deg, rgba(37,99,235,.075), rgba(255,255,255,.9)); }
.os-column[data-color="laranja"] { background: linear-gradient(180deg, rgba(249,115,22,.085), rgba(255,255,255,.92)); }
.os-column[data-color="verde"] { background: linear-gradient(180deg, rgba(22,163,74,.075), rgba(255,255,255,.92)); }
.os-column[data-color="preto"] { background: linear-gradient(180deg, rgba(17,24,39,.075), rgba(255,255,255,.93)); }
.os-column[data-color="azul"][data-area-label]::before { background: #2563eb; }
.os-column[data-color="laranja"][data-area-label]::before { background: #f97316; }
.os-column[data-color="verde"][data-area-label]::before { background: #16a34a; }
.os-column[data-color="preto"][data-area-label]::before { background: #111827; }
.os-column header {
  min-height: 54px;
  padding: 9px 8px;
  margin: -8px -8px 8px;
  border-radius: 8px 8px 0 0;
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(8px);
}
.os-column header h2 {
  font-size: 11px;
  line-height: 1.18;
  font-weight: 950;
}
.os-column header span {
  align-self: start;
  min-width: 26px;
  border-radius: 999px;
  font-size: 10px;
}
.os-column .cards {
  gap: 7px;
  padding: 1px 1px 4px;
}
.os-column .empty {
  margin-top: 2px;
  padding: 12px 8px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.58);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}
.os-card {
  height: 104px;
  min-height: 104px;
  max-height: 104px;
  grid-template-rows: 18px 24px 22px 18px;
  gap: 4px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(15,23,42,.11);
  background: #fff;
  box-shadow: 0 4px 12px rgba(15,23,42,.075);
}
.os-card:hover,
.os-card:focus-visible {
  border-color: rgba(226,49,47,.45);
  box-shadow: 0 10px 26px rgba(15,23,42,.14);
}
.os-card .ticket {
  padding: 0;
  background: transparent;
  color: var(--black);
  font-size: 11px;
  font-weight: 1000;
}
.os-card .card-top .amount {
  padding: 2px 0 2px 5px;
  background: transparent;
  color: var(--red);
  font-size: 10px;
  font-weight: 1000;
}
.os-card h3 {
  color: var(--black);
  font-size: 12px;
  line-height: 1.18;
  font-weight: 950;
}
.os-card .equipment {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 850;
}
.os-card-meta span {
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}
.os-card-meta .delivery {
  text-align: right;
}
.os-column[data-color="azul"] .os-card { border-left: 3px solid #2563eb; }
.os-column[data-color="laranja"] .os-card { border-left: 3px solid #f97316; }
.os-column[data-color="verde"] .os-card { border-left: 3px solid #16a34a; }
.os-column[data-color="preto"] .os-card { border-left: 3px solid #111827; }

.os-detail-panel {
  width: min(640px, 100%);
}
.os-detail-body {
  display: grid;
  gap: 10px;
  padding: 16px;
}
.os-detail-section {
  margin-bottom: 0;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(15,23,42,.05);
}

html.ui-theme-dark .os-column[data-color="azul"] { background: linear-gradient(180deg, rgba(37,99,235,.14), #111820); }
html.ui-theme-dark .os-column[data-color="laranja"] { background: linear-gradient(180deg, rgba(249,115,22,.14), #111820); }
html.ui-theme-dark .os-column[data-color="verde"] { background: linear-gradient(180deg, rgba(22,163,74,.13), #111820); }
html.ui-theme-dark .os-column[data-color="preto"] { background: linear-gradient(180deg, rgba(255,255,255,.075), #111820); }
html.ui-theme-dark .os-column header,
html.ui-theme-dark .os-card,
html.ui-theme-dark .os-column .empty {
  background: rgba(21,27,35,.82);
}
html.ui-theme-dark .os-card .ticket,
html.ui-theme-dark .os-card h3 {
  color: var(--black);
}
html.ui-theme-dark .os-card .card-top .amount { color: #ff8585; }
html.ui-theme-dark .os-card-meta span { background: transparent; color: var(--muted); }

@media (max-width: 980px) {
  body.is-authenticated main:has(#os-kanban) .metrics,
  body.is-authenticated main:has(#os-kanban) .os-insights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .os-kanban { grid-auto-columns: min(78vw, 260px); }
}

/* Oficina O.S. modal central - 2026-05-19 */
.os-detail-backdrop {
  place-items: center;
  padding: clamp(12px, 2vw, 24px);
}
.os-detail-panel {
  width: min(980px, 100%);
  height: min(86vh, 820px);
  border-left: 0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 28px 90px rgba(15,23,42,.34);
}
.os-detail-panel > header {
  padding: 18px 20px;
}
.os-detail-body {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
}
.os-detail-section {
  min-width: 0;
}
.os-detail-section:nth-child(2),
.os-detail-section:nth-child(3),
.os-detail-section:has(.os-detail-list) {
  grid-column: 1 / -1;
}
.os-detail-list li {
  gap: 4px;
}
.os-detail-list li strong {
  color: var(--black);
  font-size: 13px;
}
.os-detail-list li small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}
.os-detail-list li span {
  color: var(--graphite);
  font-size: 12px;
  font-weight: 900;
}
@media (max-width: 760px) {
  .os-detail-backdrop {
    place-items: stretch;
    padding: 0;
  }
  .os-detail-panel {
    width: 100%;
    height: 100dvh;
    border-radius: 0;
  }
  .os-detail-body {
    grid-template-columns: 1fr;
  }
}

/* Oficina dark polish - 2026-05-19 */
html.ui-theme-dark body.is-authenticated main:has(#os-kanban) .hero-panel,
html.ui-theme-dark body.is-authenticated main:has(#os-kanban) .source-box,
html.ui-theme-dark body.is-authenticated main:has(#os-kanban) .toolbar,
html.ui-theme-dark body.is-authenticated main:has(#os-kanban) .metric,
html.ui-theme-dark body.is-authenticated main:has(#os-kanban) .os-insight-card {
  background: #111820;
  border-color: #263241;
  box-shadow: 0 10px 28px rgba(0,0,0,.22);
}
html.ui-theme-dark body.is-authenticated main:has(#os-kanban) .metric strong,
html.ui-theme-dark body.is-authenticated main:has(#os-kanban) .os-insight-card strong {
  color: #f3f5f7;
}
html.ui-theme-dark body.is-authenticated main:has(#os-kanban) .metric span,
html.ui-theme-dark body.is-authenticated main:has(#os-kanban) .os-insight-card li,
html.ui-theme-dark body.is-authenticated main:has(#os-kanban) .os-insight-card p {
  color: #9aa7b5;
}
html.ui-theme-dark .os-kanban {
  background: linear-gradient(180deg, rgba(17,24,32,.8), rgba(13,18,24,.25));
}
html.ui-theme-dark .os-column {
  border-color: #263241;
  box-shadow: 0 10px 28px rgba(0,0,0,.22);
}
html.ui-theme-dark .os-column[data-color="azul"] { background: linear-gradient(180deg, rgba(37,99,235,.16), #101720); }
html.ui-theme-dark .os-column[data-color="laranja"] { background: linear-gradient(180deg, rgba(249,115,22,.17), #101720); }
html.ui-theme-dark .os-column[data-color="verde"] { background: linear-gradient(180deg, rgba(22,163,74,.15), #101720); }
html.ui-theme-dark .os-column[data-color="preto"] { background: linear-gradient(180deg, rgba(148,163,184,.12), #101720); }
html.ui-theme-dark .os-column header {
  background: rgba(16,23,32,.9);
  border-color: #2b3747;
}
html.ui-theme-dark .os-column header h2 {
  color: #eef2f6;
}
html.ui-theme-dark .os-column .empty {
  background: rgba(15,23,32,.72);
  border-color: #2b3747;
  color: #9aa7b5;
}
html.ui-theme-dark .os-card {
  background: #151d27;
  border-color: #2b3747;
  box-shadow: 0 8px 20px rgba(0,0,0,.24);
}
html.ui-theme-dark .os-card:hover,
html.ui-theme-dark .os-card:focus-visible {
  border-color: rgba(244,196,49,.5);
  box-shadow: 0 12px 30px rgba(0,0,0,.34);
}
html.ui-theme-dark .os-card .ticket,
html.ui-theme-dark .os-card h3 {
  color: #f3f5f7;
}
html.ui-theme-dark .os-card .equipment,
html.ui-theme-dark .os-card-meta span {
  color: #9aa7b5;
}
html.ui-theme-dark .os-card .card-top .amount {
  color: #ff9b9b;
}
html.ui-theme-dark .os-detail-backdrop {
  background: rgba(3,7,12,.72);
}
html.ui-theme-dark .os-detail-panel {
  background: #101720;
  border: 1px solid #2b3747;
  box-shadow: 0 28px 90px rgba(0,0,0,.58);
}
html.ui-theme-dark .os-detail-panel > header {
  background: linear-gradient(135deg, #070b10, #17202b);
  border-color: #2b3747;
}
html.ui-theme-dark .os-detail-section {
  background: #151d27;
  border-color: #2b3747;
  box-shadow: 0 8px 22px rgba(0,0,0,.2);
}
html.ui-theme-dark .os-detail-section h3,
html.ui-theme-dark .os-detail-field dd,
html.ui-theme-dark .os-detail-list li strong {
  color: #f3f5f7;
}
html.ui-theme-dark .os-detail-section p,
html.ui-theme-dark .os-detail-field dt,
html.ui-theme-dark .os-detail-list li small {
  color: #9aa7b5;
}
html.ui-theme-dark .os-detail-section p strong,
html.ui-theme-dark .os-detail-list li span {
  color: #c8d1dc;
}
html.ui-theme-dark .os-detail-field,
html.ui-theme-dark .os-detail-percent li,
html.ui-theme-dark .os-detail-list li {
  background: #101720;
  border: 1px solid #263241;
}
html.ui-theme-dark .os-detail-panel > footer {
  background: #101720;
  border-color: #2b3747;
}
html.ui-theme-dark .os-column-toggle small {
  color: #9aa7b5;
}

/* Dark buttons polish - 2026-05-19 */
html.ui-theme-dark .toolbar button,
html.ui-theme-dark .fleet-toolbar button,
html.ui-theme-dark .contracts-toolbar button,
html.ui-theme-dark .finance-period-tools button,
html.ui-theme-dark .settings-modal button,
html.ui-theme-dark .os-detail-panel button,
html.ui-theme-dark .show-more,
html.ui-theme-dark .active-filters button,
html.ui-theme-dark .analytics-filters button,
html.ui-theme-dark .finance-period-tools .secondary {
  background: #1b2633;
  color: #eef2f6;
  border: 1px solid #334155;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
html.ui-theme-dark .toolbar button:not(.secondary),
html.ui-theme-dark .fleet-toolbar button:not(.secondary),
html.ui-theme-dark .contracts-toolbar button:not(.secondary),
html.ui-theme-dark .finance-period-tools button:not(.secondary) {
  background: linear-gradient(180deg, #263241, #17202b);
  color: #f8fafc;
  border-color: #3b4859;
}
html.ui-theme-dark .toolbar .secondary,
html.ui-theme-dark .settings-modal .secondary,
html.ui-theme-dark .os-detail-panel .secondary,
html.ui-theme-dark .show-more,
html.ui-theme-dark .active-filters button,
html.ui-theme-dark .analytics-filters button:not(.is-active) {
  background: #111820;
  color: #c8d1dc;
  border-color: #334155;
}
html.ui-theme-dark .toolbar button:hover,
html.ui-theme-dark .fleet-toolbar button:hover,
html.ui-theme-dark .contracts-toolbar button:hover,
html.ui-theme-dark .finance-period-tools button:hover,
html.ui-theme-dark .settings-modal button:hover,
html.ui-theme-dark .os-detail-panel button:hover,
html.ui-theme-dark .show-more:hover,
html.ui-theme-dark .active-filters button:hover,
html.ui-theme-dark .analytics-filters button:hover {
  background: rgba(226,49,47,.18);
  border-color: rgba(226,49,47,.55);
  color: #fff;
}
html.ui-theme-dark .toolbar button:focus-visible,
html.ui-theme-dark .fleet-toolbar button:focus-visible,
html.ui-theme-dark .contracts-toolbar button:focus-visible,
html.ui-theme-dark .finance-period-tools button:focus-visible,
html.ui-theme-dark .settings-modal button:focus-visible,
html.ui-theme-dark .os-detail-panel button:focus-visible {
  outline: 2px solid #f4c431;
  outline-offset: 2px;
}
html.ui-theme-dark .os-detail-panel button:disabled,
html.ui-theme-dark .toolbar button:disabled {
  background: #111820;
  color: #64748b;
  border-color: #263241;
  box-shadow: none;
}

/* Frota própria: galeria de fotos por imobilizado - 2026-05-25 */
.fleet-photo-panel {
  margin: 12px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}
.fleet-photo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.fleet-photo-header strong { color: var(--black); }
.fleet-photo-button {
  width: auto;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--black);
  color: #fff;
  padding: 0 10px;
  font: inherit;
  font-size: 11px;
  font-weight: 1000;
  cursor: pointer;
}
.fleet-photo-button:hover { background: var(--red); border-color: var(--red); }
.fleet-photo-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 8px;
}
.fleet-photo-thumb {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--graphite);
  font-size: 10px;
  font-weight: 900;
}
.fleet-photo-thumb img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}
.fleet-photo-thumb span,
.fleet-photo-more {
  display: block;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.status-pill.com-foto { background: var(--green); color: #fff; }
.status-pill.sem-foto { background: var(--red); color: #fff; }
.fleet-photo-dialog {
  width: min(520px, calc(100vw - 24px));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0;
  background: var(--white);
  color: var(--graphite);
  box-shadow: var(--shadow);
}
.fleet-photo-dialog::backdrop { background: rgba(17,17,17,.45); }
.fleet-photo-dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}
.fleet-photo-dialog-head h2 {
  margin: 2px 0 0;
  color: var(--black);
  font-size: 20px;
}
.fleet-photo-dialog-head button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f3f5f7;
  color: var(--black);
  font-size: 20px;
  cursor: pointer;
}
.fleet-photo-form {
  display: grid;
  gap: 12px;
  padding: 16px;
}
.fleet-photo-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 1000;
  text-transform: uppercase;
}
.fleet-photo-form textarea {
  min-height: 84px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  font: inherit;
}
.fleet-photo-form button[type="submit"] {
  min-height: 42px;
  border: 1px solid var(--black);
  border-radius: 10px;
  background: var(--black);
  color: #fff;
  font: inherit;
  font-weight: 1000;
  cursor: pointer;
}
.fleet-photo-form button[type="submit"]:hover { background: var(--red); border-color: var(--red); }
.fleet-photo-form button:disabled { opacity: .65; cursor: wait; }
.fleet-photo-feedback {
  min-height: 20px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.fleet-photo-feedback.is-success { color: var(--green); }
.fleet-photo-feedback.is-error { color: var(--red); }

/* Frota própria: integração financeira de locações - 2026-05-25 */
.fleet-rental-panel .section-title-row {
  gap: 12px;
}
.fleet-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}
.fleet-action-card {
  text-align: left;
  min-height: 88px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--muted);
  border-radius: 12px;
  background: #fbfcfd;
  padding: 12px;
  cursor: pointer;
  font: inherit;
  box-shadow: var(--soft-shadow);
  display: grid;
  gap: 6px;
}
.fleet-action-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--soft-shadow-hover);
}
.fleet-action-number {
  display: block;
  color: var(--black);
  font-size: 26px;
  font-weight: 1000;
  line-height: 1;
}
.fleet-action-title {
  display: block;
  color: var(--black);
  font-size: 12px;
  font-weight: 1000;
  text-transform: uppercase;
}
.fleet-action-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
}
.fleet-action-card em {
  display: inline-flex;
  width: fit-content;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(17,17,17,.07);
  color: var(--graphite);
  font-size: 10px;
  font-style: normal;
  font-weight: 1000;
  text-transform: uppercase;
}
.fleet-action-card.high { border-left-color: var(--red); background: #fffafa; }
.fleet-action-card.medium { border-left-color: #d97706; background: #fffbeb; }
.fleet-action-card.ok { border-left-color: var(--green); background: #f0fdf4; }
.fleet-machine-card {
  border-left: 5px solid var(--line);
}
.fleet-machine-card.alta,
.fleet-machine-card.vencida { border-left-color: var(--red); }
.fleet-machine-card.media,
.fleet-machine-card.m-dia,
.fleet-machine-card.proxima,
.fleet-machine-card.pr-xima { border-left-color: #d97706; }
.fleet-machine-card.cadastro,
.fleet-machine-card.baixa { border-left-color: #64748b; }
.fleet-machine-card.ok { border-left-color: var(--green); }
.fleet-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}
.fleet-identity {
  min-width: 0;
  display: grid;
  gap: 5px;
}
.fleet-identity h3 {
  margin: 0;
  overflow-wrap: anywhere;
}
.fleet-identity p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.fleet-card-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  max-width: 240px;
}
.fleet-alert-line {
  margin: 10px 0 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--graphite);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.35;
}
.fleet-alert-line.alta,
.fleet-alert-line.vencida {
  border-color: #fecaca;
  background: #fff5f5;
  color: var(--red-dark);
}
.fleet-alert-line.media,
.fleet-alert-line.m-dia,
.fleet-alert-line.proxima,
.fleet-alert-line.pr-xima {
  border-color: #fed7aa;
  background: #fffbeb;
  color: #92400e;
}
.fleet-alert-line.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}
.fleet-fact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}
.fleet-fact {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfd;
}
.fleet-fact span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 1000;
  text-transform: uppercase;
}
.fleet-fact strong {
  display: block;
  color: var(--black);
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.fleet-fact.attention,
.fleet-fact.warning {
  border-color: #fed7aa;
  background: #fffbeb;
}
.fleet-fact.danger {
  border-color: #fecaca;
  background: #fff5f5;
}
.fleet-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 10px;
}
.fleet-photo-button.secondary {
  background: #fff;
  color: var(--graphite);
  border-color: var(--line);
}
.fleet-photo-button.secondary:hover {
  background: var(--black);
  color: #fff;
  border-color: var(--black);
}
.fleet-card-section {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.fleet-card-section > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fbfcfd;
  color: var(--graphite);
  cursor: pointer;
  font-size: 11px;
  font-weight: 1000;
}
.fleet-card-section > summary::-webkit-details-marker { display: none; }
.fleet-card-section[open] > summary {
  margin-bottom: 8px;
  border-color: var(--red);
  background: #fff5f5;
  color: var(--red);
}
.fleet-edit-dialog {
  width: min(760px, calc(100vw - 28px));
}
.fleet-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.contracts-metrics.compact {
  margin: 8px 0 14px;
}
.contracts-metrics.compact .contract-metric strong {
  font-size: clamp(18px, 2vw, 25px);
}
.fleet-rental-metric {
  appearance: none;
  width: 100%;
  border: 1px solid var(--line);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.fleet-rental-metric:focus-visible {
  outline: 3px solid rgba(197, 32, 39, .24);
  outline-offset: 2px;
}
.fleet-rental-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  gap: 12px;
}
.fleet-rental-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.fleet-rental-row:last-child {
  border-bottom: 0;
}
.fleet-rental-row strong {
  display: block;
  color: var(--black);
  overflow-wrap: anywhere;
}
.fleet-rental-row p {
  margin: 4px 0;
  color: var(--graphite);
}
.fleet-rental-row small {
  display: block;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.fleet-rental-row > span {
  min-width: 64px;
  text-align: center;
  border-radius: 999px;
  padding: 5px 8px;
  color: #fff;
  font-size: 10px;
  font-weight: 1000;
  text-transform: uppercase;
}
.fleet-rental-row.alta > span { background: var(--red); }
.fleet-rental-row.media > span,
.fleet-rental-row.cadastro > span { background: #b7791f; }
.fleet-rental-row.ok > span { background: var(--green); }
.fleet-rental-warnings {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.fleet-company-mini {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.fleet-company-mini > div {
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}
.fleet-company-mini strong {
  color: var(--black);
}
.fleet-company-mini small {
  color: var(--muted);
  font-weight: 800;
}
.fleet-rental-detail-dialog {
  width: min(980px, calc(100vw - 24px));
}
.fleet-photo-dialog-head small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}
.fleet-rental-detail-body {
  display: grid;
  gap: 0;
  max-height: min(68vh, 720px);
  overflow: auto;
  padding: 0 16px 16px;
}
.fleet-rental-detail-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.fleet-rental-detail-row:last-child {
  border-bottom: 0;
}
.fleet-rental-detail-row strong {
  display: block;
  color: var(--black);
  overflow-wrap: anywhere;
}
.fleet-rental-detail-row p {
  margin: 4px 0;
  color: var(--graphite);
}
.fleet-rental-detail-row small {
  display: block;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.fleet-rental-detail-row > span {
  min-width: 76px;
  text-align: center;
  border-radius: 999px;
  padding: 5px 8px;
  color: #fff;
  font-size: 10px;
  font-weight: 1000;
  text-transform: uppercase;
}
.fleet-rental-detail-row.alta > span { background: var(--red); }
.fleet-rental-detail-row.media > span,
.fleet-rental-detail-row.cadastro > span { background: #b7791f; }
.fleet-rental-detail-row.ok > span { background: var(--green); }
html.ui-theme-dark .fleet-rental-row strong {
  color: #f3f5f7;
}
html.ui-theme-dark .fleet-rental-row p {
  color: #d8dee8;
}
html.ui-theme-dark .fleet-rental-detail-row strong {
  color: #f3f5f7;
}
html.ui-theme-dark .fleet-rental-detail-row p {
  color: #d8dee8;
}
html.ui-theme-dark .fleet-company-mini > div {
  background: #101720;
  border-color: #2b3747;
}
html.ui-theme-dark .fleet-company-mini strong {
  color: #f3f5f7;
}
html.ui-theme-dark .fleet-action-card,
html.ui-theme-dark .fleet-photo-button.secondary,
html.ui-theme-dark .fleet-alert-line,
html.ui-theme-dark .fleet-fact,
html.ui-theme-dark .fleet-card-section > summary {
  background: #151b23;
  border-color: var(--line);
  color: #d7dce2;
}
html.ui-theme-dark .fleet-action-number,
html.ui-theme-dark .fleet-action-title,
html.ui-theme-dark .fleet-fact strong,
html.ui-theme-dark .fleet-identity h3 {
  color: #f3f5f7;
}
html.ui-theme-dark .fleet-action-card small,
html.ui-theme-dark .fleet-identity p,
html.ui-theme-dark .fleet-fact span {
  color: #aeb8c4;
}
html.ui-theme-dark .fleet-action-card em {
  background: #253040;
  color: #d7dce2;
}
html.ui-theme-dark .fleet-action-card.high,
html.ui-theme-dark .fleet-alert-line.alta,
html.ui-theme-dark .fleet-alert-line.vencida,
html.ui-theme-dark .fleet-fact.danger {
  background: rgba(226,49,47,.12);
  border-color: rgba(226,49,47,.36);
  color: #ff8585;
}
html.ui-theme-dark .fleet-action-card.medium,
html.ui-theme-dark .fleet-alert-line.media,
html.ui-theme-dark .fleet-alert-line.m-dia,
html.ui-theme-dark .fleet-alert-line.proxima,
html.ui-theme-dark .fleet-alert-line.pr-xima,
html.ui-theme-dark .fleet-fact.attention,
html.ui-theme-dark .fleet-fact.warning {
  background: rgba(217,119,6,.12);
  border-color: rgba(217,119,6,.36);
  color: #f8d76a;
}
html.ui-theme-dark .fleet-action-card.ok,
html.ui-theme-dark .fleet-alert-line.ok {
  background: rgba(31,157,85,.14);
  border-color: rgba(31,157,85,.38);
  color: #7ee2a8;
}
@media (max-width: 900px) {
  .fleet-rental-columns {
    grid-template-columns: 1fr;
  }
  .fleet-fact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
html.ui-theme-dark .fleet-photo-panel,
html.ui-theme-dark .fleet-photo-dialog,
html.ui-theme-dark .fleet-photo-dialog-head,
html.ui-theme-dark .fleet-photo-thumb img {
  background: #101720;
  border-color: #2b3747;
}
html.ui-theme-dark .fleet-photo-header strong,
html.ui-theme-dark .fleet-photo-dialog-head h2 { color: #f3f5f7; }
html.ui-theme-dark .fleet-photo-dialog-head button {
  background: #1b2633;
  border-color: #334155;
  color: #eef2f6;
}
html.ui-theme-dark .fleet-photo-form textarea {
  background: #111820;
  color: #eef2f6;
  border-color: #334155;
}

@media (max-width: 620px) {
  .fleet-card-head {
    grid-template-columns: 1fr;
  }
  .fleet-card-status {
    justify-content: flex-start;
    max-width: none;
  }
  .fleet-fact-grid {
    grid-template-columns: 1fr;
  }
  .fleet-photo-header { display: grid; align-items: start; }
  .fleet-photo-button { width: 100%; }
  .fleet-photo-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fleet-edit-grid { grid-template-columns: 1fr; }
}

/* Financeiro dark polish - 2026-05-21 */
html.ui-theme-dark .finance-command-bar,
html.ui-theme-dark .finance-advanced-filters,
html.ui-theme-dark .finance-period-tools,
html.ui-theme-dark .finance-result-summary > div,
html.ui-theme-dark .finance-area-card,
html.ui-theme-dark .finance-forecast-breakdown button,
html.ui-theme-dark .finance-forecast-progress,
html.ui-theme-dark .finance-alert-card,
html.ui-theme-dark .finance-sector-alert,
html.ui-theme-dark .finance-sector-card,
html.ui-theme-dark .finance-store-toggle,
html.ui-theme-dark .finance-settings-panel,
html.ui-theme-dark .finance-setting-toggle,
html.ui-theme-dark .finance-plan-sector-map,
html.ui-theme-dark .finance-sector-note {
  background: #151b23;
  color: var(--graphite);
  border-color: var(--line);
  box-shadow: 0 10px 28px rgba(0,0,0,.22);
}
html.ui-theme-dark .finance-main-grid .analytics-panel,
html.ui-theme-dark .finance-actions-grid .chart-card,
html.ui-theme-dark .history-panel:has(.finance-table),
html.ui-theme-dark .finance-decision-cards .metric {
  background: #151b23;
  border-color: #263241;
  box-shadow: 0 10px 28px rgba(0,0,0,.22);
}
html.ui-theme-dark .finance-command-bar {
  background: #111820;
}
html.ui-theme-dark .finance-command-bar > button,
html.ui-theme-dark .finance-command-period button,
html.ui-theme-dark .finance-store-toggle button,
html.ui-theme-dark .finance-toolbar > .secondary,
html.ui-theme-dark .finance-advanced-filters button,
html.ui-theme-dark .finance-settings-panel footer button,
html.ui-theme-dark .finance-icon-button {
  background: #1b2633;
  color: #eef2f6;
  border-color: #334155;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
html.ui-theme-dark .finance-command-bar > button:not(.secondary) {
  background: linear-gradient(180deg, #263241, #17202b);
  color: #f8fafc;
  border-color: #3b4859;
}
html.ui-theme-dark .finance-command-bar .secondary,
html.ui-theme-dark .finance-command-period button:not(.is-active),
html.ui-theme-dark .finance-store-toggle button:not(.is-active),
html.ui-theme-dark .finance-advanced-filters .secondary,
html.ui-theme-dark .finance-settings-panel footer .secondary {
  background: #111820;
  color: #c8d1dc;
  border-color: #334155;
}
html.ui-theme-dark .finance-command-bar > button:hover,
html.ui-theme-dark .finance-command-period button:hover,
html.ui-theme-dark .finance-store-toggle button:hover {
  background: rgba(226,49,47,.18);
  border-color: rgba(226,49,47,.55);
  color: #fff;
}
html.ui-theme-dark .finance-command-period button.is-active,
html.ui-theme-dark .finance-store-toggle button.is-active {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
html.ui-theme-dark .finance-metric.is-active {
  background: rgba(226,49,47,.14);
  border-color: rgba(226,49,47,.5);
}
html.ui-theme-dark .finance-metric.is-revenue,
html.ui-theme-dark .finance-forecast-breakdown .is-revenue,
html.ui-theme-dark .finance-forecast-breakdown .is-positive,
html.ui-theme-dark .finance-sector-card.is-positive {
  border-color: rgba(31,157,85,.42);
  background: rgba(31,157,85,.08);
}
html.ui-theme-dark .finance-metric.is-expense,
html.ui-theme-dark .finance-metric.is-negative,
html.ui-theme-dark .finance-forecast-breakdown .is-expense,
html.ui-theme-dark .finance-forecast-breakdown .is-negative,
html.ui-theme-dark .finance-sector-card.is-negative {
  border-color: rgba(226,49,47,.42);
  background: rgba(226,49,47,.1);
}
html.ui-theme-dark .finance-result-summary strong,
html.ui-theme-dark .finance-area-card header strong,
html.ui-theme-dark .finance-area-card dd,
html.ui-theme-dark .finance-bar-head strong,
html.ui-theme-dark .finance-bar-line b,
html.ui-theme-dark .finance-period-tools strong,
html.ui-theme-dark .finance-forecast-breakdown strong,
html.ui-theme-dark .finance-alert-card strong,
html.ui-theme-dark .finance-sector-card header strong,
html.ui-theme-dark .finance-sector-card dd,
html.ui-theme-dark .finance-settings-panel h2,
html.ui-theme-dark .finance-settings-section h3,
html.ui-theme-dark .finance-priority-row strong,
html.ui-theme-dark .finance-quality-row strong,
html.ui-theme-dark .finance-decision-cards .metric strong {
  color: #f3f5f7;
}
html.ui-theme-dark .finance-sector-card dd.is-positive,
html.ui-theme-dark .finance-sector-card dd.is-revenue,
html.ui-theme-dark .finance-forecast-breakdown .is-revenue strong,
html.ui-theme-dark .finance-forecast-breakdown .is-positive strong,
html.ui-theme-dark .finance-metric.is-revenue strong,
html.ui-theme-dark .finance-metric.is-positive strong,
html.ui-theme-dark .finance-cashflow-result.is-positive {
  color: #7ee2a8;
}
html.ui-theme-dark .finance-sector-card dd.is-negative,
html.ui-theme-dark .finance-sector-card dd.is-expense,
html.ui-theme-dark .finance-forecast-breakdown .is-expense strong,
html.ui-theme-dark .finance-forecast-breakdown .is-negative strong,
html.ui-theme-dark .finance-metric.is-expense strong,
html.ui-theme-dark .finance-metric.is-negative strong,
html.ui-theme-dark .finance-cashflow-result.is-negative {
  color: #ff8585;
}
html.ui-theme-dark .finance-command-main > span,
html.ui-theme-dark .finance-command-period > span,
html.ui-theme-dark .finance-result-summary span,
html.ui-theme-dark .finance-area-card dt,
html.ui-theme-dark .finance-area-card header span,
html.ui-theme-dark .finance-bar-head span,
html.ui-theme-dark .finance-bar-line em,
html.ui-theme-dark .finance-bar-group small,
html.ui-theme-dark .finance-chart-legend,
html.ui-theme-dark .finance-period-tools span,
html.ui-theme-dark .finance-forecast-breakdown span,
html.ui-theme-dark .finance-forecast-breakdown button small,
html.ui-theme-dark .finance-forecast-progress small,
html.ui-theme-dark .finance-alert-card span,
html.ui-theme-dark .finance-sector-card header span,
html.ui-theme-dark .finance-sector-card dt,
html.ui-theme-dark .finance-sector-card footer,
html.ui-theme-dark .finance-setting-toggle,
html.ui-theme-dark .finance-allocation-grid label,
html.ui-theme-dark .finance-allocation-total,
html.ui-theme-dark .finance-target-grid label,
html.ui-theme-dark .finance-plan-sector-row small,
html.ui-theme-dark .finance-settings-section small,
html.ui-theme-dark .finance-sector-note,
html.ui-theme-dark .finance-priority-row small,
html.ui-theme-dark .finance-quality-row span,
html.ui-theme-dark .finance-decision-cards .metric span {
  color: #9aa7b5;
}
html.ui-theme-dark .finance-area-card header span {
  background: #253040;
}
html.ui-theme-dark .finance-settings-section textarea {
  background: #111820;
  color: #f3f5f7;
  border-color: #334155;
}
html.ui-theme-dark .finance-plan-sector-row {
  border-color: #263241;
}
html.ui-theme-dark .finance-alert-card.high {
  background: rgba(226,49,47,.12);
  border-color: rgba(226,49,47,.38);
}
html.ui-theme-dark .finance-alert-card.medium {
  background: rgba(217,119,6,.13);
  border-color: rgba(217,119,6,.42);
}
html.ui-theme-dark .finance-alert-card.low {
  background: rgba(37,99,235,.12);
  border-color: rgba(37,99,235,.38);
}
html.ui-theme-dark .finance-alert-card.ok {
  background: rgba(31,157,85,.14);
  border-color: rgba(31,157,85,.38);
}
html.ui-theme-dark .finance-sector-alert.high {
  background: rgba(226,49,47,.12);
  border-color: rgba(226,49,47,.38);
}
html.ui-theme-dark .finance-sector-alert.medium {
  background: rgba(217,119,6,.13);
  border-color: rgba(217,119,6,.42);
}
html.ui-theme-dark .finance-sector-alert.ok {
  background: rgba(31,157,85,.14);
  border-color: rgba(31,157,85,.38);
}
html.ui-theme-dark .finance-sector-card dl,
html.ui-theme-dark .finance-expense-row,
html.ui-theme-dark .finance-priority-row,
html.ui-theme-dark .finance-quality-row,
html.ui-theme-dark .finance-bar-group {
  border-color: #263241;
}
html.ui-theme-dark .finance-forecast-progress > span {
  background: #253040;
}
html.ui-theme-dark .finance-cashflow-svg {
  background: linear-gradient(180deg, #111820, #151b23);
  border-color: #263241;
}
html.ui-theme-dark .finance-cashflow-svg .axis {
  stroke: #334155;
}
html.ui-theme-dark .finance-cashflow-svg .zero-axis {
  stroke: #607086;
}
html.ui-theme-dark .finance-cashflow-svg text {
  fill: #9aa7b5;
}
html.ui-theme-dark .finance-cashflow-svg .cash-axis-label {
  fill: #7ee2a8;
}
html.ui-theme-dark .finance-cashflow-svg .cash-axis-label.loss {
  fill: #ff8585;
}
html.ui-theme-dark .finance-sector-alert strong,
html.ui-theme-dark .finance-expense-row strong {
  color: #f3f5f7;
}
html.ui-theme-dark .finance-sector-alert span,
html.ui-theme-dark .finance-expense-row small {
  color: #9aa7b5;
}
html.ui-theme-dark .finance-expense-row em {
  color: #ff8585;
}
html.ui-theme-dark .finance-expense-bar {
  background: rgba(226,49,47,.16);
}

/* Dark map action buttons - 2026-05-19 */
html.ui-theme-dark .map-actions button {
  background: linear-gradient(180deg, #263241, #17202b);
  color: #f8fafc;
  border: 1px solid #3b4859;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
html.ui-theme-dark .map-actions button:hover,
html.ui-theme-dark .map-actions button:focus-visible {
  background: rgba(226,49,47,.18);
  border-color: rgba(226,49,47,.55);
  color: #fff;
}
html.ui-theme-dark .map-actions button:focus-visible {
  outline: 2px solid #f4c431;
  outline-offset: 2px;
}

.header-actions a.is-active,
.app-menu-panel a.is-active,
html.ui-theme-dark .header-actions a.is-active,
html.ui-theme-dark .app-menu-panel a.is-active {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

.header-actions a.is-active:hover,
.app-menu-panel a.is-active:hover,
html.ui-theme-dark .header-actions a.is-active:hover,
html.ui-theme-dark .app-menu-panel a.is-active:hover {
  background: var(--red-dark);
  color: #fff;
  border-color: var(--red-dark);
  transform: none;
}

/* Padrao global do modo escuro - 2026-06-01 */
html.ui-theme-dark .ticket,
html.ui-theme-dark .status-pill,
html.ui-theme-dark .urgency,
html.ui-theme-dark .timeline-status,
html.ui-theme-dark .filter-chip {
  border: 1px solid #3b4859;
  background: #253040;
  color: #e8edf5;
  box-shadow: none;
}
html.ui-theme-dark .ticket {
  background: #101720;
  color: #f8fafc;
}
html.ui-theme-dark .status-pill.ok,
html.ui-theme-dark .status-pill.em-dia,
html.ui-theme-dark .status-pill.concluida,
html.ui-theme-dark .status-pill.ativo,
html.ui-theme-dark .status-pill.vigente,
html.ui-theme-dark .status-pill.com-foto,
html.ui-theme-dark .urgency.ok,
html.ui-theme-dark .urgency.ativo,
html.ui-theme-dark .urgency.vigente,
html.ui-theme-dark .urgency.concluida,
html.ui-theme-dark .timeline-status.ok,
html.ui-theme-dark .timeline-status.concluida {
  background: rgba(31,157,85,.18);
  border-color: rgba(74,222,128,.38);
  color: #86efac;
}
html.ui-theme-dark .status-pill.vencida,
html.ui-theme-dark .status-pill.vencido,
html.ui-theme-dark .status-pill.alta,
html.ui-theme-dark .status-pill.critica,
html.ui-theme-dark .status-pill.crítica,
html.ui-theme-dark .status-pill[class*="sem-hor"],
html.ui-theme-dark .status-pill[class*="sem-proxima"],
html.ui-theme-dark .status-pill[class*="sem-pr-xima"],
html.ui-theme-dark .urgency.vencida,
html.ui-theme-dark .urgency.vencido,
html.ui-theme-dark .urgency.alta,
html.ui-theme-dark .urgency.critica,
html.ui-theme-dark .urgency.crítica,
html.ui-theme-dark .timeline-status.vencida {
  background: rgba(226,49,47,.2);
  border-color: rgba(248,113,113,.42);
  color: #ffb3b3;
}
html.ui-theme-dark .status-pill.proxima,
html.ui-theme-dark .status-pill.pr-xima,
html.ui-theme-dark .status-pill.media,
html.ui-theme-dark .status-pill.m-dia,
html.ui-theme-dark .status-pill.hoje,
html.ui-theme-dark .status-pill.dias-7,
html.ui-theme-dark .status-pill.dias-15,
html.ui-theme-dark .status-pill.dias-30,
html.ui-theme-dark .status-pill.sem-foto,
html.ui-theme-dark .urgency.proxima,
html.ui-theme-dark .urgency.pr-xima,
html.ui-theme-dark .urgency.media,
html.ui-theme-dark .urgency.m-dia,
html.ui-theme-dark .urgency.hoje,
html.ui-theme-dark .urgency.dias-7,
html.ui-theme-dark .urgency.dias-15,
html.ui-theme-dark .urgency.dias-30,
html.ui-theme-dark .urgency.vence-em-30-dias,
html.ui-theme-dark .urgency.vence-em-90-dias,
html.ui-theme-dark .timeline-status.hoje,
html.ui-theme-dark .timeline-status.dias-7,
html.ui-theme-dark .timeline-status.dias-15,
html.ui-theme-dark .timeline-status.dias-30 {
  background: rgba(217,119,6,.2);
  border-color: rgba(251,191,36,.42);
  color: #fed7aa;
}
html.ui-theme-dark .status-pill.cadastro,
html.ui-theme-dark .status-pill.baixa,
html.ui-theme-dark .status-pill.em-analise,
html.ui-theme-dark .status-pill.em-an-lise,
html.ui-theme-dark .urgency.em-analise,
html.ui-theme-dark .urgency.em-an-lise,
html.ui-theme-dark .urgency.locada,
html.ui-theme-dark .status-pill.locada {
  background: rgba(59,130,246,.18);
  border-color: rgba(96,165,250,.38);
  color: #bfdbfe;
}
html.ui-theme-dark .toolbar button,
html.ui-theme-dark .fleet-toolbar button,
html.ui-theme-dark .contracts-toolbar button,
html.ui-theme-dark .finance-period-tools button,
html.ui-theme-dark .settings-modal button,
html.ui-theme-dark .os-detail-panel button,
html.ui-theme-dark .fleet-photo-button,
html.ui-theme-dark .show-more,
html.ui-theme-dark .active-filters button,
html.ui-theme-dark .analytics-filters button,
html.ui-theme-dark .card-more summary,
html.ui-theme-dark .fleet-card-section > summary,
html.ui-theme-dark .app-menu summary,
html.ui-theme-dark .header-actions a,
html.ui-theme-dark .app-menu-panel a {
  background: #1b2633;
  color: #eef2f6;
  border-color: #334155;
  box-shadow: 0 4px 14px rgba(0,0,0,.16);
}
html.ui-theme-dark .toolbar button:not(.secondary),
html.ui-theme-dark .fleet-toolbar button:not(.secondary),
html.ui-theme-dark .contracts-toolbar button:not(.secondary),
html.ui-theme-dark .fleet-photo-button:not(.secondary),
html.ui-theme-dark .fleet-photo-form button[type="submit"] {
  background: linear-gradient(180deg, #263241, #17202b);
  color: #f8fafc;
  border-color: #3b4859;
}
html.ui-theme-dark .toolbar button:hover,
html.ui-theme-dark .fleet-toolbar button:hover,
html.ui-theme-dark .contracts-toolbar button:hover,
html.ui-theme-dark .finance-period-tools button:hover,
html.ui-theme-dark .settings-modal button:hover,
html.ui-theme-dark .os-detail-panel button:hover,
html.ui-theme-dark .fleet-photo-button:hover,
html.ui-theme-dark .show-more:hover,
html.ui-theme-dark .active-filters button:hover,
html.ui-theme-dark .analytics-filters button:hover,
html.ui-theme-dark .card-more summary:hover,
html.ui-theme-dark .fleet-card-section > summary:hover,
html.ui-theme-dark .app-menu summary:hover,
html.ui-theme-dark .header-actions a:hover,
html.ui-theme-dark .app-menu-panel a:hover {
  background: rgba(226,49,47,.18);
  border-color: rgba(248,113,113,.5);
  color: #fff;
}
html.ui-theme-dark .filter-metric-button:not(.is-active),
html.ui-theme-dark .fleet-metric-button:not(.is-active),
html.ui-theme-dark .contract-metric:not(.is-active),
html.ui-theme-dark .fleet-rental-metric:not(.is-active),
html.ui-theme-dark .metric,
html.ui-theme-dark .kpi-card {
  background: #151b23;
  color: #e8edf5;
  border-color: #334155;
}
html.ui-theme-dark .filter-metric-button:not(.is-active) strong,
html.ui-theme-dark .fleet-metric-button:not(.is-active) strong,
html.ui-theme-dark .contract-metric:not(.is-active) strong,
html.ui-theme-dark .metric strong,
html.ui-theme-dark .kpi-card strong {
  color: #f8fafc;
}
html.ui-theme-dark .filter-metric-button:not(.is-active) span,
html.ui-theme-dark .fleet-metric-button:not(.is-active) span,
html.ui-theme-dark .contract-metric:not(.is-active) span,
html.ui-theme-dark .metric span,
html.ui-theme-dark .kpi-card span {
  color: #aeb8c4;
}
html.ui-theme-dark .filter-metric-button.is-active,
html.ui-theme-dark .fleet-metric-button.is-active,
html.ui-theme-dark .analytics-filters button.is-active,
html.ui-theme-dark .finance-command-period button.is-active,
html.ui-theme-dark .finance-store-toggle button.is-active,
html.ui-theme-dark .header-actions a.is-active,
html.ui-theme-dark .app-menu-panel a.is-active {
  background: linear-gradient(180deg, #ef4444, #aa1e22);
  border-color: #f87171;
  color: #fff;
}
html.ui-theme-dark .filter-metric-button.is-active strong,
html.ui-theme-dark .filter-metric-button.is-active span,
html.ui-theme-dark .fleet-metric-button.is-active strong,
html.ui-theme-dark .fleet-metric-button.is-active span {
  color: #fff;
}

.fleet-audit-list {
  display: grid;
  gap: 8px;
}
.fleet-audit-row {
  display: grid;
  gap: 6px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfd;
}
.fleet-audit-row strong {
  display: block;
  color: var(--black);
  font-size: 12px;
}
.fleet-audit-row small {
  color: var(--muted);
  font-weight: 800;
}
.fleet-audit-changes {
  display: grid;
  gap: 4px;
  color: var(--graphite);
  font-size: 12px;
  line-height: 1.35;
}
.fleet-audit-changes span {
  overflow-wrap: anywhere;
}
html.ui-theme-dark .fleet-audit-row {
  background: #101720;
  border-color: #334155;
}
html.ui-theme-dark .fleet-audit-row strong,
html.ui-theme-dark .fleet-audit-changes {
  color: #e8edf5;
}
html.ui-theme-dark .fleet-audit-row small {
  color: #aeb8c4;
}

/* Oficina: indicadores visuais de risco nas O.S. - 2026-06-01 */
.os-risk-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 10px;
}
.os-risk-filters button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--graphite);
  padding: 0 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
}
.os-risk-filters button strong {
  color: var(--black);
  font-size: 13px;
}
.os-risk-filters button.is-active {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.os-risk-filters button.is-active strong {
  color: #fff;
}
.os-column .cards {
  align-content: start;
  align-items: start;
}
.os-card.has-os-indicators {
  height: 122px;
  min-height: 122px;
  max-height: 122px;
  grid-template-rows: 18px 24px 22px 18px 16px;
  overflow: hidden;
}
.os-card.os-risk-critical {
  border-left-color: var(--red) !important;
  border-left-width: 4px;
  background: #fff8f8;
}
.os-card.os-risk-warning {
  border-left-color: #d97706 !important;
  border-left-width: 4px;
  background: #fffbeb;
}
.os-card.os-risk-info {
  border-left-color: #2563eb !important;
  border-left-width: 4px;
}
.os-card-flags,
.os-detail-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}
.os-card-flags {
  flex-wrap: nowrap;
  align-items: center;
  overflow: hidden;
  min-height: 16px;
}
.os-card-flags span,
.os-detail-flags span {
  min-width: 0;
  max-width: 100%;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f3f5f7;
  color: var(--graphite);
  font-size: 9px;
  font-weight: 1000;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.os-card-flags span {
  flex: 0 1 auto;
  padding: 1px 5px;
  line-height: 14px;
}
.os-card-flags span.critical,
.os-detail-flags span.critical {
  background: #fff1f1;
  border-color: #fecaca;
  color: var(--red-dark);
}
.os-card-flags span.warning,
.os-detail-flags span.warning {
  background: #fffbeb;
  border-color: #fed7aa;
  color: #92400e;
}
.os-card-flags span.info,
.os-detail-flags span.info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}
.os-detail-flags span {
  font-size: 11px;
  padding: 5px 8px;
}
html.ui-theme-dark .os-risk-filters button {
  background: #151b23;
  color: #d7dce2;
  border-color: #334155;
}
html.ui-theme-dark .os-risk-filters button strong {
  color: #f8fafc;
}
html.ui-theme-dark .os-risk-filters button.is-active {
  background: linear-gradient(180deg, #ef4444, #aa1e22);
  border-color: #f87171;
  color: #fff;
}
html.ui-theme-dark .os-card.os-risk-critical {
  background: rgba(226,49,47,.12);
  border-left-color: #f87171 !important;
}
html.ui-theme-dark .os-card.os-risk-warning {
  background: rgba(217,119,6,.12);
  border-left-color: #fbbf24 !important;
}
html.ui-theme-dark .os-card.os-risk-info {
  border-left-color: #60a5fa !important;
}
html.ui-theme-dark .os-card-flags span,
html.ui-theme-dark .os-detail-flags span {
  background: #253040;
  border-color: #3b4859;
  color: #e8edf5;
}
html.ui-theme-dark .os-card-flags span.critical,
html.ui-theme-dark .os-detail-flags span.critical {
  background: rgba(226,49,47,.20);
  border-color: rgba(248,113,113,.42);
  color: #ffb3b3;
}
html.ui-theme-dark .os-card-flags span.warning,
html.ui-theme-dark .os-detail-flags span.warning {
  background: rgba(217,119,6,.20);
  border-color: rgba(251,191,36,.42);
  color: #fed7aa;
}
html.ui-theme-dark .os-card-flags span.info,
html.ui-theme-dark .os-detail-flags span.info {
  background: rgba(59,130,246,.18);
  border-color: rgba(96,165,250,.38);
  color: #bfdbfe;
}

/* Oficina: equilibrio visual dos cards com indicadores - 2026-06-01 */
.os-kanban {
  grid-auto-columns: clamp(246px, 15.1vw, 298px);
  gap: 12px;
}
.os-column {
  padding: 10px;
}
.os-column header {
  min-height: 54px;
  margin: -10px -10px 9px;
  padding: 10px;
}
.os-column header h2 {
  font-size: 11.5px;
  line-height: 1.2;
}
.os-column .cards {
  gap: 9px;
}
.os-card {
  align-self: start;
  height: auto;
  min-height: 134px;
  max-height: none;
  grid-template-rows: auto minmax(31px, auto) minmax(20px, auto) auto;
  gap: 6px;
  padding: 10px;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 5px 14px rgba(15,23,42,.09);
}
.os-card.has-os-indicators {
  height: auto;
  min-height: 158px;
  max-height: none;
  grid-template-rows: auto minmax(31px, auto) minmax(20px, auto) auto auto;
  overflow: visible;
}
.os-card .card-top {
  grid-template-columns: minmax(0, 1fr) minmax(74px, auto);
  gap: 7px;
}
.os-card .ticket {
  font-size: 11.5px;
  line-height: 1.2;
}
.os-card .card-top .amount {
  font-size: 10.5px;
  text-align: right;
}
.os-card h3 {
  font-size: 12.6px;
  line-height: 1.21;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.os-card .equipment {
  font-size: 10.8px;
  line-height: 1.22;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.os-card-meta span {
  font-size: 10.2px;
  line-height: 1.2;
}
.os-card.os-risk-critical,
.os-card.os-risk-warning,
.os-card.os-risk-info {
  background: #fff;
}
.os-card.os-risk-critical {
  box-shadow: inset 4px 0 0 var(--red), 0 5px 14px rgba(15,23,42,.09);
}
.os-card.os-risk-warning {
  box-shadow: inset 4px 0 0 #d97706, 0 5px 14px rgba(15,23,42,.09);
}
.os-card.os-risk-info {
  box-shadow: inset 4px 0 0 #2563eb, 0 5px 14px rgba(15,23,42,.09);
}
.os-card-flags {
  gap: 5px;
  min-height: 22px;
  padding-top: 1px;
}
.os-card-flags span {
  flex: 1 1 0;
  min-height: 21px;
  padding: 2px 6px;
  font-size: 10px;
  line-height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 980px) {
  .os-kanban { grid-auto-columns: min(82vw, 296px); }
}
html.ui-theme-dark .os-card,
html.ui-theme-dark .os-card.os-risk-critical,
html.ui-theme-dark .os-card.os-risk-warning,
html.ui-theme-dark .os-card.os-risk-info {
  background: rgba(21,27,35,.9);
}
html.ui-theme-dark .os-card.os-risk-critical {
  box-shadow: inset 4px 0 0 #f87171, 0 6px 16px rgba(0,0,0,.24);
}
html.ui-theme-dark .os-card.os-risk-warning {
  box-shadow: inset 4px 0 0 #fbbf24, 0 6px 16px rgba(0,0,0,.24);
}
html.ui-theme-dark .os-card.os-risk-info {
  box-shadow: inset 4px 0 0 #60a5fa, 0 6px 16px rgba(0,0,0,.24);
}

.app-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #1f2937;
  color: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .22);
  font-size: 14px;
  line-height: 1.35;
}

.app-toast[data-type="success"] {
  background: #166534;
}

.app-toast[data-type="error"] {
  background: #991b1b;
}

.app-toast[hidden] {
  display: none;
}
