/* ============================================================
   NASHAMAH ADMIN DASHBOARD — CUSTOM STYLES
   ============================================================ */

:root {
  --primary: #00B8D4;
  --primary-dark: #006064;
  --sidebar-bg: #0F172A;
  --sidebar-hover: #1E293B;
  --sidebar-active: #1a3a5c;
}

* { box-sizing: border-box; }
html, body { height: 100%; overflow-x: hidden; }

/* -------- Scrollbar -------- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* -------- Sidebar -------- */
.sidebar-nav {
  background: var(--sidebar-bg);
  box-shadow: 4px 0 24px rgba(0,0,0,0.3);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 10px;
  color: #94A3B8;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  position: relative;
  overflow: hidden;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #E2E8F0;
}

.nav-item.active {
  background: var(--sidebar-active);
  color: #ffffff;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  background: var(--primary);
  border-radius: 0 4px 4px 0;
}

.nav-item.active .nav-icon {
  color: var(--primary);
}

.nav-icon {
  width: 18px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
  transition: color 0.15s;
}

/* -------- Sidebar Collapsed -------- */
.sidebar-collapsed {
  width: 68px !important;
}

.sidebar-collapsed .sidebar-label {
  display: none !important;
}

.sidebar-collapsed .sidebar-section-label {
  display: none !important;
}

.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 10px;
}

.sidebar-collapsed .sidebar-user .sidebar-label { display: none !important; }

.sidebar-collapsed + #main-wrapper {
  margin-left: 68px !important;
}

/* -------- Topnav -------- */
.topnav {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
}

/* -------- Login Background -------- */
.login-bg {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0d3f44 100%);
}

.shadow-glow {
  box-shadow: 0 0 30px rgba(0, 184, 212, 0.3);
}

/* -------- Cards -------- */
.stat-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  border: 1px solid #F1F5F9;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 4px 16px rgba(0,0,0,0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.data-card {
  background: white;
  border-radius: 16px;
  border: 1px solid #F1F5F9;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 4px 16px rgba(0,0,0,0.04);
  overflow: hidden;
}

