/* ============================================
   InvestPro - Professional Investment Platform
   White & Dark Blue Theme
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ---- CSS Variables ---- */
:root {
  --primary:        #0f2d6e;
  --primary-light:  #1a3f8f;
  --primary-dark:   #071a47;
  --accent:         #2563eb;
  --accent-light:   #3b82f6;
  --accent-glow:    rgba(37,99,235,0.18);
  --success:        #10b981;
  --warning:        #f59e0b;
  --danger:         #ef4444;
  --info:           #06b6d4;
  --purple:         #8b5cf6;

  --bg:             #f0f4ff;
  --bg-card:        #ffffff;
  --bg-sidebar:     #0f2d6e;
  --bg-sidebar-light: #162f6b;

  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;
  --text-white:     #ffffff;
  --text-light:     #e2e8f0;

  --border:         #e2e8f0;
  --border-light:   #f1f5f9;
  --shadow-sm:      0 1px 3px rgba(15,45,110,0.08);
  --shadow-md:      0 4px 16px rgba(15,45,110,0.12);
  --shadow-lg:      0 8px 32px rgba(15,45,110,0.16);
  --shadow-xl:      0 16px 48px rgba(15,45,110,0.2);

  --radius-sm:      8px;
  --radius-md:      12px;
  --radius-lg:      16px;
  --radius-xl:      24px;

  --sidebar-width:  260px;
  --header-height:  70px;
  --transition:     all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { cursor: pointer; }
input, select, textarea { font-family: inherit; }

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

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

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  overflow: hidden;
  box-shadow: 4px 0 24px rgba(7,26,71,0.25);
}

.sidebar-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--header-height);
}

.sidebar-logo {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--accent-light), #60a5fa);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(37,99,235,0.4);
}

.sidebar-brand h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: white;
  letter-spacing: -0.3px;
}

.sidebar-brand span {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  display: block;
  letter-spacing: 0.5px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  padding: 12px 24px 6px;
}

.nav-item {
  padding: 0 12px;
  margin-bottom: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.6);
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  white-space: nowrap;
}

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

.nav-link.active {
  background: linear-gradient(135deg, var(--accent), #1d4ed8);
  color: white;
  box-shadow: 0 4px 12px rgba(37,99,235,0.4);
}

.nav-link .nav-icon {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  font-size: 15px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.07);
  transition: var(--transition);
}

.nav-link.active .nav-icon {
  background: rgba(255,255,255,0.2);
}

.nav-link .nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  line-height: 1.6;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

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

/* ============================================
   TOP HEADER
   ============================================ */
.top-header {
  height: var(--header-height);
  background: white;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-toggle {
  width: 38px; height: 38px;
  border: none;
  background: var(--bg);
  border-radius: var(--radius-sm);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-secondary);
  transition: var(--transition);
  cursor: pointer;
}

.header-toggle:hover { background: var(--border); color: var(--primary); }

.header-search {
  flex: 1;
  max-width: 360px;
  position: relative;
}

.header-search input {
  width: 100%;
  padding: 9px 16px 9px 40px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}

.header-search input:focus {
  border-color: var(--accent-light);
  background: white;
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.header-search .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-btn {
  width: 38px; height: 38px;
  border: none;
  background: var(--bg);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: var(--text-secondary);
  position: relative;
  transition: var(--transition);
  cursor: pointer;
}

.header-btn:hover { background: var(--border); color: var(--primary); }

.header-btn .badge-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid white;
}

.header-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border-radius: 99px;
  background: var(--bg);
  cursor: pointer;
  transition: var(--transition);
}

.header-profile:hover { background: var(--border); }

.profile-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
  overflow: hidden;
}

.profile-info .profile-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.profile-info .profile-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* ============================================
   PAGE CONTENT
   ============================================ */
