/* ============================================================
   ADRIANAUTO — Admin Panel & Login
   ============================================================ */

/* ── LOGIN OVERLAY */
#admin-login {
  position: fixed; inset: 0; z-index: 999999;
  background: rgba(15,23,42,.95);
  backdrop-filter: blur(20px);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.login-card {
  background: var(--white); border-radius: var(--radius-xl);
  padding: 48px; width: min(440px, 100%);
  box-shadow: var(--shadow-xl);
  animation: modalPop .3s cubic-bezier(.22,1,.36,1);
}
.login-brand { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--navy); margin-bottom: 3px; }
.login-brand em { color: var(--gold-500); font-style: normal; }
.login-subtitle { font-size: 13px; color: var(--text-muted); margin-bottom: 32px; }
.login-error {
  background: #fef2f2; border: 1px solid #fecaca;
  border-radius: var(--radius); padding: 11px 14px;
  font-size: 13px; color: var(--red);
  margin-bottom: 16px; display: none;
}
.login-error.show { display: block; }
.login-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }

/* ── ADMIN OVERLAY */
#admin-overlay {
  position: fixed; inset: 0; z-index: 9997;
  background: rgba(15,23,42,.45);
  backdrop-filter: blur(4px);
  display: none;
}

/* ── ADMIN PANEL DRAWER */
#admin-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(540px, 100vw);
  background: var(--white);
  border-left: 1px solid var(--border);
  z-index: 9998; overflow-y: auto;
  transform: translateX(100%);
  transition: transform var(--t-slow);
  box-shadow: var(--shadow-xl);
  display: none;
}
#admin-panel.open { transform: translateX(0); }
#admin-panel::-webkit-scrollbar { width: 4px; }
#admin-panel::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 2px; }

/* Panel Header */
.panel-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--white); z-index: 10;
}
.panel-hd-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--navy); }
.panel-hd-title em { color: var(--gold-500); font-style: normal; }
.panel-hd-user { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.panel-hd-actions { display: flex; align-items: center; gap: 8px; }
.panel-close {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gray-100); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; transition: background var(--t-base);
}
.panel-close:hover { background: var(--gray-200); }

/* Panel Tabs */
.panel-tabs {
  display: flex; border-bottom: 1px solid var(--border);
  background: var(--white); position: sticky;
  top: 73px; z-index: 9;
}
.panel-tab {
  flex: 1; padding: 13px 6px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .4px;
  border: none; cursor: pointer;
  font-family: var(--font-body);
  background: transparent; color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: color var(--t-base), border-color var(--t-base), background var(--t-base);
}
.panel-tab:hover { color: var(--text); background: var(--gray-50); }
.panel-tab.active { color: var(--gold-500); border-bottom-color: var(--gold-500); background: var(--gold-50); }

.panel-body { padding: 24px; }
.panel-section { display: none; }
.panel-section.active { display: block; }

/* ── ADMIN STATS BAR */
.admin-stats-bar {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px; margin-bottom: 20px;
}
.admin-stat-card {
  background: var(--gray-50); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}
.admin-stat-num {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 700; color: var(--navy);
}
.admin-stat-lbl { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 3px; }

/* ── Car List in Admin */
.admin-car-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px; margin-bottom: 10px;
  transition: border-color var(--t-base), box-shadow var(--t-base);
}
.admin-car-item:hover { border-color: rgba(245,158,11,.2); box-shadow: var(--shadow-sm); }
.admin-car-emoji { font-size: 38px; flex-shrink: 0; }
.admin-car-info { flex: 1; min-width: 0; }
.admin-car-brand { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--gold-500); }
.admin-car-model { font-size: 15px; font-weight: 700; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-car-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.admin-car-price { color: var(--gold-500); font-weight: 700; }
.admin-car-actions { display: flex; flex-direction: column; gap: 5px; flex-shrink: 0; }

/* ── Car Form in Admin */
.car-form-card {
  background: var(--gray-50); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 22px;
  margin-bottom: 20px; display: none;
}
.car-form-card.open { display: block; }
.car-form-title {
  font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--gold-500); margin-bottom: 18px;
  display: flex; align-items: center; gap: 8px;
}

