@import url('../fonts/alexandria.css');

/* =================================================================
   DESIGN TOKENS — light (padrão) e dark
   ================================================================= */
:root {
  --gf-blue:       #1669b3;
  --gf-blue-dark:  #0f4f8a;
  --gf-blue-light: #e8f1fa;
  --gf-red:        #e21f26;
  --gf-gray:       #6f7172;

  --bg:          #f0f4f9;
  --surface:     #ffffff;
  --surface-2:   #f8fafc;
  --border:      #e2e8f0;
  --shadow:      0 1px 3px rgba(0,0,0,.07), 0 4px 16px rgba(0,0,0,.05);
  --shadow-md:   0 4px 24px rgba(0,0,0,.09);

  --text:        #0f172a;
  --text-2:      #475569;
  --text-3:      #94a3b8;

  --sidebar-bg:           #ffffff;
  --sidebar-active-bg:    var(--gf-blue-light);
  --sidebar-active-border:var(--gf-blue);
  --sidebar-w:            220px;

  --chart-grid:  rgba(0,0,0,.06);
}

[data-theme="dark"] {
  --bg:          #0d1117;
  --surface:     #161b22;
  --surface-2:   #1c2331;
  --border:      #30363d;
  --shadow:      0 1px 3px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.2);
  --shadow-md:   0 4px 24px rgba(0,0,0,.35);

  --text:        #e6edf3;
  --text-2:      #8b949e;
  --text-3:      #484f58;

  --sidebar-bg:           #161b22;
  --sidebar-active-bg:    rgba(22,105,179,.18);
  --sidebar-active-border:var(--gf-blue);

  --chart-grid:  rgba(255,255,255,.07);
  --gf-blue-light: rgba(22,105,179,.2);
}

/* =================================================================
   RESET & BASE
   ================================================================= */
*, *::before, *::after { box-sizing: border-box; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Alexandria', system-ui, -apple-system, sans-serif;
  margin: 0;
  transition: background .25s, color .25s;
}

.btn-primary {
  --bs-btn-bg: var(--gf-blue); --bs-btn-border-color: var(--gf-blue);
  --bs-btn-hover-bg: var(--gf-blue-dark); --bs-btn-hover-border-color: var(--gf-blue-dark);
  --bs-btn-active-bg: var(--gf-blue-dark);
}
.nav-pills .nav-link.active { background: var(--gf-blue); }
a { color: var(--gf-blue); }
.form-control, .form-select {
  background-color: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
  font-family: inherit;
}
.form-control:focus, .form-select:focus {
  background-color: var(--surface);
  border-color: var(--gf-blue);
  box-shadow: 0 0 0 3px rgba(22,105,179,.12);
  color: var(--text);
}
.table { --bs-table-color: var(--text); --bs-table-bg: transparent; --bs-table-border-color: var(--border); }
.table-hover > tbody > tr:hover > * { background-color: var(--surface-2); }
.modal-content { background: var(--surface); color: var(--text); }
.alert { --bs-alert-border-color: var(--border); }

/* =================================================================
   LOGIN
   ================================================================= */
.login-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, var(--gf-blue) 0%, var(--gf-blue-dark) 60%, #081f40 100%);
  padding: 1rem;
}
.login-card {
  background: #fff; width: 100%; max-width: 390px; border-radius: 24px;
  padding: 2.2rem 1.8rem 1.6rem; box-shadow: 0 32px 80px rgba(8,31,64,.35);
}
.login-logo  { width: 230px; max-width: 84%; height: auto; }
.login-sub   { color: #94a3b8; font-size: .78rem; letter-spacing: .8px; font-weight: 600; }
.auth-head   { text-align: center; font-weight: 700; color: #1e293b; margin: 1.2rem 0 .5rem; font-size: 1.05rem; }

/* Campo com ícone */
.field-icon { position: relative; }
.field-icon .fi {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: #94a3b8; font-size: 1rem; pointer-events: none;
}
.field-icon .form-control {
  padding-left: 42px; height: 52px; border-radius: 14px;
  background: #f8fafc; border-color: #e8edf3;
}
.field-icon .form-control:focus { background: #fff; border-color: var(--gf-blue); box-shadow: 0 0 0 3px rgba(22,105,179,.12); }

/* PIN */
.pin-display { display: flex; justify-content: center; gap: 14px; height: 44px;
  align-items: center; margin: .3rem 0 .9rem; }
.pin-display .dot { width: 13px; height: 13px; border-radius: 50%; background: #dbe3ec;
  transition: transform .12s, background .12s; }
.pin-display .dot.on { background: var(--gf-blue); transform: scale(1.18); }
.pin-display.shake { animation: pinshake .4s; }
@keyframes pinshake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-7px)} 40%,80%{transform:translateX(7px)} }

