/* ============================================
   MarketMagicDigital - Main Stylesheet
   Version: 1.0.0
   ============================================ */

/* --- CSS Variables & Theme --- */
:root {
  --primary: #6C63FF;
  --primary-dark: #5a52d5;
  --primary-light: #ede9ff;
  --secondary: #FF6B6B;
  --accent: #00D9A0;
  --accent-dark: #00b886;
  --warning: #FFB020;
  --danger: #F04452;
  --info: #2E90FA;
  --success: #12B76A;

  --bg: #F7F8FC;
  --bg-card: #FFFFFF;
  --bg-sidebar: #13111A;
  --bg-hover: #1e1b2e;

  --text-primary: #0F0E17;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;
  --text-sidebar: #C4C4D4;
  --text-sidebar-active: #FFFFFF;

  --border: #E5E7EB;
  --border-light: #F3F4F6;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
  --shadow-primary: 0 8px 24px rgba(108,99,255,0.25);

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

  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;

  --transition: all 0.2s ease;
  --transition-slow: all 0.35s ease;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }
button { cursor: pointer; font-family: var(--font-body); }
img { max-width: 100%; }
input, select, textarea, button { font-family: var(--font-body); }

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

/* ============================================
   AUTH / LOGIN PAGES
   ============================================ */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #13111A 0%, #1e1b2e 50%, #0f0e17 100%);
  position: relative;
  overflow: hidden;
}

.auth-page::before {
  content: '';
  position: absolute;
  top: -200px; left: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(108,99,255,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.auth-page::after {
  content: '';
  position: absolute;
  bottom: -200px; right: -100px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(255,107,107,0.1) 0%, transparent 70%);
  pointer-events: none;
}

.auth-container {
  width: 100%;
  max-width: 440px;
  padding: 1.5rem;
  position: relative;
  z-index: 1;
}

.auth-card {
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: 0 32px 64px rgba(0,0,0,0.4);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.auth-logo-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}

.auth-logo-text {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: white;
}

.auth-logo-text span { color: var(--primary); }

.auth-heading {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: white;
  margin-bottom: 0.4rem;
}

.auth-subtext {
  color: rgba(255,255,255,0.5);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.auth-link {
  text-align: center;
  margin-top: 1.5rem;
  color: rgba(255,255,255,0.5);
  font-size: 0.875rem;
}

.auth-link a { color: var(--primary); font-weight: 500; }
.auth-link a:hover { color: var(--primary-dark); }

/* ============================================
   FORM ELEMENTS
   ============================================ */

.form-group { margin-bottom: 1.25rem; }

.form-label {
  display: block;
  font-size: 0.825rem;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.form-label-dark {
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.06);
  color: white;
  font-size: 0.9375rem;
  transition: var(--transition);
  outline: none;
}

.form-control::placeholder { color: rgba(255,255,255,0.3); }

.form-control:focus {
  border-color: var(--primary);
  background: rgba(108,99,255,0.08);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.15);
}

/* Light version for dashboard forms */
.form-control-light {
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--text-primary);
}

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

.form-control-light:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(108,99,255,0.1);
}

.form-select-light {
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1.5px solid var(--border);
  color: var(--text-primary);
  appearance: none;
  padding-right: 2.5rem;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.form-error {
  font-size: 0.8rem;
  color: var(--danger);
  margin-top: 0.35rem;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  border: 1.5px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
  line-height: 1;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #7c73ff);
  color: white;
  box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(108,99,255,0.35);
  color: white;
}

.btn-secondary {
  background: var(--bg);
  color: var(--text-primary);
  border-color: var(--border);
}

.btn-secondary:hover { background: var(--border-light); }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #0fa060; color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #d63646; color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-info { background: var(--info); color: white; }

.btn-outline {
  background: transparent;
  border-color: var(--primary);
  color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: white; }

.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.8rem; border-radius: 6px; }
.btn-lg { padding: 0.9rem 2rem; font-size: 1rem; }
.btn-full { width: 100%; }

.btn-icon { padding: 0.5rem; border-radius: var(--radius-sm); }

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

