/* =============================================
   HRz PITSTOP – Admin CMS Dashboard
   Modern SaaS Layout Redesign
   ============================================= */

/* Dashboard Layout Wrapper */
.admin-dashboard-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 80px);
  background: #090a0c;
  color: #fff;
  font-family: 'DM Sans', sans-serif;
}

/* ---- Sidebar ---- */
.admin-sidebar {
  background: #111316;
  border-right: 1px solid #ffffff14;
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  position: sticky;
  top: 80px; /* Offset for main header */
  height: calc(100vh - 80px);
  overflow-y: auto;
}

.admin-sidebar-header {
  padding: 0 24px 20px;
  border-bottom: 1px solid #ffffff0a;
  margin-bottom: 20px;
}
.admin-sidebar-header .eyebrow {
  color: var(--mute);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.admin-sidebar-header h2 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 24px;
  color: #fff;
  margin: 0;
}

.admin-tabs-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 12px;
}

.admin-tab-btn {
  background: transparent;
  border: none;
  color: #8c8d92;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 14px;
  padding: 12px 16px;
  border-radius: 8px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-tab-btn:hover {
  background: #ffffff0a;
  color: #fff;
}

.admin-tab-btn.active {
  background: var(--red);
  color: #fff;
  font-weight: 600;
}

.admin-tab-btn .badge {
  margin-left: auto;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 12px;
  font-weight: 700;
}

/* ---- Main Content Area ---- */
.admin-main {
  padding: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Topbar */
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  border-bottom: 1px solid #ffffff0a;
  background: #0d0e10;
}

.admin-page-title h1 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 28px;
  margin: 0;
  color: #fff;
}

.admin-role-switch {
  display: flex;
  align-items: center;
  gap: 12px;
}
.admin-role-switch label {
  font-size: 12px;
  color: var(--mute);
  text-transform: uppercase;
}
.admin-role-switch select {
  background: #1a1c1e;
  color: #fff;
  border: 1px solid #333;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

/* Content Container */
.admin-tab-content {
  padding: 32px;
  flex: 1;
}

/* Metric Cards */
.admin-metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}
.admin-metric-card {
  background: #131417;
  border: 1px solid #232528;
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.admin-metric-card .title {
  color: var(--mute);
  font-size: 13px;
  text-transform: uppercase;
  margin-bottom: 8px;
  font-weight: 600;
}
.admin-metric-card .value {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 36px;
  color: #fff;
  font-weight: 700;
  line-height: 1;
}

/* ---- Cards & Panels ---- */
.admin-panel-card {
  background: #131417;
  border: 1px solid #232528;
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 24px;
}

.cms-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.cms-toolbar h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 24px;
  margin: 0;
}
.cms-toolbar p {
  color: var(--mute);
  font-size: 14px;
  margin-top: 4px;
}

/* ---- Forms ---- */
.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.admin-form-full {
  grid-column: 1 / -1;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: #b0b1b3;
  margin-bottom: 8px;
  font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
  width: 100%;
  background: #1c1e22;
  border: 1px solid #333;
  color: #fff;
  padding: 12px 14px;
  border-radius: 6px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  transition: border-color 0.2s;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--red);
}

.file-upload-row { margin-top: 12px; }

