/* =========================================================
   GALEGOS TRANSPORTES • BID — CSS (root 100% tokenizado)
   - Nenhuma cor “solta” no código (tudo em vars)
   - Mobile consistente
   - Inclui resumo compacto (.sum)
   - NÃO muda efeitos: só troca valores por variáveis
========================================================= */

:root {
  /* --- Brand / Core (LIGHT) --- */
  --bg: #f7f8fb; /* fundo principal (quase branco) */
  --bg-top: #ffffff; /* topo do gradiente */

  --text: #101218; /* texto principal */
  --muted: #5f6676; /* texto secundário */
  --white: #ffffff; /* branco puro */

  --red: #e30613;
  --red2: #ff2333;

  /* --- Utility --- */
  --fade-0: transparent; /* para stops dos gradients */

  /* --- Lines / borders (light) --- */
  --line: rgba(16, 18, 24, 0.08);
  --line-2: #1012180f;
  --stroke: rgba(0, 0, 0, 0.12);
  --stroke-2: rgba(16, 18, 24, 0.16);
  --stroke-3: rgb(67, 63, 63);


  /* --- Surfaces (light) --- */
  --surface-1: rgba(255, 255, 255, 0.92); /* card topo */
  --surface-2: rgba(255, 255, 255, 0.84); /* card base */
  --surface-3: rgba(255, 255, 255, 0.78); /* caixas internas */
  --surface-4: rgba(255, 255, 255, 0.7); /* summary/tax */
  --surface-input: rgba(255, 255, 255, 0.9);
  --surface-topbar: rgba(255, 255, 255, 0.78);

  /* --- Shadows / blur (light) --- */
  --shadow: 0 10px 26px rgba(16, 18, 24, 0.12);
  --shadow-strong: 0 20px 50px rgba(16, 18, 24, 0.16);
  --focus-ring: 0 0 0 4px rgba(227, 6, 19, 0.16);

  /* --- Background accents (radiais) — mantém vermelho “fade” --- */
  --bg-accent-1: rgba(227, 6, 19, 0.16);
  --bg-accent-2: rgba(227, 6, 19, 0.1);

  /* --- Component accent tokens --- */
  --hint-border: rgba(227, 6, 19, 0.35);
  --hint-bg: rgba(227, 6, 19, 0.08);

  --btn-outline-border: rgba(227, 6, 19, 0.55);

  /* --- Extra surfaces (antes estavam “soltas”) --- */
  --surface-logo: rgba(255, 255, 255, 0.06);
  --surface-ghost: rgba(255, 255, 255, 0.06);
  --surface-icon: rgba(255, 255, 255, 0.06);

  --surface-hover-soft: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.06);

  /* --- Text opacities (antes estavam “soltas”) --- */
  --text-soft: rgba(0, 0, 0, 0.92);
  --text-strong: rgba(0, 0, 0, 0.86);
  --text-dim: rgba(0, 0, 0, 0.72);
  --text-muted2: rgba(0, 0, 0, 0.62);
  --text-muted3: rgba(0, 0, 0, 0.6);
  --sum-head: rgba(0, 0, 0, 0.85);

  /* --- Menus --- */
  --vehicle-menu-bg: rgba(210, 185, 186, 0.92);

  /* --- Image “cards” backgrounds (light) --- */
  --img-bg-a: rgba(0, 0, 0, 0.06);
  --img-bg-b: rgba(0, 0, 0, 0.03);
  --img-bg-c: rgba(0, 0, 0, 0.02);

  --img2-bg-a: rgba(0, 0, 0, 0.05);
  --img2-bg-b: rgba(0, 0, 0, 0.03);
  --img2-bg-c: rgba(0, 0, 0, 0.02);

  --vehicle-imgbox-border: rgba(255, 255, 255, 0.12);

  --img-shadow: 0 10px 24px rgba(16, 18, 24, 0.14);
  --img-inset: inset 0 0 0 1px rgba(16, 18, 24, 0.08);
  --img-drop-1: drop-shadow(0 2px 2px rgba(16, 18, 24, 0.16));
  --img-drop-2: drop-shadow(0 0 10px rgba(227, 6, 19, 0.1));

  /* vehicle-img extra drops (antes “soltos”) */
  --vehicle-img-drop-a: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.55));
  --vehicle-img-drop-b: drop-shadow(0 0 10px rgba(255, 255, 255, 0.1));

  /* --- Radii --- */
  --radius: 16px;
  --radius-14: 14px;
  --radius-12: 12px;

  /* --- Spacing --- */
  --container-max: 1180px;
  --gap: 16px;

  --pad-card: 16px;
  --pad-topbar-y: 14px;
  --pad-topbar-x: 18px;

  /* --- Typography --- */
  --fs-11: 11px;
  --fs-12: 12px;
  --fs-13: 13px;
  --fs-14: 14px;
  --fs-18: 18px;
  --fs-26: 26px;

  /* --- Mobile tuning (consistência) --- */
  --m-container-pad: 14px;
  --m-gap: 12px;
  --m-card-pad: 14px;

  --m-input-pad-y: 12px;
  --m-input-pad-x: 12px;

  --m-btn-pad-y: 12px;
  --m-btn-pad-x: 12px;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial,
    Helvetica, sans-serif;
  background: radial-gradient(
      1100px 600px at 10% -10%,
      var(--bg-accent-1),
      var(--fade-0) 55%
    ),
    radial-gradient(
      900px 540px at 90% 10%,
      var(--bg-accent-2),
      var(--fade-0) 50%
    ),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 100%);
  color: var(--text);
}

