/* ============================================
   OVM MOTORS — ADMIN DASHBOARD
   Loaded only by pages/admin.html.
   Depends on variables.css being loaded first
   via style.css.
   ============================================ */

/* ── PAGE HEADER ───────────────────────────── */
.dash-header {
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--border);
}

.dash-header-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.dash-title {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2rem, 4vw, 3rem);
  color: #000000;
  margin-top: 8px;
  line-height: 1.1;
}

.dash-header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── STAT CARDS ────────────────────────────── */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 56px;
}

.dash-stat-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition);
}

.dash-stat-card:hover {
  border-color: var(--border-dark);
  box-shadow: var(--shadow-sm);
}

.dash-stat-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.dash-stat-num {
  font-family: 'DM Serif Display', serif;
  font-size: 2.6rem;
  color: #000000;
  line-height: 1;
}

.dash-stat-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.4;
}

/* ── SECTION HEADER + CONTROLS ─────────────── */
.dash-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.dash-section-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.8rem;
  color: #000000;
}

.dash-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.dash-search {
  border: 1.5px solid var(--border);
  border-radius: 100px;
  padding: 9px 18px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color var(--transition);
  min-width: 200px;
}

.dash-search:focus { border-color: #000000; }

.dash-sort {
  border: 1.5px solid var(--border);
  border-radius: 100px;
  padding: 9px 18px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  color: var(--text);
  background: var(--white);
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23868e96' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.dash-sort:focus { border-color: #000000; }

/* ── DESKTOP TABLE ─────────────────────────── */
.dash-table-wrap {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  overflow-x: auto;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.dash-table th {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--off-white);
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
}

.dash-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

.dash-table tbody tr:last-child td { border-bottom: none; }
.dash-table tbody tr:hover td { background: var(--off-white); }

.td-name {
  font-weight: 500;
  color: #000000;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.td-price {
  font-family: 'DM Mono', monospace;
  font-size: 0.85rem;
  white-space: nowrap;
  color: #000000;
}

.td-actions {
  display: flex;
  gap: 8px;
  white-space: nowrap;
}

/* ── EMPTY STATE ───────────────────────────── */
.dash-empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--text-muted);
}

.dash-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.3;
}

/* ── MOBILE LISTING CARDS ──────────────────── */
.dash-cards { display: none; }

.dash-listing-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  transition: border-color var(--transition);
}

.dash-listing-card:hover { border-color: var(--border-dark); }

.dash-card-info {
  flex: 1;
  min-width: 0;
}

.dash-card-name {
  font-family: 'DM Serif Display', serif;
  font-size: 1.05rem;
  color: #000000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}

.dash-card-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.dash-card-price {
  font-family: 'DM Mono', monospace;
  font-size: 0.82rem;
  color: var(--text-mid);
}

.dash-card-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ── LISTING FORM MODAL ────────────────────── */
.dash-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.dash-modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.dash-modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: scaleUp 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
}

.dash-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 1;
}

.dash-modal-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.4rem;
  color: #000000;
}

.dash-modal-body { padding: 28px; }

/* ── DELETE CONFIRM MODAL ──────────────────── */
.dash-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.dash-confirm-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.dash-confirm {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 36px;
  max-width: 360px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: scaleUp 0.25s cubic-bezier(0.34,1.56,0.64,1) both;
}

.dash-confirm-listing-name {
  font-family: 'DM Serif Display', serif;
  font-size: 1.15rem;
  color: #000000;
  margin: 12px 0 6px;
}

.dash-confirm-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.dash-confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* ── DESTRUCTIVE BUTTON ────────────────────── */
.btn-red {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: 100px;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--red);
  color: var(--white);
  border: none;
}

.btn-red:hover { background: #b02a37; transform: translateY(-1px); }

/* ── RESPONSIVE ────────────────────────────── */
@media (max-width: 900px) {
  .dash-stats { grid-template-columns: 1fr 1fr; }
  .dash-table-wrap { display: none; }
  .dash-cards { display: block; }
  .dash-section-header { flex-direction: column; align-items: flex-start; }
  .dash-controls { width: 100%; }
  .dash-search { min-width: unset; flex: 1; }
  .dash-header-actions { width: 100%; }
}

@media (max-width: 560px) {
  .dash-stat-num { font-size: 2rem; }
  .dash-card-actions { flex-direction: column; }
  .dash-confirm-actions { flex-direction: column; }
}
