/* ========================================
   RACERS TOUR AND TRAVELS - Admin CSS
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Raleway:wght@300;400;500;600;700&display=swap');

:root {
  --gold:       #c9a84c;
  --gold-light: #e8c97c;
  --gold-dark:  #9d7d2a;
  --black:      #080808;
  --black-2:    #111111;
  --black-3:    #1a1a1a;
  --black-4:    #242424;
  --white:      #f5f0e8;
  --gray:       #888888;
  --gray-light: #cccccc;
  --green:      #2ecc71;
  --red:        #e74c3c;
  --orange:     #e67e22;
  --blue:       #3498db;
  --font-display: 'Cinzel', serif;
  --font-body:    'Raleway', sans-serif;
  --border-gold: 1px solid rgba(201,168,76,0.25);
  --transition: all 0.3s ease;
  --sidebar-width: 260px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  background: var(--black);
  color: var(--white);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; border: none; outline: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--black-2); }
::-webkit-scrollbar-thumb { background: var(--gold-dark); border-radius: 3px; }

/* ── Admin Login ────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--black);
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(201,168,76,0.07) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 50%, rgba(201,168,76,0.04) 0%, transparent 60%);
}
.login-bg-text {
  position: absolute;
  font-family: var(--font-display);
  font-size: 20rem;
  font-weight: 900;
  color: rgba(201,168,76,0.02);
  user-select: none;
  pointer-events: none;
  letter-spacing: 0.1em;
}
.login-card {
  position: relative;
  z-index: 2;
  width: 420px;
  background: var(--black-2);
  border: var(--border-gold);
  border-radius: 6px;
  padding: 50px 44px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.7), 0 0 60px rgba(201,168,76,0.08);
}
.login-logo {
  text-align: center;
  margin-bottom: 36px;
}
.login-logo img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 50%;
  margin: 0 auto 14px;
  border: 1px solid rgba(201,168,76,0.4);
}
.login-logo .brand {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.08em;
  display: block;
}
.login-logo .sub {
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gray);
  display: block;
  margin-top: 4px;
}
.login-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
  color: var(--white);
}
.login-subtitle {
  text-align: center;
  font-size: 0.78rem;
  color: var(--gray);
  margin-bottom: 36px;
}
.form-field {
  margin-bottom: 20px;
}
.form-field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}
.input-wrap {
  position: relative;
}
.input-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  fill: var(--gray);
}
.input-wrap input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 3px;
  padding: 12px 16px 12px 42px;
  color: var(--white);
  font-size: 0.9rem;
  transition: var(--transition);
  outline: none;
}
.input-wrap input:focus {
  border-color: var(--gold);
  background: rgba(201,168,76,0.05);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.1);
}
.input-wrap input::placeholder { color: rgba(255,255,255,0.25); }
.login-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold), var(--gold-light));
  color: var(--black);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border-radius: 3px;
  margin-top: 10px;
  transition: var(--transition);
}
.login-btn:hover {
  box-shadow: 0 6px 25px rgba(201,168,76,0.5);
  transform: translateY(-2px);
}
.login-error {
  display: none;
  background: rgba(231,76,60,0.1);
  border: 1px solid rgba(231,76,60,0.3);
  color: #e74c3c;
  padding: 10px 14px;
  border-radius: 3px;
  font-size: 0.8rem;
  margin-top: 14px;
  text-align: center;
}
.login-error.show { display: block; }
.login-footer {
  text-align: center;
  margin-top: 28px;
  font-size: 0.72rem;
  color: var(--gray);
}
.login-footer a { color: var(--gold); }

/* ── Admin Layout ───────────────────────── */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--black-2);
  border-right: var(--border-gold);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
  transition: var(--transition);
}
.sidebar-brand {
  padding: 28px 24px;
  border-bottom: var(--border-gold);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 50%;
  border: 1px solid rgba(201,168,76,0.3);
}
.sidebar-brand-text .name {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.2;
}
.sidebar-brand-text .tag {
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--gray);
  text-transform: uppercase;
}
.sidebar-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gray);
  padding: 20px 24px 8px;
}
.sidebar-nav { flex: 1; padding: 8px 12px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
  color: var(--gray);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 2px;
  position: relative;
}
.nav-item svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }
.nav-item:hover {
  background: rgba(201,168,76,0.08);
  color: var(--gold-light);
}
.nav-item.active {
  background: linear-gradient(90deg, rgba(201,168,76,0.15), rgba(201,168,76,0.05));
  color: var(--gold);
  border-left: 2px solid var(--gold);
  padding-left: 12px;
}
.nav-item .badge {
  margin-left: auto;
  background: var(--gold);
  color: var(--black);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}
