/* ===================================================================
   ZAZA LOGISTICS & FACILITY MANAGEMENT - ADMIN PORTAL STYLESHEET
   =================================================================== */

body.admin-portal-body {
  background-color: #F8FAFC;
  font-family: var(--font-body);
  color: var(--color-text-main);
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

/* -------------------------------------------------------------------
   1. LOGIN OVERLAY SCREEN
   ------------------------------------------------------------------- */
.admin-login-wrapper {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 1rem;
  background: radial-gradient(circle at top right, rgba(245, 184, 0, 0.12), transparent 40%),
              radial-gradient(circle at bottom left, rgba(211, 16, 16, 0.08), transparent 40%),
              #0F172A;
}

.admin-login-card {
  background: #FFFFFF;
  width: 100%;
  max-width: 440px;
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-title {
  font-size: 1.5rem;
  color: var(--color-dark-slate);
  font-weight: 800;
  text-align: center;
  margin-bottom: 0.25rem;
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-credentials-hint {
  margin-top: 1.5rem;
  padding: 1rem;
  background: #F1F5F9;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  color: #475569;
  border-left: 4px solid var(--color-primary-yellow);
}

.login-credentials-hint p {
  margin: 2px 0;
}

.login-credentials-hint code {
  background: #E2E8F0;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  color: var(--color-brand-red);
}

/* -------------------------------------------------------------------
   2. STANDALONE APP LAYOUT
   ------------------------------------------------------------------- */
.admin-app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Styling */
.admin-sidebar {
  width: 270px;
  background: #0F172A;
  color: #F8FAFC;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-header {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid #1E293B;
}

.sidebar-nav {
  padding: 1.25rem 0.75rem;
  flex-grow: 1;
}

.nav-section-label {
  font-size: 0.68rem;
  font-weight: 800;
  color: #64748B;
  letter-spacing: 1.2px;
  padding: 0.75rem 0.75rem 0.35rem 0.75rem;
  margin-top: 0.5rem;
}

.sidebar-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.8rem 1rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: #94A3B8;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: var(--transition-fast);
  margin-bottom: 0.25rem;
}

.sidebar-btn i {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
}

.sidebar-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #FFFFFF;
}

.sidebar-btn.active {
  background: var(--color-primary-yellow);
  color: var(--color-dark-slate);
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(245, 184, 0, 0.25);
}

.sidebar-btn.active i {
  color: var(--color-dark-slate);
}

.badge-count {
  margin-left: auto;
  background: var(--color-brand-red);
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid #1E293B;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0B1120;
}

.user-profile-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--color-brand-red);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #FFFFFF;
}

.user-role-badge {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--color-primary-yellow);
  text-transform: uppercase;
}

.btn-logout {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.btn-logout:hover {
  color: var(--color-brand-red);
  background: rgba(211, 16, 16, 0.15);
}

/* -------------------------------------------------------------------
   3. WORKSPACE AREA & TOPBAR
   ------------------------------------------------------------------- */
.admin-workspace {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #F8FAFC;
}

.workspace-topbar {
  height: 75px;
  background: #FFFFFF;
  border-bottom: 1px solid var(--color-border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.mobile-sidebar-toggle {
  display: none;
  background: #F1F5F9;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  width: 40px;
  height: 40px;
  font-size: 1.15rem;
  color: var(--color-dark-slate);
  cursor: pointer;
  margin-right: 0.75rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.mobile-sidebar-toggle:hover, .mobile-sidebar-toggle:active {
  background: var(--color-primary-yellow);
  color: var(--color-dark-slate);
  border-color: var(--color-primary-yellow);
}

.mobile-sidebar-close {
  display: none;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #FFFFFF;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  transition: var(--transition-fast);
}

.mobile-sidebar-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: var(--color-primary-yellow);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.35);
  z-index: 195;
}

.sidebar-backdrop.active {
  display: block;
}

.workspace-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--color-dark-slate);
  margin: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.live-clock {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: #F1F5F9;
  padding: 6px 12px;
  border-radius: var(--radius-full);
}

.workspace-content {
  padding: 2rem;
  flex-grow: 1;
}

.admin-pane {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.admin-pane.active {
  display: block;
}

/* -------------------------------------------------------------------
   4. STATS CARDS & OVERVIEW
   ------------------------------------------------------------------- */
.stats-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.stat-card {
  background: #FFFFFF;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.stat-icon {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-icon.yellow { background: rgba(245, 184, 0, 0.15); color: #D97706; }
.stat-icon.red { background: rgba(211, 16, 16, 0.15); color: var(--color-brand-red); }
.stat-icon.blue { background: rgba(37, 99, 235, 0.15); color: #2563EB; }
.stat-icon.green { background: rgba(16, 185, 129, 0.15); color: #10B981; }

.stat-details {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-dark-slate);
  line-height: 1.1;
  margin-top: 4px;
}

.overview-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.card-box {
  background: #FFFFFF;
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

.card-box h2, .card-box h3 {
  font-size: 1.3rem;
  color: var(--color-dark-slate);
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.system-status-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.system-status-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px dashed var(--color-border);
  font-size: 0.92rem;
}

.system-status-list li:last-child {
  border-bottom: none;
}

/* -------------------------------------------------------------------
   5. DATA TABLES & ACTION BUTTONS
   ------------------------------------------------------------------- */
.pane-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.search-filter-box {
  position: relative;
  min-width: 320px;
}

.search-filter-box i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
}

.search-filter-box input {
  padding-left: 2.6rem;
  border-radius: var(--radius-full);
}

.admin-table-wrapper {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.admin-table th {
  background: #F1F5F9;
  color: var(--color-dark-slate);
  font-weight: 700;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.admin-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.admin-table tr:hover {
  background-color: #F8FAFC;
}

.btn-xs {
  padding: 4px 10px;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}

/* Status Pill Badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
}

.badge-status.pending { background: #FEF3C7; color: #92400E; }
.badge-status.transit { background: #DBEAFE; color: #1E40AF; }
.badge-status.delivered { background: #D1FAE5; color: #065F46; }
.badge-status.admin { background: #FEE2E2; color: #991B1B; }
.badge-status.staff { background: #E0E7FF; color: #3730A3; }

/* -------------------------------------------------------------------
   6. RESPONSIVE BREAKPOINTS
   ------------------------------------------------------------------- */
@media (max-width: 992px) {
  .admin-sidebar {
    position: fixed;
    top: 0;
    left: -290px;
    width: 280px;
    height: 100vh;
    height: 100dvh;
    z-index: 200;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 8px 0 25px rgba(0, 0, 0, 0.3);
  }

  .admin-sidebar.open {
    left: 0;
  }

  .mobile-sidebar-toggle {
    display: inline-flex;
  }

  .mobile-sidebar-close {
    display: inline-flex;
  }

  .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .workspace-topbar {
    padding: 0.75rem 1.25rem;
    height: auto;
    min-height: 64px;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .topbar-left {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
  }

  .workspace-title {
    font-size: 1.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar-right {
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  .overview-grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .workspace-topbar {
    padding: 0.6rem 0.85rem;
  }

  .workspace-title {
    font-size: 1.05rem;
  }

  .live-clock {
    display: none;
  }

  .topbar-right .btn-text-label {
    display: none;
  }

  .topbar-right .btn-sm {
    padding: 0.45rem 0.65rem;
    font-size: 0.82rem;
  }

  .workspace-content {
    padding: 1.25rem 0.85rem;
  }

  .admin-card {
    padding: 1.25rem 1rem;
  }
}