/* ===========================
   TOPBAR
=========================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface-topbar);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: var(--pad-topbar-y) var(--pad-topbar-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-14);
  background: var(--surface-logo);
  border: 1px solid var(--stroke);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-title {
  font-weight: 900;
  font-size: var(--fs-14);
  letter-spacing: 0.2px;
}
.brand-subtitle {
  font-size: var(--fs-12);
  color: var(--muted);
  margin-top: 2px;
}

.top-actions {
  display: flex;
  gap: 10px;
}

/* ===========================
   LAYOUT
=========================== */
.container {
  max-width: var(--container-max);
  margin: 18px auto 34px;
  padding: 0 16px;
}

.grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--gap);
}
.col {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* ===========================
   CARD
=========================== */
.card {
  background: linear-gradient(180deg, var(--surface-1), var(--surface-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--pad-card);
  box-shadow: var(--shadow);
}
.card-title {
  font-weight: 900;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* ===========================
   FORMS
=========================== */
.row {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}
.row.cols-2 {
  grid-template-columns: 1fr 1fr;
}
.row.between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.w-full {
  width: 100%;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.label {
  font-size: var(--fs-12);
  color: var(--muted);
}

.input {
  width: 100%;
  padding: 12px 12px;
  border-radius: var(--radius-12);
  border: 1px solid var(--stroke);
  background: var(--surface-input);
  color: var(--text);
  outline: none;
}
.input:focus {
  border-color: var(--btn-outline-border);
  box-shadow: var(--focus-ring);
}

.checkbox {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}
.checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--red);
}

/* ===========================
   RADIOS
=========================== */
.radio-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.radio {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-14);
  background: var(--surface-3);
  cursor: pointer;
  user-select: none;
}
.radio input {
  width: 16px;
  height: 16px;
  accent-color: var(--red);
}

/* ===========================
   BUTTONS
=========================== */
.btn {
  border: 0;
  border-radius: var(--radius-12);
  padding: 10px 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.06s ease, filter 0.12s ease;
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background: linear-gradient(135deg, var(--red), var(--red2));
  color: var(--white);
}
.btn-outline {
  background: var(--red);
  border: 1px solid var(--btn-outline-border);
  color: var(--white);
}
.btn-ghost {
  background: var(--stroke-3);
  border: 1px solid var(--stroke-3);
  color: var(--white);
}
.btn:hover {
  filter: brightness(1.05);
}

/* ===========================
   DIVIDER / HINTS
=========================== */
.divider {
  height: 1px;
  background: var(--line);
  margin: 14px 0;
}

.mini-title {
  font-weight: 900;
  font-size: var(--fs-13);
}
.mini-hint {
  color: var(--muted);
  font-size: var(--fs-12);
  margin-top: 4px;
}

.hint-box {
  margin-top: 10px;
  border-radius: var(--radius-14);
  border: 1px dashed var(--hint-border);
  background: var(--hint-bg);
  padding: 12px;
  color: var(--text-soft);
}
.hint-line {
  margin-top: 6px;
  font-size: var(--fs-12);
}
.hint-line.small {
  color: var(--text-dim);
}

/* ===========================
   EXTRAS LIST
=========================== */
.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}
.list-item {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-14);
  background: var(--surface-3);
}
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-12);
  border: 1px solid var(--stroke-3);
  background: var(--stroke-3);
  color: var(--white);
  cursor: pointer;
}
.icon-btn:hover {
  filter: brightness(1.06);
}