/* ── Upload Area */
.upload-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-md);
  padding: 28px 20px; text-align: center;
  cursor: pointer; transition: border-color var(--t-base), background var(--t-base);
  background: var(--white);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--gold-300);
  background: var(--gold-50);
}
.upload-zone-icon { font-size: 32px; margin-bottom: 10px; }
.upload-zone-text { font-size: 14px; font-weight: 500; color: var(--text-soft); margin-bottom: 4px; }
.upload-zone-sub { font-size: 12px; color: var(--text-muted); }
#upload-file-input { display: none; }

.img-thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.img-thumb {
  position: relative; width: 88px; height: 78px;
  border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--border);
}
.img-thumb img { width: 100%; height: 100%; object-fit: cover; }
.img-thumb-del {
  position: absolute; top: 4px; right: 4px;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,.75); color: #fff;
  border: none; cursor: pointer; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity var(--t-base);
}
.img-thumb:hover .img-thumb-del { opacity: 1; }
.img-thumb-main {
  position: absolute; bottom: 3px; left: 3px;
  background: var(--gold-500); color: #fff;
  font-size: 9px; font-weight: 700;
  padding: 1px 6px; border-radius: 3px;
}

/* ── Toggle Switch */
.toggle-wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.toggle-info .toggle-lbl { font-size: 14px; font-weight: 600; color: var(--text); }
.toggle-info .toggle-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.toggle {
  position: relative; width: 48px; height: 27px;
  flex-shrink: 0; cursor: pointer;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute; inset: 0;
  background: var(--gray-300); border-radius: 30px;
  transition: background .2s;
}
.toggle input:checked + .toggle-track { background: var(--gold-500); }
.toggle-knob {
  position: absolute; top: 3.5px; left: 3.5px;
  width: 20px; height: 20px;
  background: #fff; border-radius: 50%;
  transition: transform .2s; box-shadow: var(--shadow-sm);
}
.toggle input:checked ~ .toggle-knob { transform: translateX(21px); }

/* ── Messages in Admin */
.msg-item {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 18px;
  margin-bottom: 12px; transition: border-color var(--t-base);
}
.msg-item.unread { border-left: 3px solid var(--gold-400); }
.msg-item:hover { border-color: rgba(245,158,11,.2); }
.msg-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.msg-name { font-size: 15px; font-weight: 700; color: var(--navy); }
.msg-date { font-size: 11px; color: var(--text-muted); }
.msg-car { font-size: 12px; color: var(--gold-500); font-weight: 600; margin-bottom: 6px; }
.msg-text { font-size: 14px; color: var(--text-soft); margin-bottom: 14px; line-height: 1.6; }
.msg-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Section dividers in admin */
.admin-section { margin-bottom: 20px; }
.admin-section-title {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-muted); margin-bottom: 14px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}

/* ── Saving indicator */
.saving-bar {
  display: none; align-items: center; gap: 8px;
  padding: 10px 14px; background: var(--gold-50);
  border-radius: var(--radius); font-size: 13px; color: var(--gold-600);
  margin-top: 12px;
}
.saving-bar.show { display: flex; }

/* Logout button */
.btn-logout {
  background: none; border: none; cursor: pointer;
  font-size: 12px; color: var(--text-muted);
  padding: 6px 10px; border-radius: var(--radius-sm);
  font-family: var(--font-body);
  transition: color var(--t-fast), background var(--t-fast);
}
.btn-logout:hover { color: var(--red); background: #fef2f2; }

@media(max-width:600px) {
  #admin-panel { width: 100vw; }
  .panel-tab { font-size: 9px; padding: 12px 3px; }
  .login-card { padding: 32px 24px; }
}
