/* =========================================================
   Nexus Auto — estilos globais
   ========================================================= */

:root {
  /* shadcn/ui design tokens (zinc — light theme) */
  --background: 0 0% 100%;
  --foreground: 240 10% 3.9%;
  --card: 0 0% 100%;
  --card-foreground: 240 10% 3.9%;
  --popover: 0 0% 100%;
  --muted: 240 4.8% 95.9%;
  --muted-foreground: 240 3.8% 46.1%;
  --accent: 240 4.8% 95.9%;
  --accent-foreground: 240 5.9% 10%;
  --primary: 240 5.9% 10%;
  --primary-foreground: 0 0% 98%;
  --secondary: 240 4.8% 95.9%;
  --secondary-foreground: 240 5.9% 10%;
  --border: 240 5.9% 90%;
  --input: 240 5.9% 90%;
  --ring: 240 5% 64.9%;
  --radius: 0.625rem;

  /* Aliases pra compatibilidade com o CSS legacy + paleta semântica de cores */
  --c-bg: hsl(240 5% 98%);
  --c-surface: hsl(var(--card));
  --c-border: hsl(var(--border));
  --c-border-strong: hsl(240 5% 84%);
  --c-text: hsl(var(--foreground));
  --c-text-muted: hsl(var(--muted-foreground));
  --c-text-soft: hsl(240 4% 65%);
  --c-primary: #2563eb;        /* blue-600 (acento) */
  --c-primary-700: #1d4ed8;
  --c-success: #16a34a;        /* green-600 */
  --c-success-bg: #f0fdf4;
  --c-danger: #dc2626;         /* red-600 */
  --c-danger-bg: #fef2f2;
  --c-warning: #d97706;        /* amber-600 */
  --c-warning-bg: #fffbeb;
  --c-info-bg: #eff6ff;
  --c-zinc-50: hsl(240 5% 98%);
  --c-zinc-100: hsl(var(--muted));
  --c-zinc-200: hsl(var(--border));
  --c-zinc-900: hsl(var(--foreground));

  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 10px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.04);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.06), 0 2px 4px -2px rgb(0 0 0 / 0.04);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.06), 0 4px 6px -4px rgb(0 0 0 / 0.05);
  --sidebar-w: 240px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-feature-settings: 'cv11', 'ss01';
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
*, *::before, *::after { min-width: 0; } /* impede flex/grid items de quebrarem layout */

a { color: var(--c-primary-700); text-decoration: none; }
a:hover { text-decoration: underline; }

/* =========================================================
   SIDEBAR (desktop)
   ========================================================= */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w);
  background: var(--c-surface);
  border-right: 1px solid var(--c-border);
  display: flex; flex-direction: column;
  z-index: 50;
}
.sidebar__brand {
  padding: 20px 24px;
  border-bottom: 1px solid var(--c-border);
}
.sidebar__brand a { display: flex; align-items: center; gap: 10px; color: var(--c-text); text-decoration: none; }
.brand__logo { font-size: 22px; color: var(--c-primary); }
.brand__name { font-weight: 700; font-size: 17px; letter-spacing: -.01em; }

.sidebar__nav { padding: 12px 8px; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nav__link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; border-radius: var(--r-md);
  color: var(--c-text-muted); text-decoration: none;
  font-weight: 500; font-size: 14px;
  transition: background .15s, color .15s;
}
.nav__link:hover { background: var(--c-zinc-100); color: var(--c-text); text-decoration: none; }
.nav__link.is-active { background: var(--c-zinc-100); color: var(--c-text); font-weight: 600; }
.nav__icon { font-size: 16px; width: 20px; text-align: center; opacity: .8; }

.sidebar__footer {
  padding: 16px 24px; font-size: 12px; color: var(--c-text-soft);
  border-top: 1px solid var(--c-border);
}