/* ---- Hero Preview Box ---- */
.hero-preview-box {
  border: 1px solid #333;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 32px;
}
.hero-preview-box h4 {
  background: #1a1c1e;
  padding: 12px 16px;
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--mute);
  border-bottom: 1px solid #333;
}
.rider-hero {
  position: relative;
  height: 350px;
  display: flex;
  align-items: center;
  padding-left: 40px;
}
.hero-content-box {
  position: relative;
  z-index: 2;
  max-width: 400px;
}
.hero-badge { color: var(--red2); font-weight: 700; font-size: 12px; display: block; margin-bottom: 10px; }
.hero-headline { font-family: 'Barlow Condensed'; font-size: 40px; font-weight: 800; line-height: 1; margin: 0 0 16px; }
.hero-subhead { font-size: 14px; color: #ccc; }

.image-preset-picker {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.preset-img-btn {
  background: #1c1e22;
  border: 1px solid #333;
  color: #fff;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}
.preset-img-btn:hover { border-color: var(--red); }

/* ---- Table ---- */
.admin-table-wrapper {
  background: #131417;
  border: 1px solid #232528;
  border-radius: 12px;
  overflow: hidden;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.admin-table th {
  background: #181a1d;
  color: #8c8d92;
  font-size: 12px;
  text-transform: uppercase;
  padding: 16px;
  font-weight: 600;
  border-bottom: 1px solid #232528;
}
.admin-table td {
  padding: 16px;
  border-bottom: 1px solid #1a1c1e;
  font-size: 14px;
  color: #dfdfe0;
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(255,255,255,0.02); }

.cat-tag, .stock-tag {
  background: #1c1e22;
  border: 1px solid #333;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}
.stock-tag.in { color: #4ade80; border-color: rgba(74,222,128,0.2); background: rgba(74,222,128,0.05); }
.stock-tag.out { color: #ef4444; border-color: rgba(239,68,68,0.2); background: rgba(239,68,68,0.05); }

.small-action-btn {
  background: #232528;
  border: 1px solid #333;
  color: #fff;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.small-action-btn:hover { background: #333; }
.small-action-btn.danger { color: #ef4444; border-color: rgba(239,68,68,0.3); background: rgba(239,68,68,0.05); }
.small-action-btn.danger:hover { background: #ef4444; color: #fff; border-color: #ef4444; }

/* ---- Reviews Grid ---- */
.reviews-moderation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}
.moderation-card {
  background: #131417;
  border: 1px solid #232528;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
}
.moderation-card.pending { border-top: 3px solid var(--gold); }
.moderation-card.published { border-top: 3px solid var(--green); }
.moderation-card.rejected { border-top: 3px solid #666; opacity: 0.7; }

.mod-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.status-badge { font-size: 10px; font-weight: bold; padding: 3px 8px; border-radius: 4px; text-transform: uppercase; }
.status-badge.pending { background: rgba(234,179,8,0.1); color: var(--gold); }
.status-badge.published { background: rgba(74,222,128,0.1); color: var(--green); }
.status-badge.rejected { background: rgba(255,255,255,0.1); color: #999; }

.bike-info { font-size: 12px; color: var(--mute); margin-bottom: 12px; border-bottom: 1px solid #232528; padding-bottom: 12px; }
.moderation-card .title { font-size: 15px; margin: 0 0 8px; font-weight: 700; color: #fff; }
.moderation-card .comment { font-size: 13px; color: #a0a1a5; line-height: 1.6; flex: 1; }
.mod-actions { display: flex; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid #232528; }

/* ---- Audit Logs ---- */
.audit-log-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.log-item {
  background: #1a1c1e;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 13px;
  border: 1px solid #232528;
  display: flex;
  gap: 12px;
}
.log-time { color: var(--red2); font-family: monospace; font-size: 12px; }
.log-user { color: #fff; }
.log-text { color: #999; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .admin-dashboard-layout { grid-template-columns: 1fr; }
  .admin-sidebar { height: auto; position: relative; top: 0; padding: 16px; border-right: none; border-bottom: 1px solid #232528; }
  .admin-tabs-list { flex-direction: row; flex-wrap: wrap; }
  .admin-tab-btn { flex: 1 1 calc(50% - 8px); text-align: center; justify-content: center; }
  .admin-tab-btn .badge { display: none; }
  .admin-metrics-row { grid-template-columns: 1fr; }
  .admin-form-grid { grid-template-columns: 1fr; }
  .admin-topbar { flex-direction: column; align-items: flex-start; gap: 16px; }
}
