/* ============================================================
   CreatorHub CRM - Light Beautiful Design System
   Flutter-inspired with smooth animations
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/remixicon/4.2.0/remixicon.min.css');

/* ---- CSS Variables ---- */
:root {
  --primary: #6366F1;
  --primary-dark: #4F46E5;
  --primary-light: #EEF2FF;
  --primary-glow: rgba(99,102,241,0.18);
  --accent: #F472B6;
  --accent-light: #FDF2F8;
  --success: #10B981;
  --success-light: #D1FAE5;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --danger: #EF4444;
  --danger-light: #FEE2E2;
  --info: #3B82F6;
  --info-light: #DBEAFE;

  --bg: #F5F7FF;
  --surface: #FFFFFF;
  --surface-2: #FAFBFF;
  --border: #E5E7FF;
  --border-light: #F0F0FF;

  --text: #1E1B4B;
  --text-2: #6B7280;
  --text-3: #9CA3AF;

  --sidebar-width: 265px;
  --topbar-height: 68px;

  --radius: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;

  --shadow: 0 2px 20px rgba(99,102,241,0.07);
  --shadow-md: 0 4px 30px rgba(99,102,241,0.12);
  --shadow-lg: 0 8px 40px rgba(99,102,241,0.18);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 8px 24px rgba(99,102,241,0.06);

  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
  --transition-bounce: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);

  --gradient: linear-gradient(135deg, #6366F1 0%, #8B5CF6 50%, #A78BFA 100%);
  --gradient-card: linear-gradient(135deg, #6366F1 0%, #7C3AED 100%);
  --gradient-warm: linear-gradient(135deg, #F472B6 0%, #FB7185 100%);
  --gradient-success: linear-gradient(135deg, #10B981 0%, #059669 100%);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
ul { list-style: none; }
input, select, textarea, button { font-family: inherit; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-light); }

/* ============================================================
   LAYOUT
   ============================================================ */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: var(--transition);
  overflow: hidden;
}

.sidebar-brand {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border-light);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 40px; height: 40px;
  background: var(--gradient);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.brand-icon i { font-size: 20px; color: white; }

.brand-text h1 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}
.brand-text span {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.nav-section-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 12px 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: var(--primary-light);
  color: var(--primary);
  transform: translateX(2px);
}

.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--primary);
  border-radius: 99px;
}

.nav-item i { font-size: 19px; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  min-width: 20px;
  text-align: center;
}

.sidebar-user {
  padding: 16px 12px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-info strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-info span {
  font-size: 11px;
  color: var(--text-3);
}

.logout-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: white;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}
.logout-btn:hover { background: var(--danger-light); color: var(--danger); border-color: var(--danger); }

/* ---- Main Content ---- */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Topbar ---- */
.topbar {
  height: var(--topbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  flex: 1;
}
.topbar-title h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}
.topbar-title p { font-size: 12px; color: var(--text-3); }

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

.icon-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: white;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-2);
  transition: var(--transition);
  position: relative;
}
.icon-btn:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }

.notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid white;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.2); }
}

.hamburger-btn {
  display: none;
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: white;
  align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-2);
  transition: var(--transition);
}

/* ---- Page Content ---- */
.page-content {
  padding: 28px;
  flex: 1;
}

/* ============================================================
   COMPONENTS
   ============================================================ */