/* ============================================
   BADGES
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef9c3; color: #854d0e; }
.badge-info    { background: #dbeafe; color: #1e40af; }
.badge-secondary { background: var(--border-light); color: var(--text-secondary); }
.badge-primary { background: var(--primary-light); color: var(--primary-dark); }

/* ============================================
   ALERTS
   ============================================ */

.alert {
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}

.alert-success { background: #dcfce7; color: #166534; border-left: 4px solid var(--success); }
.alert-danger  { background: #fee2e2; color: #991b1b; border-left: 4px solid var(--danger); }
.alert-warning { background: #fef9c3; color: #854d0e; border-left: 4px solid var(--warning); }
.alert-info    { background: #dbeafe; color: #1e40af; border-left: 4px solid var(--info); }

.alert-close {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  opacity: 0.6;
  flex-shrink: 0;
}

.alert-close:hover { opacity: 1; }

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition-slow);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.brand-logo { flex-shrink: 0; }

.brand-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  color: white;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: var(--text-sidebar);
  font-size: 1.1rem;
  padding: 0.25rem;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  margin: 0.75rem;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.06);
}

.sidebar-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.875rem;
  color: white;
  flex-shrink: 0;
}

.sidebar-user-info { min-width: 0; }

.sidebar-user-name {
  display: block;
  color: white;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav {
  flex: 1;
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-sidebar);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
}

.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: white;
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(108,99,255,0.25), rgba(108,99,255,0.1));
  color: var(--text-sidebar-active);
  border-left: 3px solid var(--primary);
}

.nav-item.active svg { stroke: var(--primary); }

.nav-item-logout {
  margin-top: auto;
  color: rgba(240,68,82,0.7);
}

.nav-item-logout:hover {
  background: rgba(240,68,82,0.1);
  color: var(--danger);
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.sidebar-credits {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
}

/* ============================================
   MAIN LAYOUT
   ============================================ */

.main-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin var(--transition-slow);
}

.main-content {
  flex: 1;
  padding: 2rem;
  margin-top: var(--topbar-height);
}

/* ============================================
   TOP BAR
   ============================================ */

.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--topbar-height);
  background: white;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 90;
  box-shadow: var(--shadow-sm);
  transition: left var(--transition-slow);
}

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

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: var(--transition);
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

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

.notif-wrapper { position: relative; }

.notif-btn {
  background: none;
  border: none;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: var(--transition);
  position: relative;
}

.notif-btn:hover { background: var(--bg); color: var(--text-primary); }

.notif-badge {
  position: absolute;
  top: 2px; right: 2px;
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0 4px;
  border-radius: 99px;
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notif-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 340px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  display: none;
  overflow: hidden;
  animation: dropdownFade 0.15s ease;
}

.notif-dropdown.show { display: block; }

@keyframes dropdownFade {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.875rem;
}

.notif-mark-all {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--primary);
}

.notif-list { max-height: 340px; overflow-y: auto; }

.notif-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  transition: var(--transition);
}

.notif-item:hover { background: var(--bg); }
.notif-item.notif-unread { background: #fafbff; }
.notif-item.notif-unread::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--primary);
  border-radius: 0 2px 2px 0;
}

.notif-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 2px; }

.notif-content { min-width: 0; }
.notif-content strong { display: block; font-size: 0.825rem; font-weight: 600; margin-bottom: 2px; }
.notif-content p { font-size: 0.78rem; color: var(--text-secondary); margin: 0; line-height: 1.4; }
.notif-content time { display: block; font-size: 0.72rem; color: var(--text-muted); margin-top: 4px; }

.notif-empty {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.notif-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.notif-footer a {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 500;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.topbar-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  color: white;
}

.topbar-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ============================================
   SIDEBAR OVERLAY (mobile)
   ============================================ */

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
  backdrop-filter: blur(2px);
}