/* Teclado */
.keypad { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.keypad .key {
  height: 62px; border: none; border-radius: 16px; background: #f1f5f9;
  font-size: 1.5rem; font-weight: 600; color: #1e293b; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  user-select: none; transition: transform .08s, background .1s;
  -webkit-tap-highlight-color: transparent; font-family: inherit;
}
.keypad .key:active { transform: scale(.93); background: #e2e8f0; }
.keypad .key-ok  { background: var(--gf-blue); color: #fff; font-size: 1.4rem; }
.keypad .key-ok:active { background: var(--gf-blue-dark); }
.keypad .key-del { background: transparent; color: #94a3b8; font-size: 1.3rem; }
.keypad .key-del:active { background: #f1f5f9; }

.auth-switch { text-align: center; margin-top: 1rem; }
.auth-switch button { background: none; border: none; color: #64748b; font-size: .85rem;
  font-weight: 500; cursor: pointer; padding: .4rem; font-family: inherit; }
.auth-switch button:hover { color: var(--gf-blue); }
.auth-pane { display: none; }
.auth-pane.active { display: block; animation: fadeUp .22s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* =================================================================
   ADMIN — SHELL
   ================================================================= */
.admin-body { margin: 0; }
.admin-shell { display: flex; min-height: 100vh; }

/* Sidebar */
.admin-sidebar {
  width: var(--sidebar-w); background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  position: fixed; top: 0; bottom: 0;
  border-right: 1px solid var(--border);
  transition: background .25s, border-color .25s, transform .3s;
  z-index: 1100;
}
.sidebar-brand { padding: 1rem 1.1rem; border-bottom: 1px solid var(--border); }
.sidebar-brand .logo-full { width: 156px; max-width: 100%; height: auto; }
.sidebar-brand .logo-mark { width: 32px; height: auto; display: none; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: .5rem 0; }
.sidebar-group {
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .8px;
  color: var(--text-3); padding: .85rem 1.1rem .3rem;
}
.sidebar-group:first-child { padding-top: .35rem; }
.sidebar-nav a {
  display: flex; align-items: center; gap: .65rem; padding: .65rem 1.1rem;
  color: var(--text-2); text-decoration: none; font-size: .9rem; font-weight: 500;
  border-left: 3px solid transparent; transition: background .15s, color .15s;
}
.sidebar-nav a .bi { font-size: 1.05rem; width: 1.3rem; text-align: center; }
.sidebar-nav a:hover { background: var(--surface-2); color: var(--gf-blue); }
.sidebar-nav a.active {
  background: var(--sidebar-active-bg); color: var(--gf-blue);
  font-weight: 700; border-left-color: var(--sidebar-active-border);
}
/* Paginação */
.pager { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; margin-top: 1rem; }
.pager-btn { min-width: 36px; height: 36px; padding: 0 .5rem; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 9px; color: var(--text-2); text-decoration: none; font-size: .88rem; font-weight: 600; transition: background .12s, color .12s; }
.pager-btn:hover { background: var(--surface-2); color: var(--gf-blue); }
.pager-btn.active { background: var(--gf-blue); border-color: var(--gf-blue); color: #fff; }
.pager-btn.disabled { opacity: .4; pointer-events: none; }
.pager-gap { color: var(--text-3); padding: 0 .2rem; }
.pager-info { margin-left: auto; font-size: .82rem; color: var(--text-3); }

/* Bloco de ajuda recolhível ("Como funciona…") */
.help-box { border: 1px solid color-mix(in srgb, var(--gf-blue) 30%, transparent);
  background: color-mix(in srgb, var(--gf-blue) 6%, transparent); border-radius: 12px; overflow: hidden; }
.help-box > summary { cursor: pointer; list-style: none; padding: .75rem 1rem; font-weight: 600;
  color: var(--gf-blue); display: flex; align-items: center; gap: .25rem; user-select: none; }
.help-box > summary::-webkit-details-marker { display: none; }
.help-box > summary::after { content: '\F282'; font-family: 'bootstrap-icons'; margin-left: auto; font-weight: 400; transition: transform .2s; }
.help-box[open] > summary::after { transform: rotate(180deg); }
.help-box .help-body { padding: 0 1.1rem 1rem; font-size: .9rem; color: var(--text); }
.help-box .help-steps { padding-left: 1.1rem; display: flex; flex-direction: column; gap: .45rem; }
.help-box .help-steps li { line-height: 1.4; }
.help-box .badge { vertical-align: middle; }

/* Abas segmentadas (ex.: área de Manutenção: Registros / Planos preventivos) */
.seg-tabs { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg-tabs a {
  display: inline-flex; align-items: center; padding: .4rem .9rem; border-radius: 8px;
  font-size: .88rem; font-weight: 600; color: var(--text-2); text-decoration: none; transition: background .12s, color .12s;
}
.seg-tabs a:hover { color: var(--gf-blue); }
.seg-tabs a.active { background: var(--surface); color: var(--gf-blue); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

.sidebar-logout {
  padding: .9rem 1.1rem; color: var(--text-3); text-decoration: none;
  border-top: 1px solid var(--border); font-size: .88rem;
  display: flex; align-items: center; gap: .5rem; transition: color .15s;
}
.sidebar-logout:hover { color: var(--gf-red); }

/* Backdrop (mobile) */
.sidebar-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.45); z-index: 1050;
}
.sidebar-backdrop.show { display: block; }

/* Main */
.admin-main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; }
.admin-topbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: .85rem 1.5rem; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 500; transition: background .25s, border-color .25s;
  gap: .75rem;
}
.topbar-left  { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.topbar-left h1 { font-size: 1.1rem; font-weight: 700; color: var(--text); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: .75rem; flex-shrink: 0; }
.topbar-user  { font-size: .88rem; color: var(--text-2); white-space: nowrap; }

/* Hamburger (hidden on desktop) */
.btn-burger {
  display: none; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; width: 36px; height: 36px;
  align-items: center; justify-content: center; cursor: pointer;
  color: var(--text-2); font-size: 1.2rem; transition: background .15s; flex-shrink: 0;
}
.btn-burger:hover { background: var(--gf-blue-light); color: var(--gf-blue); }

/* Theme toggle */
.btn-theme {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-2); font-size: 1rem; transition: background .15s, color .15s;
}
.btn-theme:hover { background: var(--gf-blue-light); color: var(--gf-blue); }

/* Notification bell */
.notif-wrap { position: relative; }
.btn-icon {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-2); font-size: 1rem; transition: background .15s;
  position: relative;
}
.btn-icon:hover { background: var(--gf-blue-light); color: var(--gf-blue); }
.notif-badge {
  position: absolute; top: -5px; right: -5px;
  background: var(--gf-red); color: #fff;
  font-size: .65rem; font-weight: 700; border-radius: 10px;
  min-width: 16px; height: 16px; display: flex; align-items: center; justify-content: center;
  padding: 0 4px; line-height: 1; border: 2px solid var(--surface);
}
.notif-dropdown {
  display: none; position: absolute; top: calc(100% + 8px); right: 0;
  width: 300px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow-md); z-index: 300; overflow: hidden;
}
.notif-dropdown.open { display: block; }
.notif-hd {
  padding: .75rem 1rem; font-size: .82rem; font-weight: 700;
  color: var(--text-2); text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 1px solid var(--border); background: var(--surface-2);
}

/* Content */
.admin-content { padding: 1.5rem; flex: 1; }

/* Card base */
.card-gf {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow); transition: background .25s, border-color .25s, box-shadow .25s;
}

/* =================================================================
   DASHBOARD — KPI CARDS
   ================================================================= */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.kpi-card {
  background: var(--surface); border-radius: 16px; padding: 1.2rem 1.25rem;
  border: 1px solid var(--border); box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: .25rem; position: relative; overflow: hidden;
  transition: transform .15s, box-shadow .15s, background .25s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; border-radius: 16px 0 0 16px;
  background: var(--kpi-color, var(--gf-blue));
}
.kpi-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; margin-bottom: .3rem;
  background: color-mix(in srgb, var(--kpi-color, var(--gf-blue)) 12%, transparent);
  color: var(--kpi-color, var(--gf-blue));
}
.kpi-valor { font-size: 2rem; font-weight: 800; color: var(--text); line-height: 1; }
.kpi-label { font-size: .8rem; color: var(--text-2); font-weight: 500; }
.kpi-trend { font-size: .78rem; font-weight: 600; display: flex; align-items: center; gap: 3px; margin-top: .2rem; }
.kpi-trend.up   { color: #16a34a; }
.kpi-trend.zero { color: var(--text-3); }

/* =================================================================
   DASHBOARD — CHARTS
   ================================================================= */
.charts-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; margin-bottom: 1rem; }
@media (max-width: 900px) { .charts-grid { grid-template-columns: 1fr; } }

.chart-card  { padding: 1.25rem 1.5rem; }
.chart-title { font-size: .9rem; font-weight: 700; color: var(--text); margin-bottom: 1rem; display: flex; align-items: center; gap: .4rem; }
.chart-wrap  { position: relative; }

/* Live feed */
.live-pulse-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--gf-red);
  animation: livepulse 1.8s ease-in-out infinite; flex-shrink: 0;
}
@keyframes livepulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.4;transform:scale(.8)} }

.live-item {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .6rem .25rem; border-bottom: 1px solid var(--border);
}
.live-item:last-child { border-bottom: none; }
.live-ic   { font-size: 1rem; width: 24px; text-align: center; flex-shrink: 0; padding-top: 1px; }
.live-msg  { font-size: .85rem; color: var(--text); font-weight: 500; }
.live-quando { font-size: .75rem; color: var(--text-3); margin-top: 1px; }
.live-empty  { padding: 2rem; text-align: center; }

