/* ============================================================
   RENAVIX — Telas do sistema recriadas (dados inventados)
   Layout comum: barra lateral, cabeçalho, cartões, tabela, selos
   ============================================================ */

:root {
  --purple: #8557FF;
  --purple-dark: #6D3FE0;
  --purple-bg: #F3EFFE;
  --purple-light: #CBB8F7;
  --green: #16A34A;
  --green-text: #15803D;
  --amber: #B45309;
  --amber-border: #D97706;
  --amber-bg: #FFFBEB;
  --teal: #0CA5B8;
  --teal-bg: #E0F7FA;
  --gray-50: #F8F9FB;
  --gray-100: #F1F3F5;
  --gray-200: #E5E7EB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-700: #374151;
  --gray-900: #1F2937;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #fff;
  font-family: 'Roboto', Arial, sans-serif;
  color: var(--gray-900);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .num, .store-name, .page-title {
  font-family: 'Poppins', 'Roboto', Arial, sans-serif;
}

a { text-decoration: none; color: inherit; }

svg.icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ---------------- Layout ---------------- */

.app-shell {
  width: 1600px;
  display: flex;
  align-items: stretch;
  background: #fff;
}

.sidebar {
  width: 256px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--gray-100);
  display: flex;
  flex-direction: column;
  position: relative;
  padding-bottom: 24px;
}

.sidebar-resize-handle {
  position: absolute;
  top: 110px;
  right: -1px;
  width: 10px;
  height: 20px;
  border-radius: 6px;
  background: var(--purple);
  opacity: .18;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  height: 64px;
  padding: 0 24px;
  border-bottom: 1px solid var(--gray-100);
}

.sidebar-logo img { height: 24px; }

.sidebar-nav {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--gray-700);
  cursor: default;
}

.nav-item .icon { color: var(--gray-500); }

.nav-item.active {
  background: var(--purple-bg);
  color: var(--purple);
  font-weight: 600;
}

.nav-item.active .icon { color: var(--purple); }

.nav-item .chev { margin-left: auto; color: var(--gray-400); }

.nav-sub {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-left: 20px;
  padding-left: 12px;
  border-left: 1px solid var(--gray-100);
  margin-top: 2px;
  margin-bottom: 4px;
}

.nav-sub .nav-item { font-size: 14px; padding: 10px 12px; }

.nav-item .label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }

.new-badge {
  background: var(--purple);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .3px;
  padding: 2px 5px;
  border-radius: 4px;
  margin-left: auto;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border-bottom: 1px solid var(--gray-100);
}

.topbar-left { display: flex; align-items: center; gap: 14px; }

.collapse-btn {
  width: 24px; height: 24px;
  border-radius: 6px;
  border: 1px solid var(--gray-200);
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-500);
}
.collapse-btn svg { width: 14px; height: 14px; }

.store-name { font-size: 19px; font-weight: 700; color: var(--gray-900); margin: 0; letter-spacing: .2px; }

.topbar-right { display: flex; align-items: center; gap: 20px; }

.icon-btn {
  width: 34px; height: 34px;
  border-radius: 8px;
  border: none;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-500);
}

.user-info { text-align: right; line-height: 1.3; }
.user-info strong { display: block; font-size: 14px; font-weight: 700; color: var(--gray-900); }
.user-info span { display: block; font-size: 12px; color: var(--gray-500); }

.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--purple);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
  font-family: 'Poppins', sans-serif;
}

.content { padding: 32px; background: #fff; }

/* ---------------- Page header ---------------- */

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-title { font-size: 25px; font-weight: 700; color: var(--gray-900); margin: 0 0 4px; }
.page-subtitle { font-size: 14px; color: var(--gray-500); margin: 0; }

.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--purple);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Roboto', sans-serif;
  white-space: nowrap;
}
.btn-primary svg { width: 16px; height: 16px; }

.btn-outline {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff;
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
}

/* ---------------- Toolbar / busca ---------------- */

.toolbar { display: flex; gap: 12px; margin-bottom: 20px; }