.panel {
  margin-top: 10px;
  padding-top: 6px;
}

/* ===========================
   KPIs
=========================== */
.kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
.kpi {
  border: 1px solid var(--line);
  border-radius: var(--radius-14);
  background: var(--surface-3);
  padding: 12px;
}
.kpi-label {
  font-size: var(--fs-12);
  color: var(--muted);
}
.kpi-value {
  font-size: var(--fs-18);
  font-weight: 950;
  margin-top: 6px;
}
.kpi-value.big {
  font-size: var(--fs-26);
  color: var(--white);
}

/* ===========================
   SUMMARY BOX (container)
=========================== */
.summary {
  margin-top: 8px;
}
.summary-title {
  font-weight: 900;
  margin-bottom: 8px;
}
.summary-box {
  margin: 0;
  border-radius: var(--radius-14);
  background: var(--surface-4);
  border: 1px solid var(--line);
  padding: 12px;
  color: var(--text-soft);
}

/* ===========================
   TAXES BREAKDOWN
=========================== */
.tax-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 12px;
  padding: 12px;
  border-radius: var(--radius-14);
  background: var(--surface-4);
  border: 1px solid var(--line);
}
.tax-name {
  color: var(--text-strong);
  font-size: var(--fs-12);
}
.tax-val {
  font-weight: 900;
  font-size: var(--fs-12);
  text-align: right;
}
.tax-muted {
  color: var(--text-muted3);
}

/* ===========================
   VEHICLE SELECTOR (cards dropdown)
=========================== */
.vehicle-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  padding: 10px 14px;
  transition: background 0.15s ease, border 0.15s ease;
}
.vehicle-trigger:hover {
  background: var(--surface-hover-soft);
}

.vehicle-trigger-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

/* imagem selecionada */
.vehicle-trigger-img {
  width: 60px;
  height: 46px;
  object-fit: contain;
  padding: 7px;
  background: radial-gradient(
    120% 120% at 30% 20%,
    var(--img-bg-a),
    var(--img-bg-b) 55%,
    var(--img-bg-c) 100%
  );
  border: 1px solid var(--stroke-2);
  border-radius: var(--radius-14);
  box-shadow: var(--img-shadow), var(--img-inset);
  flex: 0 0 auto;
  filter: brightness(1.35) contrast(1.25) saturate(1.05) var(--img-drop-1)
    var(--img-drop-2);
}

/* texto */
.vehicle-trigger-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.1;
}
.vehicle-trigger-text b {
  font-weight: 700;
  font-size: var(--fs-14);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vehicle-trigger-text small {
  font-size: var(--fs-12);
  opacity: 0.75;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vehicle-trigger-caret {
  opacity: 0.8;
  font-size: var(--fs-14);
  flex: 0 0 auto;
  transition: transform 0.2s ease;
}
.vehicle-trigger[aria-expanded="true"] .vehicle-trigger-caret {
  transform: rotate(180deg);
}

/* menu */
.vehicle-menu {
  margin-top: 8px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--vehicle-menu-bg);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-strong);
  overflow: hidden;
}