/* Summary */
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.summary-item {
  background: var(--surface-2); border-radius: 12px; padding: .9rem 1rem;
  border: 1px solid var(--border);
}
.summary-item .s-label { font-size: .75rem; color: var(--text-2); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.summary-item .s-val   { font-size: 1.4rem; font-weight: 800; color: var(--text); }
.summary-item .s-unit  { font-size: .75rem; color: var(--text-3); }

/* =================================================================
   MOTORISTA
   ================================================================= */
.motorista-body { margin: 0; padding-bottom: 72px; background: var(--bg); transition: background .25s; }
.mot-topbar {
  background: var(--gf-blue); color: #fff; padding: .7rem 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.mot-topbar .mot-brand { height: 24px; width: auto; flex-shrink: 0; }
.mot-topbar .mot-title {
  font-weight: 700; font-size: .95rem; flex: 1; min-width: 0; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mot-logout {
  color: rgba(255,255,255,.85); text-decoration: none; font-size: 1.1rem;
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; transition: background .15s;
}
.mot-logout:hover { background: rgba(255,255,255,.15); color: #fff; }
.mot-content { padding: 1rem; max-width: 560px; margin: 0 auto; }

.mot-bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface);
  border-top: 1px solid var(--border); display: flex; height: 66px;
  box-shadow: 0 -2px 12px rgba(0,0,0,.07);
}
.mot-bottomnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--text-3); text-decoration: none; font-size: .68rem; font-weight: 600;
  transition: color .15s;
}
.mot-bottomnav a .bi { font-size: 1.3rem; }
.mot-bottomnav a.active { color: var(--gf-blue); }

/* Motorista live badge */
.mot-live-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(226,31,38,.1); color: var(--gf-red);
  border-radius: 20px; padding: .3rem .75rem; font-size: .8rem; font-weight: 600;
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--gf-red);
  animation: livepulse 1.8s ease-in-out infinite;
}

/* Task cards */
.task-card {
  display: block; background: var(--surface); border-radius: 16px; padding: 1rem 1.1rem;
  margin-bottom: .75rem; text-decoration: none; color: inherit;
  border: 1px solid var(--border); box-shadow: var(--shadow);
  transition: transform .12s, box-shadow .12s;
}
.task-card:active { transform: scale(.99); }
.task-destino { font-size: 1.05rem; font-weight: 700; margin-top: .5rem; color: var(--text); }
.task-tipo    { color: var(--text-2); font-size: .83rem; margin-top: .2rem; }

.empty-state { text-align: center; color: var(--text-3); padding: 3rem 1rem; }
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: .75rem; color: var(--text-3); opacity: .5; }

/* =================================================================
   RESPONSIVE — tablet (≤900px): sidebar ícone apenas
   ================================================================= */
@media (max-width: 900px) {
  :root { --sidebar-w: 64px; }
  .sidebar-brand { padding: .85rem 0; text-align: center; }
  .sidebar-brand .logo-full { display: none; }
  .sidebar-brand .logo-mark { display: inline-block; }
  .sidebar-group { display: none; }
  .sidebar-nav a { justify-content: center; padding: .7rem 0; border-left: none; border-bottom: 3px solid transparent; }
  .sidebar-nav a span:not(.bi) { display: none; }
  .sidebar-nav a .bi { width: auto; font-size: 1.2rem; }
  .sidebar-nav a.active { border-bottom-color: var(--sidebar-active-border); background: var(--sidebar-active-bg); }
  .sidebar-logout { justify-content: center; padding: .9rem 0; }
  .sidebar-logout span { display: none; }
  .topbar-user { display: none; }
}

/* =================================================================
   RESPONSIVE — mobile (≤640px): sidebar gaveta
   ================================================================= */
@media (max-width: 640px) {
  :root { --sidebar-w: 0px; }
  .btn-burger { display: flex !important; }
  .topbar-user { display: none; }

  .admin-sidebar {
    width: 240px !important;
    transform: translateX(-240px);
    box-shadow: none;
  }
  .admin-sidebar.mob-open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(0,0,0,.18);
  }
  /* Restaura estilos completos da sidebar dentro do drawer */
  .admin-sidebar .sidebar-brand { padding: 1rem 1.1rem !important; text-align: left !important; }
  .admin-sidebar .logo-full     { display: block !important; width: 140px !important; }
  .admin-sidebar .logo-mark     { display: none !important; }
  .admin-sidebar .sidebar-nav a {
    justify-content: flex-start !important; padding: .65rem 1.1rem !important;
    border-left: 3px solid transparent !important; border-bottom: none !important;
  }
  .admin-sidebar .sidebar-nav a span:not(.bi) { display: inline !important; }
  .admin-sidebar .sidebar-nav a .bi { font-size: 1.05rem !important; width: 1.3rem !important; }
  .admin-sidebar .sidebar-nav a.active { border-bottom-color: transparent !important; border-left-color: var(--gf-blue) !important; }
  .admin-sidebar .sidebar-logout { justify-content: flex-start !important; padding: .9rem 1.1rem !important; }
  .admin-sidebar .sidebar-logout span { display: inline !important; }

  .admin-main { margin-left: 0 !important; }
  .admin-topbar { padding: .75rem 1rem; }
  .admin-content { padding: 1rem; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .fin-strip { grid-template-columns: 1fr 1fr !important; }
  .veic-grid { grid-template-columns: 1fr !important; }
}

/* =================================================================
   FORMULÁRIOS — seções e uploader de foto
   ================================================================= */
.form-section-title {
  font-size: .8rem; font-weight: 700; color: var(--text-2);
  text-transform: uppercase; letter-spacing: .6px;
  padding-bottom: .6rem; border-bottom: 1px solid var(--border); margin-bottom: .2rem;
}
.foto-uploader {
  position: relative; width: 100%; aspect-ratio: 4/3;
  border: 2px dashed var(--border); border-radius: 14px;
  background: var(--surface-2); overflow: hidden; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .15s, background .15s;
}
.foto-uploader:hover { border-color: var(--gf-blue); }
.foto-uploader img { width: 100%; height: 100%; object-fit: cover; }
.foto-placeholder { text-align: center; color: var(--text-3); padding: 1rem; }
.foto-placeholder .bi { font-size: 2.2rem; display: block; margin-bottom: .4rem; opacity: .5; }
.foto-placeholder span { display: block; font-size: .85rem; font-weight: 600; color: var(--text-2); }
.foto-placeholder small { font-size: .72rem; }

/* =================================================================
   VEÍCULOS — resumo + grid de cards
   ================================================================= */
.frota-resumo {
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 1rem 1.5rem; box-shadow: var(--shadow);
}
.fr-item { display: flex; flex-direction: column; line-height: 1.1; }
.fr-num  { font-size: 1.6rem; font-weight: 800; color: var(--text); }
.fr-lbl  { font-size: .75rem; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }

.veic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px,1fr)); gap: 1.1rem; }
.veic-card {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; overflow: hidden; text-decoration: none; color: inherit;
  box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s;
}
.veic-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.veic-foto { position: relative; aspect-ratio: 16/10; background: var(--surface-2); }
.veic-foto img { width: 100%; height: 100%; object-fit: cover; }
.veic-foto-vazia { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 2.5rem; opacity: .35; }
.veic-status { position: absolute; top: .6rem; right: .6rem; }
.veic-body { padding: .85rem 1rem 1rem; }
.veic-placa { font-size: 1.05rem; font-weight: 800; color: var(--text); letter-spacing: .5px; }
.veic-modelo { font-size: .85rem; color: var(--text-2); margin-top: .1rem; }
.veic-meta { display: flex; gap: 1rem; margin-top: .6rem; font-size: .76rem; color: var(--text-3); }
.veic-meta .bi { margin-right: 2px; }

/* =================================================================
   DASHBOARD — faixa financeira
   ================================================================= */
