/* ==========================================================================
   Admin Panel Stylesheet
   Zanzibar Nordy Safari - High Precision Dashboard & Forms Design System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --admin-sidebar-bg: #0f172a;
  --admin-sidebar-hover: #1e293b;
  --admin-primary: #0284c7;
  --admin-accent: #f59e0b;
  --admin-bg: #f1f5f9;
  --admin-card-bg: #ffffff;
  --admin-text: #334155;
  --admin-text-light: #94a3b8;
  --admin-border: #e2e8f0;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--admin-bg);
  color: var(--admin-text);
  min-height: 100vh;
  display: flex;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Desktop Sidebar (Fixed on Desktop > 1200px) */
.admin-sidebar {
  width: 260px;
  background-color: var(--admin-sidebar-bg);
  color: #ffffff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.sidebar-header {
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-brand {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--admin-accent);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-nav {
  padding: 20px 0;
  flex-grow: 1;
}

.sidebar-menu-title {
  padding: 10px 20px 6px 20px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--admin-text-light);
  font-weight: 700;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #cbd5e1;
  transition: all 0.2s ease;
}

.sidebar-link:hover,
.sidebar-link.active {
  background-color: var(--admin-sidebar-hover);
  color: #ffffff;
  border-left: 4px solid var(--admin-accent);
}

.sidebar-link i {
  width: 20px;
  font-size: 1.1rem;
  color: var(--admin-accent);
}

