:root {
  --ink: #101828;
  --muted: #667085;
  --line: #d0d5dd;
  --line-soft: #eaecf0;
  --blue: #155eef;
  --blue-dark: #0b1f4d;
  --green: #067647;
  --bg: #f6f8fb;
  --surface: #ffffff;
}
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-size: 14px; }
.login-page { min-height: 100vh; background: linear-gradient(135deg, #0b1f4d, #14532d); }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-panel { width: min(100%, 430px); background: #fff; border-radius: 8px; padding: 30px; box-shadow: 0 24px 70px rgba(16,24,40,.28); }
.login-panel h1 { font-size: 1.45rem; margin: 14px 0 6px; font-weight: 750; }
.login-panel p { color: var(--muted); margin: 0; }
.brand-mark, .brand span { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; background: #1d4ed8; color: #fff; font-weight: 800; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 264px; background: #0b1220; border-right: 1px solid #182235; padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 7px; color: #cbd5e1; text-decoration: none; font-weight: 600; margin-bottom: 2px; }
.sidebar a:hover { background: #182235; color: #fff; }
.sidebar a i { color: #93c5fd; }
.brand { margin-bottom: 16px; color: #fff !important; }
.brand strong { font-size: 1.05rem; }
.main { flex: 1; padding: 24px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 18px; }
.topbar h1 { display: inline-block; margin: 0 0 0 8px; font-size: 1.45rem; vertical-align: middle; font-weight: 750; letter-spacing: 0; }
.user-pill { display: flex; align-items: center; gap: 9px; background: #fff; border: 1px solid var(--line-soft); border-radius: 8px; padding: 7px 8px 7px 12px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.user-pill small { color: var(--muted); }
.metric, .content-block, .form-block { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 8px; padding: 16px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.metric span, .metric small { display: block; color: var(--muted); }
.metric strong { display: block; font-size: 1.45rem; margin: 6px 0; font-weight: 780; }
.content-block h2, .form-block h2 { font-size: 1.02rem; margin-bottom: 12px; font-weight: 750; }
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table thead th { background: #f8fafc; border-bottom: 1px solid var(--line); color: #475467; font-size: .78rem; text-transform: uppercase; letter-spacing: .02em; white-space: nowrap; }
.table tbody td { border-color: var(--line-soft); vertical-align: middle; }
.table tbody tr:hover { background: #f9fbff; }
.table-responsive { border: 1px solid var(--line-soft); border-radius: 8px; }
.table-responsive .table thead th:first-child, .table-responsive .table tbody td:first-child { padding-left: 14px; }
.actionbar { display: flex; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar-form { display: flex; gap: 8px; align-items: center; min-width: min(100%, 420px); }
.toolbar-form .form-control { min-width: 220px; }
.btn, .form-control, .form-select { border-radius: 7px; min-height: 40px; }
.btn { font-weight: 650; }
.btn-sm { min-height: 32px; }
.status-badge { border-radius: 999px; padding: 4px 9px; font-size: .78rem; font-weight: 750; text-transform: uppercase; }
.status-ativo { background: #dcfce7; color: #166534; }
.status-inativo { background: #fee2e2; color: #991b1b; }
.pagination-shell { display: flex; gap: 12px; justify-content: space-between; align-items: center; padding-top: 14px; flex-wrap: wrap; }
.pagination-summary { color: var(--muted); font-size: .9rem; }
.pagination .page-link { color: #344054; border-color: var(--line-soft); min-width: 38px; text-align: center; }
.pagination .page-item.active .page-link { background: var(--blue); border-color: var(--blue); color: #fff; }
.vehicle-photo { display:grid; place-items:center; height:150px; border:1px dashed var(--line); border-radius:8px; background:#f8fafc; color:var(--blue); font-size:3rem; }
canvas { max-width:100%; }
@media (max-width: 991px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 20; transform: translateX(-100%); transition: .2s ease; width: 82vw; max-width: 310px; }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 0 100vw rgba(0,0,0,.35); }
  .main { padding: 14px; }
  .topbar { align-items: flex-start; }
  .user-pill { flex-wrap: wrap; justify-content: flex-end; }
  .toolbar-form { width: 100%; }
  .toolbar-form .form-control, .toolbar-form .btn { flex: 1 1 100%; }
  .pagination-shell { align-items: flex-start; }
  .pagination { flex-wrap: wrap; gap: 4px; }
}
@media print {
  .sidebar, .topbar .btn, .user-pill, .actionbar, .pagination-shell { display: none !important; }
  .main { padding: 0; }
  body { background: #fff; }
  .content-block { box-shadow: none; border: 0; }
}

.mobile-bottom-nav, .mobile-more-sheet, .mobile-app-title, .mobile-card-list { display: none; }

@media (max-width: 767px) {
  body { font-size: 13px; background: #eef2f7; padding-bottom: 76px; overflow-x: hidden; }
  .app-shell { display: block; min-height: 100vh; }
  .sidebar, .sidebar.open, .sidebar-toggle { display: none !important; }
  .main { padding: 10px 10px 86px; width: 100%; overflow-x: hidden; }
  .topbar { position: sticky; top: 0; z-index: 12; min-height: 52px; margin: -10px -10px 10px; padding: 8px 10px; align-items: center; background: #fff; border-bottom: 1px solid var(--line-soft); box-shadow: 0 1px 8px rgba(16,24,40,.06); }
  .topbar > div:first-child { min-width: 0; display: flex; align-items: center; gap: 8px; }
  .mobile-app-title { display: inline-flex; color: var(--blue); font-size: .72rem; font-weight: 850; letter-spacing: 0; }
  .topbar h1 { display: block; margin: 0; font-size: 1rem; line-height: 1.15; max-width: 54vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .user-pill { border: 0; box-shadow: none; background: transparent; padding: 0; gap: 3px; flex-direction: column; align-items: flex-end; font-size: .78rem; max-width: 34vw; }
  .user-pill span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .user-pill .btn { display: none; }
  .alert { border-radius: 8px; padding: 9px 10px; margin-bottom: 10px; }
  h1 { font-size: 18px; }
  h2, h3, .content-block h2, .form-block h2 { font-size: 16px; }
  .row.g-3 { --bs-gutter-x: .55rem; --bs-gutter-y: .55rem; }
  .metric, .content-block, .form-block { border-radius: 8px; padding: 11px; box-shadow: 0 1px 6px rgba(16,24,40,.06); }
  .metric span, .metric small { font-size: .76rem; }
  .metric strong { font-size: 1.08rem; margin: 3px 0; word-break: break-word; }
  .btn, .form-control, .form-select { min-height: 44px; font-size: 13px; }
  .btn-sm { min-height: 38px; }
  .actionbar { display: grid; gap: 8px; margin-bottom: 10px; }
  .toolbar-form, .toolbar-form .form-control, .toolbar-form .btn { width: 100%; min-width: 0; }
  .toolbar-form { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .table-responsive.mobile-table-hide { display: none; }
  .mobile-card-list { display: grid; gap: 9px; }
  .mobile-list-card { background: #fff; border: 1px solid var(--line-soft); border-radius: 8px; padding: 11px; box-shadow: 0 1px 6px rgba(16,24,40,.06); }
  .mobile-list-card h2, .mobile-list-card h3 { font-size: .96rem; margin: 0 0 6px; font-weight: 800; }
  .mobile-card-meta { display: grid; gap: 3px; color: var(--muted); font-size: .82rem; }
  .mobile-card-meta strong { color: var(--ink); font-weight: 750; }
  .mobile-card-actions { display: flex; gap: 7px; margin-top: 10px; }
  .mobile-card-actions .btn { flex: 1; }
  .pagination-shell { gap: 8px; padding-top: 10px; }
  .pagination-summary { font-size: .8rem; }
  .pagination .page-link { min-width: 34px; padding: 7px 9px; }
  .report-title-block, .report-total-highlight { font-size: .82rem; }
  .mobile-bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1050; display: grid; grid-template-columns: repeat(5, 1fr); height: 66px; padding: 5px 6px calc(5px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line-soft); box-shadow: 0 -6px 18px rgba(16,24,40,.12); }
  .mobile-nav-item { border: 0; background: transparent; color: #667085; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; font-size: .7rem; font-weight: 750; border-radius: 8px; min-width: 0; }
  .mobile-nav-item i { font-size: 1.2rem; line-height: 1; }
  .mobile-nav-item.active { color: var(--blue); background: #eff6ff; }
  .mobile-more-sheet { display: block; height: auto !important; max-height: 72vh; border-radius: 16px 16px 0 0; }
  .mobile-more-sheet .offcanvas-title { font-size: 1rem; font-weight: 850; }
  .mobile-more-sheet small { color: var(--muted); }
  .mobile-more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
  .mobile-more-grid a { min-height: 74px; border: 1px solid var(--line-soft); border-radius: 8px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; text-decoration: none; color: var(--ink); font-weight: 750; font-size: .78rem; background: #f8fafc; text-align: center; }
  .mobile-more-grid i { font-size: 1.25rem; color: var(--blue); }
  .mobile-more-grid .mobile-more-danger { color: #b42318; }
  .mobile-more-grid .mobile-more-danger i { color: #b42318; }
}

@media (min-width: 768px) {
  .mobile-only { display: none !important; }
}

@media print {
  .mobile-bottom-nav, .mobile-more-sheet, .mobile-card-list { display: none !important; }
  .table-responsive.mobile-table-hide { display: block !important; }
}

.app-kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.app-kpi-grid div { border: 1px solid var(--line-soft); border-radius: 8px; padding: 10px; background: #f8fafc; }
.app-kpi-grid span { display: block; color: var(--muted); font-size: .78rem; }
.app-kpi-grid strong { display: block; margin-top: 3px; font-size: 1rem; }
.app-form-actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 767px) {
  .app-vehicle-summary p { font-size: .82rem; color: var(--muted); }
  .app-kpi-grid { gap: 8px; }
  .app-kpi-grid div { padding: 9px; }
  .app-kpi-grid strong { font-size: .95rem; }
  .app-form-actions { position: sticky; bottom: 76px; z-index: 8; margin: 12px -2px -2px; padding: 8px 0 0; background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 18%); }
  .app-form-actions .btn { flex: 1 1 100%; }
}


.login-logo { display: block; width: min(100%, 210px); height: 118px; object-fit: contain; margin-bottom: 14px; }
.brand-logo { align-items: center; gap: 10px; padding: 8px 10px !important; }
.brand-logo img { width: 44px; height: 34px; object-fit: contain; border-radius: 6px; background: #fff; padding: 3px; }
.brand-logo strong { line-height: 1; letter-spacing: 0; }
.mobile-top-logo { display: none; width: 36px; height: 28px; object-fit: contain; }
.dashboard-brand-strip { display: flex; align-items: center; gap: 14px; }
.dashboard-brand-strip img { width: 96px; height: 64px; object-fit: contain; flex: 0 0 auto; }
.dashboard-brand-strip h2 { margin: 0 0 3px; font-size: 1.15rem; }
.dashboard-brand-strip p { margin: 0; color: var(--muted); }
.chart-compact { min-height: 222px; }
.doughnut-wrap { height: 176px; max-width: 320px; margin: 0 auto; display: grid; place-items: center; }
.doughnut-wrap canvas { max-height: 176px !important; max-width: 320px !important; }

@media (max-width: 767px) {
  .login-panel { padding: 22px; }
  .login-logo { width: 170px; height: 102px; margin: 0 auto 10px; }
  .mobile-top-logo { display: inline-block; flex: 0 0 auto; }
  .dashboard-brand-strip { gap: 9px; padding: 10px; }
  .dashboard-brand-strip img { width: 64px; height: 44px; }
  .dashboard-brand-strip h2 { font-size: .95rem; }
  .dashboard-brand-strip p { font-size: .78rem; }
  .doughnut-wrap { height: 150px; max-width: 260px; }
  .doughnut-wrap canvas { max-height: 150px !important; max-width: 260px !important; }
}