.page-content {
  flex: 1;
  padding: 28px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.page-title p {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.breadcrumb a { color: var(--accent); }
.breadcrumb-sep { font-size: 10px; }

/* ============================================
   STATS GRID
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

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

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--card-accent, var(--accent));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card.green  { --card-accent: var(--success); }
.stat-card.blue   { --card-accent: var(--accent); }
.stat-card.amber  { --card-accent: var(--warning); }
.stat-card.red    { --card-accent: var(--danger); }
.stat-card.purple { --card-accent: var(--purple); }
.stat-card.teal   { --card-accent: var(--info); }

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

.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  background: var(--icon-bg, #eff6ff);
  color: var(--icon-color, var(--accent));
}

.stat-card.green .stat-icon  { background: #d1fae5; color: var(--success); }
.stat-card.blue  .stat-icon  { background: #dbeafe; color: var(--accent); }
.stat-card.amber .stat-icon  { background: #fef3c7; color: var(--warning); }
.stat-card.red   .stat-icon  { background: #fee2e2; color: var(--danger); }
.stat-card.purple .stat-icon { background: #ede9fe; color: var(--purple); }
.stat-card.teal  .stat-icon  { background: #cffafe; color: var(--info); }

.stat-trend {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 99px;
}

.stat-trend.up   { color: var(--success); background: #d1fae5; }
.stat-trend.down { color: var(--danger);  background: #fee2e2; }
.stat-trend.neutral { color: var(--text-muted); background: var(--bg); }

.stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

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

/* ============================================
   CARDS
   ============================================ */
.card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  overflow: hidden;
}

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

.card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title .title-icon {
  color: var(--accent);
}

.card-body {
  padding: 24px;
}

.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  background: var(--bg);
}

/* ============================================
   TABLES
   ============================================ */
.table-wrap {
  overflow-x: auto;
}

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

thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  background: var(--bg);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

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

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