/* ---- Card ---- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  animation: fadeSlideUp 0.4s ease both;
}

.card:hover { box-shadow: var(--shadow-md); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
  gap: 12px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.card-subtitle { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.card-body { padding: 20px 24px; }
.card-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ---- Stat Cards ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  padding: 22px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: var(--transition-bounce);
  animation: fadeSlideUp 0.4s ease both;
  cursor: default;
}

.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.2s; }

.stat-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 24px;
}

.stat-icon.purple { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.orange { background: var(--warning-light); color: var(--warning); }
.stat-icon.pink { background: var(--accent-light); color: var(--accent); }
.stat-icon.blue { background: var(--info-light); color: var(--info); }

.stat-info { flex: 1; min-width: 0; }
.stat-label { font-size: 12px; color: var(--text-3); font-weight: 500; margin-bottom: 4px; }
.stat-value { font-size: 26px; font-weight: 800; color: var(--text); line-height: 1; letter-spacing: -0.5px; }
.stat-change { font-size: 11px; margin-top: 4px; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  outline: none;
  white-space: nowrap;
  letter-spacing: -0.1px;
}

.btn i { font-size: 17px; }

.btn-primary {
  background: var(--gradient);
  color: white;
  box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px var(--primary-glow); }
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-2);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

.btn-success {
  background: var(--gradient-success);
  color: white;
  box-shadow: 0 4px 14px rgba(16,185,129,0.25);
}
.btn-success:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(16,185,129,0.3); }

.btn-danger {
  background: var(--danger);
  color: white;
  box-shadow: 0 4px 14px rgba(239,68,68,0.25);
}
.btn-danger:hover { transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: none;
  padding: 8px 12px;
}
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 15px; border-radius: var(--radius-md); }
.btn-block { width: 100%; }
.btn-icon-only {
  width: 36px; height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
}

.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; }

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.badge-primary   { background: var(--primary-light); color: var(--primary); }
.badge-success   { background: var(--success-light); color: var(--success); }
.badge-warning   { background: var(--warning-light); color: #92400E; }
.badge-danger    { background: var(--danger-light); color: var(--danger); }
.badge-info      { background: var(--info-light); color: var(--info); }
.badge-secondary { background: var(--bg); color: var(--text-2); border: 1px solid var(--border); }

/* ---- Form Elements ---- */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 7px;
}
.form-label .required { color: var(--danger); }

.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  transition: var(--transition);
  outline: none;
  appearance: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-control::placeholder { color: var(--text-3); }

.form-hint { font-size: 12px; color: var(--text-3); margin-top: 5px; }

.input-group {
  display: flex;
  align-items: center;
  gap: 0;
}
.input-group .form-control { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; flex-shrink: 0; }

.input-icon-wrap { position: relative; }
.input-icon-wrap .form-control { padding-left: 40px; }
.input-icon-wrap .input-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  font-size: 18px;
  pointer-events: none;
}

/* ---- Table ---- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

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

thead th {
  background: var(--bg);
  padding: 13px 16px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  white-space: nowrap;
}

tbody td {
  padding: 14px 16px;
  border-top: 1px solid var(--border-light);
  font-size: 13.5px;
  color: var(--text);
  vertical-align: middle;
}

tbody tr { transition: var(--transition-fast); }
tbody tr:hover { background: var(--bg); }

/* ---- Modal ---- */
.modal-overlay { display: none !important; 
  position: fixed;
  inset: 0;
  background: rgba(30, 27, 75, 0.35);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  animation: fadeIn 0.2s ease forwards;
}

.modal-box {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.modal-box.modal-lg { max-width: 720px; }
.modal-box.modal-sm { max-width: 400px; }

.modal-header {
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-title { font-size: 17px; font-weight: 700; color: var(--text); }
.modal-subtitle { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.modal-close {
  width: 32px; height: 32px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: white;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-2);
  transition: var(--transition);
  flex-shrink: 0;
}
.modal-close:hover { background: var(--danger-light); color: var(--danger); }

.modal-body { padding: 22px 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ---- File Upload Area ---- */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--surface-2);
}
.upload-area:hover, .upload-area.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}
.upload-area i { font-size: 40px; color: var(--text-3); margin-bottom: 10px; display: block; }
.upload-area:hover i { color: var(--primary); }
.upload-area p { font-size: 14px; color: var(--text-2); }
.upload-area span { font-size: 12px; color: var(--text-3); }

