/* ============================================================
   ARAGÃO CAMINHÕES — Estilos Globais
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --bg:       #0c0c10;
  --s1:       #141418;
  --s2:       #1e1e26;
  --bd:       #28282f;
  --acc:      #e81717;
  --tx:       #f2f2f5;
  --mu:       #7070a0;
  --ok:       #2ed573;
  --dng:      #ff4757;
  --r:        12px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--tx);
  min-height: 100vh;
  overflow-x: hidden;
}

/* noise overlay */
body::after {
  content: '';
  position: fixed; inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 9999;
}

a { color: inherit; text-decoration: none; }
button { font-family: 'DM Sans', sans-serif; cursor: pointer; }
input, select, textarea { font-family: 'DM Sans', sans-serif; }

/* ── HEADER ─────────────────────────────────────────────── */
.hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 40px;
  border-bottom: 1px solid var(--bd);
  background: rgba(12,12,16,.92);
  backdrop-filter: blur(16px);
  position: sticky; top: 0; z-index: 100;
  gap: 12px; flex-wrap: wrap;
}
.logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.8rem; letter-spacing: .08em;
}
.logo span { color: var(--acc); }
.hdr-right { display: flex; align-items: center; gap: 18px; }
.stat-v { font-family: 'Bebas Neue', sans-serif; font-size: 1.3rem; color: var(--acc); line-height: 1; }
.stat-l { font-size: .62rem; color: var(--mu); text-transform: uppercase; letter-spacing: .1em; }
.hdr-link {
  background: var(--s2); border: 1px solid var(--bd);
  border-radius: 999px; padding: 7px 14px;
  font-size: .78rem; font-weight: 500; color: var(--mu);
}
.hdr-link:hover { border-color: var(--acc); color: var(--acc); }

/* ── MAIN ────────────────────────────────────────────────── */
.main { max-width: 1380px; margin: 0 auto; padding: 28px 40px 60px; }

/* ── TOOLBAR ─────────────────────────────────────────────── */
.toolbar { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }

.search-wrap { flex: 1; min-width: 180px; position: relative; }
.search-wrap svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--mu); }
.search-inp {
  width: 100%; background: var(--s1); border: 1px solid var(--bd);
  border-radius: var(--r); padding: 10px 13px 10px 40px;
  color: var(--tx); font-size: .88rem; outline: none;
}
.search-inp:focus { border-color: var(--acc); }

.flt {
  background: var(--s1); border: 1px solid var(--bd);
  border-radius: var(--r); padding: 10px 14px;
  color: var(--tx); font-size: .88rem; outline: none;
}
.flt:focus { border-color: var(--acc); }

/* ── GRID ────────────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
}

/* ── CARD ────────────────────────────────────────────────── */
.card {
  background: var(--s1); border: 1px solid var(--bd);
  border-radius: 16px; overflow: hidden;
  transition: transform .2s, border-color .2s, box-shadow .2s;
  animation: fadeUp .35s ease both;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(232,255,71,.25);
  box-shadow: 0 16px 48px rgba(0,0,0,.45);
}

/* CAROUSEL */
.carousel { position: relative; height: 210px; background: var(--s2); overflow: hidden; }
.carousel img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.no-photo {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: var(--mu);
}
.no-photo svg { opacity: .2; }
.no-photo span { font-size: .72rem; opacity: .4; }
.c-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.55); border: none; border-radius: 50%;
  width: 28px; height: 28px; color: #fff; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 2;
}
.c-prev { left: 7px; }
.c-next { right: 7px; }
.c-dots {
  position: absolute; bottom: 7px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 5px; z-index: 2;
}
.c-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.35); cursor: pointer; transition: background .15s; }
.c-dot.active { background: var(--acc); }
.c-count {
  position: absolute; top: 9px; right: 9px;
  background: rgba(0,0,0,.6); color: #fff;
  font-size: .62rem; font-weight: 700; padding: 2px 8px; border-radius: 20px;
  z-index: 2;
}

.card-body { padding: 16px; }
.card-tag { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--acc); margin-bottom: 3px; }
.card-model { font-family: 'Bebas Neue', sans-serif; font-size: 1.4rem; letter-spacing: .04em; line-height: 1.1; margin-bottom: 10px; }
.card-price-lbl { font-size: .62rem; color: var(--mu); text-transform: uppercase; letter-spacing: .1em; }
.card-price { font-size: 1.2rem; font-weight: 600; }
.card-km { font-size: .72rem; color: var(--mu); margin-top: 3px; }

