/* Redantec Fleet — design system (minimalista / compacto) */
:root {
  --sidebar: #0B1B33;
  --primary: #1769E0;
  --primary-600: #0F57C2;
  --primary-50: #EEF4FD;
  --secondary: #5B35D5;
  --secondary-50: #F2EFFC;
  --accent: #FF8A00;
  --accent-50: #FFF5EA;
  --success: #12B76A;
  --success-50: #EAF8F1;
  --danger: #EF4444;
  --danger-50: #FDEFEF;
  --warning: #F59E0B;
  --warning-50: #FEF7EA;
  --bg: #F5F7FB;
  --card: #FFFFFF;
  --text: #17233C;
  --muted: #667085;
  --line: #E7EAF0;
  --line-2: #F1F3F7;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow-lg: 0 16px 40px rgba(11, 27, 51, .16);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --sidebar-w: 216px;
  --header-h: 56px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; font-weight: 600; }
.icon { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 14px; height: 14px; }
.icon.lg { width: 20px; height: 20px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }
.mono { font-variant-numeric: tabular-nums; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
  background: var(--sidebar); color: #C7D2E5;
  display: flex; flex-direction: column; padding: 16px 10px; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 9px; padding: 2px 8px 18px; color: #fff; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--primary); }
.brand-mark .icon { color: #fff; width: 16px; height: 16px; }
.brand-name { font-weight: 700; font-size: 14px; letter-spacing: -.01em; }
.brand-name span { color: var(--accent); }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-label { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: #5F7090; padding: 14px 10px 4px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px;
  color: #A9B6CD; font-weight: 500; transition: background .12s, color .12s;
}
.nav a:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.nav a.active { background: rgba(255, 255, 255, .09); color: #fff; }
.nav a.active .icon { color: var(--accent); }
.nav a .badge { margin-left: auto; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; padding: 0 6px; border-radius: 99px; line-height: 16px; }
.sidebar-foot { margin-top: auto; padding: 10px; font-size: 11px; color: #5F7090; }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--header-h); display: flex; align-items: center; gap: 12px; padding: 0 24px;
  background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.topbar .mobile-brand { display: none; }
.search { position: relative; flex: 1; max-width: 380px; }
.search input {
  width: 100%; height: 34px; padding: 0 12px 0 34px; border-radius: 8px;
  border: 1px solid transparent; background: var(--bg); outline: none; transition: border-color .12s, background .12s;
}
.search input:focus { border-color: var(--primary); background: #fff; }
.search > .icon { position: absolute; left: 11px; top: 9px; color: var(--muted); }
.search-results {
  position: absolute; top: 40px; left: 0; right: 0; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); border: 1px solid var(--line); padding: 4px; max-height: 340px; overflow: auto;
}
.search-results a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 7px; color: var(--text); }
.search-results a:hover { background: var(--bg); }
.search-results .muted { font-size: 11px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent;
  display: grid; place-items: center; cursor: pointer; color: var(--muted); position: relative;
}
.icon-btn:hover { background: var(--bg); color: var(--text); }
.icon-btn .dot { position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; line-height: 12px; text-align: center; border: 2px solid var(--card); }
.notif-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.notif-all { margin-left: auto; border: 0; background: none; color: var(--primary); font-weight: 600; font-size: 12px; cursor: pointer; padding: 2px 4px; border-radius: 6px; }
.notif-all:hover { background: var(--primary-50); }
.dropdown .notif { align-items: flex-start; border-radius: 8px; }
.dropdown .notif:hover { background: var(--bg); }
.dropdown .notif .grow { flex: 1; min-width: 0; }
.dropdown .notif.is-read { opacity: .55; }
.notif-act { border: 1px solid var(--line); background: var(--card); color: var(--muted); width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; cursor: pointer; flex: none; }
.notif-act:hover { color: var(--success); border-color: var(--success); }
.notif-sep { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 10px 4px; border-top: 1px solid var(--line-2); margin-top: 4px; }
.dropdown { max-height: 70vh; overflow: auto; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 3px 8px 3px 3px; border-radius: 8px; cursor: pointer; border: 0; background: none; }
.user-chip:hover { background: var(--bg); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--primary-50); color: var(--primary); font-weight: 600; font-size: 11px;
}
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.user-chip .meta { text-align: left; line-height: 1.2; }
.user-chip .meta strong { display: block; font-size: 12px; font-weight: 600; }
.user-chip .meta small { color: var(--muted); font-size: 11px; }

.dropdown {
  position: absolute; right: 0; top: 42px; min-width: 240px; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); border: 1px solid var(--line); padding: 4px; z-index: 60;
}
.dropdown a, .dropdown button.item {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border-radius: 7px;
  color: var(--text); background: none; border: 0; cursor: pointer; text-align: left;
}
.dropdown a:hover, .dropdown button.item:hover { background: var(--bg); }
.dropdown .head { padding: 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.dropdown .notif { display: flex; gap: 8px; padding: 8px 10px; font-size: 12px; }
.dropdown .notif .icon { margin-top: 1px; }

.content { padding: 4px 24px 32px; flex: 1; width: 100%; max-width: 1360px; }
.page-head { display: flex; align-items: center; gap: 12px; margin: 18px 0 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 18px; }
.page-head p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; margin-top: 14px; }
.back-link:hover { color: var(--primary); }

.bottom-nav { display: none; }

/* ---------- Cards / grid ---------- */
.card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); min-width: 0; }
.card-pad { padding: 16px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 0; }
.card-head h3 { font-size: 13px; }
.card-head .sub { color: var(--muted); font-size: 11px; }
.card-head .actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-body { padding: 12px 16px 16px; }
.grid { display: grid; gap: 14px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.mt { margin-top: 14px; }

.kpi { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.kpi-top { display: flex; align-items: center; gap: 6px; }
.kpi-icon { display: grid; place-items: center; border-radius: 8px; width: 32px; height: 32px; }
.kpi .kpi-icon { width: auto; height: auto; background: none !important; }
.kpi .kpi-icon .icon { width: 14px; height: 14px; }
.kpi-icon.blue { background: var(--primary-50); color: var(--primary); }
.kpi-icon.orange { background: var(--accent-50); color: var(--accent); }
.kpi-icon.green { background: var(--success-50); color: var(--success); }
.kpi-icon.purple { background: var(--secondary-50); color: var(--secondary); }
.kpi-icon.red { background: var(--danger-50); color: var(--danger); }
.kpi-title { color: var(--muted); font-size: 12px; }
.kpi-value { font-size: 20px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi-value small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.kpi-foot { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.trend { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; font-size: 11px; }
.trend.up { color: #0A8F52; }
.trend.down { color: #C42B2B; }
.trend.neutral { color: var(--muted); font-weight: 500; }
.trend .icon { width: 12px; height: 12px; }

/* ---------- Buttons / form ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 12px;
  border-radius: 8px; border: 1px solid transparent; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn .icon { width: 15px; height: 15px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #E87C00; }
.btn-success { background: var(--success); color: #fff; }
.btn-light { background: var(--card); border-color: var(--line); color: var(--text); }
.btn-light:hover { background: var(--bg); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-danger { background: var(--danger-50); color: var(--danger); }
.btn-sm { height: 28px; padding: 0 9px; font-size: 12px; border-radius: 7px; }
.btn-icon { width: 28px; padding: 0; }
.btn-block { width: 100%; }
.btn-lg { height: 42px; font-size: 14px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-weight: 500; font-size: 12px; }
.field label .req { color: var(--danger); }
.field .hint { font-size: 11px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid #D9DEE7; background: #fff;
  outline: none; transition: border-color .12s, box-shadow .12s;
}
textarea.input { height: auto; min-height: 70px; padding: 8px 10px; resize: vertical; }
select.input { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.input-lg { height: 46px; font-size: 18px; font-weight: 600; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }
.form-section { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; grid-column: 1 / -1; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 12px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters .input { width: auto; min-width: 140px; height: 32px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }

.segmented { display: inline-flex; background: var(--line-2); padding: 3px; border-radius: 8px; gap: 2px; flex-wrap: wrap; }
.segmented button { border: 0; background: none; padding: 4px 10px; border-radius: 6px; font-weight: 500; color: var(--muted); cursor: pointer; font-size: 12px; }
.segmented button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(16, 24, 40, .08); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 11px; font-weight: 500; color: var(--muted); padding: 8px 12px;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr:hover td { background: #FAFBFD; }
.table td.actions { text-align: right; white-space: nowrap; width: 1%; }
.table tfoot td { font-weight: 600; border-top: 1px solid var(--line); background: #FAFBFD; }
.cell-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-main strong { display: block; font-weight: 500; }
.cell-main small, .sub-line { color: var(--muted); font-size: 11px; display: block; }
.cell-main .veh-ico, .cell-main > .kpi-icon, .list-row > .kpi-icon { display: none; }
.plate {
  display: inline-block; font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-weight: 600; font-size: 11px;
  letter-spacing: .04em; padding: 0 6px; border-radius: 5px; background: var(--line-2); color: #33415C; line-height: 18px;
}
.veh-ico { width: 32px; height: 32px; border-radius: 8px; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; flex: none; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 99px; font-size: 11px; font-weight: 500; white-space: nowrap; line-height: 18px; }
.pill::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill.green { color: #0A8F52; background: var(--success-50); }
.pill.blue { color: var(--primary); background: var(--primary-50); }
.pill.orange { color: #B86100; background: var(--accent-50); }
.pill.red { color: #C42B2B; background: var(--danger-50); }
.pill.purple { color: var(--secondary); background: var(--secondary-50); }
.pill.gray { color: var(--muted); background: var(--line-2); }

.empty { text-align: center; padding: 32px 16px; color: var(--muted); font-size: 12px; }
.empty .icon { width: 26px; height: 26px; color: #B5BFD0; margin: 0 auto 8px; }
.empty strong { display: block; color: var(--text); margin-bottom: 2px; font-size: 13px; font-weight: 500; }

/* ---------- Dashboard widgets ---------- */
.chart-slot { width: 100%; min-height: 40px; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: var(--font); fill: var(--muted); font-size: 10px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.donut-wrap { display: flex; align-items: center; gap: 20px; }
.donut-wrap svg { width: 120px; flex: none; }
.donut-legend { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.donut-legend div { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.donut-legend i { width: 8px; height: 8px; border-radius: 2px; }
.donut-legend b { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.alert-list { display: flex; flex-direction: column; gap: 6px; }
.alert-item { display: flex; gap: 8px; padding: 8px 10px; border-radius: 8px; font-size: 12px; align-items: flex-start; }
.alert-item.warning { background: var(--warning-50); color: #8A5A06; }
.alert-item.danger { background: var(--danger-50); color: #A32020; }
.alert-item.info { background: var(--primary-50); color: #0F4FA8; }
.alert-item .icon { width: 14px; height: 14px; margin-top: 1px; }
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row strong { display: block; font-weight: 500; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row small { color: var(--muted); font-size: 11px; }

/* ---------- Check-in ---------- */
.stepper { display: flex; gap: 6px; margin-bottom: 14px; }
.stepper .step { flex: 1; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); color: var(--muted); font-weight: 500; font-size: 12px; min-width: 0; }
.stepper .step .label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stepper .step .n { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--line-2); font-size: 11px; flex: none; }
.stepper .step.on { border-color: var(--primary); color: var(--text); }
.stepper .step.on .n { background: var(--primary); color: #fff; }
.stepper .step.done .n { background: var(--success); color: #fff; }
.stepper .step .n .icon { width: 12px; height: 12px; }
.vehicle-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.vehicle-opt {
  text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 10px 12px; cursor: pointer;
  display: flex; flex-direction: column; gap: 4px; transition: border-color .12s, box-shadow .12s;
}
.vehicle-opt:hover { border-color: #B9C7DE; }
.vehicle-opt.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.vehicle-opt:disabled { opacity: .45; cursor: not-allowed; }
.vehicle-opt .row { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.vehicle-opt strong { font-size: 13px; font-weight: 500; }
.vehicle-opt small { color: var(--muted); font-size: 11px; display: flex; align-items: center; gap: 4px; }
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.photo-slot {
  position: relative; aspect-ratio: 4 / 3; border-radius: 8px; border: 1.5px dashed #CDD5E2; background: #FAFBFD;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer;
  overflow: hidden; color: var(--muted); text-align: center; padding: 8px; transition: border-color .12s, background .12s;
}
.photo-slot:hover { border-color: var(--primary); background: var(--primary-50); color: var(--primary); }
.photo-slot input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-slot .silhouette { width: 48px; height: 30px; color: #AAB6CA; }
.photo-slot strong { color: var(--text); font-size: 12px; font-weight: 500; }
.photo-slot small { font-size: 11px; }
.photo-slot.filled { border: 0; padding: 0; }
.photo-slot.filled img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-slot.filled .tag {
  position: absolute; left: 6px; bottom: 6px; background: rgba(11, 27, 51, .75); color: #fff; font-size: 11px; font-weight: 500;
  padding: 2px 7px; border-radius: 5px; display: flex; align-items: center; gap: 4px;
}
.photo-slot.filled .tag .icon { width: 12px; height: 12px; color: #5BE3A2; }
.photo-slot.filled .redo { position: absolute; top: 6px; right: 6px; background: rgba(255, 255, 255, .92); color: var(--text); border-radius: 5px; padding: 1px 7px; font-size: 11px; }
.photo-slot.busy::after { content: 'Processando…'; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255, 255, 255, .8); font-weight: 500; color: var(--primary); }
.progress { height: 4px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--primary); border-radius: 99px; transition: width .25s; }
.fuel-levels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.fuel-levels button { height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); font-weight: 500; cursor: pointer; }
.fuel-levels button.on { border-color: var(--primary); background: var(--primary-50); color: var(--primary); }
.wizard-foot { display: flex; gap: 8px; justify-content: space-between; margin-top: 14px; }
.summary-box { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.summary-box div { background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.summary-box small { display: block; color: var(--muted); font-size: 11px; }
.summary-box strong { font-size: 13px; font-weight: 500; }
.summary-box .icon { width: 12px; height: 12px; color: var(--success); }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.gallery figure { margin: 0; position: relative; border-radius: 8px; overflow: hidden; background: var(--line-2); aspect-ratio: 4 / 3; cursor: zoom-in; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery figcaption { position: absolute; left: 6px; bottom: 6px; background: rgba(11, 27, 51, .75); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 5px; }
.thumbs { display: flex; gap: 3px; }
.thumbs img { width: 28px; height: 21px; object-fit: cover; border-radius: 3px; background: var(--line-2); }
.cover { width: 40px; height: 30px; border-radius: 5px; object-fit: cover; background: var(--line-2); flex: none; }

.active-use { border-radius: var(--radius); padding: 16px; color: #fff; background: var(--sidebar); }
.active-use small { color: #9FB0CC; font-size: 11px; display: block; }
.active-use .big { font-size: 17px; font-weight: 600; margin: 2px 0 12px; }
.active-use .row { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 14px; }
.active-use .row b { display: block; font-size: 14px; font-weight: 600; }
.quick-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.quick-action {
  display: flex; flex-direction: column; gap: 8px; padding: 14px; background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--line); color: var(--text); font-weight: 500; cursor: pointer; text-align: left;
}
.quick-action small { color: var(--muted); font-weight: 400; font-size: 11px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--primary); border-bottom-color: var(--primary); }

/* ---------- Modal / toast ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(11, 27, 51, .4); z-index: 100; display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: fade .12s ease-out;
}
.modal {
  background: var(--card); border-radius: 12px; width: 100%; max-width: 560px; max-height: calc(100vh - 40px);
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: pop .15s ease-out;
}
.modal.wide { max-width: 760px; }
.modal.sm { max-width: 400px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 14px; }
.modal-head .icon-btn { margin-left: auto; width: 30px; height: 30px; }
.modal-body { padding: 16px; overflow: auto; }
.modal-foot { padding: 10px 16px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.lightbox { background: rgba(5, 12, 24, .92); }
.lightbox img { max-width: 100%; max-height: calc(100vh - 90px); border-radius: 8px; }
.lightbox .caption { color: #fff; text-align: center; margin-top: 8px; }
.lightbox .icon-btn { position: fixed; top: 14px; right: 14px; background: rgba(255, 255, 255, .12); color: #fff; }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 9px; background: var(--sidebar); color: #fff;
  box-shadow: var(--shadow-lg); max-width: 380px; animation: slide .18s ease-out;
}
.toast.error { background: #B42323; }
.toast .icon { color: #5BE3A2; }
.toast.error .icon { color: #fff; }
.form-error { background: var(--danger-50); color: #A32020; padding: 8px 10px; border-radius: 8px; margin-bottom: 12px; display: flex; gap: 6px; font-size: 12px; }
.form-error .icon { margin-top: 1px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }
@keyframes slide { from { opacity: 0; transform: translateY(8px); } }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--primary); animation: spin .7s linear infinite; margin: 48px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-hero { color: #fff; padding: 40px; display: flex; flex-direction: column; background: var(--sidebar); }
.auth-hero .brand { padding: 0; }
.auth-hero h1 { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin-top: auto; max-width: 420px; line-height: 1.15; }
.auth-hero h1 span { color: var(--accent); }
.auth-hero p { color: #9FB0CC; font-size: 14px; max-width: 400px; margin: 12px 0 24px; }
.auth-feats { display: flex; flex-direction: column; gap: 10px; margin-bottom: auto; }
.auth-feats div { display: flex; gap: 8px; align-items: center; color: #C7D2E5; }
.auth-feats .icon { color: var(--accent); }
.auth-hero footer { color: #5F7090; font-size: 11px; margin-top: 24px; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 32px 20px; background: #fff; }
.auth-box { width: 100%; max-width: 340px; }
.auth-box h2 { font-size: 20px; }
.auth-box > p { color: var(--muted); margin: 4px 0 22px; }
.auth-box form { display: flex; flex-direction: column; gap: 12px; }
.auth-box .switch { text-align: center; color: var(--muted); margin-top: 16px; font-size: 12px; }
.demo-hint { margin-top: 20px; padding: 10px 12px; border-radius: 8px; background: var(--bg); color: var(--muted); font-size: 12px; }
.demo-hint button { background: none; border: 0; color: var(--primary); font-weight: 600; cursor: pointer; padding: 0; }

/* ---------- Report ---------- */
.report-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.report-head .veh-ico { display: none; }
.report-head h2 { font-size: 18px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spec { display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 12px; margin-top: 4px; }
.print-only { display: none; }

/* ---------- Rotas (GPS) ---------- */
.route-banner { display: flex; align-items: center; gap: 10px; padding: 9px 24px; font-size: 12px; border-bottom: 1px solid; }
.route-banner.warning { background: var(--warning-50); color: #8A5A06; border-color: #F6E3BF; }
.route-banner.danger { background: var(--danger-50); color: #A32020; border-color: #F7D4D4; }
.route-banner span { flex: 1; }
.summary-text { font-size: 13px; line-height: 1.6; }
.summary-text p { margin: 0 0 8px; }
.summary-text p:last-child { margin: 0; }
.summary-text b.red { color: var(--danger); }
.tl { display: flex; flex-direction: column; gap: 3px; }
.tl-row { display: grid; grid-template-columns: 84px 1fr 64px 112px; align-items: center; gap: 10px; font-size: 12px; cursor: pointer; border-radius: 8px; padding: 4px 6px; }
.tl-row:hover { background: var(--bg); }
.tl-row.on { background: var(--primary-50); box-shadow: inset 3px 0 0 var(--primary); }
.tl-row .day { white-space: nowrap; }
.tl-row .day small { color: var(--muted); }
.tl-row .km { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); font-weight: 500; }
.tl-row .st { text-align: right; }
.tl-track { position: relative; height: 22px; background: #F4F6FA; border-radius: 5px; overflow: hidden; }
.tl-track .work { position: absolute; top: 0; bottom: 0; background: #E8EEF8; }
.tl-track .gl { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(16, 24, 40, .07); }
.tl-track .bar { position: absolute; top: 4px; bottom: 4px; border-radius: 3px; min-width: 4px; }
.tl-track .silence, .hatch-sw { background: repeating-linear-gradient(135deg, rgba(102,112,133,.28) 0 3px, transparent 3px 7px); }
.tl-track .silence { position: absolute; top: 0; bottom: 0; }
.tl-track .hol { position: absolute; inset: 0; display: flex; align-items: center; padding-left: 8px; font-size: 10px; color: var(--muted); }
.tl-axis { display: grid; grid-template-columns: 84px 1fr 64px 112px; gap: 10px; font-size: 10px; color: var(--muted); padding: 0 6px; }

.verdict-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; margin-bottom: 10px; }
.verdict-title .icon { width: 20px; height: 20px; }
.verdict.ok .verdict-title { color: #0A8F52; }
.verdict.warn .verdict-title { color: #B86100; }
.verdict.bad .verdict-title { color: #C42B2B; }
.verdict.neutral .verdict-title { color: var(--muted); }
.facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.facts li { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.45; }
.facts li .icon { margin-top: 2px; flex: none; }
.facts li.ok .icon { color: var(--success); } .facts li.warn .icon { color: var(--warning); } .facts li.bad .icon { color: var(--danger); } .facts li.info .icon { color: var(--muted); }
.section-title { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.kmbar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--line-2); margin-bottom: 14px; }
.kmbar i { display: block; height: 100%; }
.kmbar-legend { display: flex; flex-direction: column; gap: 10px; }
.kmbar-legend div { display: grid; grid-template-columns: 10px 1fr auto 40px; gap: 8px; align-items: center; font-size: 12px; }
.kmbar-legend i { width: 10px; height: 10px; border-radius: 3px; }
.kmbar-legend b { font-variant-numeric: tabular-nums; font-weight: 600; }
.kmbar-legend small { color: var(--muted); text-align: right; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.chips button { border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 4px 10px; font-size: 12px; cursor: pointer; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.chips button em { font-style: normal; background: var(--line-2); border-radius: 99px; padding: 0 6px; font-size: 11px; color: var(--text); }
.chips button.on { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }
.chips button.on em { background: var(--primary); color: #fff; }
.day-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; }
.trip-list { display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow: auto; }
.trip { display: flex; gap: 10px; align-items: flex-start; text-align: left; width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.trip:hover { border-color: #C9D3E3; }
.trip.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.trip .grow { flex: 1; min-width: 0; }
.trip strong { display: block; font-weight: 500; font-size: 13px; }
.trip small { display: block; color: var(--muted); font-size: 11px; }
.trip .num, .map-num { width: 22px; height: 22px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; flex: none; }
.map-num { display: inline-grid; transform: translate(-50%, -50%); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.just-note { display: flex; gap: 6px; align-items: flex-start; margin-top: 6px; padding: 6px 8px; border-radius: 6px; font-size: 12px; line-height: 1.4; }
.just-note .icon { margin-top: 1px; flex: none; }
.just-note em { color: var(--muted); font-style: normal; font-size: 11px; }
.just-note.ok { background: #E9F7EF; color: #0B6B3A; }
.just-note.bad { background: var(--danger-50); color: #A32020; }
.trip.is-just { border-color: #BFE6CF; }
/* Resumo semanal (Rotas) + tabela de dados */
.fws { border-color: #E8EDF5; border-radius: 14px; box-shadow: 0 2px 10px rgba(15, 35, 70, .04); overflow: hidden; }
.fws-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid #E6EAF0; flex-wrap: wrap; }
.fws-title { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 240px; }
.fws-title > .icon { color: var(--primary); width: 18px; height: 18px; }
.fws-title h3 { font-size: 15px; font-weight: 700; color: #172033; }
.fws-nav { display: flex; gap: 2px; margin-left: 4px; }
.fws-tabs { display: inline-flex; background: #F0F3F7; padding: 3px; border-radius: 9px; gap: 2px; }
.fws-tabs button { border: 0; background: none; padding: 5px 12px; border-radius: 7px; font-weight: 500; font-size: 12px; color: #667085; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.fws-tabs button em { font-style: normal; font-size: 11px; color: #98A2B3; }
.fws-tabs button.on { background: var(--primary); color: #fff; box-shadow: 0 1px 3px rgba(23, 105, 224, .3); }
.fws-tabs button.on em { color: rgba(255, 255, 255, .8); }
.dt-toolbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; flex-wrap: wrap; }
.dt-search { position: relative; flex: 0 1 300px; }
.dt-search .icon { position: absolute; left: 10px; top: 9px; color: var(--muted); }
.dt-search input { width: 100%; height: 32px; border: 1px solid #E6EAF0; border-radius: 8px; padding: 0 10px 0 30px; outline: none; background: #fff; }
.dt-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.dt-hint { font-size: 11px; color: var(--muted); }
.dt-wrap { overflow: auto; max-height: 620px; border-top: 1px solid #E6EAF0; }
table.dt { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.dt th { position: sticky; top: 0; z-index: 1; height: 40px; background: #F7F9FC; text-align: left; font-size: 12px; font-weight: 500; color: #667085; padding: 0 14px; border-bottom: 1px solid #E6EAF0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: none; }
.dt th.sortable { cursor: pointer; }
.dt th.sortable:hover { color: #172033; }
.dt th.r, .dt td.r { text-align: right; }
.dt-sort { margin-left: 4px; font-size: 10px; color: #C0C8D4; }
.dt-sort.on { color: var(--primary); }
.dt td { height: 42px; padding: 0 14px; border-bottom: 1px solid #F0F3F7; font-size: 13px; color: #344054; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dt tbody tr:last-child td { border-bottom: 0; }
.dt tbody tr:hover td { background: #F7F9FC; }
.dt tbody tr.click { cursor: pointer; }
.dt .dt-empty { text-align: center; color: var(--muted); height: 80px; white-space: normal; }
.dt .num { font-variant-numeric: tabular-nums; font-weight: 500; color: #172033; }
.dt .num.danger { color: #E53935; font-weight: 600; }
.dt .num.warn { color: #D98200; font-weight: 600; }
.dt .pct { color: #667085; font-size: 12px; }
.dt .route-txt { color: #344054; }
.dt .cv { display: inline; }
.veh-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.veh-name { font-size: 13px; font-weight: 500; color: #344054; overflow: hidden; text-overflow: ellipsis; }
.plate-chip { display: inline-block; background: #F1F4F8; color: #344054; font: 700 11px ui-monospace, 'SF Mono', Consolas, monospace; letter-spacing: .03em; padding: 3px 7px; border-radius: 6px; flex: none; }
.badge-s { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge-s .icon { width: 12px; height: 12px; }
.badge-s.ok { color: #16A66A; background: #E9F8F1; }
.badge-s.low { color: #D98200; background: #FFF3E3; }
.badge-s.high { color: #E53935; background: #FDECEC; }
.badge-s.nodata { color: #667085; background: #F0F3F7; }
.badge-s.info { color: #5B35D5; background: #F0EBFC; }
.badge-s.just { color: #0B6B3A; background: #E1F4E9; }
.dt-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; border-top: 1px solid #E6EAF0; font-size: 12px; color: #667085; flex-wrap: wrap; min-height: 48px; }
.dt-pages { display: flex; gap: 4px; align-items: center; }
.dt-page { min-width: 30px; height: 30px; border: 1px solid #E6EAF0; background: #fff; border-radius: 8px; font-size: 12px; font-weight: 500; color: #344054; cursor: pointer; display: grid; place-items: center; padding: 0 6px; }
.dt-page:hover:not(:disabled) { border-color: #C9D3E3; }
.dt-page.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.dt-page:disabled { opacity: .4; cursor: default; }
.dt-dots { color: #98A2B3; padding: 0 2px; }
@media (max-width: 900px) {
  .fws-head { padding: 12px; }
  .fws-tabs { width: 100%; } .fws-tabs button { flex: 1; justify-content: center; }
  .dt-search { flex: 1 1 100%; }
  .dt-wrap { max-height: none; }
  table.dt, .dt thead, .dt tbody, .dt tr, .dt td { display: block; width: 100%; }
  .dt colgroup, .dt thead { display: none; }
  .dt tbody tr { padding: 10px 12px; border-bottom: 1px solid #E6EAF0; }
  .dt td { height: auto; padding: 2px 0; border: 0; display: flex; justify-content: space-between; gap: 10px; white-space: normal; text-align: right; background: none !important; }
  .dt td::before { content: attr(data-label); color: var(--muted); font-size: 11px; text-align: left; flex: none; }
  .dt td:first-child { padding-bottom: 6px; } .dt td:first-child::before { display: none; }
  .dt td.col-opt { display: none; }
}

/* Marcadores do mapa ao vivo */
.vmk-wrap { background: none; border: 0; }
.vmk { position: relative; width: 36px; height: 36px; }
.vmk .dot { position: absolute; inset: 4px; border-radius: 50%; display: grid; place-items: center; border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(16, 24, 40, .35); }
.vmk .dot svg { width: 15px; height: 15px; }
.vmk.offline .dot { opacity: .85; }
.vmk.sel .dot { box-shadow: 0 0 0 4px rgba(23, 105, 224, .35), 0 2px 6px rgba(16, 24, 40, .35); }
.vmk .dir { position: absolute; inset: 0; display: block; }
.vmk .dir b { position: absolute; left: 50%; top: -6px; transform: translateX(-50%); width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 9px solid; filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff); }
.vmk.alarm::before { content: ''; position: absolute; inset: -2px; border-radius: 50%; border: 3px solid #E5484D; animation: vmk-pulse 1.4s ease-out infinite; }
@keyframes vmk-pulse { from { transform: scale(.8); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.vmk .tag { position: absolute; top: 36px; left: 50%; transform: translateX(-50%); white-space: nowrap; background: rgba(255, 255, 255, .95); color: var(--text); font: 600 10px var(--font); padding: 1px 6px; border-radius: 4px; box-shadow: 0 1px 3px rgba(16, 24, 40, .25); display: none; }
.show-tags .vmk .tag, .vmk.sel .tag { display: block; }
.map-legend { background: rgba(255, 255, 255, .95); border-radius: 8px; padding: 6px 10px; box-shadow: 0 1px 4px rgba(16, 24, 40, .2); display: flex; flex-direction: column; gap: 3px; font: 11px var(--font); color: var(--text); }
.map-legend span { display: flex; align-items: center; gap: 6px; }
.map-legend i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgba(16, 24, 40, .2); }
.silence-note { display: flex; gap: 6px; font-size: 11px; color: var(--muted); background: var(--bg); border-radius: 8px; padding: 8px 10px; margin-top: 4px; }
details.more > summary { list-style: none; cursor: pointer; padding: 14px 16px; display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: 13px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary .sub { font-weight: 400; color: var(--muted); font-size: 11px; }
details.more[open] > summary { border-bottom: 1px solid var(--line-2); }
.mini { background: var(--bg); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.mini small { color: var(--muted); font-size: 11px; }
.mini b { font-size: 16px; font-weight: 600; }
.mini span { color: var(--muted); font-size: 11px; }
@media print { details.more { display: block; } details.more > * { display: block; } }
.tl-axis div { position: relative; height: 14px; }
.tl-axis div span { position: absolute; transform: translateX(-50%); }
.k-normal { background: #1769E0; } .k-fora_viagem { background: #5B35D5; } .k-folga_viagem { background: #FF8A00; }
.k-fora_curto { background: #F59E0B; } .k-fora_local, .k-madrugada, .k-folga_local { background: #EF4444; }
#routeMap { height: 380px; border-radius: 8px; background: var(--line-2); z-index: 0; }
.alert-row { display: grid; grid-template-columns: 70px 92px 1fr auto; gap: 10px; align-items: center; padding: 9px 16px; border-bottom: 1px solid var(--line-2); font-size: 12px; }
.alert-row:last-child { border-bottom: 0; }
.alert-row .what strong { font-weight: 500; display: block; font-size: 13px; }
.alert-row .what small { color: var(--muted); }
.alert-row.done { opacity: .6; }
.alert-group { padding: 8px 16px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: #FAFBFD; border-bottom: 1px solid var(--line-2); }
.sched-grid { display: grid; grid-template-columns: minmax(0, 1fr) 104px 104px; gap: 6px 8px; align-items: center; }
.sched-grid .input:disabled { opacity: .4; }
@media (max-width: 900px) {
  .route-banner { padding: 9px 14px; flex-wrap: wrap; }
  .tl-row, .tl-axis { grid-template-columns: 58px 1fr 52px; gap: 6px; }
  .tl-row .st, .tl-axis > span:last-child { display: none; }
  .day-grid { grid-template-columns: 1fr; }
  .alert-row { grid-template-columns: 1fr auto; }
  .alert-row .when { grid-column: 1 / -1; }
  .sched-grid { grid-template-columns: minmax(0, 1fr) 92px 92px; }
  #routeMap { height: 300px; }
}

/* Colunas secundárias: somem em telas médias para evitar rolagem lateral */
@media (max-width: 1280px) { .col-opt { display: none; } }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  :root { --header-h: 52px; }
  .sidebar { display: none; }
  .main { margin-left: 0; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .topbar { padding: 0 12px; gap: 6px; background: var(--sidebar); color: #fff; border-bottom: 0; }
  .topbar .mobile-brand { display: flex; align-items: center; gap: 8px; font-weight: 600; color: #fff; }
  .topbar .search { display: none; }
  .topbar .search.open { display: block; position: fixed; top: 0; left: 0; right: 0; max-width: none; padding: 9px 10px; background: var(--sidebar); z-index: 50; }
  .topbar .search.open > .icon { left: 22px; top: 18px; }
  .topbar .search.open .search-results { left: 10px; right: 10px; top: 52px; }
  .topbar .icon-btn { color: #C7D2E5; }
  .topbar .icon-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
  .topbar .icon-btn .dot { border-color: var(--sidebar); }
  .avatar { background: rgba(255, 255, 255, .12); color: #fff; }
  .user-chip:hover { background: none; }
  .user-chip .meta { display: none; }
  .dropdown { position: fixed; top: 56px; right: 8px; left: 8px; min-width: 0; }
  .content { padding: 0 14px 20px; }
  .page-head { margin: 14px 0 12px; }
  .page-head .actions { margin-left: 0; width: 100%; }
  .page-head .actions .btn, .page-head .actions select { flex: 1; }
  .grid { gap: 10px; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-2.keep, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 1fr; }
  .filters { width: 100%; }
  .filters .input { flex: 1; min-width: 0; }
  .toolbar { padding: 10px 12px; }
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; background: var(--card);
    border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 2px; color: var(--muted); font-size: 10px; font-weight: 500; }
  .bottom-nav a .icon { width: 19px; height: 19px; }
  .bottom-nav a.on { color: var(--primary); }
  .bottom-nav a.fab span.ball { width: 42px; height: 42px; margin-top: -18px; border-radius: 12px; display: grid; place-items: center; background: var(--accent); color: #fff; border: 3px solid var(--bg); }
  .bottom-nav a.fab em { color: var(--text); font-style: normal; }

  /* Tabelas viram cartões */
  .table.responsive thead { display: none; }
  .table.responsive, .table.responsive tbody, .table.responsive tr, .table.responsive td { display: block; width: 100%; }
  .table.responsive tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .table.responsive td { border: 0; padding: 2px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; background: none !important; }
  .table.responsive td::before { content: attr(data-label); color: var(--muted); font-size: 11px; text-align: left; }
  .table.responsive td.primary { padding-bottom: 6px; text-align: left; }
  .table.responsive td.primary::before, .table.responsive td.actions::before { display: none; }
  .table.responsive td.actions { justify-content: flex-end; width: 100%; }
  .table.responsive tfoot { display: block; }
  .table.responsive tfoot tr { display: flex; flex-wrap: wrap; }

  .overlay { padding: 0; align-items: flex-end; }
  .modal, .modal.wide, .modal.sm { max-width: none; max-height: 92vh; border-radius: 14px 14px 0 0; }
  .modal-foot { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
  .modal-foot .btn { flex: 1; }
  .toasts { left: 10px; right: 10px; bottom: calc(72px + env(safe-area-inset-bottom)); }
  .toast { max-width: none; }

  .stepper .step { justify-content: center; padding: 8px; }
  .stepper .step .label { display: none; }
  .stepper .step.on .label { display: inline; }
  .photo-grid, .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .wizard-foot { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); background: var(--bg); padding: 10px 0; margin-top: 4px; }
  .wizard-foot .btn { flex: 1; height: 40px; }
  .auth { grid-template-columns: 1fr; }
  .auth-hero { padding: 22px 20px 26px; }
  .auth-hero h1 { font-size: 22px; margin-top: 22px; }
  .auth-hero p { font-size: 13px; margin-bottom: 0; }
  .auth-feats, .auth-hero footer { display: none; }
  .auth-form { padding: 24px 20px 32px; align-items: flex-start; }
}
@media (min-width: 901px) { .mobile-only { display: none !important; } }
@media (max-width: 900px) { .desktop-only { display: none !important; } }

/* ---------- Impressão ---------- */
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; font-size: 10px; }
  .sidebar, .topbar, .bottom-nav, .no-print, .toasts { display: none !important; }
  .main { margin: 0; padding: 0; }
  .content { padding: 0; max-width: none; }
  .card { break-inside: avoid; }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .print-only { display: block; }
  .col-opt { display: table-cell !important; }
  .table th, .table td { padding: 4px 6px; }
  .gallery { grid-template-columns: repeat(6, 1fr); gap: 4px; }
}