.sidebar-footer {
  padding: 20px 12px;
  border-top: var(--border-gold);
}
.logout-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  width: 100%;
  border-radius: 4px;
  color: rgba(231,76,60,0.8);
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
}
.logout-btn svg { width: 16px; height: 16px; fill: currentColor; }
.logout-btn:hover { background: rgba(231,76,60,0.1); color: var(--red); }

/* Main Content */
.admin-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.admin-topbar {
  background: var(--black-2);
  border-bottom: var(--border-gold);
  padding: 0 36px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 20px;
}
.topbar-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}
.topbar-date {
  font-size: 0.78rem;
  color: var(--gray);
}
.admin-avatar {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--black);
}
.admin-content {
  padding: 36px;
  flex: 1;
}

/* ── Dashboard Panels ───────────────────── */
.panel { display: none; }
.panel.active { display: block; }

/* Stats Cards */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--black-2);
  border: var(--border-gold);
  border-radius: 6px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
.stat-card:hover { border-color: var(--gold); transform: translateY(-3px); }
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
}
.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-icon.gold { background: rgba(201,168,76,0.15); }
.stat-icon.gold svg { fill: var(--gold); }
.stat-icon.green { background: rgba(46,204,113,0.15); }
.stat-icon.green svg { fill: var(--green); }
.stat-icon.blue { background: rgba(52,152,219,0.15); }
.stat-icon.blue svg { fill: var(--blue); }
.stat-icon.red { background: rgba(231,76,60,0.15); }
.stat-icon.red svg { fill: var(--red); }
.stat-num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-lbl {
  font-size: 0.75rem;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
}

/* Table Styles */
.admin-table-wrap {
  background: var(--black-2);
  border: var(--border-gold);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 30px;
}
.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: var(--border-gold);
  gap: 16px;
  flex-wrap: wrap;
}
.table-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
}
.table-search {
  flex: 1;
  max-width: 280px;
  position: relative;
}
.table-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  fill: var(--gray);
}
.table-search input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 3px;
  padding: 9px 14px 9px 36px;
  color: var(--white);
  font-size: 0.82rem;
  outline: none;
  transition: var(--transition);
}
.table-search input:focus { border-color: var(--gold); }
.table-search input::placeholder { color: rgba(255,255,255,0.25); }
table {
  width: 100%;
  border-collapse: collapse;
}
thead tr { background: rgba(201,168,76,0.06); }
th {
  padding: 13px 18px;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  border-bottom: var(--border-gold);
  white-space: nowrap;
}
td {
  padding: 14px 18px;
  font-size: 0.83rem;
  color: var(--gray-light);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(201,168,76,0.03); }
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.status-badge.new {
  background: rgba(52,152,219,0.15);
  color: #3498db;
  border: 1px solid rgba(52,152,219,0.3);
}
.status-badge.confirmed {
  background: rgba(46,204,113,0.15);
  color: #2ecc71;
  border: 1px solid rgba(46,204,113,0.3);
}
.status-badge.pending {
  background: rgba(230,126,34,0.15);
  color: #e67e22;
  border: 1px solid rgba(230,126,34,0.3);
}
.status-badge.cancelled {
  background: rgba(231,76,60,0.15);
  color: #e74c3c;
  border: 1px solid rgba(231,76,60,0.3);
}
.status-badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.action-btns { display: flex; gap: 8px; }
.action-btn {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  cursor: pointer;
}
.action-btn svg { width: 14px; height: 14px; }
.action-btn.view { background: rgba(52,152,219,0.15); color: #3498db; }
.action-btn.view svg { fill: #3498db; }
.action-btn.edit { background: rgba(201,168,76,0.15); color: var(--gold); }
.action-btn.edit svg { fill: var(--gold); }
.action-btn.delete { background: rgba(231,76,60,0.15); color: #e74c3c; }
.action-btn.delete svg { fill: #e74c3c; }
.action-btn:hover { opacity: 0.75; transform: scale(1.1); }
.empty-state {
  text-align: center;
  padding: 60px;
  color: var(--gray);
}
.empty-state svg { width: 48px; height: 48px; fill: rgba(201,168,76,0.2); margin-bottom: 16px; }
.empty-state h3 { font-size: 1rem; color: var(--gray-light); margin-bottom: 8px; }
.empty-state p { font-size: 0.8rem; }

/* ── Admin Buttons ──────────────────────── */
.admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: var(--transition);
  cursor: pointer;
}
.admin-btn svg { width: 16px; height: 16px; fill: currentColor; }
.admin-btn.primary {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--black);
}
.admin-btn.primary:hover { box-shadow: 0 4px 15px rgba(201,168,76,0.4); }
.admin-btn.danger {
  background: rgba(231,76,60,0.15);
  color: #e74c3c;
  border: 1px solid rgba(231,76,60,0.3);
}
.admin-btn.danger:hover { background: rgba(231,76,60,0.25); }
.admin-btn.success {
  background: rgba(46,204,113,0.15);
  color: #2ecc71;
  border: 1px solid rgba(46,204,113,0.3);
}
.admin-btn.success:hover { background: rgba(46,204,113,0.25); }
.admin-btn.outline {
  border: 1px solid rgba(201,168,76,0.3);
  color: var(--gold);
  background: transparent;
}
.admin-btn.outline:hover { background: rgba(201,168,76,0.1); }

/* ── Modal ──────────────────────────────── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 500;
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--black-2);
  border: var(--border-gold);
  border-radius: 6px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0,0,0,0.8);
}
.modal-header {
  padding: 24px 28px 20px;
  border-bottom: var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
}
.modal-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  color: var(--gray);
  font-size: 1.2rem;
  line-height: 1;
}
.modal-close:hover { background: rgba(231,76,60,0.2); color: #e74c3c; }
.modal-body { padding: 28px; }
.modal-footer {
  padding: 20px 28px;
  border-top: var(--border-gold);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* Admin Form Fields */
.admin-form-group {
  margin-bottom: 20px;
}
.admin-form-group label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}
.admin-form-group input,
.admin-form-group select,
.admin-form-group textarea {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 3px;
  padding: 11px 14px;
  color: var(--white);
  font-size: 0.87rem;
  transition: var(--transition);
  outline: none;
}
.admin-form-group input:focus,
.admin-form-group select:focus,
.admin-form-group textarea:focus {
  border-color: var(--gold);
  background: rgba(201,168,76,0.04);
}
.admin-form-group input::placeholder,
.admin-form-group textarea::placeholder {
  color: rgba(255,255,255,0.2);
}
.admin-form-group select option { background: var(--black-2); }
.admin-form-group textarea { resize: vertical; min-height: 90px; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-row .admin-form-group { margin-bottom: 0; }
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}
.checkbox-item input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--gold);
  cursor: pointer;
}
.checkbox-item span {
  font-size: 0.8rem;
  color: var(--gray-light);
}