/* Bloco de usuário logado no rodapé do sidebar */
.sidebar__user {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--c-border);
  background: var(--c-zinc-50);
}
.sidebar__user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--c-text); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.sidebar__user-info { flex: 1; min-width: 0; line-height: 1.2; }
.sidebar__user-info strong {
  display: block; font-size: 13px; color: var(--c-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar__user-info small {
  display: block; color: var(--c-text-soft); font-size: 11px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar__logout {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--c-text-muted); text-decoration: none;
  font-size: 16px; transition: background .15s, color .15s;
  flex-shrink: 0;
}
.sidebar__logout:hover { background: #fef2f2; color: var(--c-danger); text-decoration: none; }

/* Mobile top bar (com nome do usuário e sair) */
.mobile-top { display: none; }
@media (max-width: 768px) {
  .mobile-top {
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 40;
    background: var(--c-surface); border-bottom: 1px solid var(--c-border);
    padding: 10px 14px;
    margin: -16px -14px 14px;
  }
  .mobile-top__brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
  .mobile-top__brand span { color: var(--c-primary); font-size: 18px; }
  .mobile-top__user {
    display: flex; align-items: center; gap: 8px;
    text-decoration: none; color: var(--c-text-muted);
    padding: 6px 10px; border-radius: 8px;
    font-size: 13px; font-weight: 500;
    background: var(--c-zinc-100);
  }
  .mobile-top__avatar {
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--c-text); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
  }
  .mobile-top__user:hover { text-decoration: none; }
}

/* =========================================================
   MOBILE NAV
   ========================================================= */
.mobilenav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  padding: 6px 4px env(safe-area-inset-bottom);
  z-index: 50;
}
.mobilenav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 4px; color: var(--c-text-muted); text-decoration: none;
  font-size: 11px;
}
.mobilenav a span { font-size: 18px; }
.mobilenav a.is-active { color: var(--c-primary); }
.mobilenav a:hover { text-decoration: none; }

/* =========================================================
   MAIN LAYOUT
   ========================================================= */