.search-box {
  flex: 1;
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 11px 16px;
  color: var(--gray-400);
  font-size: 14px;
}
.search-box .icon { color: var(--gray-400); width: 18px; height: 18px; }

/* ---------------- Tabela de veículos ---------------- */

.vtable { width: 100%; border-collapse: collapse; }

.vtable thead th {
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-500);
  padding: 0 8px 14px;
  border-bottom: 1px solid var(--gray-100);
}

.vtable tbody tr { border-bottom: 1px solid var(--gray-100); }
.vtable tbody td { padding: 20px 8px; vertical-align: top; }

.col-placa { width: 220px; }
.col-modelo { width: 440px; }
.col-ano { width: 120px; }
.col-datas { width: 230px; }
.col-acoes { width: 90px; text-align: right; }

.placa-row { display: flex; align-items: flex-start; gap: 10px; }

.status-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 2px solid var(--gray-400);
  margin-top: 6px;
  flex-shrink: 0;
}
.status-dot.filled { background: var(--gray-500); border-color: var(--gray-500); }

.placa-text { font-size: 14px; font-weight: 600; color: var(--gray-900); letter-spacing: .5px; }
.chassi-text {
  font-size: 12px; color: var(--gray-400); margin-top: 3px;
  filter: blur(3px);
  user-select: none;
  letter-spacing: .5px;
}

.modelo-name { font-size: 14px; font-weight: 600; color: var(--gray-900); margin-bottom: 8px; }
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; }

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  line-height: 1.4;
  white-space: nowrap;
}
.badge.status-em-estoque { background: var(--green); color: #fff; }
.badge.status-crlve-pendente { background: var(--amber-bg); color: var(--amber-border); border: 1px solid var(--amber-border); }
.badge.status-usado,
.badge.status-consignado,
.badge.status-proprio { background: var(--gray-100); color: var(--gray-700); }

.ano-principal { font-size: 14px; font-weight: 700; color: var(--gray-900); }
.ano-fab { font-size: 12px; color: var(--gray-400); margin-top: 3px; }

.data-linha { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--gray-700); margin-bottom: 6px; }
.data-linha:last-child { margin-bottom: 0; }
.data-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.data-dot.on { background: var(--purple); }
.data-dot.off { border: 1.5px solid var(--gray-300, #D1D5DB); }
.data-label { color: var(--gray-400); width: 52px; flex-shrink: 0; }
.data-valor { font-weight: 500; }

.acoes-row { display: flex; gap: 10px; justify-content: flex-end; }
.acao-btn {
  width: 32px; height: 32px;
  border-radius: 7px;
  border: 1px solid var(--gray-200);
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  color: var(--purple);
}
.acao-btn svg { width: 16px; height: 16px; }

/* ---------------- Dashboard ---------------- */

.dash-header-row { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 28px; }
.dash-welcome { font-size: 14px; color: var(--gray-500); margin: 0; }

.date-range { display: flex; align-items: center; gap: 10px; }
.date-field {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 13.5px;
  color: var(--gray-700);
  font-weight: 500;
}
.date-field svg { width: 15px; height: 15px; color: var(--gray-400); }
.btn-aplicar {
  background: var(--purple); color: #fff; border: none; border-radius: 8px;
  padding: 10px 18px; font-size: 14px; font-weight: 600;
}

.stat-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 20px; }

.stat-card {
  border: 1px solid var(--gray-100);
  border-radius: 12px;
  padding: 22px 24px;
  display: flex; align-items: center; gap: 16px;
}
.stat-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon.purple { background: var(--purple-bg); color: var(--purple); }
.stat-icon.teal { background: var(--teal-bg); color: var(--teal); }
.stat-icon svg { width: 22px; height: 22px; }

.stat-label { font-size: 12px; font-weight: 700; letter-spacing: .4px; color: var(--gray-500); text-transform: uppercase; margin-bottom: 6px; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--purple); font-family: 'Poppins', sans-serif; }
.stat-value.teal { color: var(--teal); }

