/* ============================================================
   CDSB Veículos – admin.css  (Light Admin Theme)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600;700;800&family=Inter:wght@400;500;600&display=swap');

:root {
  --adm-bg:        #F4F6FA;
  --adm-sidebar:   #1B2D4F;
  --adm-sidebar2:  #0f1d35;
  --adm-white:     #FFFFFF;
  --adm-primary:   #1B2D4F;
  --adm-accent:    #C0392B;
  --adm-accent2:   #e74c3c;
  --adm-success:   #16a34a;
  --adm-warning:   #d97706;
  --adm-text:      #1a1e2e;
  --adm-muted:     #6B7280;
  --adm-border:    #E5E7EB;
  --adm-border2:   #D1D5DB;
  --adm-shadow:    0 2px 8px rgba(0,0,0,.08);
  --adm-shadow-lg: 0 4px 20px rgba(0,0,0,.12);
  --adm-radius:    10px;
  --adm-font-head: 'Montserrat', sans-serif;
  --adm-font-body: 'Inter', sans-serif;
  --adm-sidebar-w: 260px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }
body {
  font-family: var(--adm-font-body);
  background: var(--adm-bg);
  color: var(--adm-text);
  font-size: 14px;
}

/* ── LAYOUT ──────────────────────────────────────────────── */
.admin-wrapper { display: flex; min-height: 100vh; }