.file-list { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.file-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.file-item i { font-size: 20px; color: var(--primary); }
.file-item .name { flex: 1; font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .size { font-size: 11px; color: var(--text-3); }
.file-item .remove { cursor: pointer; color: var(--text-3); transition: var(--transition); }
.file-item .remove:hover { color: var(--danger); }

/* ---- Search Input ---- */
.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 200;
  max-height: 220px;
  overflow-y: auto;
}
.search-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: var(--transition-fast);
}
.search-item:hover { background: var(--bg); }
.search-item .avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--gradient); color: white; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.search-item .info strong { display: block; font-size: 13px; font-weight: 600; color: var(--text); }
.search-item .info span { font-size: 11px; color: var(--text-3); }

/* ---- Notification Dropdown ---- */
.notif-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 340px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 300;
  animation: slideUp 0.2s ease;
  overflow: hidden;
}

.notif-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
}
.notif-header h4 { font-size: 14px; font-weight: 700; }

.notif-item {
  display: flex; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition-fast);
  cursor: pointer;
}
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: var(--primary-light); }
.notif-item .notif-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 16px;
}
.notif-item.info .notif-icon { background: var(--info-light); color: var(--info); }
.notif-item.success .notif-icon { background: var(--success-light); color: var(--success); }
.notif-item.warning .notif-icon { background: var(--warning-light); color: var(--warning); }
.notif-item.danger .notif-icon { background: var(--danger-light); color: var(--danger); }
.notif-item .notif-content p { font-size: 13px; color: var(--text); line-height: 1.4; }
.notif-item .notif-content span { font-size: 11px; color: var(--text-3); margin-top: 3px; display: block; }

/* ---- Project Card (Creator Mobile) ---- */
.project-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 18px;
  box-shadow: var(--shadow-card);
  animation: fadeSlideUp 0.35s ease both;
  transition: var(--transition);
}
.project-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.project-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.project-code { font-size: 11px; font-weight: 700; color: var(--primary); background: var(--primary-light); padding: 3px 8px; border-radius: 99px; }
.project-name { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.project-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.project-meta-item { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); }
.project-meta-item i { font-size: 14px; color: var(--text-3); }
.project-meta-item strong { color: var(--text); }

.deadline-bar {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}
.deadline-label { display: flex; align-items: center; justify-content: space-between; font-size: 12px; margin-bottom: 6px; }
.deadline-label span { color: var(--text-2); }
.deadline-label strong { color: var(--text); }
.progress-bar { height: 5px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; transition: width 0.8s ease; }
.progress-fill.safe { background: var(--success); }
.progress-fill.warn { background: var(--warning); }
.progress-fill.danger { background: var(--danger); }

.project-actions { display: flex; gap: 8px; margin-top: 14px; }
.project-actions .btn { flex: 1; }

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-state i { font-size: 56px; color: var(--border); display: block; margin-bottom: 16px; }
.empty-state h3 { font-size: 17px; font-weight: 700; color: var(--text-2); margin-bottom: 6px; }
.empty-state p { font-size: 13px; color: var(--text-3); }

/* ---- Avatar Group ---- */
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--gradient); color: white; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.lg { width: 48px; height: 48px; font-size: 17px; }
.avatar.xl { width: 64px; height: 64px; font-size: 22px; }

/* ---- Toast ---- */
#toast-container {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 18px;
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  min-width: 300px;
  max-width: 400px;
  animation: slideInRight 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toast.success .toast-icon { color: var(--success); background: var(--success-light); }
.toast.error .toast-icon { color: var(--danger); background: var(--danger-light); }
.toast.warning .toast-icon { color: var(--warning); background: var(--warning-light); }
.toast-icon { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 16px; }
.toast-body strong { display: block; font-size: 13.5px; font-weight: 700; color: var(--text); }
.toast-body p { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.toast-hide { animation: slideOutRight 0.25s ease forwards; }

/* ---- Section Headers ---- */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
  gap: 14px;
}
.section-header h3 { font-size: 16px; font-weight: 700; color: var(--text); }

