/* ==========================================================================
   Sandhu Majesty Auto — Admin area styles (matches assets/css/style.css)
   ========================================================================== */

:root {
  --sma-red: #670000;
  --sma-red-dark: #4a0000;
}

.admin-banner {
  background: linear-gradient(135deg, var(--sma-red) 0%, #2b0000 100%);
  padding: 140px 0 70px;
  text-align: center;
  color: #fff;
}
.admin-banner h1 {
  color: #fff;
  font-size: 34px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.admin-banner p {
  color: rgba(255,255,255,0.8);
  margin-top: 10px;
}

.admin-section {
  padding: 60px 0 90px;
  background: #f8f6f6;
  min-height: 50vh;
}

/* ---------- Login / Sign up card ---------- */
.admin-card {
  max-width: 480px;
  margin: 0 auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.08);
  padding: 40px;
}

.admin-social-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 22px;
}
.admin-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 30px;
  border: 1px solid #ddd;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  cursor: pointer;
  transition: all 0.25s;
}
.admin-social-btn:hover {
  border-color: var(--sma-red);
  color: var(--sma-red);
}
.admin-social-btn.google i { color: #DB4437; }
.admin-social-btn.facebook i { color: #1877F2; }
.admin-social-btn.other i { color: var(--sma-red); }

.admin-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: #999;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 22px 0;
}
.admin-divider::before,
.admin-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid #eee;
}
.admin-divider span {
  padding: 0 12px;
}

.admin-tabs {
  display: flex;
  margin-bottom: 26px;
  border-bottom: 2px solid #eee;
}
.admin-tabs button {
  flex: 1;
  background: none;
  border: none;
  padding: 12px 0;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #999;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}
.admin-tabs button.active {
  color: var(--sma-red);
  border-bottom-color: var(--sma-red);
}

.admin-form .form-group {
  margin-bottom: 18px;
}
.admin-form label {
  font-size: 13px;
  font-weight: 600;
  color: #444;
  margin-bottom: 6px;
  display: block;
}
.admin-form .form-control {
  border-radius: 6px;
  border: 1px solid #ddd;
  padding: 12px 14px;
  height: auto;
  font-size: 14px;
}
.admin-form .form-control:focus {
  border-color: var(--sma-red);
  box-shadow: 0 0 0 3px rgba(103,0,0,0.08);
}
.admin-submit-btn {
  width: 100%;
  background-color: var(--sma-red);
  color: #fff;
  border: none;
  padding: 13px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s;
}
.admin-submit-btn:hover {
  background-color: var(--sma-red-dark);
}

.admin-alert {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 18px;
  display: none;
}
.admin-alert.show { display: block; }
.admin-alert.error { background: #fdecea; color: #a51c1c; border: 1px solid #f5c6cb; }
.admin-alert.success { background: #eaf7ed; color: #1c7a34; border: 1px solid #c3e6cb; }
.admin-alert.info { background: #fff6e5; color: #8a5c00; border: 1px solid #ffe2a8; }

.admin-note {
  font-size: 12px;
  color: #999;
  margin-top: 22px;
  line-height: 1.7;
  text-align: center;
}
.admin-note a { color: var(--sma-red); }

/* ---------- Dashboard ---------- */
.admin-dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  background: #fff;
  border-radius: 10px;
  padding: 20px 26px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  margin-bottom: 26px;
}
.admin-dash-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--sma-red);
  text-transform: uppercase;
}
.admin-dash-header .who {
  font-size: 13px;
  color: #777;
}
.admin-logout-btn {
  background: transparent;
  border: 1px solid var(--sma-red);
  color: var(--sma-red);
  padding: 9px 22px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.25s;
}
.admin-logout-btn:hover {
  background: var(--sma-red);
  color: #fff;
}

.admin-panel {
  background: #fff;
  border-radius: 10px;
  padding: 26px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  margin-bottom: 26px;
}
.admin-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.admin-panel-head h3 {
  font-size: 17px;
  font-weight: 700;
  color: #333;
}
.admin-add-btn {
  background-color: var(--sma-red);
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}
.admin-add-btn:hover { background-color: var(--sma-red-dark); }

.admin-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #999;
  border-bottom: 2px solid #f0f0f0;
  padding: 10px 12px;
}
.admin-table td {
  padding: 12px;
  border-bottom: 1px solid #f5f5f5;
  font-size: 14px;
  vertical-align: middle;
}
.admin-table img.thumb {
  width: 60px;
  height: 44px;
  object-fit: cover;
  border-radius: 4px;
}
.admin-table .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 4px;
  align-items: center;
}
.admin-table .actions button {
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  margin-right: 4px;
  white-space: nowrap;
}
.admin-table .actions .edit-btn { color: #1a6dc4; }
.admin-table .actions .delete-btn { color: #c41a1a; }
.admin-empty {
  color: #999;
  font-size: 14px;
  padding: 20px 0;
  text-align: center;
}

.pending-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid #f5f5f5;
}
.pending-row:last-child { border-bottom: none; }
.pending-row .who strong { display: block; font-size: 14px; }
.pending-row .who span { font-size: 12px; color: #999; }
.pending-row .btns button {
  border: none;
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  margin-left: 8px;
}
.pending-row .approve-btn { background: #eaf7ed; color: #1c7a34; }
.pending-row .reject-btn { background: #fdecea; color: #a51c1c; }

/* ---------- Modal ---------- */
.admin-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 99999;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 40px 16px;
}
.admin-modal-backdrop.show { display: flex; }
.admin-modal {
  background: #fff;
  border-radius: 10px;
  width: 100%;
  max-width: 720px;
  padding: 30px;
}
.admin-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.admin-modal-head h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--sma-red);
}
.admin-modal-close {
  border: none;
  background: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #999;
}
.admin-image-upload {
  border: 2px dashed #ddd;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  color: #999;
  font-size: 13px;
  margin-bottom: 14px;
}
.admin-image-upload:hover { border-color: var(--sma-red); color: var(--sma-red); }
.admin-image-preview-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.admin-image-preview {
  position: relative;
  width: 90px;
  height: 66px;
}
.admin-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}
.admin-image-preview .remove-img {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--sma-red);
  color: #fff;
  border: none;
  font-size: 12px;
  line-height: 20px;
  cursor: pointer;
}