.grid-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.card-dash {
  border: 1px solid var(--gray-100);
  border-radius: 12px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  min-height: 190px;
}

.card-dash-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 14.5px; font-weight: 600; color: var(--gray-900);
  margin-bottom: 18px;
}
.card-dash-title svg { width: 18px; height: 18px; }
.card-dash-title.purple svg { color: var(--purple); }
.card-dash-title.teal svg { color: var(--teal); }

.card-body-center {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-400);
  font-size: 14px;
}

.card-foot {
  border-top: 1px solid var(--gray-100);
  margin-top: 14px;
  padding-top: 12px;
  display: flex; justify-content: space-between;
  font-size: 12.5px; color: var(--gray-500);
}
.card-foot strong { color: var(--gray-700); font-weight: 600; }

.kv-row { display: flex; justify-content: space-between; align-items: center; font-size: 14px; margin-bottom: 14px; }
.kv-row:last-child { margin-bottom: 0; }
.kv-label { color: var(--gray-700); }
.kv-value { font-weight: 700; }
.kv-value.green { color: var(--green-text); }
.kv-value.amber { color: var(--amber-border); }
.kv-value.dark { color: var(--gray-900); }

/* Produção — gráfico de barras por dia */
.prod-chart-label { font-size: 12px; color: var(--gray-500); margin-bottom: 12px; }
.prod-chart { flex: 1; display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; min-height: 52px; }
.prod-bar-wrap { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; flex: 1; height: 100%; }
.prod-bar { width: 14px; height: 40px; border-radius: 3px 3px 0 0; background: var(--purple); }
.prod-bar.prod-bar-zero { height: 3px; border-radius: 2px; background: var(--gray-200); }
.prod-bar-label { font-size: 10.5px; color: var(--gray-500); }

/* Consumo no Período — total + barra proporcional + legenda */
.consumo-total { font-size: 24px; font-weight: 700; font-family: 'Poppins', sans-serif; color: var(--gray-900); margin-bottom: 16px; }
.consumo-bar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--gray-100); margin-bottom: 18px; }
.consumo-bar-seg.detran { background: var(--purple); }
.consumo-bar-seg.renave { background: var(--purple-light); }
.consumo-legend { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.consumo-legend-row { display: flex; align-items: center; font-size: 13.5px; color: var(--gray-700); }
.consumo-dot { width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; flex-shrink: 0; }
.consumo-dot.detran { background: var(--purple); }
.consumo-dot.renave { background: var(--purple-light); }
.consumo-legend-label { flex: 1; }
.consumo-legend-value { font-weight: 700; color: var(--gray-900); }

.cortesias-num { font-size: 30px; font-weight: 700; font-family: 'Poppins', sans-serif; color: var(--gray-900); text-align: center; margin-bottom: 14px; }
.cortesias-num span { font-size: 18px; color: var(--gray-400); font-weight: 600; }
.progress-track { height: 8px; border-radius: 6px; background: var(--gray-100); overflow: hidden; margin-bottom: 10px; }
.progress-fill { height: 100%; background: var(--purple); border-radius: 6px; }
.progress-caption { font-size: 12.5px; color: var(--gray-500); text-align: center; }

.saldo-valor { font-size: 28px; font-weight: 700; color: var(--teal); font-family: 'Poppins', sans-serif; margin-bottom: 18px; }
.btn-add-credito {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 11px;
  background: #fff;
  font-size: 13.5px; font-weight: 600; color: var(--gray-700);
  margin-top: auto;
}
.btn-add-credito svg { width: 16px; height: 16px; color: var(--purple); }

/* Linha secundária de cartões (2 cartões, cada um ocupando 2 das 4 colunas
   da grade acima: mesma largura total + mesmo gap => alinhamento exato com
   .grid-cards). Nome genérico porque a Task 3b reaproveita esta classe. */
.grid-cards-2col { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

.sidebar-version { margin-top: auto; padding: 16px 24px 0; font-size: 11.5px; color: var(--gray-400); }