/* ---- Grid Layouts ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.gap-4 { gap: 16px; }

/* ---- Utility ---- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-xs { font-size: 11px; }
.text-sm { font-size: 12.5px; }
.text-muted { color: var(--text-3); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.d-none { display: none !important; }
.hidden { display: none; }
.relative { position: relative; }

.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ---- Login Page ---- */
.login-page {
  min-height: 100vh;
  display: flex;
  background: var(--bg);
}
.login-left {
  flex: 1;
  background: var(--gradient);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
  position: relative;
  overflow: hidden;
}
.login-left::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 400px; height: 400px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
}
.login-left::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -80px;
  width: 300px; height: 300px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}
.login-left-content { position: relative; z-index: 1; color: white; text-align: center; }
.login-left-content .logo { font-size: 48px; margin-bottom: 24px; display: block; }
.login-left-content h1 { font-size: 36px; font-weight: 800; margin-bottom: 12px; letter-spacing: -1px; }
.login-left-content p { font-size: 16px; opacity: 0.8; max-width: 320px; }
.login-features { margin-top: 40px; display: flex; flex-direction: column; gap: 14px; }
.login-feature { display: flex; align-items: center; gap: 12px; }
.login-feature .fi { width: 36px; height: 36px; background: rgba(255,255,255,0.15); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.login-feature span { font-size: 14px; opacity: 0.9; }

.login-right {
  width: 460px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: white;
}
.login-form-wrap { width: 100%; max-width: 380px; }
.login-form-wrap .title { font-size: 26px; font-weight: 800; color: var(--text); margin-bottom: 6px; letter-spacing: -0.5px; }
.login-form-wrap .subtitle { font-size: 14px; color: var(--text-3); margin-bottom: 32px; }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

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

@keyframes slideOutRight {
  to { opacity: 0; transform: translateX(30px); }
}

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

.loading-spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

/* ============================================================
   MOBILE BOTTOM NAV
   ============================================================ */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 8px 0 env(safe-area-inset-bottom, 8px);
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(99,102,241,0.08);
}

.mobile-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  max-width: 500px;
  margin: 0 auto;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-3);
  min-width: 60px;
  text-decoration: none;
}

.mobile-nav-item i { font-size: 22px; }
.mobile-nav-item span { font-size: 10px; font-weight: 600; }
.mobile-nav-item.active { color: var(--primary); }
.mobile-nav-item.active i { transform: scale(1.1); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  :root { --sidebar-width: 0px; }

  .sidebar {
    transform: translateX(-280px);
    width: 280px;
    box-shadow: none;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

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

  .hamburger-btn { display: flex; }

  .sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(30,27,75,0.3);
    z-index: 99;
    backdrop-filter: blur(2px);
  }
  .sidebar-overlay.open { display: block; }

  .mobile-nav { display: block; }

  .page-content {
    padding: 16px;
    padding-bottom: 80px; /* bottom nav clearance */
  }

  .topbar { padding: 0 16px; }

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

  .stat-card { padding: 16px; }
  .stat-value { font-size: 22px; }

  .login-left { display: none; }
  .login-right { width: 100%; padding: 30px 24px; }

  .modal-box { max-width: 100%; border-radius: var(--radius) var(--radius) 0 0; margin: auto auto 0; }
  .modal-overlay { display: none !important;  align-items: flex-end; padding: 0; }

  .modal-footer { flex-direction: column-reverse; }
  .modal-footer .btn { width: 100%; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 20px; }
  .stat-icon { width: 42px; height: 42px; font-size: 20px; }
  .page-content { padding: 14px; padding-bottom: 82px; }
}

/* Modal fix */
.modal-overlay { display: none !important; position: fixed; inset: 0; background: rgba(30,27,75,0.35); backdrop-filter: blur(4px); z-index: 999; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.active { display: flex !important; }