.main {
  margin-left: var(--sidebar-w);
  padding: 28px 32px 56px;
  min-height: 100vh;
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .mobilenav { display: flex; }
  .main { margin-left: 0; padding: 16px 14px 80px; }
  .page-header h1 { font-size: 20px; }
  .metric__value { font-size: 22px; }
  .card__title { padding: 14px 18px; }
  .card__pad { padding: 16px 18px; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .metric { padding: 16px 18px; }
}

/* =========================================================
   PAGE HEADER
   ========================================================= */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.page-header h1 { margin: 0 0 4px; font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.page-header p { margin: 0; color: var(--c-text-muted); font-size: 14px; }

/* =========================================================
   CARDS
   ========================================================= */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, border-color .2s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card__pad { padding: 20px 24px; }
.card__title {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-bottom: 1px solid var(--c-border);
}
.card__title h2 { margin: 0; font-size: 15px; font-weight: 600; color: var(--c-text); }
.card__title small { color: var(--c-text-muted); font-size: 13px; }

/* =========================================================
   METRIC CARD (KPIs)
   ========================================================= */
.kpi-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 22px;
}
.metric {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
  transition: transform .15s, box-shadow .2s;
}
.metric::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--c-primary); opacity: .85;
}
.metric--good::before { background: var(--c-success); }
.metric--bad::before  { background: var(--c-danger); }
.metric--info::before { background: var(--c-primary); }
.metric:hover { box-shadow: var(--shadow-md); }
.metric__label { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--c-text-muted); font-weight: 600; }
.metric__value { font-size: 26px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.metric__hint { font-size: 12px; color: var(--c-text-muted); margin-top: 6px; }
.metric--good .metric__value { color: var(--c-success); }
.metric--bad  .metric__value { color: var(--c-danger); }
.metric--info .metric__value { color: var(--c-primary); }

/* =========================================================
   GRID GENÉRICO
   ========================================================= */
.grid-2 { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.grid-3 { display: grid; gap: 14px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* =========================================================
   TABELA
   ========================================================= */
.table-wrap { overflow-x: auto; }
table.t {
  width: 100%; border-collapse: collapse; background: var(--c-surface);
}
table.t thead th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--c-text-muted); font-weight: 600;
  padding: 10px 14px; border-bottom: 1px solid var(--c-border);
  background: var(--c-zinc-50);
  white-space: nowrap;
}
table.t tbody td {
  padding: 12px 14px; border-bottom: 1px solid var(--c-border);
  font-size: 14px; vertical-align: middle;
}
table.t tbody tr:last-child td { border-bottom: none; }
table.t tbody tr:hover { background: var(--c-zinc-50); }
table.t tbody tr.row-link { cursor: pointer; }
table.t .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t .placa { font-family: 'SFMono-Regular', Menlo, Consolas, monospace; font-weight: 600; letter-spacing: .03em; }

/* =========================================================
   BADGE
   ========================================================= */
.badge {
  display: inline-block; padding: 3px 10px; font-size: 11px; font-weight: 600;
  border-radius: 999px; line-height: 1.4; text-transform: uppercase; letter-spacing: .03em;
}
.badge--green  { background: #ecfdf5; color: #047857; }
.badge--amber  { background: #fffbeb; color: #b45309; }
.badge--red    { background: #fef2f2; color: #b91c1c; }
.badge--gray   { background: #f4f4f5; color: #52525b; }
.badge--sky    { background: #f0f9ff; color: #0369a1; }

/* =========================================================
   BOTÕES
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--r-md);
  border: 1px solid transparent;
  font-weight: 600; font-size: 14px;
  cursor: pointer; transition: background .15s, border-color .15s, color .15s;
  text-decoration: none; white-space: nowrap;
}
.btn--primary { background: var(--c-text); color: #fff; }
.btn--primary:hover { background: #000; text-decoration: none; }
.btn--secondary { background: var(--c-zinc-100); color: var(--c-text); }
.btn--secondary:hover { background: var(--c-zinc-200); text-decoration: none; }
.btn--outline { background: var(--c-surface); border-color: var(--c-border-strong); color: var(--c-text); }
.btn--outline:hover { background: var(--c-zinc-50); text-decoration: none; }
.btn--ghost { background: transparent; color: var(--c-text-muted); }
.btn--ghost:hover { background: var(--c-zinc-100); color: var(--c-text); text-decoration: none; }
.btn--danger { background: var(--c-danger); color: #fff; }
.btn--danger:hover { background: #b91c1c; text-decoration: none; }
.btn--sm { padding: 5px 10px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* =========================================================
   FORMULÁRIOS
   ========================================================= */
.form-row { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); margin-bottom: 14px; }
.form-row--3 { grid-template-columns: repeat(3, 1fr); }
.form-row--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 700px) {
  .form-row, .form-row--3, .form-row--4 { grid-template-columns: 1fr; }
}
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; font-weight: 600; color: var(--c-text-muted); text-transform: uppercase; letter-spacing: .03em; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md);
  background: var(--c-surface);
  font-size: 14px;
  color: var(--c-text);
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(14,165,233,.15);
}
.field textarea { resize: vertical; min-height: 80px; }
.field--money input { text-align: right; font-variant-numeric: tabular-nums; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 18px; }
.muted { color: var(--c-text-muted); font-size: 13px; }

/* =========================================================
   PROGRESS BAR
   ========================================================= */
.progress {
  background: var(--c-zinc-100);
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
}
.progress__bar { height: 100%; background: var(--c-success); border-radius: 999px; transition: width .3s; }
.progress__bar--warn { background: var(--c-warning); }
.progress__bar--info { background: var(--c-primary); }

/* =========================================================
   FLASH MESSAGES
   ========================================================= */
.flash {
  padding: 11px 16px; border-radius: var(--r-md); margin-bottom: 16px;
  border: 1px solid; font-size: 14px;
  /* Mensagens sempre visíveis sem rolagem horizontal */
  word-wrap: break-word; overflow-wrap: anywhere;
  display: flex; align-items: flex-start; gap: 8px;
  line-height: 1.45;
}
.flash::before {
  flex-shrink: 0; font-weight: 700; line-height: 1.45;
}
.flash--success::before { content: '✓'; color: var(--c-success); }
.flash--error::before   { content: '✕'; color: var(--c-danger); }
.flash--info::before    { content: 'ℹ'; color: var(--c-primary); }
.flash--warn::before    { content: '⚠'; color: var(--c-warning); }
.flash--success { background: var(--c-success-bg); border-color: #a7f3d0; color: #065f46; }
.flash--error   { background: var(--c-danger-bg);  border-color: #fecaca; color: #991b1b; }
.flash--info    { background: var(--c-info-bg);    border-color: #bae6fd; color: #075985; }
.flash--warn    { background: var(--c-warning-bg); border-color: #fde68a; color: #92400e; }

/* =========================================================
   FICHA DO VEÍCULO
   ========================================================= */
.veiculo-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 22px; gap: 14px; flex-wrap: wrap;
}
.veiculo-header__info h1 { margin: 0 0 6px; font-size: 22px; font-weight: 700; }
.veiculo-header__info .placa-big {
  font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
  font-weight: 700; letter-spacing: .05em; font-size: 14px;
  background: var(--c-zinc-100); padding: 4px 10px; border-radius: var(--r-sm);
  display: inline-block; margin-right: 10px;
}

/* =========================================================
   DASHBOARD — ranking de quitação
   ========================================================= */
.ranking-item { padding: 12px 0; border-bottom: 1px solid var(--c-border); }
.ranking-item:last-child { border-bottom: none; }
.ranking-item__head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 6px;
}
.ranking-item__name { font-weight: 600; }
.ranking-item__pct { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--c-success); }
.ranking-item__sub { font-size: 12px; color: var(--c-text-muted); margin-top: 4px; font-variant-numeric: tabular-nums; }

/* =========================================================
   GRÁFICO DE BARRAS SIMPLES (CSS puro)
   ========================================================= */
.barchart { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding: 8px 0; }
.barchart__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.barchart__bar { width: 100%; background: var(--c-primary); border-radius: 4px 4px 0 0; min-height: 2px; }
.barchart__lbl { font-size: 10px; color: var(--c-text-muted); text-transform: uppercase; }

/* =========================================================
   REPASSE FORM
   ========================================================= */
.repasse-table input[type="number"] {
  width: 100%; min-width: 70px; max-width: 110px;
  text-align: right; font-variant-numeric: tabular-nums;
  padding: 6px 8px; border: 1px solid var(--c-border-strong); border-radius: 6px;
}
.repasse-table input[type="number"]:focus { outline: none; border-color: var(--c-primary); }
.repasse-table .liquido-cel { font-weight: 600; color: var(--c-success); font-variant-numeric: tabular-nums; text-align: right; }
.repasse-table tfoot td {
  font-weight: 700; padding: 14px 14px;
  background: var(--c-zinc-50); border-top: 2px solid var(--c-border-strong);
  font-variant-numeric: tabular-nums;
}

/* =========================================================
   LOCAÇÃO ABERTA
   ========================================================= */
.locacao-aberta {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; background: var(--c-zinc-50); border: 1px solid var(--c-border);
  border-radius: var(--r-md); margin-bottom: 8px;
}
.locacao-aberta__info strong { display: block; }
.locacao-aberta__info small { color: var(--c-text-muted); font-size: 12px; }

/* =========================================================
   UTIL
   ========================================================= */
.mt-0  { margin-top: 0; }
.mt-2  { margin-top: 8px; }
.mt-3  { margin-top: 12px; }
.mt-4  { margin-top: 16px; }
.mt-6  { margin-top: 24px; }
.mb-2  { margin-bottom: 8px; }
.mb-3  { margin-bottom: 12px; }
.mb-4  { margin-bottom: 16px; }
.mb-6  { margin-bottom: 24px; }
.text-right { text-align: right; }
.text-muted { color: var(--c-text-muted); }
.text-success { color: var(--c-success); font-weight: 600; }
.text-danger  { color: var(--c-danger);  font-weight: 600; }
.tab-num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.empty-state {
  padding: 40px 20px; text-align: center; color: var(--c-text-muted);
}
.empty-state__icon { font-size: 32px; opacity: .4; margin-bottom: 8px; }

/* =========================================================
   LOGIN
   ========================================================= */
.login-body {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #fafafa 0%, #f0f9ff 100%);
  padding: 24px 16px;
}
.login-card {
  width: 100%; max-width: 400px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: 0 10px 40px rgba(15, 23, 42, .06), 0 2px 6px rgba(15, 23, 42, .04);
}
.login-brand { text-align: center; margin-bottom: 26px; }
.login-brand__logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 14px;
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-700) 100%);
  color: #fff; font-size: 26px; margin-bottom: 12px;
  box-shadow: 0 8px 20px rgba(14,165,233,.25);
}
.login-brand__name { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.login-brand__sub { margin: 4px 0 0; color: var(--c-text-muted); font-size: 13px; }
.login-card .field { margin-bottom: 14px; }
.login-card .field label { font-size: 12px; font-weight: 600; color: var(--c-text-muted); text-transform: uppercase; letter-spacing: .03em; }
.login-card .field input {
  width: 100%; padding: 11px 14px;
  border: 1px solid var(--c-border-strong); border-radius: 10px;
  font-size: 15px; box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s;
}
.login-card .field input:focus {
  outline: none; border-color: var(--c-primary);
  box-shadow: 0 0 0 4px rgba(14,165,233,.15);
}
.login-foot { text-align: center; color: var(--c-text-soft); font-size: 12px; margin: 22px 0 0; }

/* Wrapper do input de senha + botão de toggle */
.senha-wrap { position: relative; }
.senha-wrap input { padding-right: 48px !important; }
.senha-toggle {
  position: absolute; top: 50%; right: 6px;
  transform: translateY(-50%);
  width: 36px; height: 36px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none; cursor: pointer;
  color: var(--c-text-muted); border-radius: 8px;
  transition: background .15s, color .15s;
}
.senha-toggle:hover { background: var(--c-zinc-100); color: var(--c-text); }
.senha-toggle:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 1px; }
.senha-toggle .icon-eye, .senha-toggle .icon-eye-off { display: block; }
.senha-toggle .hidden { display: none; }