/* ---------- Vehicle details "not found" state ---------- */
.vehicle-gone {
  text-align: center;
  padding: 70px 20px;
}
.vehicle-gone h3 {
  color: var(--sma-red);
  margin-bottom: 12px;
}

/* ---------- Sold vehicle treatment (image + stamp) ----------
   Applied wherever a vehicle photo is shown: Inventory cards, the
   Vehicle Details page, and the Admin Dashboard thumbnail. A sold photo
   is desaturated and gets the "SOLD" stamp overlaid on top; the listing
   itself is auto-removed 1 week after being marked sold
   (see assets/js/vehicles-data.js). */
.sold-media {
  position: relative;
  display: block;
  overflow: hidden;
}
.sold-media img:not(.sold-stamp) {
  filter: grayscale(100%);
}
.sold-media .sold-stamp {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 55%;
  max-width: 220px;
  pointer-events: none;
  user-select: none;
}
.admin-table .sold-media {
  width: 60px;
  height: 44px;
  border-radius: 4px;
}
.admin-table .sold-media .thumb {
  width: 100%;
  height: 100%;
}
.admin-table .sold-media .sold-stamp {
  width: 85%;
}
.sold-badge {
  display: inline-block;
  background: #670000;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 3px;
  margin-left: 8px;
}
.admin-table .actions .sold-btn { color: #670000; }
.admin-table .actions .unsold-btn { color: #777; }
/* ---------- Unsaved change badge ---------- */
.unsaved-badge {
  display: inline-block;
  background: #fff6e5;
  color: #8a5c00;
  border: 1px solid #ffe2a8;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 3px;
  margin-left: 8px;
}

/* ---------- Single, global Save Changes button (bottom of the panel) ----------
   Same red/rounded look as the site's .filled-button, but with a custom
   hover (black background, white text) as requested here specifically. */
.admin-save-all-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid #f0f0f0;
}
.admin-save-all-btn {
  background-color: #670000;
  color: #fff;
  border: none;
  font-size: 13px;
  text-transform: uppercase;
  font-weight: 700;
  padding: 12px 34px;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s;
}
.admin-save-all-btn:hover:not(:disabled) {
  background-color: #000;
  color: #fff;
}
.admin-save-all-btn:disabled {
  background-color: #e6c9c9;
  color: #fff;
  cursor: not-allowed;
}
.admin-save-toast {
  margin-top: 12px;
  background: #eaf7ed;
  color: #1c7a34;
  border: 1px solid #c3e6cb;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 20px;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.admin-save-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Custom confirm dialog (replaces window.confirm()) ---------- */
.admin-confirm-modal {
  max-width: 420px;
}
.admin-confirm-message {
  font-size: 15px;
  color: #333;
  line-height: 1.6;
  margin-bottom: 24px;
}
.admin-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}
.admin-confirm-actions button {
  border: none;
  padding: 10px 22px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}
.admin-confirm-no {
  background: #f0f0f0;
  color: #555;
}
.admin-confirm-yes {
  background: var(--sma-red);
  color: #fff;
}
.admin-confirm-yes:hover {
  background: var(--sma-red-dark);
}