/* ============================================
   CARDS & STATS
   ============================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 50%;
  transform: translate(25px, -25px);
  opacity: 0.06;
}

.stat-card-primary::after  { background: var(--primary); width: 100px; height: 100px; }
.stat-card-success::after  { background: var(--success); }
.stat-card-warning::after  { background: var(--warning); }
.stat-card-danger::after   { background: var(--danger); }
.stat-card-info::after     { background: var(--info); }

.stat-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; }

.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
}

.stat-icon-primary { background: var(--primary-light); color: var(--primary); }
.stat-icon-success { background: #dcfce7; color: var(--success); }
.stat-icon-warning { background: #fef9c3; color: var(--warning); }
.stat-icon-danger  { background: #fee2e2; color: var(--danger); }
.stat-icon-info    { background: #dbeafe; color: var(--info); }

.stat-change {
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px;
}

.stat-change-up   { color: var(--success); }
.stat-change-down { color: var(--danger); }

.stat-value {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 0.35rem;
}

.stat-label {
  font-size: 0.825rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.card-body { padding: 1.5rem; }
.card-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); background: var(--bg); }

/* ============================================
   TABLES
   ============================================ */

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: middle;
}

.table tbody tr { transition: var(--transition); }
.table tbody tr:hover { background: #fafbff; }
.table tbody tr:last-child td { border-bottom: none; }

.table-actions { display: flex; gap: 0.4rem; align-items: center; }

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

.user-avatar-sm {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.user-info-cell { line-height: 1.3; }
.user-name { font-weight: 600; font-size: 0.875rem; }
.user-email { font-size: 0.775rem; color: var(--text-muted); }

/* ============================================
   FILTERS / SEARCH BAR
   ============================================ */

.filters-bar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-box svg {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.6rem 0.9rem 0.6rem 2.5rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  font-size: 0.875rem;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.1);
}

.filter-select {
  padding: 0.6rem 2rem 0.6rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 8px center;
  appearance: none;
  font-size: 0.875rem;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

.filter-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.1);
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
  background: white;
  transition: var(--transition);
}

.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: white; }

/* ============================================
   MODALS
   ============================================ */

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  backdrop-filter: blur(4px);
  animation: backdropIn 0.2s ease;
}

.modal-backdrop.show { display: flex; align-items: center; justify-content: center; padding: 1.5rem; }

@keyframes backdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 32px 80px rgba(0,0,0,0.2);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.2s ease;
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  padding: 0.25rem;
  border-radius: 6px;
  line-height: 1;
  transition: var(--transition);
}

.modal-close:hover { background: var(--bg); color: var(--text-primary); }

.modal-body { padding: 1.5rem 1.75rem; }

.modal-footer {
  padding: 1rem 1.75rem 1.5rem;
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
  background: white;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border-left: 4px solid var(--primary);
  min-width: 280px;
  max-width: 380px;
  pointer-events: auto;
  animation: toastIn 0.3s ease;
  font-size: 0.875rem;
  font-weight: 500;
}

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

.toast-success { border-color: var(--success); }
.toast-error   { border-color: var(--danger); }
.toast-warning { border-color: var(--warning); }
.toast-info    { border-color: var(--info); }

.toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.toast-message { flex: 1; line-height: 1.4; }

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.empty-icon {
  width: 64px; height: 64px;
  border-radius: var(--radius);
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.25rem;
  color: var(--text-muted);
}

.empty-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.empty-text {
  color: var(--text-muted);
  font-size: 0.875rem;
  max-width: 300px;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* ============================================
   SECTION HEADER
   ============================================ */

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
}

.section-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* ============================================
   PROGRESS BAR
   ============================================ */

.progress-bar-wrapper {
  background: var(--border);
  border-radius: 99px;
  height: 6px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.6s ease;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); font-size: 0.85rem; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.fw-bold { font-weight: 700; }
.fw-600 { font-weight: 600; }
.small { font-size: 0.8rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.25rem; }

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }

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

  .sidebar-close { display: block; }
  .sidebar-overlay.show { display: block; }

  .main-wrapper { margin-left: 0; }
  .topbar { left: 0; }
  .hamburger { display: flex; }
  .topbar-name { display: none; }

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

@media (max-width: 768px) {
  .main-content { padding: 1.25rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .section-header { flex-direction: column; }
  .filters-bar { flex-direction: column; }
  .search-box { min-width: 100%; }
  .modal { border-radius: var(--radius); }
  .stat-value { font-size: 1.5rem; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 1.75rem 1.25rem; }
  .main-content { padding: 1rem; }
}