/* ── Toast / Notification ───────────────── */
.admin-toast {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  background: var(--black-3);
  border-radius: 5px;
  padding: 14px 22px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  transform: translateX(120%);
  transition: transform 0.4s ease;
  max-width: 320px;
  min-width: 220px;
  border-left: 3px solid var(--gold);
}
.admin-toast.success { border-left-color: var(--green); }
.admin-toast.error { border-left-color: var(--red); }
.admin-toast.show { transform: translateX(0); }
.admin-toast .title {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--white);
  margin-bottom: 3px;
}
.admin-toast .msg { font-size: 0.78rem; color: var(--gray); }

/* ── Package Cards in Admin ─────────────── */
.pkg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
  margin-top: 24px;
}
.admin-pkg-card {
  background: var(--black-2);
  border: var(--border-gold);
  border-radius: 6px;
  overflow: hidden;
  transition: var(--transition);
}
.admin-pkg-card:hover { border-color: var(--gold); }
.admin-pkg-thumb {
  height: 160px;
  background: var(--black-3);
  position: relative;
  overflow: hidden;
}
.admin-pkg-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
}
.admin-pkg-status {
  position: absolute;
  top: 12px;
  right: 12px;
}
.admin-pkg-body { padding: 18px; }
.admin-pkg-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 6px;
}
.admin-pkg-price {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 12px;
}
.admin-pkg-actions {
  display: flex;
  gap: 10px;
  padding-top: 12px;
  border-top: var(--border-gold);
}

/* ── Booking Detail View ─────────────────── */
.booking-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
}
.detail-row { margin-bottom: 8px; }
.detail-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gray);
  display: block;
  margin-bottom: 3px;
}
.detail-value {
  font-size: 0.88rem;
  color: var(--white);
  font-weight: 500;
}

/* ── Quick Actions ──────────────────────── */
.quick-actions {
  display: flex;
  gap: 14px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

/* ── Responsive Admin ───────────────────── */
@media (max-width: 900px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .admin-topbar { padding: 0 20px; }
  .admin-content { padding: 20px; }
}
@media (max-width: 600px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .login-card { padding: 32px 24px; width: 100%; max-width: 380px; }
  .booking-detail-grid { grid-template-columns: 1fr; }
}