/* PLACA INTERNA */
.placa-row {
  display: flex; align-items: center; gap: 7px;
  background: var(--s2); border: 1px solid var(--bd);
  border-radius: 7px; padding: 5px 9px; margin-bottom: 9px;
}
.placa-row .placa-lbl { font-size: .58rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--mu); flex: 1; }
.placa-badge { display: inline-flex; align-items: center; border-radius: 3px; overflow: hidden; border: 1px solid rgba(255,255,255,.15); }
.placa-faixa { background: #1a3a8f; padding: 1px 4px; font-size: .48rem; font-weight: 700; color: #fff; }
.placa-num { background: #fff; color: #111; font-size: .7rem; font-weight: 700; letter-spacing: .1em; padding: 1px 6px; font-family: monospace; }

/* SELLER ACTIONS */
.card-actions { display: flex; gap: 7px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--bd); }
.btn-edit, .btn-del {
  flex: 1; padding: 7px; border-radius: 8px; border: 1px solid var(--bd);
  font-size: .74rem; font-weight: 500; background: transparent;
  display: flex; align-items: center; justify-content: center; gap: 5px;
}
.btn-edit { color: var(--tx); }
.btn-edit:hover { border-color: var(--acc); color: var(--acc); }
.btn-del  { color: var(--mu); }
.btn-del:hover  { border-color: var(--dng); color: var(--dng); }

/* ── EMPTY ───────────────────────────────────────────────── */
.empty { grid-column: 1/-1; text-align: center; padding: 70px 20px; color: var(--mu); }
.empty-icon { font-size: 3rem; opacity: .2; margin-bottom: 12px; }
.empty-title { font-family: 'Bebas Neue', sans-serif; font-size: 1.7rem; opacity: .35; color: var(--tx); margin-bottom: 5px; }

/* ── OVERLAY / MODAL ─────────────────────────────────────── */
.overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.85); backdrop-filter: blur(8px);
  z-index: 200; align-items: flex-start; justify-content: center;
  padding: 20px; overflow-y: auto;
}
.overlay.open { display: flex; }

.modal {
  background: var(--s1); border: 1px solid var(--bd);
  border-radius: 20px; width: 100%; max-width: 560px;
  margin: auto; animation: fadeUp .25s ease;
}
.modal-lg { max-width: 640px; }

.modal-hdr { display: flex; align-items: flex-start; justify-content: space-between; padding: 20px 24px 0; gap: 12px; }
.modal-title { font-family: 'Bebas Neue', sans-serif; font-size: 1.6rem; letter-spacing: .05em; }
.modal-sub { font-size: .68rem; color: var(--mu); margin-top: 2px; }
.modal-x {
  background: var(--s2); border: 1px solid var(--bd); border-radius: 8px;
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  color: var(--mu); cursor: pointer; flex-shrink: 0; font-size: .9rem;
}
.modal-x:hover { color: var(--tx); border-color: var(--tx); }

.modal-body { padding: 16px 24px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 0 24px 24px; }

/* SECTION LABEL */
.s-lbl {
  font-size: .6rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .12em; color: var(--mu);
  margin: 14px 0 9px; padding-bottom: 5px; border-bottom: 1px solid var(--bd);
}
.s-lbl:first-child { margin-top: 0; }
.s-lbl-row { display: flex; align-items: center; justify-content: space-between; }

/* FORM */
.fg { margin-bottom: 11px; }
.lbl { display: block; font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--mu); margin-bottom: 5px; }
.inp {
  width: 100%; background: var(--s2); border: 1px solid var(--bd);
  border-radius: 9px; padding: 10px 13px; color: var(--tx);
  font-size: .88rem; outline: none; transition: border-color .15s;
}
.inp:focus { border-color: var(--acc); }
.inp::placeholder { color: var(--mu); opacity: .5; }
.inp-placa { text-transform: uppercase; letter-spacing: .14em; font-family: monospace; font-weight: 700; font-size: .9rem; }
.form-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.field-hint { font-size: .64rem; color: var(--mu); margin-top: 4px; }

.internal-badge {
  display: inline-flex; align-items: center;
  background: rgba(232,255,71,.08); border: 1px solid rgba(232,255,71,.18);
  border-radius: 4px; padding: 2px 7px;
  font-size: .56rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: rgba(232,255,71,.65);
}

/* DROPZONE */
.dropzone {
  border: 2px dashed var(--bd); border-radius: 11px;
  padding: 20px; text-align: center; cursor: pointer;
  transition: all .2s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--acc); background: rgba(232,255,71,.04); }
.dropzone p { font-size: .8rem; color: var(--mu); }
.dropzone strong { color: var(--acc); }