/* Sidebar */
.admin-sidebar {
  width: var(--adm-sidebar-w);
  background: var(--adm-sidebar);
  position: fixed;
  inset-block: 0;
  left: 0;
  overflow-y: auto;
  z-index: 200;
  display: flex;
  flex-direction: column;
  transition: transform .3s ease;
}
.sidebar-logo {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-logo .logo-text {
  font-family: var(--adm-font-head);
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}
.sidebar-logo .logo-sub { font-size: 10.5px; color: rgba(255,255,255,.45); text-transform: uppercase; letter-spacing: .06em; }

.sidebar-nav { flex: 1; padding: 16px 12px; }
.sidebar-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.35);
  padding: 14px 8px 6px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: rgba(255,255,255,.72);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all .2s ease;
  margin-bottom: 2px;
}
.sidebar-link i { width: 18px; text-align: center; font-size: 14px; opacity: .8; }
.sidebar-link:hover { background: rgba(255,255,255,.1); color: #fff; }
.sidebar-link.active { background: var(--adm-accent); color: #fff; }
.sidebar-link.active i { opacity: 1; }
.sidebar-link .badge-nav {
  margin-left: auto;
  background: rgba(255,255,255,.2);
  color: #fff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 50px;
}
.sidebar-link.active .badge-nav { background: rgba(255,255,255,.3); }

.sidebar-user {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-avatar {
  width: 36px; height: 36px;
  background: var(--adm-accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--adm-font-head);
  font-weight: 700;
  color: #fff;
  font-size: 13px;
  flex-shrink: 0;
}
.sidebar-username { font-size: 13px; font-weight: 600; color: #fff; }
.sidebar-userrole { font-size: 11px; color: rgba(255,255,255,.45); }
.sidebar-logout { margin-left: auto; color: rgba(255,255,255,.4); font-size: 1rem; text-decoration: none; transition: color .2s; }
.sidebar-logout:hover { color: var(--adm-accent2); }

/* Main area */
.admin-main {
  margin-left: var(--adm-sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
.admin-topbar {
  background: var(--adm-white);
  border-bottom: 1px solid var(--adm-border);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--adm-shadow);
}
.admin-topbar .page-title {
  font-family: var(--adm-font-head);
  font-size: 15px;
  font-weight: 800;
  color: var(--adm-primary);
}
.breadcrumb-item { font-size: 12.5px; }
.breadcrumb-item a { color: var(--adm-muted); }
.breadcrumb-item.active { color: var(--adm-primary); font-weight: 600; }
.breadcrumb-item + .breadcrumb-item::before { color: var(--adm-border2); }

.admin-content { padding: 28px 24px; flex: 1; }

/* ── Cards ───────────────────────────────────────────────── */
.admin-card {
  background: var(--adm-white);
  border-radius: var(--adm-radius);
  border: 1px solid var(--adm-border);
  box-shadow: var(--adm-shadow);
  overflow: hidden;
}
.admin-card-header {
  padding: 16px 20px;
  font-family: var(--adm-font-head);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--adm-primary);
  background: var(--adm-bg);
  border-bottom: 1px solid var(--adm-border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-card .p-4 { padding: 20px !important; }

/* Stat cards */
.stat-admin-card {
  background: var(--adm-white);
  border-radius: var(--adm-radius);
  border: 1px solid var(--adm-border);
  box-shadow: var(--adm-shadow);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.stat-icon.blue   { background: #eff6ff; color: #2563eb; }
.stat-icon.green  { background: #f0fdf4; color: #16a34a; }
.stat-icon.red    { background: #fef2f2; color: #dc2626; }
.stat-icon.yellow { background: #fffbeb; color: #d97706; }
.stat-icon.purple { background: #f5f3ff; color: #7c3aed; }
.stat-val {
  font-family: var(--adm-font-head);
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--adm-primary);
  line-height: 1;
}
.stat-label {
  font-size: 12px;
  color: var(--adm-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: 4px;
}

/* ── Table ───────────────────────────────────────────────── */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.admin-table thead th {
  padding: 12px 16px;
  background: var(--adm-bg);
  color: var(--adm-primary);
  font-family: var(--adm-font-head);
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 2px solid var(--adm-border);
  white-space: nowrap;
}
.admin-table tbody tr { border-bottom: 1px solid var(--adm-border); transition: background .15s; }
.admin-table tbody tr:hover { background: var(--adm-bg); }
.admin-table tbody tr:last-child { border-bottom: none; }
.admin-table td { padding: 14px 16px; vertical-align: middle; color: var(--adm-text); }
.admin-table td:last-child { white-space: nowrap; }

/* ── Badges ──────────────────────────────────────────────── */
.badge-disponivel { background: #dcfce7; color: #15803d; padding: 3px 10px; border-radius: 50px; font-size: 11px; font-weight: 700; font-family: var(--adm-font-head); text-transform: uppercase; letter-spacing: .04em; display: inline-block; }
.badge-reservado  { background: #ede9fe; color: #6d28d9; padding: 3px 10px; border-radius: 50px; font-size: 11px; font-weight: 700; font-family: var(--adm-font-head); text-transform: uppercase; letter-spacing: .04em; display: inline-block; }
.badge-vendido    { background: #fee2e2; color: #b91c1c; padding: 3px 10px; border-radius: 50px; font-size: 11px; font-weight: 700; font-family: var(--adm-font-head); text-transform: uppercase; letter-spacing: .04em; display: inline-block; }
.badge-oculto     { background: #f3f4f6; color: #6b7280; padding: 3px 10px; border-radius: 50px; font-size: 11px; font-weight: 700; font-family: var(--adm-font-head); text-transform: uppercase; letter-spacing: .04em; display: inline-block; }

/* ── Botões ──────────────────────────────────────────────── */
.btn-primary-admin {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--adm-accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-family: var(--adm-font-head);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s ease, transform .2s ease;
}
.btn-primary-admin:hover { background: var(--adm-accent2); color: #fff; transform: translateY(-1px); }
.btn-primary-admin.w-100 { justify-content: center; width: 100%; }

.btn-secondary-admin {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--adm-white);
  color: var(--adm-primary);
  border: 1.5px solid var(--adm-border2);
  border-radius: 8px;
  padding: 9px 18px;
  font-family: var(--adm-font-head);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s ease;
}
.btn-secondary-admin:hover { border-color: var(--adm-primary); color: var(--adm-primary); }
.btn-secondary-admin.w-100 { justify-content: center; width: 100%; }

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: var(--adm-font-head);
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all .15s ease;
}
.btn-edit { background: #eff6ff; color: #2563eb; }
.btn-edit:hover { background: #2563eb; color: #fff; }
.btn-del  { background: #fef2f2; color: #dc2626; }
.btn-del:hover  { background: #dc2626; color: #fff; }
.btn-view { background: #f0fdf4; color: #16a34a; }
.btn-view:hover { background: #16a34a; color: #fff; }
.btn-yellow { background: #fffbeb; color: #d97706; }
.btn-yellow:hover { background: #d97706; color: #fff; }

/* ── Forms ───────────────────────────────────────────────── */
.admin-form .form-label {
  font-family: var(--adm-font-head);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--adm-primary);
  margin-bottom: 6px;
}
.admin-form .form-control,
.admin-form .form-select {
  background: var(--adm-white);
  border: 1.5px solid var(--adm-border2);
  border-radius: 8px;
  color: var(--adm-text);
  font-size: 14px;
  padding: 10px 14px;
  transition: border-color .2s;
}
.admin-form .form-control:focus,
.admin-form .form-select:focus {
  border-color: var(--adm-primary);
  box-shadow: 0 0 0 3px rgba(27,45,79,.1);
}
.admin-form .form-control::placeholder { color: var(--adm-muted); }
.admin-form textarea.form-control { resize: vertical; }
.admin-form .input-group-text {
  background: var(--adm-bg);
  border: 1.5px solid var(--adm-border2);
  color: var(--adm-muted);
  font-weight: 600;
  border-radius: 8px 0 0 8px;
}
.admin-form .input-group .form-control { border-radius: 0 8px 8px 0; }

/* Checkboxes opcionais */
.check-group { display: flex; flex-wrap: wrap; gap: 8px; }
.check-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 9px 14px;
  background: var(--adm-bg);
  border: 1.5px solid var(--adm-border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--adm-text);
  transition: all .15s ease;
  user-select: none;
}
.check-item:hover { border-color: var(--adm-accent); color: var(--adm-accent); }
.check-item input[type="checkbox"] { accent-color: var(--adm-accent); width: 16px; height: 16px; cursor: pointer; }
.check-item input:checked ~ span,
.check-item:has(input:checked) { border-color: var(--adm-accent); background: #fef2f2; color: var(--adm-accent); }

/* Upload */
.upload-area {
  border: 2.5px dashed var(--adm-border2);
  border-radius: var(--adm-radius);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  color: var(--adm-muted);
  transition: all .2s ease;
  background: var(--adm-bg);
}
.upload-area:hover, .upload-area.dragover {
  border-color: var(--adm-accent);
  background: #fef2f2;
  color: var(--adm-accent);
}
.upload-area i { font-size: 2rem; display: block; margin-bottom: 8px; }
.upload-area p { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
.upload-area small { font-size: 12px; }

.upload-preview { display: flex; flex-wrap: wrap; gap: 10px; }
.upload-preview-item {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--adm-border);
  background: var(--adm-bg);
}
.upload-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.upload-preview-item .badge-principal {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: var(--adm-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  padding: 2px 0;
}
.upload-preview-item .remove-photo {
  position: absolute;
  top: 4px; right: 4px;
  width: 22px; height: 22px;
  background: rgba(0,0,0,.7);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 11px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.remove-photo:hover { background: var(--adm-accent); }

/* ── Alert ───────────────────────────────────────────────── */
.alert-danger { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; border-radius: 8px; }
.alert-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; border-radius: 8px; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; border-radius: 8px; }

/* ── Login page ─────────────────────────────────────────── */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--adm-bg); }
.login-card {
  background: var(--adm-white);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--adm-shadow-lg);
  border: 1px solid var(--adm-border);
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo .logo-title { font-family: var(--adm-font-head); font-size: 1.4rem; font-weight: 900; color: var(--adm-primary); }
.login-logo .logo-sub { color: var(--adm-muted); font-size: 13px; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 991px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .admin-content { padding: 20px 16px; }
  .admin-topbar { padding: 0 16px; }
}

/* Overlay para mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 150;
}
.sidebar-overlay.open { display: block; }

/* Aliases usados em admin/index.php e login.php */
.stat-card-admin {
  background: var(--adm-white);
  border-radius: var(--adm-radius);
  border: 1px solid var(--adm-border);
  box-shadow: var(--adm-shadow);
  padding: 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.stat-num-admin {
  font-family: var(--adm-font-head);
  font-size: 2rem;
  font-weight: 900;
  color: var(--adm-primary);
  line-height: 1;
}
.stat-lbl-admin {
  font-size: 12px;
  color: var(--adm-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.login-box {
  background: var(--adm-white);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--adm-shadow-lg);
  border: 1px solid var(--adm-border);
}

/* ── Topbar extras ───────────────────────────────────────── */
.page-title {
  font-family: var(--adm-font-head);
  font-size: 15px;
  font-weight: 800;
  color: var(--adm-primary);
}

/* ── Misc ────────────────────────────────────────────────── */
.text-danger { color: var(--adm-accent) !important; }
.text-success { color: var(--adm-success) !important; }
.text-warning { color: var(--adm-warning) !important; }
.text-muted { color: var(--adm-muted) !important; }

/* Modal de confirmação */
.confirm-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.confirm-modal.open { display: flex; }
.confirm-box {
  background: #fff;
  border-radius: 12px;
  padding: 32px;
  max-width: 400px;
  width: 90%;
  box-shadow: var(--adm-shadow-lg);
  text-align: center;
}
.confirm-icon { font-size: 2.5rem; color: var(--adm-accent); margin-bottom: 12px; }
.confirm-title { font-family: var(--adm-font-head); font-size: 1.1rem; font-weight: 800; color: var(--adm-primary); margin-bottom: 8px; }
.confirm-msg { font-size: 13.5px; color: var(--adm-muted); margin-bottom: 24px; }