.fin-strip { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; }
.fin-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 1rem 1.1rem; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: .8rem;
}
.fin-card-total { background: linear-gradient(135deg, var(--gf-blue), var(--gf-blue-dark)); border: none; }
.fin-card-total .fin-val, .fin-card-total .fin-lbl { color: #fff; }
.fin-card-total .fin-ic { background: rgba(255,255,255,.18); color: #fff; }
.fin-ic {
  width: 42px; height: 42px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
  background: color-mix(in srgb, var(--fc,#1669b3) 14%, transparent); color: var(--fc,#1669b3);
}
.fin-val { font-size: 1.2rem; font-weight: 800; color: var(--text); line-height: 1.1; }
.fin-lbl { font-size: .74rem; color: var(--text-3); font-weight: 600; }

/* =================================================================
   DASHBOARD — agenda
   ================================================================= */
.agenda-lista { display: flex; flex-direction: column; }
.agenda-item {
  display: flex; align-items: center; gap: .9rem; padding: .65rem .25rem;
  border-bottom: 1px solid var(--border); text-decoration: none; color: inherit;
}
.agenda-item:last-child { border-bottom: none; }
.agenda-hora {
  font-size: .95rem; font-weight: 800; color: var(--gf-blue);
  background: var(--gf-blue-light); border-radius: 9px; padding: .3rem .55rem; flex-shrink: 0;
}
.agenda-dest { font-size: .88rem; font-weight: 600; color: var(--text); }
.agenda-meta { font-size: .76rem; color: var(--text-3); }

/* =================================================================
   DASHBOARD — ocorrências mini + ranking + frota mini
   ================================================================= */
.ocorr-mini { display: flex; align-items: flex-start; gap: .7rem; padding: .55rem .2rem; border-bottom: 1px solid var(--border); }
.ocorr-mini:last-child { border-bottom: none; }
.ocorr-mini > .bi { color: var(--gf-red); font-size: 1rem; padding-top: 2px; }
.ocorr-mini-desc { font-size: .85rem; color: var(--text); font-weight: 500; }
.ocorr-mini-meta { font-size: .74rem; color: var(--text-3); }

.rank-item { display: flex; align-items: center; gap: .8rem; padding: .55rem .2rem; border-bottom: 1px solid var(--border); }
.rank-item:last-child { border-bottom: none; }
.rank-pos { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; font-size: .8rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--text-2); }
.rank-pos.rank-1 { background: #fef3c7; color: #b45309; }
.rank-pos.rank-2 { background: #e5e7eb; color: #4b5563; }
.rank-pos.rank-3 { background: #fed7aa; color: #9a3412; }
.rank-avatar { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; overflow: hidden;
  background: var(--gf-blue-light); display: flex; align-items: center; justify-content: center; color: var(--gf-blue); }
.rank-avatar img { width: 100%; height: 100%; object-fit: cover; }
.rank-nome { font-size: .88rem; font-weight: 600; color: var(--text); }
.rank-meta { font-size: .74rem; color: var(--text-3); }
.rank-num  { font-size: 1.2rem; font-weight: 800; color: var(--gf-blue); }

.frota-mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px,1fr)); gap: .8rem; }
.frota-mini { text-align: center; }
.frota-mini-foto { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden;
  background: var(--surface-2); display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 1.4rem; border: 1px solid var(--border); }
.frota-mini-foto img { width: 100%; height: 100%; object-fit: cover; }
.dot-status { position: absolute; bottom: 5px; right: 5px; width: 11px; height: 11px;
  border-radius: 50%; border: 2px solid var(--surface); }
.frota-mini-placa { font-size: .78rem; font-weight: 700; color: var(--text); margin-top: .3rem; }
.frota-mini-st { font-size: .68rem; color: var(--text-3); }

/* =================================================================
   OCORRÊNCIAS — lista completa
   ================================================================= */
.ocorr-lista { display: flex; flex-direction: column; gap: .9rem; }
.ocorr-card { display: flex; gap: 1rem; padding: 1.1rem 1.25rem; }
.ocorr-ic { width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
  background: color-mix(in srgb, var(--oc,#e21f26) 14%, transparent); color: var(--oc,#e21f26); }
.ocorr-body { flex: 1; min-width: 0; }
.ocorr-tipo { font-size: .95rem; font-weight: 700; color: var(--text); }
.ocorr-data { font-size: .78rem; color: var(--text-3); white-space: nowrap; }
.ocorr-desc { font-size: .88rem; color: var(--text-2); margin: .3rem 0 .5rem; }
.ocorr-meta { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .78rem; color: var(--text-3); }
.ocorr-meta .bi { margin-right: 3px; }
.ocorr-foto-link { color: var(--gf-blue); text-decoration: none; font-weight: 600; }

/* =================================================================
   NOTIFICAÇÕES — dropdown do sino (admin)
   ================================================================= */
.notif-item {
  display: flex; gap: .65rem; padding: .7rem .9rem; text-decoration: none; color: inherit;
  border-bottom: 1px solid var(--border); transition: background .12s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.nao-lida { background: color-mix(in srgb, var(--gf-blue) 6%, transparent); }
.notif-item-ic { font-size: 1rem; width: 22px; text-align: center; flex-shrink: 0; padding-top: 1px; }
.notif-item-body { display: flex; flex-direction: column; min-width: 0; }
.notif-item-titulo { font-size: .85rem; font-weight: 700; color: var(--text); }
.notif-item-msg { font-size: .78rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-item-quando { font-size: .72rem; color: var(--text-3); margin-top: 1px; }

/* Página de notificações (admin) */
.notif-row {
  display: flex; gap: .9rem; align-items: flex-start; padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.notif-row:last-child { border-bottom: none; }
.notif-row.nao-lida { background: color-mix(in srgb, var(--gf-blue) 5%, transparent); }
.notif-row-ic {
  width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.15rem;
  background: color-mix(in srgb, var(--nc,#1669b3) 14%, transparent); color: var(--nc,#1669b3);
}
.notif-row-titulo { font-weight: 700; color: var(--text); }
.notif-row-msg { font-size: .88rem; color: var(--text-2); margin-top: .15rem; }
.notif-row-data { font-size: .78rem; color: var(--text-3); white-space: nowrap; }

/* =================================================================
   MOTORISTA — topbar com sino
   ================================================================= */
/* Detalhe da jornada (histórico do motorista) */
.hist-destaque {
  display: flex; align-items: stretch; gap: .5rem; margin: .25rem 0 1rem;
  background: var(--gf-blue-light, rgba(22,105,179,.08)); border-radius: 12px; padding: .75rem 1rem;
}
.hist-destaque-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.hist-destaque-sep { width: 1px; background: var(--border); }
.hist-destaque .hd-num { font-size: 1.45rem; font-weight: 800; color: var(--gf-blue); line-height: 1.1; }
.hist-destaque .hd-lbl { font-size: .72rem; color: var(--text-2); text-transform: uppercase; letter-spacing: .5px; }
.hist-odo { display: flex; flex-direction: column; gap: 0; }
.hist-odo-row {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .55rem .25rem; border-bottom: 1px solid var(--border);
}
.hist-odo-row:last-child { border-bottom: 0; }
.hist-odo .ho-lbl { font-size: .85rem; color: var(--text-2); white-space: nowrap; }
.hist-odo .ho-val { font-size: 1.05rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

.mot-topbar-actions { display: flex; align-items: center; gap: .25rem; }
.mot-iconbtn {
  position: relative; color: rgba(255,255,255,.9); text-decoration: none; font-size: 1.15rem;
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; transition: background .15s;
  /* reset para quando o elemento é um <button> (ex.: alternar tema) */
  background: transparent; border: 0; padding: 0; cursor: pointer; -webkit-appearance: none; appearance: none;
}
.mot-iconbtn:hover { background: rgba(255,255,255,.15); color: #fff; }
.mot-iconbtn:focus-visible { outline: 2px solid rgba(255,255,255,.6); outline-offset: 2px; }
.mot-notif-badge {
  position: absolute; top: 4px; right: 4px; background: var(--gf-red); color: #fff;
  font-size: .62rem; font-weight: 700; min-width: 15px; height: 15px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
  border: 2px solid var(--gf-blue);
}

/* Notificações do motorista (lista) */
.notif-mot { display: flex; gap: .8rem; align-items: flex-start; padding: .9rem 1rem; margin-bottom: .6rem; }
.notif-mot-link { text-decoration: none; color: inherit; }
.notif-mot-link:active { transform: scale(.99); }
.notif-mot.nao-lida { border-left: 3px solid var(--gf-blue); }
.notif-mot-ic {
  width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.15rem;
  background: color-mix(in srgb, var(--nc,#1669b3) 14%, transparent); color: var(--nc,#1669b3);
}
.notif-mot-titulo { font-weight: 700; color: var(--text); }
.notif-mot-msg { font-size: .87rem; color: var(--text-2); margin-top: .15rem; }
.notif-mot-quando { font-size: .74rem; color: var(--text-3); margin-top: .3rem; }

/* =================================================================
   MOTORISTA — Meu Desempenho
   ================================================================= */
.perfil-hero {
  text-align: center; padding: 1.5rem 1rem .5rem;
}
.perfil-avatar {
  width: 84px; height: 84px; border-radius: 50%; margin: 0 auto .75rem; overflow: hidden;
  background: linear-gradient(135deg, var(--gf-blue), var(--gf-blue-dark));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.8rem; font-weight: 800; box-shadow: 0 8px 24px rgba(22,105,179,.35);
}
.perfil-avatar img { width: 100%; height: 100%; object-fit: cover; }
.perfil-nome { font-size: 1.3rem; font-weight: 800; color: var(--text); }
.perfil-user { font-size: .85rem; color: var(--text-3); }
.perfil-rank {
  display: inline-flex; align-items: center; gap: .4rem; margin-top: .7rem;
  background: #fef3c7; color: #b45309; border-radius: 20px; padding: .35rem .9rem;
  font-size: .82rem; font-weight: 700;
}
[data-theme="dark"] .perfil-rank { background: rgba(245,158,11,.18); color: #fbbf24; }

.perfil-mes-card {
  background: linear-gradient(135deg, var(--gf-blue), var(--gf-blue-dark));
  border-radius: 18px; padding: 1.1rem 1.3rem; margin: 1rem 0; color: #fff;
  box-shadow: 0 10px 30px rgba(22,105,179,.3);
}
.pm-label { font-size: .8rem; font-weight: 600; opacity: .85; margin-bottom: .5rem; }
.pm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.pm-val { font-size: 1.9rem; font-weight: 800; line-height: 1; }
.pm-sub { font-size: .78rem; opacity: .85; margin-top: .2rem; }

.perfil-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: 1.25rem; }
.perfil-stat { padding: 1rem; text-align: center; }
.ps-ic {
  width: 40px; height: 40px; border-radius: 11px; margin: 0 auto .5rem;
  display: flex; align-items: center; justify-content: center; font-size: 1.15rem;
  background: color-mix(in srgb, var(--c,#1669b3) 14%, transparent); color: var(--c,#1669b3);
}
.ps-val { font-size: 1.5rem; font-weight: 800; color: var(--text); line-height: 1; }
.ps-lbl { font-size: .75rem; color: var(--text-3); margin-top: .25rem; }

.perfil-sec-titulo { font-size: .82rem; font-weight: 700; color: var(--text-2); text-transform: uppercase;
  letter-spacing: .5px; margin: .5rem 0 .75rem; }
.hist-mini { display: flex; align-items: center; gap: .8rem; padding: .8rem 1rem; margin-bottom: .6rem; }
.hist-mini-ic {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--gf-blue-light); color: var(--gf-blue); font-size: 1.1rem;
}
.hist-mini-placa { font-weight: 700; color: var(--text); }
.hist-mini-data { font-size: .76rem; color: var(--text-3); }
.hist-mini-km { font-weight: 800; color: var(--gf-blue); white-space: nowrap; }

/* =================================================================
   MOTORISTA — Jornada hero (cronômetro ao vivo)
   ================================================================= */
.jornada-hero {
  background: linear-gradient(140deg, var(--gf-blue) 0%, var(--gf-blue-dark) 100%);
  border-radius: 22px; padding: 1.6rem 1.3rem; color: #fff; text-align: center;
  margin-bottom: 1rem; box-shadow: 0 14px 40px rgba(22,105,179,.35); position: relative; overflow: hidden;
}
.jornada-hero::after {
  content: ''; position: absolute; top: -40%; right: -20%; width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(255,255,255,.12), transparent 70%); pointer-events: none;
}
.jh-status {
  display: inline-flex; align-items: center; gap: .45rem; font-size: .82rem; font-weight: 700;
  background: rgba(255,255,255,.18); border-radius: 20px; padding: .3rem .85rem; margin-bottom: 1rem;
}
.jh-pulse { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: livepulse 1.6s infinite; }
.jh-timer { font-size: 3rem; font-weight: 800; letter-spacing: 2px; line-height: 1; font-variant-numeric: tabular-nums; }
.jh-timer-lbl { font-size: .78rem; opacity: .8; text-transform: uppercase; letter-spacing: 1px; margin-top: .3rem; }
.jh-veiculo {
  display: flex; align-items: center; gap: .7rem; justify-content: center;
  margin-top: 1.3rem; padding-top: 1.1rem; border-top: 1px solid rgba(255,255,255,.2); text-align: left;
}
.jh-veiculo > .bi { font-size: 1.6rem; }
.jh-placa { font-weight: 800; font-size: 1.05rem; }
.jh-km { font-size: .8rem; opacity: .85; }

.btn-jornada {
  display: flex; align-items: center; gap: .7rem; padding: 1rem 1.1rem; border-radius: 15px;
  font-weight: 700; font-size: .95rem; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); text-decoration: none; box-shadow: var(--shadow); transition: transform .1s;
}
.btn-jornada:active { transform: scale(.98); }
.btn-jornada > .bi:first-child {
  width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; flex-shrink: 0;
}
.btn-jornada .bi-chevron-right { font-size: .9rem; color: var(--text-3); }
.btn-jornada-abast > .bi:first-child { background: rgba(245,158,11,.14); color: #f59e0b; }
.btn-jornada-ocorr > .bi:first-child { background: rgba(226,31,38,.14); color: var(--gf-red); }
.btn-jornada-fim   > .bi:first-child { background: var(--gf-blue-light); color: var(--gf-blue); }

/* =================================================================
   MOTORISTA — Escolha de veículo + Checklist de saída
   ================================================================= */
.veic-escolha {
  display: flex; align-items: center; gap: .75rem; text-decoration: none; color: inherit;
  padding: .7rem .25rem; border-bottom: 1px solid var(--border); transition: background .12s;
}
.veic-escolha:last-child { border-bottom: none; }
.veic-escolha:active { background: var(--surface-2); }

.chk-hero {
  display: flex; align-items: center; gap: .9rem;
  background: linear-gradient(135deg, var(--gf-blue), var(--gf-blue-dark));
  color: #fff; border-radius: 18px; padding: 1.1rem 1.3rem; box-shadow: 0 10px 30px rgba(22,105,179,.3);
}
.chk-hero > .bi { font-size: 2rem; }
.chk-hero-tit { font-size: 1.15rem; font-weight: 800; }
.chk-hero-sub { font-size: .85rem; opacity: .85; }

.chk-item {
  display: flex; align-items: center; gap: .8rem; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: .85rem 1rem; margin-bottom: .6rem; box-shadow: var(--shadow);
}
.chk-item-ic {
  width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.15rem;
  background: var(--gf-blue-light); color: var(--gf-blue);
}
.chk-item-tit { display: block; font-weight: 700; color: var(--text); }
.chk-item-desc { display: block; font-size: .76rem; color: var(--text-3); }
.chk-switch .form-check-input { width: 2.8em; height: 1.5em; cursor: pointer; }
.chk-switch .form-check-input:checked { background-color: #16a34a; border-color: #16a34a; }
.chk-switch .form-check-input:not(:checked) { background-color: var(--gf-red); border-color: var(--gf-red);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e"); }
/* Item marcado como problema fica destacado */
.chk-item.tem-problema { border-color: var(--gf-red); }
.chk-item.tem-problema .chk-item-ic { background: rgba(226,31,38,.14); color: var(--gf-red); }
.chk-item.tem-problema .chk-estado-txt { color: var(--gf-red); }

/* Estado do item (rótulo + switch) */
.chk-item-estado { display: flex; flex-direction: column; align-items: center; gap: 4px; flex-shrink: 0; }
.chk-estado-txt { font-size: .68rem; font-weight: 700; color: #16a34a; white-space: nowrap; }

/* Aviso de item crítico com problema */
.chk-aviso { display: flex; gap: .6rem; align-items: flex-start; margin-top: 1rem;
  background: rgba(226,31,38,.08); border: 1px solid rgba(226,31,38,.3); border-radius: 12px;
  padding: .8rem 1rem; font-size: .85rem; color: var(--text); }
.chk-aviso .bi { color: var(--gf-red); font-size: 1.2rem; flex-shrink: 0; }

/* Foto do comprovante (abastecimento) */
.foto-comprovante {
  position: relative; width: 100%; aspect-ratio: 4/3; max-height: 240px;
  border: 2px dashed var(--border); border-radius: 14px; background: var(--surface-2);
  overflow: hidden; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.foto-comprovante img { width: 100%; height: 100%; object-fit: cover; }
.foto-comprovante-vazia { text-align: center; color: var(--text-3); }
.foto-comprovante-vazia .bi { font-size: 2.4rem; display: block; margin-bottom: .4rem; }
.foto-comprovante-vazia span { font-size: .85rem; font-weight: 600; color: var(--text-2); }

/* =================================================================
   ABASTECIMENTO — detalhe + cards de lista (mobile)
   ================================================================= */
.abast-foto { display: block; border-radius: 12px; overflow: hidden; }
.abast-foto img { width: 100%; height: auto; display: block; }
.abast-foto-vazia { aspect-ratio: 4/3; border-radius: 12px; background: var(--surface-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-3); gap: .4rem; }
.abast-foto-vazia .bi { font-size: 2.4rem; }
.abast-dados { display: flex; flex-direction: column; }
.ad-row { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--border); }
.ad-row:last-child { border-bottom: none; }
.ad-lbl { color: var(--text-3); font-size: .85rem; }
.ad-val { font-weight: 600; color: var(--text); text-align: right; }

.list-card { display: flex; align-items: center; gap: .8rem; padding: .85rem 1rem; margin-bottom: .6rem;
  text-decoration: none; color: inherit; }
.list-card-ic { width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.15rem;
  background: color-mix(in srgb, var(--c,#1669b3) 14%, transparent); color: var(--c,#1669b3); }

/* =================================================================
   MOTORISTA — veículos autorizados (form)
   ================================================================= */
.veic-aut-lista { display: grid; grid-template-columns: 1fr; gap: .5rem; }
@media (min-width: 600px){ .veic-aut-lista { grid-template-columns: 1fr 1fr; } }
.veic-aut {
  display: flex; align-items: center; gap: .5rem; padding: .6rem .8rem;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2);
  transition: border-color .15s, background .15s;
}
.veic-aut.on { border-color: var(--gf-blue); background: var(--gf-blue-light); }
.veic-aut-check { display: flex; align-items: center; gap: .6rem; flex: 1; margin: 0; cursor: pointer; }
.veic-aut-check input { width: 1.2em; height: 1.2em; flex-shrink: 0; }
.veic-aut-info { display: flex; flex-direction: column; line-height: 1.15; }
.veic-aut-star { margin: 0; cursor: pointer; position: relative; }
.veic-aut-star input { position: absolute; opacity: 0; }
.veic-aut-star .bi { font-size: 1.15rem; color: var(--text-3); transition: color .15s, transform .1s; }
.veic-aut-star input:checked + .bi { color: #f59e0b; transform: scale(1.15); }
.veic-aut-star:hover .bi { color: #f59e0b; }

/* =================================================================
   PERFIL — editar foto
   ================================================================= */
.perfil-foto-edit {
  position: relative; width: 110px; height: 110px; margin: 0 auto; cursor: pointer;
  border-radius: 50%; overflow: hidden;
  background: linear-gradient(135deg, var(--gf-blue), var(--gf-blue-dark));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(22,105,179,.35);
}
.perfil-foto-edit img { width: 100%; height: 100%; object-fit: cover; }
.perfil-foto-iniciais { color: #fff; font-size: 2.2rem; font-weight: 800; }
.perfil-foto-cam {
  position: absolute; right: 4px; bottom: 4px; width: 32px; height: 32px; border-radius: 50%;
  background: #fff; color: var(--gf-blue); display: flex; align-items: center; justify-content: center;
  font-size: .95rem; box-shadow: 0 2px 8px rgba(0,0,0,.25); border: 2px solid var(--gf-blue);
}
.topbar-user { cursor: pointer; transition: color .15s; }
a.topbar-user:hover { color: var(--gf-blue); }

/* =================================================================
   FINALIZAR JORNADA — referência de KM
   ================================================================= */
.km-ref {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px;
  padding: .85rem 1.1rem;
}
.km-ref-lbl { font-size: .85rem; color: var(--text-2); font-weight: 600; }
.km-ref-val { font-size: 1.4rem; font-weight: 800; color: var(--text); letter-spacing: 1px; }

/* =================================================================
   OCORRÊNCIAS — central de inspeções (visual)
   ================================================================= */
.insp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap: 1.1rem; }
.insp-card { overflow: hidden; display: flex; flex-direction: column; }
.insp-foto { position: relative; aspect-ratio: 16/10; background: var(--surface-2); cursor: pointer; overflow: hidden; }
.insp-foto img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.insp-foto:hover img { transform: scale(1.04); }
.insp-foto-vazia { width:100%; height:100%; display:flex; flex-direction:column; align-items:center; justify-content:center;
  color: var(--text-3); gap:.3rem; cursor:default; }
.insp-foto-vazia .bi { font-size: 2rem; }
.insp-zoom { position:absolute; right:.6rem; bottom:.6rem; width:32px; height:32px; border-radius:8px;
  background: rgba(0,0,0,.55); color:#fff; display:flex; align-items:center; justify-content:center; font-size:.9rem; }
.insp-tag { position:absolute; top:.6rem; left:.6rem; color:#fff; font-size:.72rem; font-weight:700;
  padding:.2rem .6rem; border-radius:20px; }
.insp-body { padding: .9rem 1rem 1rem; }
.insp-data { font-size:.76rem; color: var(--text-3); }
.insp-desc { font-size:.92rem; color: var(--text); font-weight:500; margin:.35rem 0 .6rem; }
.insp-meta { display:flex; flex-direction:column; gap:.2rem; font-size:.78rem; color: var(--text-2); }
.insp-meta .bi { color: var(--text-3); margin-right:3px; }

.insp-lightbox { display:none; position:fixed; inset:0; z-index:1000; background:rgba(0,0,0,.9);
  align-items:center; justify-content:center; padding:1rem; cursor:zoom-out; }
.insp-lightbox.open { display:flex; }
.insp-lightbox img { max-width:100%; max-height:90vh; border-radius:10px; }
.insp-lightbox-close { position:absolute; top:1rem; right:1.2rem; color:#fff; font-size:1.6rem; cursor:pointer; }

/* =================================================================
   MOTORISTA — multas (lista + detalhe)
   ================================================================= */
.multa-card { display:flex; align-items:center; gap:.8rem; padding:.7rem .8rem; margin-bottom:.6rem;
  text-decoration:none; color:inherit; }
.multa-card-foto { width:54px; height:54px; border-radius:10px; overflow:hidden; flex-shrink:0;
  background: var(--surface-2); display:flex; align-items:center; justify-content:center; color: var(--gf-red); font-size:1.3rem; }
.multa-card-foto img { width:100%; height:100%; object-fit:cover; }
.multa-foto-hero { display:block; position:relative; border-radius:16px; overflow:hidden; margin-bottom:1rem;
  box-shadow: var(--shadow); }
.multa-foto-hero img { width:100%; max-height:300px; object-fit:cover; display:block; }
.multa-det { display:flex; flex-direction:column; }
.md-row { display:flex; justify-content:space-between; gap:1rem; padding:.7rem 1rem; border-bottom:1px solid var(--border); }
.md-row:last-child { border-bottom:none; }
.md-lbl { color: var(--text-3); font-size:.82rem; }
.md-val { font-weight:600; color: var(--text); text-align:right; }

/* =================================================================
   STATUS OPERACIONAL — destaque de pendentes + ação inline
   ================================================================= */
.linha-pendente > td { background: color-mix(in srgb, var(--gf-red) 6%, transparent); }
.list-card-pendente { border-left: 3px solid var(--gf-red); }
.insp-pendente { border-color: color-mix(in srgb, var(--gf-red) 45%, var(--border)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--gf-red) 25%, transparent), var(--shadow); }
.insp-acao { display: flex; gap: .4rem; align-items: center; margin-top: .5rem; padding-top: .7rem; border-top: 1px solid var(--border); }
.insp-acao .form-select-sm { flex: 1; min-width: 0; }

/* =================================================================
   DASHBOARD — controle operacional (multas / ocorrências)
   ================================================================= */
.ctrl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px){ .ctrl-grid { grid-template-columns: 1fr; } }
.ctrl-card { display:block; text-decoration:none; color:inherit; padding: 1.1rem 1.25rem; transition: transform .12s, box-shadow .12s; }
.ctrl-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.ctrl-titulo { font-size:.9rem; font-weight:700; color: var(--text); margin-bottom:.8rem; }
.ctrl-itens { display:flex; gap:1.5rem; }
.ctrl-itens > div { display:flex; flex-direction:column; line-height:1.1; }
.ctrl-num { font-size:1.7rem; font-weight:800; }
.ctrl-lbl { font-size:.74rem; color: var(--text-3); font-weight:600; }
.ctrl-rodape { display:flex; justify-content:space-between; gap:.5rem; margin-top:.9rem; padding-top:.7rem;
  border-top:1px solid var(--border); font-size:.8rem; font-weight:600; }

/* =================================================================
   RODAPÉ — assinatura GF Comunicação (discreto)
   ================================================================= */
.gf-footer { text-align: center; font-size: .68rem; color: var(--text-3); opacity: .6;
  padding: 1.6rem 1rem .8rem; margin-top: auto; letter-spacing: .2px; }
.gf-footer a { color: var(--text-2); text-decoration: none; font-weight: 600; }
.gf-footer a:hover { color: var(--gf-blue); text-decoration: underline; }
.motorista-body .gf-footer { padding-bottom: .5rem; }
.gf-footer-login { position: fixed; left: 0; right: 0; bottom: 0; color: rgba(255,255,255,.7); }
.gf-footer-login a { color: rgba(255,255,255,.92); }
.gf-footer-login a:hover { color: #fff; }

/* =================================================================
   BADGES com rótulo (evita ambiguidade entre status x situação/pagamento)
   ================================================================= */
.badge-par { display: inline-flex; align-items: center; gap: .3rem; margin-right: .6rem; }
.badge-par .bp-lbl { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--text-3); }
.badge-grupo { display: flex; flex-wrap: wrap; gap: .15rem .2rem; align-items: center; }

/* =================================================================
   HISTÓRICO DO VEÍCULO (consolidado)
   ================================================================= */
.vh-foto { width: 84px; height: 64px; border-radius: 12px; overflow: hidden; flex-shrink: 0;
  background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--text-3); font-size: 1.8rem; }
.vh-foto img { width: 100%; height: 100%; object-fit: cover; }
.vh-resumo { display: grid; grid-template-columns: repeat(6, 1fr); gap: .8rem; }
@media (max-width: 900px){ .vh-resumo { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px){ .vh-resumo { grid-template-columns: repeat(2, 1fr); } }
.vh-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: .9rem; text-align: center; box-shadow: var(--shadow); }
.vh-num { display: block; font-size: 1.25rem; font-weight: 800; color: var(--text); line-height: 1.1; }
.vh-lbl { font-size: .72rem; color: var(--text-3); font-weight: 600; }
.vh-item { display: flex; align-items: center; gap: .8rem; padding: .6rem .1rem; border-bottom: 1px solid var(--border); }
.vh-item:last-child { border-bottom: none; }

/* =================================================================
   RELATÓRIOS — cards no mobile (rótulo: valor)
   ================================================================= */
.rel-cards { padding: .6rem; display: flex; flex-direction: column; gap: .6rem; }
.rel-card { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.rel-row { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem .8rem; border-bottom: 1px solid var(--border); }
.rel-row:last-child { border-bottom: none; }
.rel-row-head { background: var(--surface-2); }
.rel-k { font-size: .72rem; text-transform: uppercase; letter-spacing: .4px; color: var(--text-3); font-weight: 600; }
.rel-v { font-size: .88rem; color: var(--text); font-weight: 600; text-align: right; }
.rel-row-head .rel-v { color: var(--gf-blue); }

/* Card de perfil do admin no dashboard */
/* Faixa de alertas do dashboard (preventiva + documentos) */
.dash-alertas { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .75rem; }
.dash-alerta { display: flex; align-items: center; gap: .7rem; padding: .8rem 1rem; border-radius: 12px;
  text-decoration: none; font-size: .9rem; border: 1px solid; transition: transform .12s, box-shadow .12s; }
.dash-alerta:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.dash-alerta > .bi:first-child { font-size: 1.3rem; }
.dash-alerta div { line-height: 1.25; }
.dash-alerta strong { font-size: 1.05rem; }
.dash-alerta-danger { background: color-mix(in srgb, var(--gf-red) 10%, transparent); border-color: color-mix(in srgb, var(--gf-red) 35%, transparent); color: var(--gf-red); }
.dash-alerta-warning { background: color-mix(in srgb, #f59e0b 12%, transparent); border-color: color-mix(in srgb, #f59e0b 40%, transparent); color: #b45309; }
[data-theme="dark"] .dash-alerta-warning { color: #fbbf24; }

/* Mini-itens de documento/plano (cadastro de veículo e motorista) */
.doc-mini, .prev-mini { display: flex; align-items: center; gap: .6rem; padding: .55rem .75rem;
  border: 1px solid var(--border); border-radius: 10px; transition: background .12s; }
.doc-mini:hover, .prev-mini:hover { background: var(--surface-2); }

.dash-perfil { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; }
.dash-perfil-av { flex-shrink: 0; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  font-size: 1.8rem; color: var(--gf-blue); background: color-mix(in srgb, var(--gf-blue) 12%, transparent); }
.dash-perfil-info { flex: 1; min-width: 0; }
.dash-perfil-saud { font-size: 1.05rem; color: var(--text); }
.dash-perfil-meta { display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: .8rem; color: var(--text-3); margin-top: .15rem; }
@media (max-width: 560px) {
  .dash-perfil { gap: .75rem; padding: .85rem 1rem; }
  .dash-perfil-av { width: 44px; height: 44px; font-size: 1.5rem; }
  .dash-perfil .btn { padding: .25rem .5rem; }
  .dash-perfil .btn span, .dash-perfil-meta span:first-child { }
}

/* Resumo consolidado (cards de KPI) */
.rel-resumo { display: grid; grid-template-columns: repeat(3, 1fr); gap: .9rem; }
.rel-kpi { display: flex; align-items: center; gap: .8rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: 16px; padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.rel-kpi-ic { flex-shrink: 0; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  font-size: 1.3rem; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.rel-kpi-val { font-size: 1.35rem; font-weight: 800; line-height: 1.1; color: var(--text); }
.rel-kpi-lbl { font-size: .8rem; font-weight: 600; color: var(--text-2); }
.rel-kpi-sub { font-size: .72rem; color: var(--text-3); }
.rel-sec-ic { width: 30px; height: 30px; border-radius: 9px; display: inline-grid; place-items: center;
  font-size: .95rem; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
@media (max-width: 992px) { .rel-resumo { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) {
  .rel-resumo { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .rel-kpi { padding: .7rem .75rem; gap: .55rem; flex-direction: column; align-items: flex-start; }
  .rel-kpi-ic { width: 38px; height: 38px; font-size: 1.05rem; }
  .rel-kpi-val { font-size: 1.1rem; }
}

/* =================================================================
   TOOLBAR — filtros com scroll + ação (responsivo)
   ================================================================= */
.pg-head { display: flex; gap: .75rem; align-items: center; }
.chips-scroll { display: flex; gap: .5rem; overflow-x: auto; flex: 1; min-width: 0;
  padding-bottom: 2px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.chips-scroll::-webkit-scrollbar { height: 0; }
.chips-scroll .btn { white-space: nowrap; flex-shrink: 0; }
.chips-acao { flex-shrink: 0; white-space: nowrap; }
@media (max-width: 640px) {
  .pg-head { flex-direction: column; align-items: stretch; }
  .chips-acao { width: 100%; }
}

/* =================================================================
   MAPA AO VIVO
   ================================================================= */
.mapa-wrap { display: grid; grid-template-columns: 320px 1fr; gap: 1rem; height: calc(100vh - 140px); min-height: 460px; }
.mapa-side { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 1rem; overflow-y: auto; box-shadow: var(--shadow); }
.mapa-box { border-radius: 16px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); }
#mapa { width: 100%; height: 100%; min-height: 460px; }
.mapa-item { display: flex; align-items: center; gap: .7rem; padding: .6rem .3rem; border-bottom: 1px solid var(--border); cursor: pointer; border-radius: 8px; }
.mapa-item:last-child { border-bottom: none; }
.mapa-item:hover { background: var(--surface-2); }
.mapa-item-ic { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #fff; }
.mapa-item-ic.on  { background: #16a34a; }
.mapa-item-ic.off { background: var(--text-3); }
.leaflet-popup-content { font-family: 'Alexandria', sans-serif; font-size: .82rem; }
@media (max-width: 900px) {
  .mapa-wrap { grid-template-columns: 1fr; height: auto; }
  .mapa-side { max-height: 230px; order: 2; }
  .mapa-box { order: 1; height: 60vh; }
}

/* =================================================================
   TRAJETO (histórico do caminho)
   ================================================================= */
.traj-resumo { display: grid; grid-template-columns: repeat(4,1fr); gap: .8rem; }
@media (max-width: 600px){ .traj-resumo { grid-template-columns: 1fr 1fr; } }
.traj-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: .9rem; text-align: center; box-shadow: var(--shadow); }
.tk-num { display: block; font-size: 1.15rem; font-weight: 800; color: var(--text); line-height: 1.1; }
.tk-lbl { font-size: .72rem; color: var(--text-3); font-weight: 600; }
.traj-mapa { width: 100%; height: 520px; }
@media (max-width: 900px){ .traj-mapa { height: 62vh; min-height: 360px; } }
.vh-item-link { text-decoration: none; color: inherit; border-radius: 8px; }
.vh-item-link:hover { background: var(--surface-2); }

/* =================================================================
   MAPA — contém z-index do Leaflet (evita cobrir o sino/notificações)
   ================================================================= */
.mapa-box, #mapa, .traj-mapa { position: relative; z-index: 0; }
.notif-dropdown { z-index: 600; }

/* =================================================================
   ACONTECENDO AGORA — painel em destaque
   ================================================================= */
.live-hero { padding: 0; overflow: hidden; border: 1px solid var(--border); }
.live-hero-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .9rem 1.25rem; background: linear-gradient(135deg, color-mix(in srgb, var(--gf-red) 10%, var(--surface)), var(--surface));
  border-bottom: 1px solid var(--border); }
.live-hero-titulo { font-weight: 800; font-size: 1.02rem; color: var(--text); display: flex; align-items: center; gap: .5rem; }
.live-hero-titulo .bi { color: var(--gf-red); }
.live-hero-mapa { font-size: .82rem; font-weight: 600; text-decoration: none; color: var(--gf-blue);
  background: var(--gf-blue-light); padding: .35rem .7rem; border-radius: 20px; white-space: nowrap; transition: background .15s; }
.live-hero-mapa:hover { background: color-mix(in srgb, var(--gf-blue) 22%, transparent); }
.live-hero-feed { max-height: 340px; overflow-y: auto; padding: .4rem .6rem; }
@media (min-width: 768px){ .live-hero-feed { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.2rem; } }
.min0 { min-width: 0; }
.live-item { display: flex; align-items: center; gap: .7rem; padding: .6rem .65rem; border-bottom: 1px solid var(--border); }
.live-ic { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0; }
.live-titulo { font-size: .8rem; font-weight: 700; color: var(--text); }
.live-msg { font-size: .8rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-quando { font-size: .72rem; color: var(--text-3); white-space: nowrap; flex-shrink: 0; }

/* =================================================================
   NUDGE — incentivo discreto p/ ativar localização/notificações
   ================================================================= */
.gf-nudge { display: flex; align-items: center; gap: .6rem; padding: .55rem .9rem;
  background: color-mix(in srgb, var(--gf-blue) 12%, var(--surface)); color: var(--text);
  border-bottom: 1px solid var(--border); font-size: .82rem; }
.gf-nudge > .bi { color: var(--gf-blue); font-size: 1rem; }
.gf-nudge span { flex: 1; min-width: 0; }
.gf-nudge-btn { background: var(--gf-blue); color: #fff; border: none; border-radius: 20px;
  padding: .3rem .9rem; font-size: .8rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.gf-nudge-btn:hover { background: var(--gf-blue-dark); }