/* -------- Page Header -------- */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title { font-size: 1.5rem; font-weight: 700; color: #0F172A; line-height: 1.2; }
.page-subtitle { font-size: 0.85rem; color: #64748B; margin-top: 3px; }

/* -------- Table -------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #64748B;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
  white-space: nowrap;
}

.data-table td {
  padding: 13px 16px;
  color: #334155;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
}

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

.data-table tbody tr:hover td { background: #F8FAFC; }

/* -------- Badges -------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
}

.badge-green  { background: #DCFCE7; color: #16A34A; }
.badge-red    { background: #FEE2E2; color: #DC2626; }
.badge-blue   { background: #DBEAFE; color: #2563EB; }
.badge-yellow { background: #FEF9C3; color: #CA8A04; }
.badge-gray   { background: #F1F5F9; color: #64748B; }
.badge-purple { background: #EDE9FE; color: #7C3AED; }
.badge-orange { background: #FFF7ED; color: #EA580C; }
.badge-teal   { background: #CCFBF1; color: #0D9488; }

/* -------- Action Buttons -------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-primary:hover { background: #0097A7; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,184,212,0.35); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  background: white;
  color: #475569;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-secondary:hover { background: #F8FAFC; border-color: #CBD5E1; }

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: #FEE2E2;
  color: #DC2626;
  border: none;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-danger:hover { background: #FECACA; }

.btn-edit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: #EFF6FF;
  color: #2563EB;
  border: none;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-edit:hover { background: #DBEAFE; }

.btn-view {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: #F0FDF4;
  color: #16A34A;
  border: none;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-view:hover { background: #DCFCE7; }

/* -------- Icon Button -------- */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 13px;
}
.icon-btn-edit  { background: #EFF6FF; color: #2563EB; }
.icon-btn-edit:hover  { background: #DBEAFE; }
.icon-btn-delete { background: #FEF2F2; color: #EF4444; }
.icon-btn-delete:hover { background: #FEE2E2; }
.icon-btn-view  { background: #F0FDF4; color: #22C55E; }
.icon-btn-view:hover  { background: #DCFCE7; }

/* -------- Form Inputs -------- */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12.5px; font-weight: 600; color: #374151; margin-bottom: 6px; }
.form-input {
  width: 100%;
  padding: 9px 13px;
  border: 1.5px solid #E2E8F0;
  border-radius: 10px;
  font-size: 13.5px;
  color: #1E293B;
  background: white;
  transition: all 0.15s;
  font-family: 'Inter', sans-serif;
}
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,184,212,0.1); }
.form-input::placeholder { color: #94A3B8; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236B7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; padding-right: 36px; }
.form-textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* -------- Search Bar -------- */
.search-bar {
  position: relative;
}
.search-bar i {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: #94A3B8;
  font-size: 13px;
}
.search-bar input {
  padding-left: 34px;
  padding-right: 12px;
  padding-top: 9px;
  padding-bottom: 9px;
  border: 1.5px solid #E2E8F0;
  border-radius: 10px;
  font-size: 13px;
  color: #334155;
  background: white;
  width: 100%;
  transition: all 0.15s;
  font-family: 'Inter', sans-serif;
}
.search-bar input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,184,212,0.1); }

/* -------- Pagination -------- */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
}
.page-btn {
  min-width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1.5px solid #E2E8F0;
  background: white;
  color: #475569;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  padding: 0 8px;
}
.page-btn:hover { background: #F8FAFC; border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: white; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* -------- Toast Notifications -------- */
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 500;
  min-width: 280px;
  max-width: 380px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  pointer-events: auto;
  animation: slideInRight 0.3s ease;
}
.toast-success { background: #16A34A; color: white; }
.toast-error   { background: #DC2626; color: white; }
.toast-info    { background: var(--primary); color: white; }
.toast-warning { background: #D97706; color: white; }

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

@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; transform: translateX(20px); }
}

/* -------- Loading Spinner -------- */
.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
}
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #E2E8F0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* -------- Empty State -------- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-state i { font-size: 48px; color: #CBD5E1; margin-bottom: 16px; }
.empty-state h4 { font-size: 16px; font-weight: 600; color: #475569; margin-bottom: 6px; }
.empty-state p { font-size: 13px; color: #94A3B8; }

/* -------- Section Tabs -------- */
.tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid #E2E8F0;
  margin-bottom: 20px;
}
.tab-btn {
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 500;
  color: #64748B;
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
  border-radius: 6px 6px 0 0;
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); background: rgba(0,184,212,0.05); }

/* -------- Image Preview -------- */
.img-preview {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  border: 1.5px solid #E2E8F0;
  background: #F8FAFC;
}

.img-preview-lg {
  width: 80px;
  height: 60px;
  border-radius: 10px;
  object-fit: cover;
  border: 1.5px solid #E2E8F0;
  background: #F8FAFC;
}

/* -------- Stat Card Icon Circles -------- */
.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

/* -------- Chart Container -------- */
.chart-container {
  position: relative;
  height: 280px;
}

/* -------- Modal Size Variants -------- */
.modal-lg { max-width: 760px !important; }
.modal-xl { max-width: 960px !important; }

/* -------- Chips (Day/Time selector) -------- */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1.5px solid #E2E8F0;
  background: #F8FAFC;
  color: #64748B;
  transition: all 0.15s;
  user-select: none;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.chip-active:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

/* -------- Responsive -------- */
@media (max-width: 1024px) {
  .sidebar-nav { transform: translateX(-100%); }
  .sidebar-nav.sidebar-open { transform: translateX(0); }
  #main-wrapper { margin-left: 0 !important; }
}

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; }
}

/* -------- Switch Toggle -------- */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider-switch {
  position: absolute; cursor: pointer; inset: 0;
  background: #CBD5E1; border-radius: 22px;
  transition: 0.3s;
}
.slider-switch::before {
  content: ''; position: absolute;
  width: 16px; height: 16px;
  left: 3px; bottom: 3px;
  background: white; border-radius: 50%;
  transition: 0.3s; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch input:checked + .slider-switch { background: var(--primary); }
.switch input:checked + .slider-switch::before { transform: translateX(18px); }

/* -------- Hover Row -------- */
.data-table tbody tr { transition: background 0.1s; }

/* -------- Skeleton Loading -------- */
.skeleton {
  background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 50%, #F1F5F9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* -------- Upload Area -------- */
.upload-area {
  border: 2px dashed #CBD5E1;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #F8FAFC;
}
.upload-area:hover { border-color: var(--primary); background: rgba(0,184,212,0.03); }

/* -------- Filter Row -------- */
.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* -------- Counter Badge -------- */
.nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}