tbody tr:hover td { background: #f8faff; }

.table-avatar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-avatar .avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.badge-success  { background: #d1fae5; color: #065f46; }
.badge-warning  { background: #fef3c7; color: #92400e; }
.badge-danger   { background: #fee2e2; color: #991b1b; }
.badge-info     { background: #cffafe; color: #155e75; }
.badge-primary  { background: #dbeafe; color: #1e40af; }
.badge-secondary{ background: #f1f5f9; color: #475569; }
.badge-purple   { background: #ede9fe; color: #5b21b6; }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  line-height: 1;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--primary-light));
  color: white;
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(37,99,235,0.45);
  transform: translateY(-1px);
  color: white;
}

.btn-success {
  background: linear-gradient(135deg, var(--success), #059669);
  color: white;
  box-shadow: 0 4px 12px rgba(16,185,129,0.3);
}

.btn-success:hover { transform: translateY(-1px); color: white; }

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #dc2626);
  color: white;
}

.btn-danger:hover { transform: translateY(-1px); color: white; }

.btn-warning {
  background: linear-gradient(135deg, var(--warning), #d97706);
  color: white;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
}

.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }

.btn-sm  { padding: 6px 14px; font-size: 12px; }
.btn-lg  { padding: 12px 28px; font-size: 15px; }
.btn-icon { padding: 9px; }
.btn-xs  { padding: 4px 10px; font-size: 11px; }

/* ============================================
   FORMS
   ============================================ */
.form-group {
  margin-bottom: 20px;
}

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

label .required { color: var(--danger); margin-left: 2px; }

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text-primary);
  background: white;
  transition: var(--transition);
  outline: none;
  font-family: inherit;
}

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

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

.form-control.is-invalid { border-color: var(--danger); }
.form-control.is-valid   { border-color: var(--success); }

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

.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.input-group {
  position: relative;
}

.input-group .input-prefix,
.input-group .input-suffix {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13.5px;
  pointer-events: none;
}

.input-group .input-prefix { left: 14px; }
.input-group .input-suffix { right: 14px; }
.input-group.has-prefix .form-control { padding-left: 36px; }
.input-group.has-suffix .form-control { padding-right: 36px; }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}

textarea.form-control { resize: vertical; min-height: 100px; }

/* ============================================
   ALERTS
   ============================================ */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid transparent;
  margin-bottom: 16px;
}

.alert-success { background: #d1fae5; border-color: #a7f3d0; color: #065f46; }
.alert-danger   { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }
.alert-warning  { background: #fef3c7; border-color: #fde68a; color: #92400e; }
.alert-info     { background: #dbeafe; border-color: #93c5fd; color: #1e40af; }

.alert-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-close {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.6;
  font-size: 16px;
  color: inherit;
}

/* ============================================
   PLAN CARDS
   ============================================ */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.plan-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  border: 2px solid var(--border);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.plan-card:hover {
  border-color: var(--accent-light);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.plan-card.featured {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.plan-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: var(--plan-color, var(--accent));
  opacity: 0.06;
  transform: translate(40px, -40px);
}

.plan-icon {
  width: 54px; height: 54px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  color: white;
  background: var(--plan-color, var(--accent));
  margin-bottom: 18px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.plan-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.plan-range {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.plan-profit {
  font-size: 38px;
  font-weight: 800;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--plan-color, var(--accent));
  letter-spacing: -1px;
  line-height: 1;
}

.plan-profit span { font-size: 18px; font-weight: 600; }

.plan-features {
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.plan-feature {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--text-secondary);
}

.plan-feature i { color: var(--success); font-size: 13px; }

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7,26,71,0.6);
  backdrop-filter: blur(4px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: white;
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: translateY(20px) scale(0.97);
  transition: var(--transition);
}

.modal-overlay.show .modal {
  transform: translateY(0) scale(1);
}

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

.modal-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  width: 32px; height: 32px;
  border: none;
  background: var(--bg);
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}

.modal-close:hover { background: var(--border); color: var(--danger); }

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

/* ============================================
   PROGRESS BARS
   ============================================ */
.progress {
  height: 8px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

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

.progress-bar.success { background: linear-gradient(90deg, var(--success), #34d399); }
.progress-bar.warning { background: linear-gradient(90deg, var(--warning), #fbbf24); }
.progress-bar.danger  { background: linear-gradient(90deg, var(--danger), #f87171); }

/* ============================================
   NOTIFICATIONS DROPDOWN
   ============================================ */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 340px;
  z-index: 1000;
  display: none;
  overflow: hidden;
}

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

.dropdown-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dropdown-header h6 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.notif-item {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  gap: 12px;
  transition: var(--transition);
}

.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: #f0f4ff; }

.notif-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.notif-text .notif-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.notif-text .notif-msg {
  font-size: 12px;
  color: var(--text-secondary);
}

.notif-text .notif-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ============================================
   UPLOAD AREA
   ============================================ */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent-light);
  background: var(--accent-glow);
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-zone .upload-icon {
  font-size: 36px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.upload-zone p {
  font-size: 13.5px;
  color: var(--text-secondary);
}

.upload-zone span {
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state .empty-icon {
  font-size: 52px;
  color: var(--text-muted);
  margin-bottom: 16px;
  opacity: 0.6;
}

.empty-state h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 13.5px;
  color: var(--text-secondary);
  max-width: 280px;
  margin: 0 auto 20px;
}

/* ============================================
   TABS
   ============================================ */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
}

.tab-link {
  padding: 10px 20px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 7px;
}

.tab-link:hover { color: var(--accent); }
.tab-link.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* ============================================
   AUTH PAGES
   ============================================ */
.auth-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.auth-bg-pattern {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(37,99,235,0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(139,92,246,0.1) 0%, transparent 40%);
}

.auth-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-xl);
  position: relative;
  z-index: 1;
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo .logo-icon {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  color: white;
  margin: 0 auto 14px;
  box-shadow: 0 8px 24px rgba(37,99,235,0.35);
}

.auth-logo h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.auth-logo p {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.auth-divider {
  text-align: center;
  position: relative;
  margin: 20px 0;
  font-size: 12px;
  color: var(--text-muted);
}

.auth-divider::before, .auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 20px);
  height: 1px;
  background: var(--border);
}

.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    position: fixed;
    z-index: 1000;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
    width: 100%;
  }
  .header-toggle {
    display: flex !important;
  }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
  }
  .sidebar-overlay.show {
    display: block;
  }
}

@media (max-width: 768px) {
  /* Page layout */
  .page-content    { padding: 14px; }
  .page-header     { flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
  .page-title h1   { font-size: 20px; }
  .top-header      { padding: 0 14px; gap: 10px; }
  .header-search   { display: none; }
  .header-actions  { gap: 6px; }

  /* Grids */
  .stats-grid      { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
  .plan-grid       { grid-template-columns: 1fr; }
  .grid-2          { grid-template-columns: 1fr; gap: 14px; }
  .grid-3          { grid-template-columns: 1fr; gap: 14px; }

  /* Stats */
  .stat-card       { padding: 14px; }
  .stat-value      { font-size: 20px; }
  .stat-label      { font-size: 12px; }

  /* Cards */
  .card-body       { padding: 16px; }
  .card-header     { padding: 14px 16px; }

  /* Tables — make scrollable */
  .table-wrap      { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Modals */
  .modal           { max-width: calc(100% - 20px); margin: 10px; max-height: 90vh; overflow-y: auto; }
  .modal-body      { padding: 16px; }
  .modal-header    { padding: 14px 16px; }
  .modal-footer    { padding: 14px 16px; }

  /* Forms */
  .form-control    { font-size: 16px; } /* prevents iOS zoom on focus */
  select.form-control { font-size: 16px; }

  /* Inline grids used in dashboard/other pages */
  [style*="grid-template-columns:1fr 320px"],
  [style*="grid-template-columns: 1fr 320px"],
  [style*="grid-template-columns:1fr 340px"],
  [style*="grid-template-columns: 1fr 340px"],
  [style*="grid-template-columns:1fr 300px"],
  [style*="grid-template-columns: 1fr 300px"] {
    grid-template-columns: 1fr !important;
  }

  /* Fallback: collapse any card/page inline grids */
  .card-body > [style*="grid-template-columns"],
  .page-content > [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  /* Notification dropdown — full width on mobile */
  .dropdown-menu[style*="width:320px"],
  .dropdown-menu[style*="width: 320px"] {
    width: calc(100vw - 20px) !important;
    right: 10px !important;
    left: auto !important;
  }

  /* Plan features — stack vertically */
  .plan-features { flex-direction: column; gap: 6px; }

  /* Top header — hide name, show avatar only */
  .header-user-name { display: none; }
  .profile-info     { display: none; }
  .header-profile   { padding: 4px; border-radius: 50%; }

  /* Thinner progress bars on mobile */
  .progress { height: 8px; }

  /* Upload zones */
  .upload-zone { min-height: 80px; padding: 16px; }

  /* Input group adornments */
  .input-group.has-prefix .input-prefix,
  .input-group.has-suffix .input-suffix { padding: 0 10px; font-size: 13px; }

  /* Stat trend badges */
  .stat-trend { font-size: 10px; padding: 2px 6px; }
}

@media (max-width: 480px) {
  /* Single column everything */
  .stats-grid      { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
  .modal           { max-width: 100%; margin: 0; border-radius: 0; max-height: 100vh; }
  .page-content    { padding: 10px; }
  .top-header      { padding: 0 10px; }
  .stat-card       { padding: 12px; }
  .stat-value      { font-size: 18px; }

  /* Buttons on small screens */
  .btn-lg          { padding: 11px 18px; font-size: 13px; }

  /* Auth pages */
  .auth-card       { padding: 24px 16px; margin: 10px; border-radius: 16px; }
  .auth-wrapper    { padding: 10px; }
  .auth-container  { padding: 10px; }

  /* Page header buttons */
  .page-header .btn   { font-size: 12px; padding: 7px 12px; }
  .page-header .btn i { margin-right: 4px; }

  /* Tables */
  table th, table td { font-size: 12px; padding: 10px; }

  /* Badges & nav */
  .badge     { font-size: 10px; padding: 3px 7px; }
  .nav-badge { min-width: 16px; height: 16px; font-size: 9px; }
}

/* ============================================
   UTILITIES
   ============================================ */
.text-primary   { color: var(--primary) !important; }
.text-accent    { color: var(--accent) !important; }
.text-success   { color: var(--success) !important; }
.text-warning   { color: var(--warning) !important; }
.text-danger    { color: var(--danger) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }

.d-flex  { display: flex; }
.d-grid  { display: grid; }
.d-none  { display: none; }
.d-block { display: block; }

.align-items-center { align-items: center; }
.justify-between    { justify-content: space-between; }
.flex-wrap          { flex-wrap: wrap; }
.gap-1 { gap: 6px; } .gap-2 { gap: 12px; } .gap-3 { gap: 18px; } .gap-4 { gap: 24px; }

.mt-1 { margin-top: 6px; }   .mt-2 { margin-top: 12px; }  .mt-3 { margin-top: 18px; }  .mt-4 { margin-top: 24px; }
.mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 18px; } .mb-4 { margin-bottom: 24px; }
.p-1  { padding: 6px; }  .p-2  { padding: 12px; } .p-3  { padding: 18px; }  .p-4  { padding: 24px; }

.rounded    { border-radius: var(--radius-sm); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: 999px; }

.w-100 { width: 100%; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-bold { font-weight: bold; }

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

@media (max-width: 640px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

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

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

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
  pointer-events: none;
}

.toast {
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-left: 4px solid var(--toast-color, var(--accent));
  pointer-events: all;
  animation: slideIn 0.3s ease forwards;
  max-width: 100%;
}

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

.toast.hiding {
  animation: slideOut 0.3s ease forwards;
}

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

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

.toast-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.toast-success .toast-icon { color: var(--success); }
.toast-danger  .toast-icon { color: var(--danger);  }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info    .toast-icon { color: var(--accent);  }

.toast-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.toast-msg {
  font-size: 12.5px;
  color: var(--text-secondary);
}

/* ============================================
   SIDEBAR GRID — 2-col layout with right sidebar
   Used throughout user and admin pages
   ============================================ */

.sidebar-grid {
  display: grid !important;
  gap: 24px;
}

/* Collapse right sidebar column on tablet/mobile */
@media (max-width: 900px) {
  .sidebar-grid,
  .dashboard-main-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ============================================
   MOBILE LAYOUT FIXES — All Pages
   ============================================ */

/* ============================================
   MOBILE BOTTOM NAVIGATION
   Visible only on screens ≤ 768px
   ============================================ */

.mobile-bottom-nav {
  display: none; /* hidden on desktop */
}

@media (max-width: 768px) {

  /* ── Push page content up so it's not hidden behind the nav ── */
  .page-content {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  /* ── The bar itself ── */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -4px 20px rgba(15, 45, 110, 0.10);
    z-index: 1100;
    align-items: stretch;
    /* iPhone notch / home-bar padding */
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  /* ── Each nav item ── */
  .mob-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: color 0.18s ease;
    position: relative;
    -webkit-tap-highlight-color: transparent;
  }

  .mob-nav-item:active {
    background: rgba(37, 99, 235, 0.05);
  }

  /* ── Icon wrapper ── */
  .mob-nav-icon {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: transform 0.18s ease, color 0.18s ease;
  }

  /* ── Label ── */
  .mob-nav-label {
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.2px;
    line-height: 1;
  }

  /* ── Active state ── */
  .mob-nav-item.active {
    color: #2563eb;
  }

  .mob-nav-item.active .mob-nav-icon {
    color: #2563eb;
    transform: translateY(-2px);
  }

  /* ── Active indicator dot ── */
  .mob-nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #2563eb;
  }

  /* ── Centre raised button (Tasks) ── */
  .mob-nav-center {
    position: relative;
    flex: 1;
    /* Give it a little extra room for the raised button */
    margin-top: -14px;
  }

  .mob-nav-icon-center {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a3f8f, #2563eb);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.45);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    border: 3px solid #ffffff;
  }

  .mob-nav-center:active .mob-nav-icon-center {
    transform: scale(0.93);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
  }

  .mob-nav-center .mob-nav-label {
    color: #2563eb;
    font-weight: 700;
    margin-top: 2px;
  }

  /* Active state for centre button */
  .mob-nav-center.active .mob-nav-icon-center {
    background: linear-gradient(135deg, #0f2d6e, #1a3f8f);
    box-shadow: 0 6px 20px rgba(15, 45, 110, 0.5);
    transform: translateY(-1px) scale(1.04);
  }

  /* Remove the dot indicator for the centre button */
  .mob-nav-center::after {
    display: none !important;
  }

} /* end @media 768px */
