/*
 * =============================================
 * Alka Refrigeration — Admin Dashboard Styles
 * Dark sidebar + clean card layout
 * =============================================
 */

/* =============================================
   Layout
   ============================================= */
.admin-body {
  display: flex;
  min-height: 100vh;
  background: #f0f2f8;
  overflow-x: hidden;
}

/* =============================================
   SIDEBAR
   ============================================= */
.admin-sidebar {
  width: 260px;
  min-height: 100vh;
  background: linear-gradient(180deg, #0d1b4a 0%, #1a237e 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.sidebar-logo-img {
  height: 32px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: rgba(255,255,255,0.65);
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 500;
  transition: all 0.2s ease;
  text-decoration: none;
  cursor: pointer;
}

.sidebar-link:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.sidebar-link.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 #ff6f00;
}

.sidebar-icon {
  font-size: 1.15rem;
  width: 24px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* =============================================
   MAIN CONTENT AREA
   ============================================= */
.admin-main {
  margin-left: 260px;
  flex: 1;
  min-height: 100vh;
  padding: 0;
}

/* =============================================
   TOP BAR
   ============================================= */
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #e5e8f0;
}

.admin-topbar h2 {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: #1a237e;
}

.sidebar-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
}

.sidebar-toggle span {
  width: 22px;
  height: 2.5px;
  background: #353b50;
  border-radius: 2px;
}

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

.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #ff6f00;
  object-fit: cover;
}

.topbar-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #353b50;
}

/* =============================================
   ADMIN SECTIONS
   ============================================= */
.admin-section {
  display: none;
  padding: 28px 32px;
  animation: fadeInSection 0.3s ease;
}

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

