:root {
  --bg: #0a0a0c;
  --bg-alt: #111114;
  --surface: #17181c;
  --surface-2: #1e2024;
  --border: #2a2c31;
  --text: #f4f4f5;
  --text-dim: #a8adb5;
  --text-mute: #74787f;
  --red: #d81f2a;
  --red-dark: #a3161f;
  --gold: #f0b429;
  --green: #22c55e;
  --amber: #f59e0b;
  --radius-sm: 8px;
  --radius: 14px;
  --font-heading: "Poppins", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}
h1, h2, h3, h4 { font-family: var(--font-heading); margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ---- Login ---- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at 20% 20%, #1a1b1f, #08080a 70%);
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 36px 32px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
.login-card img { height: 48px; margin-bottom: 18px; border-radius: 6px; }
.login-card h1 { font-size: 1.3rem; margin-bottom: 6px; }
.login-card p { color: var(--text-mute); font-size: 0.88rem; margin-bottom: 26px; }
.field { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.8rem; color: var(--text-dim); font-weight: 600; }
.field input, .field select, .field textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  color: #fff;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  width: 100%;
  font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--red); }
.form-error { background: rgba(216,31,42,0.15); border: 1px solid rgba(216,31,42,0.4); color: #ff8a90; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.85rem; margin-bottom: 16px; }
.form-success { background: rgba(34,197,94,0.15); border: 1px solid rgba(34,197,94,0.4); color: #7ee2a8; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.85rem; margin-bottom: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 10px; font-weight: 700; font-size: 0.9rem;
  border: none; cursor: pointer; transition: background 0.15s, transform 0.15s;
}
.btn--primary { background: var(--red); color: #fff; }
.btn--primary:hover { background: var(--red-dark); }
.btn--block { width: 100%; }
.btn--ghost { background: transparent; border: 1.5px solid var(--border); color: #fff; }
.btn--ghost:hover { border-color: #fff; }
.btn--danger { background: rgba(216,31,42,0.15); color: #ff8a90; border: 1px solid rgba(216,31,42,0.4); }
.btn--danger:hover { background: rgba(216,31,42,0.28); }
.btn--sm { padding: 8px 14px; font-size: 0.8rem; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ---- Shell ---- */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg-alt);
  border-right: 1px solid var(--border);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.admin-sidebar__brand { display: flex; align-items: center; gap: 10px; margin-bottom: 30px; }
.admin-sidebar__brand img { height: 36px; border-radius: 6px; }
.admin-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.admin-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 10px;
  font-size: 0.9rem; font-weight: 600; color: var(--text-dim);
}
.admin-nav a:hover { background: var(--surface); color: #fff; }
.admin-nav a.is-active { background: var(--surface); color: #fff; border: 1px solid var(--border); }
.admin-main { flex: 1; padding: 32px; max-width: 100%; overflow-x: hidden; }
.admin-topline { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; flex-wrap: wrap; gap: 12px; }
.admin-topline h1 { font-size: 1.5rem; }
.admin-topline p { color: var(--text-mute); font-size: 0.85rem; margin-top: 4px; }

.mobile-topbar { display: none; }

/* ---- Table / list ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 22px; }
.vehicle-table { width: 100%; border-collapse: collapse; }
.vehicle-table th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-mute); padding: 10px 12px; border-bottom: 1px solid var(--border); }
.vehicle-table td { padding: 12px; border-bottom: 1px solid var(--border); font-size: 0.88rem; vertical-align: middle; }
.vehicle-table tr:last-child td { border-bottom: none; }
.vehicle-thumb { width: 64px; height: 44px; object-fit: cover; border-radius: 6px; background: #000; }
.table-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.status-select { background: var(--bg); border: 1px solid var(--border); color: #fff; padding: 6px 8px; border-radius: 6px; font-size: 0.8rem; }
.badge { display: inline-flex; padding: 3px 9px; border-radius: 999px; font-size: 0.68rem; font-weight: 800; text-transform: uppercase; }
.badge--disponivel { background: rgba(34,197,94,0.18); color: var(--green); }
.badge--vendido { background: rgba(216,31,42,0.2); color: #ff6b74; }
.badge--reservado { background: rgba(245,158,11,0.18); color: var(--amber); }
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; }
.stat-card strong { display: block; font-size: 1.6rem; font-family: var(--font-heading); }
.stat-card span { color: var(--text-mute); font-size: 0.8rem; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.toolbar input { max-width: 280px; }

/* ---- Form ---- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.form-section { margin-bottom: 34px; }
.form-section h3 { font-size: 1rem; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.checklist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.check-item { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 0.85rem; }
.check-item input { width: 16px; height: 16px; accent-color: var(--red); }
.photo-grid { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.photo-item { position: relative; width: 120px; }
.photo-item img { width: 120px; height: 84px; object-fit: cover; border-radius: 8px; border: 2px solid var(--border); }
.photo-item.is-primary img { border-color: var(--gold); }
.photo-item__remove { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%; background: var(--red); color: #fff; border: 2px solid var(--bg); font-size: 0.8rem; line-height: 1; cursor: pointer; }
.photo-item__primary-btn { display: block; width: 100%; margin-top: 4px; font-size: 0.68rem; text-align: center; padding: 3px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim); cursor: pointer; }
.photo-item.is-primary .photo-item__primary-btn { background: rgba(240,180,41,0.18); color: var(--gold); border-color: rgba(240,180,41,0.4); }
.upload-drop {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 26px;
  text-align: center;
  color: var(--text-mute);
  font-size: 0.85rem;
  cursor: pointer;
}
.upload-drop:hover { border-color: var(--red); color: var(--text-dim); }
.form-actions { display: flex; gap: 12px; margin-top: 30px; }

.settings-preview {
  align-self: flex-start;
  width: 140px;
  height: 80px;
  object-fit: contain;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
}

@media (max-width: 900px) {
  .admin-sidebar { display: none; }
  .mobile-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; background: var(--bg-alt); border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 20;
  }
  .mobile-topbar img { height: 32px; border-radius: 6px; }
  .admin-shell { flex-direction: column; }
  .admin-main { padding: 20px; }
  .vehicle-table-wrap { overflow-x: auto; }
}
