/* =======================================================
   Admin Panel CSS Theme - Dominant Bright & Clean Light Theme
   Emerald Green Gradient Accents & High-Contrast Typography
   ======================================================= */

:root {
  --admin-sidebar-w: 260px;
  --admin-sidebar-bg: #ffffff;
  --admin-sidebar-active: #10b981;
  --admin-sidebar-grad: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --admin-topbar-h: 68px;
  
  --admin-bg: #f8fafc;
  --admin-card: #ffffff;
  --admin-card-hover: #f1f5f9;
  --admin-border: #e2e8f0;
  --admin-border-green: rgba(16, 185, 129, 0.4);
  
  --text-dark: #0f172a;
  --text-heading: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --text-secondary: #475569;
  --primary-green: #059669;
}

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

/* Admin Sidebar */
.admin-sidebar {
  width: var(--admin-sidebar-w);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background-color: var(--admin-sidebar-bg);
  border-right: 1px solid var(--admin-border);
  color: var(--text-body);
  z-index: 1040;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  box-shadow: 2px 0 12px rgba(15, 23, 42, 0.03);
}

.sidebar-header {
  height: var(--admin-topbar-h);
  display: flex;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid var(--admin-border);
}

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

.sidebar-brand .badge-tag {
  background: var(--admin-sidebar-grad);
  color: #ffffff;
  font-size: 0.72rem;
  padding: 3px 7px;
  border-radius: 6px;
  font-family: monospace;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.sidebar-menu {
  flex-grow: 1;
  padding: 20px 14px;
  overflow-y: auto;
}

.menu-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #059669;
  padding: 12px 12px 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: #475569;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.92rem;
  transition: all 0.2s ease;
  margin-bottom: 3px;
}

.sidebar-link i {
  font-size: 1.1rem;
}

.sidebar-link:hover {
  color: #047857;
  background-color: rgba(16, 185, 129, 0.08);
}

.sidebar-link.active {
  color: #ffffff;
  background: var(--admin-sidebar-grad);
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35);
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--admin-border);
  font-size: 0.85rem;
  background-color: #f8fafc;
}

/* Admin Main Wrapper */
.admin-main {
  margin-left: var(--admin-sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.3s ease;
}

/* Admin Topbar */
.admin-topbar {
  height: var(--admin-topbar-h);
  background-color: #ffffff;
  border-bottom: 1px solid var(--admin-border);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1020;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.topbar-toggle {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: #059669;
  cursor: pointer;
}

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

/* Cards */
.card {
  background-color: var(--admin-card);
  border: 1px solid var(--admin-border);
  color: var(--text-body);
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.card-header {
  background-color: #ffffff;
  border-bottom: 1px solid var(--admin-border);
  color: var(--text-heading);
}

/* Stat Cards */
.stat-card {
  background-color: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--admin-border-green);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.12), 0 2px 8px rgba(15, 23, 42, 0.04);
}

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

.stat-val {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-heading);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 2px;
}

/* Tables */
.table-custom {
  margin-bottom: 0;
  color: var(--text-body);
}

.table-custom th {
  background-color: #f8fafc;
  color: #0f172a;
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 14px 18px;
  border-bottom: 1px solid var(--admin-border);
}

.table-custom td {
  padding: 14px 18px;
  vertical-align: middle;
  font-size: 0.92rem;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-body);
  background-color: transparent;
}

.table-custom tr:hover td {
  background-color: rgba(16, 185, 129, 0.04);
}

/* Form inputs */
.form-control, .form-select {
  background-color: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #0f172a;
  border-radius: 8px;
}

.form-control:focus, .form-select:focus {
  background-color: #ffffff;
  border-color: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
  color: #0f172a;
}

.form-control::placeholder {
  color: #94a3b8;
}

.input-group-text {
  background-color: #f8fafc;
  border: 1.5px solid #cbd5e1;
  color: var(--text-muted);
}

/* Buttons */
.btn-primary {
  background: var(--admin-sidebar-grad);
  border: none;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
}

.btn-outline-primary {
  border-color: #10b981;
  color: #059669;
  background: transparent;
  font-weight: 600;
}

.btn-outline-primary:hover {
  background: var(--admin-sidebar-grad);
  color: #ffffff;
  border-color: #10b981;
}

/* Dropzone & Preview */
.upload-dropzone {
  border: 2px dashed rgba(16, 185, 129, 0.5);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  background-color: #f8fafc;
  cursor: pointer;
  transition: all 0.2s ease;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
  border-color: #10b981;
  background-color: #f0fdf4;
}

.img-preview-box {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(16, 185, 129, 0.3);
  background-color: #f1f5f9;
  position: relative;
  display: none;
  margin: 15px auto 0;
}

.img-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Global Admin Contrast Utilities */
.text-dark {
  color: #0f172a !important;
}

.text-muted {
  color: #64748b !important;
}

.text-secondary {
  color: #475569 !important;
}

.text-primary {
  color: #059669 !important;
}

.text-success {
  color: #059669 !important;
}

.bg-white {
  background-color: #ffffff !important;
}

.bg-light {
  background-color: #f8fafc !important;
}

.bg-light-subtle {
  background-color: #f8fafc !important;
}

.bg-surface {
  background-color: #f8fafc !important;
}

.bg-primary-subtle {
  background-color: rgba(16, 185, 129, 0.12) !important;
  color: #047857 !important;
}

.bg-success-subtle {
  background-color: rgba(16, 185, 129, 0.15) !important;
  color: #047857 !important;
}

.border {
  border-color: var(--admin-border) !important;
}