/* Botão block (largura total) */
.btn--block { width: 100%; justify-content: center; padding: 12px 16px; font-size: 15px; }

/* delete button inline */
.btn-x {
  background: none; border: none; color: var(--c-text-soft); cursor: pointer;
  padding: 4px 8px; border-radius: 4px; font-size: 16px; line-height: 1;
}
.btn-x:hover { color: var(--c-danger); background: var(--c-danger-bg); }

/* =========================================================
   ÍCONES LUCIDE (SVG inline)
   ========================================================= */
.icon {
  display: inline-block;
  width: 1em; height: 1em;
  vertical-align: -0.125em;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
.icon--sm { width: 14px; height: 14px; }
.icon--md { width: 18px; height: 18px; }
.icon--lg { width: 22px; height: 22px; }

/* =========================================================
   SIDEBAR — refinado shadcn-style
   ========================================================= */
.sidebar { box-shadow: var(--shadow-sm); }
.nav__icon {
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  opacity: .9;
}
.nav__icon .icon { width: 18px; height: 18px; stroke-width: 1.75; }
.nav__link.is-active .nav__icon { opacity: 1; color: var(--c-text); }

/* =========================================================
   DASHBOARD — KPIs com ícone (estilo shadcn)
   ========================================================= */
.kpi-grid { gap: 16px; }

.metric {
  padding: 22px 24px;
  border-radius: var(--radius);
  position: relative;
  overflow: visible;
}
.metric::before { display: none; } /* remove a barrinha colorida do design anterior */

.metric__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.metric__label {
  font-size: 13px; font-weight: 500;
  color: var(--c-text-muted);
  text-transform: none;
  letter-spacing: 0;
}
.metric__icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--c-zinc-100);
  color: var(--c-text-muted);
}
.metric__icon .icon { width: 16px; height: 16px; stroke-width: 2; }
.metric__icon--blue   { background: #eff6ff; color: #2563eb; }
.metric__icon--green  { background: #f0fdf4; color: #16a34a; }
.metric__icon--amber  { background: #fffbeb; color: #d97706; }
.metric__icon--violet { background: #f5f3ff; color: #7c3aed; }
.metric__icon--red    { background: #fef2f2; color: #dc2626; }

.metric__value {
  font-size: 28px; font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--c-text);
  margin: 0;
}
.metric__hint {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--c-text-muted);
  margin-top: 8px;
}
.metric--good .metric__value { color: var(--c-text); }
.metric--bad  .metric__value { color: var(--c-danger); }
.metric--info .metric__value { color: var(--c-text); }

/* =========================================================
   CARD — refinado
   ========================================================= */
.card { box-shadow: var(--shadow-sm); border-color: var(--c-border); }
.card:hover { box-shadow: var(--shadow-md); }
.card__title {
  padding: 18px 24px;
  border-bottom: 1px solid var(--c-border);
}
.card__title h2 {
  font-size: 14px; font-weight: 600;
  color: var(--c-text);
  display: flex; align-items: center; gap: 8px;
}
.card__title h2 .icon { width: 16px; height: 16px; color: var(--c-text-muted); }
.card__title small { font-size: 12px; color: var(--c-text-muted); }

/* =========================================================
   RANKING refinado (avatares circulares com placa abreviada)
   ========================================================= */
.ranking-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--c-border);
}
.ranking-item:last-child { border-bottom: none; }
.ranking-item__avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-zinc-100) 0%, hsl(240 5% 92%) 100%);
  color: var(--c-text);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 11px;
  font-family: 'JetBrains Mono', 'SFMono-Regular', Menlo, Consolas, monospace;
  letter-spacing: .02em;
  flex-shrink: 0;
  border: 1px solid var(--c-border);
}
.ranking-item__main { flex: 1; min-width: 0; }
.ranking-item__head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 6px; gap: 8px;
}
.ranking-item__name {
  font-weight: 500; font-size: 14px; color: var(--c-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ranking-item__name .placa { font-size: 11px; color: var(--c-text-muted); margin-left: 4px; }
.ranking-item__pct {
  font-variant-numeric: tabular-nums;
  font-weight: 600; font-size: 13px;
  color: var(--c-success);
  flex-shrink: 0;
}
.ranking-item__sub {
  font-size: 12px; color: var(--c-text-muted);
  margin-top: 6px; font-variant-numeric: tabular-nums;
}
.progress { height: 6px; background: var(--c-zinc-100); }
.progress__bar { background: var(--c-success); }

/* =========================================================
   GRÁFICO DE BARRAS refinado
   ========================================================= */
.barchart {
  display: flex; align-items: flex-end; gap: 10px;
  height: 140px; padding: 12px 0;
  position: relative;
}
.barchart::before, .barchart::after {
  content: ''; position: absolute; left: 0; right: 0;
  height: 1px; background: var(--c-border);
}
.barchart::before { top: 12px; }
.barchart::after  { bottom: 28px; }
.barchart__col {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 6px;
  position: relative; z-index: 1;
}
.barchart__bar {
  width: 100%; max-width: 36px;
  background: linear-gradient(180deg, var(--c-primary) 0%, var(--c-primary-700) 100%);
  border-radius: 6px 6px 0 0;
  min-height: 3px;
  transition: opacity .15s, transform .15s;
  cursor: pointer;
}
.barchart__col:hover .barchart__bar { opacity: .85; transform: translateY(-2px); }
.barchart__lbl {
  font-size: 11px; color: var(--c-text-muted);
  text-transform: capitalize; font-weight: 500;
}

/* Repasses listagem textual abaixo do gráfico */
.repasse-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--c-border);
  font-size: 13px;
}
.repasse-row:last-child { border-bottom: none; }
.repasse-row span:first-child { color: var(--c-text-muted); text-transform: capitalize; }
.repasse-row span:last-child { font-weight: 600; color: var(--c-text); font-variant-numeric: tabular-nums; }

/* =========================================================
   LOCAÇÃO ABERTA (refinada com ícone)
   ========================================================= */
.locacao-aberta {
  border-radius: var(--radius);
  border-color: var(--c-border);
  background: var(--c-surface);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.locacao-aberta__icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: #f0fdf4; color: #16a34a;
  display: inline-flex; align-items: center; justify-content: center;
  margin-right: 12px; flex-shrink: 0;
}
.locacao-aberta__icon .icon { width: 18px; height: 18px; }
.locacao-aberta { display: flex; align-items: center; }
.locacao-aberta__info { flex: 1; }

/* =========================================================
   PAGE HEADER — refinado
   ========================================================= */
.page-header h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.025em;
}
.page-header p {
  font-size: 13px;
  color: var(--c-text-muted);
}