/* Main Layout */
.admin-main {
  margin-left: 260px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-topbar {
  background: #ffffff;
  padding: 16px 30px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-topbar-user {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-avatar {
  width: 38px;
  height: 38px;
  background: var(--admin-primary);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.admin-content {
  padding: 30px;
  flex-grow: 1;
}

/* Cards & Dashboard Layout */
.admin-card {
  background: var(--admin-card-bg);
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  border: 1px solid var(--admin-border);
  margin-bottom: 24px;
}

.admin-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.admin-card-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--admin-sidebar-bg);
}

/* Metrics Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 22px;
  border: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.06);
}

.stat-icon-wrap {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  flex-shrink: 0;
}

.stat-val {
  font-size: 1.8rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
}

.stat-lbl {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 600;
  margin-top: 4px;
}

/* Data Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: #ffffff;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--admin-border);
}

.data-table th {
  background-color: #f8fafc;
  color: #475569;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.76rem;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #e2e8f0;
}

.data-table td {
  color: #1e293b;
}

.data-table tr:hover {
  background-color: #f8fafc;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-danger  { background: #fee2e2; color: #b91c1c; }
.badge-info    { background: #e0f2fe; color: #0369a1; }

/* Buttons */
.btn-admin {
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-admin-primary { background: var(--admin-primary); color: #ffffff; }
.btn-admin-primary:hover { background: #0369a1; }
.btn-admin-accent  { background: var(--admin-accent); color: #000000; }
.btn-admin-accent:hover  { background: #d97706; }
.btn-admin-danger  { background: #ef4444; color: #ffffff; }
.btn-admin-danger:hover  { background: #dc2626; }
.btn-admin-secondary { background: #e2e8f0; color: #334155; }
.btn-admin-secondary:hover { background: #cbd5e1; }

/* Flash Messages */
.flash-alert {
  padding: 14px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.flash-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.flash-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ==========================================================================
   SUPERIOR FORM CONTROLS SYSTEM FOR ADMIN PANEL (NO LABEL OVERLAPS)
   ========================================================================== */
.form-group {
  margin-bottom: 22px !important;
  display: block !important;
  clear: both !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.form-label,
label.form-label,
label {
  display: block !important;
  clear: both !important;
  float: none !important;
  font-weight: 700 !important;
  margin-top: 0 !important;
  margin-bottom: 8px !important;
  font-size: 0.9rem !important;
  color: #1e293b !important;
  line-height: 1.4 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  width: 100% !important;
}

.form-control,
input[type="text"].form-control,
input[type="number"].form-control,
input[type="email"].form-control,
input[type="password"].form-control,
input[type="date"].form-control,
input[type="file"].form-control,
select.form-control,
textarea.form-control {
  display: block !important;
  clear: both !important;
  float: none !important;
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 11px 14px !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 8px !important;
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  font-size: 0.95rem !important;
  color: #0f172a !important;
  background-color: #ffffff !important;
  box-shadow: none !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
  margin-top: 4px !important;
  margin-bottom: 0 !important;
}

.form-control:focus,
input:focus.form-control,
select:focus.form-control,
textarea:focus.form-control {
  outline: none !important;
  border-color: #0284c7 !important;
  box-shadow: 0 0 0 3.5px rgba(2, 132, 199, 0.18) !important;
}

textarea.form-control {
  min-height: 100px !important;
  line-height: 1.6 !important;
  resize: vertical !important;
}

select.form-control {
  height: 44px !important;
  appearance: auto !important;
  cursor: pointer !important;
}

input[type="file"].form-control {
  padding: 9px 12px !important;
  height: 44px !important;
  font-size: 0.85rem !important;
  background: #f8fafc !important;
  cursor: pointer !important;
}

/* ==========================================================================
   BRIGHT GOLDEN YELLOW HAMBURGER MENU DRAWER (Closed By Default <= 1200px)
   ========================================================================== */
button.admin-hamburger-btn,
.admin-hamburger-btn {
  display: none !important;
  background-color: #f59e0b !important; /* BRIGHT GOLDEN YELLOW */
  background: #f59e0b !important;
  color: #000000 !important;
  border: none !important;
  outline: none !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  border-radius: 8px !important;
  font-size: 1.3rem !important;
  cursor: pointer !important;
  align-items: center !important;
  justify-content: center !important;
  margin-right: 14px !important;
  flex-shrink: 0 !important;
  box-shadow: 0 3px 10px rgba(245, 158, 11, 0.45) !important;
  transition: all 0.2s ease !important;
}

button.admin-hamburger-btn i,
.admin-hamburger-btn i {
  color: #000000 !important;
  font-size: 1.3rem !important;
  display: inline-block !important;
}

button.admin-hamburger-btn:hover,
.admin-hamburger-btn:hover {
  background-color: #d97706 !important;
  background: #d97706 !important;
  color: #000000 !important;
  transform: scale(1.05) !important;
}

.admin-sidebar-close-btn {
  display: none;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.admin-sidebar-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  color: var(--admin-accent);
}

.admin-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1040;
}

.admin-sidebar-overlay.open,
.admin-sidebar-overlay.active,
.admin-sidebar-overlay.show {
  display: block !important;
}

/* Media Query for Mobile & Tablet Screens (<= 1200px) */
@media screen and (max-width: 1200px) {
  /* SIDEBAR IS CLOSED & HIDDEN OFF-SCREEN BY DEFAULT ON MOBILE */
  body .admin-sidebar,
  aside.admin-sidebar,
  .admin-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 280px !important;
    height: 100vh !important;
    z-index: 99999 !important;
    transform: translateX(-100%) !important; /* HIDDEN OFF-SCREEN BY DEFAULT */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5) !important;
  }

  /* SLIDE IN TO VIEW WHEN OPEN CLASS IS ADDED BY CLICKING YELLOW HAMBURGER */
  body .admin-sidebar.open,
  body .admin-sidebar.active,
  body .admin-sidebar.show,
  aside.admin-sidebar.open,
  aside.admin-sidebar.active,
  aside.admin-sidebar.show,
  .admin-sidebar.open,
  .admin-sidebar.active,
  .admin-sidebar.show {
    transform: translateX(0) !important;
  }

  /* MAIN CONTENT OCCUPIES 100% WIDTH ON MOBILE */
  body .admin-main,
  .admin-main {
    margin-left: 0 !important;
    width: 100% !important;
  }

  /* SHOW BRIGHT GOLDEN YELLOW HAMBURGER BUTTON ON TOPBAR FOR MOBILE */
  button.admin-hamburger-btn,
  .admin-hamburger-btn {
    display: inline-flex !important;
  }

  /* SHOW CLOSE BUTTON INSIDE SIDEBAR FOR MOBILE */
  button.admin-sidebar-close-btn,
  .admin-sidebar-close-btn {
    display: inline-flex !important;
  }

  .admin-topbar {
    padding: 12px 18px !important;
  }

  .admin-topbar-title {
    font-size: 1.05rem !important;
  }

  .admin-content {
    padding: 18px 16px !important;
  }
}