.border-top {
  border-top-color: var(--admin-border) !important;
}

.border-bottom {
  border-bottom-color: var(--admin-border) !important;
}

.list-group-item {
  background-color: #ffffff;
  color: var(--text-body);
  border-color: var(--admin-border);
}

.list-group-item.bg-light-subtle {
  background-color: #f8fafc;
}

/* Nav Tabs */
.nav-tabs {
  border-bottom: 1px solid var(--admin-border);
}

.nav-tabs .nav-link {
  color: var(--text-muted);
  border: 1px solid transparent;
  font-weight: 600;
}

.nav-tabs .nav-link:hover {
  color: #0f172a;
}

.nav-tabs .nav-link.active {
  background-color: #ffffff;
  color: #059669 !important;
  border-color: var(--admin-border) var(--admin-border) #ffffff;
  font-weight: 700;
}

/* Modals */
.modal-content {
  background-color: #ffffff;
  border: 1px solid var(--admin-border);
  color: var(--text-body);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15);
}

.modal-header, .modal-footer {
  border-color: var(--admin-border);
  background-color: #f8fafc;
}

/* =======================================================
   Pro Toast Popup Notification System
   ======================================================= */
.toast-container-custom {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
  width: calc(100% - 48px);
  pointer-events: none;
}

.pro-toast {
  position: relative;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12), 0 4px 12px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  pointer-events: auto;
  transform: translateX(120%) scale(0.95);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.pro-toast.show {
  transform: translateX(0) scale(1);
  opacity: 1;
}

.pro-toast.hide {
  transform: translateX(120%) scale(0.9);
  opacity: 0;
}

.pro-toast-body {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px 16px 13px;
}

.pro-toast-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.pro-toast-success .pro-toast-icon {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.25);
}

.pro-toast-success {
  border-color: rgba(16, 185, 129, 0.35);
}

.pro-toast-danger .pro-toast-icon {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.25);
}

.pro-toast-danger {
  border-color: rgba(239, 68, 68, 0.35);
}

.pro-toast-warning .pro-toast-icon {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.25);
}

.pro-toast-warning {
  border-color: rgba(245, 158, 11, 0.35);
}

.pro-toast-info .pro-toast-icon {
  background: rgba(14, 165, 233, 0.12);
  color: #0284c7;
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.25);
}

.pro-toast-info {
  border-color: rgba(14, 165, 233, 0.35);
}

.pro-toast-content {
  flex-grow: 1;
  min-width: 0;
}

.pro-toast-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: #0f172a;
  line-height: 1.25;
  margin-bottom: 2px;
}

.pro-toast-msg {
  font-size: 0.84rem;
  color: #475569;
  line-height: 1.4;
  word-break: break-word;
}

.pro-toast-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-top: -2px;
  margin-right: -4px;
}

.pro-toast-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.pro-toast-progress {
  height: 3.5px;
  width: 100%;
  background: rgba(226, 232, 240, 0.5);
  position: relative;
  overflow: hidden;
}

.pro-toast-progress-bar {
  height: 100%;
  width: 100%;
  transform-origin: left;
  animation: toastProgress 4.5s linear forwards;
}

.pro-toast-success .pro-toast-progress-bar {
  background: linear-gradient(90deg, #10b981, #059669);
}

.pro-toast-danger .pro-toast-progress-bar {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

.pro-toast-warning .pro-toast-progress-bar {
  background: linear-gradient(90deg, #f59e0b, #d97706);
}

.pro-toast-info .pro-toast-progress-bar {
  background: linear-gradient(90deg, #0ea5e9, #0284c7);
}

@keyframes toastProgress {
  0% {
    transform: scaleX(1);
  }
  100% {
    transform: scaleX(0);
  }
}

/* Paused on hover */
.pro-toast:hover .pro-toast-progress-bar {
  animation-play-state: paused;
}

@media (max-width: 575.98px) {
  .toast-container-custom {
    top: 14px;
    left: 14px;
    right: 14px;
    width: auto;
    max-width: none;
  }
}

/* Sidebar Backdrop Overlay on Mobile */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1035;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.sidebar-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

/* Topbar Toggle Button */
.topbar-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background-color: #f1f5f9;
  border: 1px solid var(--admin-border);
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.topbar-toggle-btn:hover {
  background-color: rgba(16, 185, 129, 0.12);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.3);
}

/* Responsive Table Enhancements */
.table-responsive {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f8fafc;
}

.table-responsive::-webkit-scrollbar {
  height: 6px;
}

.table-responsive::-webkit-scrollbar-track {
  background: #f8fafc;
}

.table-responsive::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 4px;
}

/* Mobile responsive */
@media (max-width: 991.98px) {
  .admin-sidebar {
    transform: translateX(-100%);
    z-index: 1040;
    box-shadow: 10px 0 30px rgba(15, 23, 42, 0.15);
  }
  
  .admin-sidebar.show {
    transform: translateX(0) !important;
  }
  
  .admin-main {
    margin-left: 0 !important;
  }

  .admin-topbar {
    padding: 0 16px;
    height: 62px;
  }

  .admin-content {
    padding: 18px 14px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-val {
    font-size: 1.5rem;
  }

  .stat-label {
    font-size: 0.78rem;
  }

  .stat-icon-wrap {
    width: 42px;
    height: 42px;
    font-size: 1.25rem;
  }
}

@media (min-width: 576px) and (max-width: 991.98px) {
  .admin-content {
    padding: 24px 20px;
  }
}

@media (min-width: 992px) {
  .admin-content {
    padding: 28px 32px;
  }
}