/* item */
.vehicle-item {
  width: 100%;
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  cursor: pointer;
  border: 0;
  background: var(--fade-0);
  color: inherit;
  text-align: left;
  transition: background 0.15s ease;
}
.vehicle-item:hover {
  background: var(--surface-hover);
}
.vehicle-item + .vehicle-item {
  border-top: 1px solid var(--line-2);
}

/* imagem dropdown */
.vehicle-imgbox {
  width: 64px;
  height: 48px;
  padding: 7px;
  overflow: hidden;
  border-radius: var(--radius-14);
  background: radial-gradient(
    120% 120% at 30% 20%,
    var(--img2-bg-a),
    var(--img2-bg-b) 55%,
    var(--img2-bg-c) 100%
  );
  border: 1px solid var(--vehicle-imgbox-border);
  box-shadow: var(--img-shadow), var(--img-inset);
  display: grid;
  place-items: center;
}
.vehicle-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  filter: brightness(1.35) contrast(1.25) saturate(1.05) var(--vehicle-img-drop-a)
    var(--vehicle-img-drop-b);
}
.vehicle-item:hover .vehicle-img {
  transform: scale(1.1);
}

.vehicle-item .name {
  font-weight: 700;
  font-size: var(--fs-14);
}

.vehicle-item .desc {
  font-size: var(--fs-12);
  opacity: 0.75;
  margin-top: 3px;
}

/* ===========================
   RESUMO COMPACTO (novo) — .sum
=========================== */
.sum {
  display: grid;
  gap: 8px;
}
.sum-title {
  font-weight: 900;
  font-size: var(--fs-14);
}
.sum-meta {
  font-size: var(--fs-11);
  color: var(--muted);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.sum-meta .sep {
  opacity: 0.6;
}

.sum-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  align-items: baseline;
}

.sum-h {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  font-weight: 900;
  font-size: var(--fs-11);
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--sum-head);
}

.sum-v {
  font-weight: 900;
  text-align: right;
}

.sum-price-l {
  font-weight: 800;
}
.sum-price-v {
  font-weight: 950;
  text-align: right;
  font-size: var(--fs-18);
  background: linear-gradient(135deg, var(--red), var(--red2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ===========================
   MOBILE (consistente)
=========================== */
@media (max-width: 980px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .container {
    padding: 0 var(--m-container-pad);
  }
  .col {
    gap: var(--m-gap);
  }
  .card {
    padding: var(--m-card-pad);
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
    padding: 12px var(--m-container-pad);
  }
  .top-actions {
    width: 100%;
  }
  .top-actions .btn {
    width: 100%;
    padding: var(--m-btn-pad-y) var(--m-btn-pad-x);
  }
}

@media (max-width: 520px) {
  .row {
    gap: 10px;
    margin-bottom: 10px;
  }
  .row.cols-2 {
    grid-template-columns: 1fr;
  }
  .kpis {
    grid-template-columns: 1fr;
  }
  .list-item {
    grid-template-columns: 1fr;
  }

  .input {
    padding: var(--m-input-pad-y) var(--m-input-pad-x);
  }
  .btn {
    padding: var(--m-btn-pad-y) var(--m-btn-pad-x);
  }

  /* resumo compacto: mantém tudo legível no mobile */
  .sum-meta {
    gap: 4px;
  }
  .sum-price-v {
    font-size: 16px;
  }
  .sum-grid {
    gap: 4px 8px;
  }

  /* veículo */
  .vehicle-item {
    grid-template-columns: 64px 1fr;
    gap: 12px;
    padding: 12px;
  }
  .vehicle-imgbox {
    width: 60px;
    height: 44px;
  }
  .vehicle-trigger-img {
    width: 56px;
    height: 44px;
  }
}