.thumb-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 7px; margin-top: 10px; }
.thumb { aspect-ratio: 1; border-radius: 8px; overflow: hidden; position: relative; background: var(--s2); border: 1px solid var(--bd); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-rm {
  position: absolute; top: 3px; right: 3px;
  background: rgba(0,0,0,.75); border: none; border-radius: 4px;
  color: #fff; width: 19px; height: 19px; font-size: 10px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  opacity: 0; transition: opacity .15s;
}
.thumb:hover .thumb-rm { opacity: 1; }
.thumb-add {
  aspect-ratio: 1; border-radius: 8px; border: 2px dashed var(--bd);
  display: flex; align-items: center; justify-content: center;
  color: var(--mu); font-size: 1.4rem; cursor: pointer;
}
.thumb-add:hover { border-color: var(--acc); color: var(--acc); }

.site-note { background: rgba(46,213,115,.06); border: 1px solid rgba(46,213,115,.2); border-radius: 8px; padding: 7px 12px; font-size: .74rem; color: var(--ok); margin-bottom: 9px; }

/* PROG BAR */
.prog-wrap { margin-bottom: 12px; }
.prog-labels { display: flex; justify-content: space-between; font-size: .7rem; color: var(--mu); margin-bottom: 5px; }
.prog-track { background: var(--s2); border-radius: 999px; height: 5px; overflow: hidden; }
.prog-bar { height: 100%; background: var(--acc); border-radius: 999px; transition: width .3s; width: 0; }

/* BUTTONS */
.btn-primary {
  background: var(--acc); color: #0c0c10; border: none;
  border-radius: 10px; padding: 10px 22px;
  font-weight: 700; font-size: .88rem;
  display: flex; align-items: center; gap: 7px;
}
.btn-primary:hover { opacity: .9; }

.btn-cancel {
  background: transparent; border: 1px solid var(--bd);
  border-radius: 10px; padding: 10px 20px;
  color: var(--mu); font-size: .88rem;
}
.btn-cancel:hover { color: var(--tx); border-color: var(--tx); }

.btn-outline {
  background: var(--s2); border: 1px solid var(--bd);
  border-radius: 10px; padding: 10px 16px;
  color: var(--tx); font-size: .85rem; font-weight: 500;
  display: flex; align-items: center; gap: 6px;
}
.btn-outline:hover { border-color: var(--acc); color: var(--acc); }

/* LIGHTBOX */
.lightbox {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.95); z-index: 500;
  flex-direction: column; align-items: center; justify-content: center; gap: 14px;
}
.lightbox.open { display: flex; }
.lightbox-img { max-width: 88vw; max-height: 76vh; border-radius: 10px; object-fit: contain; }
.lightbox-nav { display: flex; align-items: center; gap: 16px; }
.lb-btn {
  background: rgba(255,255,255,.1); border: none; border-radius: 50%;
  width: 44px; height: 44px; color: #fff; font-size: 1.5rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.lb-btn:disabled { opacity: .2; cursor: default; }
.lb-close {
  position: fixed; top: 20px; right: 24px;
  background: rgba(255,255,255,.1); border: none; border-radius: 8px;
  color: #fff; font-size: 1.2rem; width: 38px; height: 38px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.lb-counter { color: rgba(255,255,255,.4); font-size: .8rem; letter-spacing: .08em; }
.lb-dots { display: flex; gap: 6px; }
.lb-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.25); cursor: pointer; transition: background .15s; }
.lb-dot.active { background: var(--acc); }

/* TOAST */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--s2); border-radius: 11px;
  padding: 12px 18px; font-size: .86rem;
  display: flex; align-items: center; gap: 8px;
  z-index: 600; max-width: 340px;
  opacity: 0; transform: translateY(20px);
  transition: all .3s cubic-bezier(.34,1.56,.64,1);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-ok  { border: 1px solid var(--ok);  }
.toast-err { border: 1px solid var(--dng); }

/* MAP TABLE */
.map-row { display: grid; grid-template-columns: 1fr 18px 1fr; gap: 8px; align-items: center; margin-bottom: 9px; }
.map-lbl { font-size: .84rem; font-weight: 500; color: var(--acc); }
.map-arr { color: var(--mu); text-align: center; }
.map-sel { background: var(--s2); border: 1px solid var(--bd); border-radius: 8px; padding: 9px 11px; color: var(--tx); font-size: .82rem; outline: none; width: 100%; }
.map-sel:focus { border-color: var(--acc); }

.tbl-wrap { border-radius: 8px; border: 1px solid var(--bd); overflow: hidden; overflow-x: auto; }
.preview-tbl { width: 100%; border-collapse: collapse; font-size: .78rem; }
.preview-tbl th { background: var(--s2); padding: 8px 11px; text-align: left; font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--mu); white-space: nowrap; }
.preview-tbl td { padding: 8px 11px; border-top: 1px solid var(--bd); white-space: nowrap; }

/* FOOTER */
footer { border-top: 1px solid var(--bd); padding: 22px 40px; text-align: center; color: var(--mu); font-size: .76rem; }

/* ANIMATIONS */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse  { 0%,100%{opacity:.4} 50%{opacity:.7} }

.skeleton { border-radius: 16px; background: var(--s1); animation: pulse 1.5s ease infinite; }

/* RESPONSIVE */
@media (max-width: 640px) {
  .hdr  { padding: 14px 18px; }
  .main { padding: 20px 16px 50px; }
  .form-row2 { grid-template-columns: 1fr; }
  .thumb-grid { grid-template-columns: repeat(4,1fr); }
}