@keyframes fadeInSection {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =============================================
   STATS GRID
   ============================================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 12px rgba(13,27,74,0.06);
  border: 1px solid #eceef5;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(13,27,74,0.1);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-total .stat-icon { background: #e3f2fd; }
.stat-pending .stat-icon { background: #fff8e1; }
.stat-done .stat-icon { background: #e8f5e9; }
.stat-customers .stat-icon { background: #f3e5f5; }
.stat-revenue .stat-icon { background: #fbe9e7; }

.stat-value {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 1.8rem;
  font-weight: 800;
  color: #1a237e;
  line-height: 1;
}

.stat-label {
  font-size: 0.82rem;
  color: #8890a7;
  margin-top: 4px;
}

/* =============================================
   TAB BAR
   ============================================= */
.tab-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  padding: 4px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(13,27,74,0.04);
  border: 1px solid #eceef5;
}

.tab-btn {
  flex: 1;
  padding: 12px 20px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #636b83;
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background: #f5f6fa;
  color: #1a237e;
}

.tab-btn.active {
  background: #1a237e;
  color: #fff;
  box-shadow: 0 4px 12px rgba(26,35,126,0.25);
}

/* =============================================
   COMPLAINTS GRID
   ============================================= */
.complaints-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

.complaint-card-admin {
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(13,27,74,0.06);
  border: 1px solid #eceef5;
  transition: all 0.2s ease;
}

.complaint-card-admin:hover {
  box-shadow: 0 8px 28px rgba(13,27,74,0.1);
  border-color: #d8dbe8;
}

.complaint-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.complaint-customer h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #232838;
  margin-bottom: 4px;
}

.complaint-customer .customer-meta {
  font-size: 0.8rem;
  color: #8890a7;
}

.complaint-customer .customer-meta a {
  color: #1a237e;
  text-decoration: none;
}

.complaint-badge {
  padding: 4px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge-pending { background: #fff8e1; color: #f57f17; }
.badge-called { background: #e3f2fd; color: #1565c0; }
.badge-confirmed { background: #e8f5e9; color: #2e7d32; }
.badge-on-the-way { background: #f3e5f5; color: #7b1fa2; }
.badge-completed { background: #e8f5e9; color: #2e7d32; }
.badge-cancelled { background: #ffebee; color: #c62828; }

.complaint-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
  padding: 16px;
  background: #f8f9fc;
  border-radius: 10px;
}

.complaint-detail {
  font-size: 0.82rem;
}

.complaint-detail .detail-label {
  color: #8890a7;
  font-weight: 500;
  margin-bottom: 2px;
}

.complaint-detail .detail-value {
  color: #353b50;
  font-weight: 600;
}

.complaint-status-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.status-chip {
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chip-call-done { background: #e3f2fd; color: #1565c0; }
.chip-not-called { background: #fafafa; color: #9e9e9e; }
.chip-confirmed { background: #e8f5e9; color: #2e7d32; }
.chip-not-confirmed { background: #fafafa; color: #9e9e9e; }
.chip-on-way { background: #f3e5f5; color: #7b1fa2; }
.chip-not-assigned { background: #fafafa; color: #9e9e9e; }

.complaint-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid #eceef5;
}

.btn-action {
  padding: 7px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-action:hover {
  transform: translateY(-1px);
}

.btn-call { background: #e3f2fd; color: #1565c0; }
.btn-call:hover { background: #bbdefb; }
.btn-confirm { background: #e8f5e9; color: #2e7d32; }
.btn-confirm:hover { background: #c8e6c9; }
.btn-on-way { background: #f3e5f5; color: #7b1fa2; }
.btn-on-way:hover { background: #e1bee7; }
.btn-done { background: #e8f5e9; color: #2e7d32; }
.btn-done:hover { background: #c8e6c9; }
.btn-not-done { background: #ffebee; color: #c62828; }
.btn-not-done:hover { background: #ffcdd2; }
.btn-amount { background: #fff8e1; color: #f57f17; }
.btn-amount:hover { background: #ffecb3; }

/* =============================================
   ADMIN TABLE
   ============================================= */
.table-wrapper {
  overflow-x: auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(13,27,74,0.06);
  border: 1px solid #eceef5;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table thead {
  background: #f5f6fa;
}

.admin-table th {
  padding: 14px 20px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #636b83;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #eceef5;
}

.admin-table td {
  padding: 14px 20px;
  font-size: 0.88rem;
  color: #353b50;
  border-bottom: 1px solid #f5f6fa;
}

.admin-table tbody tr:hover {
  background: #f8f9fc;
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

/* =============================================
   ADMIN CARDS & FORMS
   ============================================= */
.admin-card {
  background: #fff;
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 2px 12px rgba(13,27,74,0.06);
  border: 1px solid #eceef5;
}

.admin-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a237e;
  margin-bottom: 20px;
}

.coupon-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  max-width: 600px;
}

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

.section-toolbar h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a237e;
}

/* =============================================
   REPORT CARDS
   ============================================= */
.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.report-card {
  background: #fff;
  border-radius: 14px;
  padding: 32px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(13,27,74,0.06);
  border: 1px solid #eceef5;
  cursor: pointer;
  transition: all 0.2s ease;
}

.report-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(13,27,74,0.1);
  border-color: #1a237e;
}

.report-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.report-card h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #232838;
  margin-bottom: 8px;
}

.report-card p {
  font-size: 0.82rem;
  color: #8890a7;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn-admin-primary {
  width: 100%;
  padding: 12px 24px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #1a237e, #3949ab);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(26,35,126,0.25);
}

.btn-admin-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(26,35,126,0.35);
}

.btn-admin-secondary {
  padding: 10px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1a237e;
  background: #eceef5;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-admin-secondary:hover {
  background: #d8dbe8;
}

/* =============================================
   MODAL
   ============================================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(13,27,74,0.4);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-card {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(13,27,74,0.2);
}

.modal-card h3 {
  font-size: 1.15rem;
  color: #1a237e;
  margin-bottom: 8px;
}

.modal-card p {
  font-size: 0.88rem;
  color: #636b83;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.modal-actions .btn-admin-primary {
  flex: 1;
}

.modal-actions .btn-admin-secondary {
  flex: 1;
}

/* =============================================
   DASHBOARD RECENT
   ============================================= */
.dashboard-recent h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a237e;
  margin-bottom: 16px;
}

/* =============================================
   TOAST (reuse from main site)
   ============================================= */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  animation: toastSlideIn 0.3s ease;
  max-width: 380px;
}

.toast.success { background: #e8f5e9; color: #2e7d32; }
.toast.error { background: #ffebee; color: #c62828; }
.toast.warning { background: #fff8e1; color: #f57f17; }
.toast.info { background: #e3f2fd; color: #1565c0; }

.toast-icon { font-size: 1.1rem; }
.toast-message { flex: 1; }
.toast-close {
  cursor: pointer;
  opacity: 0.6;
  font-size: 0.85rem;
}
.toast-close:hover { opacity: 1; }

@keyframes toastSlideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes toastSlideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

/* =============================================
   LOADING SPINNER
   ============================================= */
.admin-loading {
  text-align: center;
  padding: 60px;
  color: #8890a7;
}

.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid rgba(26,35,126,0.15);
  border-top-color: #1a237e;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =============================================
   NO DATA STATE
   ============================================= */
.no-data {
  text-align: center;
  padding: 60px 20px;
  color: #8890a7;
}

.no-data .no-data-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.no-data h3 {
  font-size: 1.1rem;
  color: #636b83;
  margin-bottom: 4px;
}

.no-data p {
  font-size: 0.85rem;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }

  .admin-sidebar.open {
    transform: translateX(0);
  }

  .admin-main {
    margin-left: 0;
  }

  .sidebar-toggle {
    display: flex;
  }

  .admin-section {
    padding: 20px 16px;
  }

  .admin-topbar {
    padding: 12px 16px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .complaints-grid {
    grid-template-columns: 1fr;
  }

  .complaint-details {
    grid-template-columns: 1fr;
  }

  .reports-grid {
    grid-template-columns: 1fr;
  }

  .tab-bar {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-value {
    font-size: 1.4rem;
  }
}

/* =============================================
   ADMIN CANCEL BOOKING BUTTON
   ============================================= */
.btn-cancel-admin {
  background: #ffebee;
  color: #c62828;
}
.btn-cancel-admin:hover {
  background: #ffcdd2;
}

/* Complaint cancellation note (shown on card) */
.complaint-cancel-note {
  padding: 8px 14px;
  background: #ffebee;
  border: 1px solid #ffcdd2;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #c62828;
  margin-bottom: 12px;
}

/* =============================================
   ADMIN MOBILE BOTTOM NAV
   ============================================= */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid #eceef5;
  z-index: 200;
  padding: 6px 0 env(safe-area-inset-bottom, 6px);
  box-shadow: 0 -4px 20px rgba(13,27,74,0.08);
}

.admin-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  .admin-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #eceef5;
    z-index: 200;
    padding: 6px 0 env(safe-area-inset-bottom, 6px);
    box-shadow: 0 -4px 20px rgba(13,27,74,0.08);
  }

  /* Keep main content above bottom nav */
  .admin-main {
    padding-bottom: 72px;
  }
}

.admin-bottom-nav a,
.admin-bottom-nav button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  font-size: 0.65rem;
  font-weight: 600;
  color: #8890a7;
  text-decoration: none;
  transition: color 0.2s ease;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body, 'Inter', sans-serif);
}

.admin-bottom-nav a:hover,
.admin-bottom-nav a.active {
  color: #1a237e;
}

.admin-bottom-nav svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
}

