/* SelebMoney - Main Stylesheet */
:root {
  --sm-navy: #3b1024;
  --sm-navy-light: #5b1835;
  --sm-emerald: #ec4899;
  --sm-emerald-dark: #db2777;
  --sm-emerald-light: #fce7f3;
  --sm-white: #ffffff;
  --sm-gray-50: #f8fafc;
  --sm-gray-100: #f1f5f9;
  --sm-gray-200: #e2e8f0;
  --sm-gray-400: #94a3b8;
  --sm-gray-600: #475569;
  --sm-gray-800: #1e293b;
  --sm-charcoal: #2a1020;
  --sm-gold: #f59e0b;
  --sm-red: #ef4444;
  --sm-blue: #f97316;
  --sidebar-width: 260px;
  --header-height: 64px;
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
  --transition: all .2s ease;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--sm-gray-50);
  color: var(--sm-gray-800);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== TYPOGRAPHY ===== */
h1,h2,h3,h4,h5,h6 { font-weight: 600; line-height: 1.3; color: var(--sm-charcoal); }
.text-emerald { color: var(--sm-emerald) !important; }
.text-navy { color: var(--sm-navy) !important; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

/* ===== BUTTONS ===== */
.btn { border-radius: var(--border-radius-sm); font-weight: 500; transition: var(--transition); letter-spacing: .01em; }
.btn-primary { background: var(--sm-emerald); border-color: var(--sm-emerald); color: #fff; }
.btn-primary:hover { background: var(--sm-emerald-dark); border-color: var(--sm-emerald-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(236,72,153,.3); }
.btn-navy { background: var(--sm-navy); border-color: var(--sm-navy); color: #fff; }
.btn-navy:hover { background: var(--sm-navy-light); border-color: var(--sm-navy-light); color: #fff; }
.btn-outline-emerald { border-color: var(--sm-emerald); color: var(--sm-emerald); }
.btn-outline-emerald:hover { background: var(--sm-emerald); color: #fff; }
.btn-emerald-gradient { background: linear-gradient(135deg, var(--sm-emerald) 0%, var(--sm-emerald-dark) 100%); border: none; color: #fff; box-shadow: 0 4px 12px rgba(236,72,153,.25); }
.btn-emerald-gradient:hover { background: linear-gradient(135deg, var(--sm-emerald-dark) 0%, #be185d 100%); box-shadow: 0 6px 16px rgba(236,72,153,.35); transform: translateY(-2px); color: #fff; }
.btn-outline-indigo { border-color: #f43f5e; color: #f43f5e; }
.btn-outline-indigo:hover { background: #f43f5e; color: #fff; }
.btn-lg { padding: .75rem 2rem; font-size: 1rem; }
.btn-xl { padding: 1rem 2.5rem; font-size: 1.1rem; border-radius: 10px; }

/* ===== CARDS ===== */
.card { border: 1px solid var(--sm-gray-200); border-radius: var(--border-radius); box-shadow: var(--shadow-sm); transition: var(--transition); background: #fff; }
.card:hover { box-shadow: var(--shadow); }
.card-header { background: transparent; border-bottom: 1px solid var(--sm-gray-200); padding: 1.25rem 1.5rem; font-weight: 600; }
.card-body { padding: 1.5rem; }

/* Stat Cards */
.stat-card { border-radius: var(--border-radius); padding: 1rem 1.125rem; position: relative; overflow: hidden; transition: var(--transition); }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-card .stat-icon { width: 36px; height: 36px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.stat-card .stat-value { font-size: 1.35rem; font-weight: 700; line-height: 1; margin: .35rem 0 .2rem; }
.stat-card .stat-label { font-size: .7rem; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; opacity: .7; }
.stat-card .stat-change { font-size: .7rem; font-weight: 500; margin-top: .25rem; }
.stat-card-emerald { background: linear-gradient(135deg, var(--sm-emerald) 0%, var(--sm-emerald-dark) 100%); color: #fff; }
.stat-card-navy { background: linear-gradient(135deg, var(--sm-navy-light) 0%, var(--sm-navy) 100%); color: #fff; }
.stat-card-gold { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: #fff; }
.stat-card-blue { background: linear-gradient(135deg, #f97316 0%, #ea580c 100%); color: #fff; }
.stat-card-white { background: #fff; border: 1px solid var(--sm-gray-200); }

/* ===== SIDEBAR ===== */
.sidebar { width: var(--sidebar-width); height: 100vh; position: fixed; top: 0; left: 0; background: linear-gradient(135deg, var(--sm-gold), var(--sm-red)); z-index: 1000; display: flex; flex-direction: column; transition: transform .3s ease; overflow-y: auto; }
.sidebar-brand { padding: 1.5rem; border-bottom: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: .75rem; text-decoration: none; }
.sidebar-brand .brand-logo { width: 36px; height: 36px; background: var(--sm-emerald); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; font-size: 1rem; }
.sidebar-brand .brand-name { color: #fff; font-weight: 700; font-size: 1.1rem; }
.sidebar-brand .brand-tagline { color: rgba(255,255,255,.5); font-size: .7rem; }
.sidebar-nav { padding: 1rem 0; flex: 1; }
.sidebar-section { padding: .5rem 1.5rem .25rem; font-size: .65rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: rgba(255,255,255,.35); }
.sidebar-link { display: flex; align-items: center; gap: .75rem; padding: .65rem 1.5rem; color: rgba(255,255,255,.65); text-decoration: none; font-size: .875rem; font-weight: 500; transition: var(--transition); border-left: 3px solid transparent; }
.sidebar-link:hover { color: #fff; background: rgba(255,255,255,.06); }
.sidebar-link.active { color: #fff; background: rgba(245,158,11,.2); border-left-color: var(--sm-gold); }
.sidebar-link i { font-size: 1rem; width: 20px; text-align: center; }
.sidebar-link .badge { margin-left: auto; font-size: .65rem; }
.sidebar-footer { padding: 1rem 1.5rem; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-user { display: flex; align-items: center; gap: .75rem; }
.sidebar-user .avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--sm-emerald); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-size: .875rem; flex-shrink: 0; }
.sidebar-user .user-name { color: #fff; font-size: .875rem; font-weight: 500; }
.sidebar-user .user-status { color: rgba(255,255,255,.45); font-size: .7rem; }
.sidebar-logout { display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; margin-top: .875rem; padding: .65rem .9rem; border-radius: var(--border-radius-sm); background: rgba(255,255,255,.16); color: #fff; text-decoration: none; font-size: .875rem; font-weight: 600; transition: var(--transition); }
.sidebar-logout:hover { background: rgba(255,255,255,.25); color: #fff; transform: translateY(-1px); }
.sidebar-logout i { font-size: 1rem; }

/* ===== MAIN CONTENT ===== */
.main-wrapper { margin-left: var(--sidebar-width); min-height: 100vh; display: flex; flex-direction: column; width: calc(100vw - var(--sidebar-width)); max-width: calc(100vw - var(--sidebar-width)); overflow-x: hidden; }
.topbar { height: var(--header-height); background: #fff; border-bottom: 1px solid var(--sm-gray-200); display: flex; align-items: center; padding: 0 1.5rem; gap: 1rem; position: sticky; top: 0; z-index: 100; }
.topbar-title { font-weight: 600; font-size: 1.1rem; color: var(--sm-charcoal); flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: .75rem; }
.notification-btn { position: relative; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--sm-gray-200); background: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: var(--transition); color: var(--sm-gray-600); }
.notification-btn:hover { background: var(--sm-gray-50); }
.notification-badge { position: absolute; top: -4px; right: -4px; background: var(--sm-red); color: #fff; border-radius: 50%; width: 18px; height: 18px; font-size: .65rem; display: flex; align-items: center; justify-content: center; font-weight: 600; }
.page-content { padding: 1.5rem; flex: 1; width: 100%; max-width: 100%; overflow-x: hidden; box-sizing: border-box; }

/* Container and row fixes */
.container-fluid, .container { max-width: 100%; overflow-x: hidden; }
.row { margin-left: 0; margin-right: 0; max-width: 100%; }
.row > * { padding-left: 0.75rem; padding-right: 0.75rem; max-width: 100%; box-sizing: border-box; }

/* Card and content constraints */
.card { max-width: 100%; overflow-x: hidden; box-sizing: border-box; }
.card-body { max-width: 100%; overflow-x: hidden; box-sizing: border-box; }
.chart-container { max-width: 100%; overflow-x: hidden; }

/* Large screen specific fixes */
@media (min-width: 1200px) {
  .main-wrapper { 
    width: calc(100vw - var(--sidebar-width)) !important; 
    max-width: calc(100vw - var(--sidebar-width)) !important; 
  }
  .page-content { 
    max-width: calc(100vw - var(--sidebar-width) - 3rem) !important; 
  }
  .container-fluid { 
    max-width: calc(100vw - var(--sidebar-width) - 3rem) !important; 
  }
}

@media (min-width: 1400px) {
  .main-wrapper { 
    width: calc(100vw - var(--sidebar-width)) !important; 
    max-width: calc(100vw - var(--sidebar-width)) !important; 
  }
  .page-content { 
    max-width: calc(100vw - var(--sidebar-width) - 3rem) !important; 
  }
  .container-fluid { 
    max-width: calc(100vw - var(--sidebar-width) - 3rem) !important; 
  }
}

/* ===== TABLES ===== */
.table { font-size: .875rem; table-layout: auto; width: 100%; }
.table th, .table td { word-break: break-word; }
.table td, .table th { padding: .5rem .75rem; }
.table th { font-weight: 600; }
.table th { font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--sm-gray-600); border-bottom: 2px solid var(--sm-gray-200); padding: .875rem 1rem; }
.table td { padding: .875rem 1rem; vertical-align: middle; border-bottom: 1px solid var(--sm-gray-100); }
.table tbody tr:hover { background: var(--sm-gray-50); }
.table-card { border-radius: var(--border-radius); overflow: hidden; box-shadow: var(--shadow-sm); }

/* ===== BADGES ===== */
.badge-status { padding: .3rem .75rem; border-radius: 20px; font-size: .75rem; font-weight: 500; }
.badge-active { background: linear-gradient(135deg, var(--sm-emerald-light) 0%, #fbcfe8 100%); color: var(--sm-emerald-dark); }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-approved { background: var(--sm-emerald-light); color: var(--sm-emerald-dark); }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-inactive { background: var(--sm-gray-100); color: var(--sm-gray-600); }
.badge-admin { background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%); color: #fff; padding: .3rem .75rem; border-radius: 20px; font-size: .75rem; font-weight: 500; }

/* ===== PROFILE CARD ===== */
.profile-card { background: #fff; border-radius: var(--border-radius) !important; overflow: hidden; transition: var(--transition); }
.profile-card:hover { box-shadow: var(--shadow-lg) !important; }
.profile-avatar-wrapper { margin-bottom: 1.5rem; }
.profile-avatar { width: 100px; height: 100px; border-radius: 50%; background: linear-gradient(135deg, var(--sm-emerald) 0%, var(--sm-emerald-dark) 100%); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 2.5rem; margin: 0 auto; box-shadow: 0 8px 20px rgba(236,72,153,.25); border: 4px solid #fff; }
.profile-info-section { background: var(--sm-gray-50); border-radius: var(--border-radius-sm); padding: 0.5rem; }
.info-row { font-size: .875rem; transition: var(--transition); }
.info-row:hover { background: #e8f5e9 !important; }
.bg-gradient-emerald { background: linear-gradient(135deg, var(--sm-emerald) 0%, var(--sm-emerald-dark) 100%) !important; }
.bg-gradient-indigo { background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%) !important; }

/* ===== FORMS ===== */
.form-control, .form-select { border: 1px solid var(--sm-gray-200); border-radius: var(--border-radius-sm); padding: .625rem 1rem; font-size: .875rem; transition: var(--transition); }
.form-control:focus, .form-select:focus { border-color: var(--sm-emerald); box-shadow: 0 0 0 3px rgba(236,72,153,.1); outline: none; }
.form-label { font-weight: 500; font-size: .875rem; color: var(--sm-gray-800); margin-bottom: .375rem; }
.input-group-text { background: var(--sm-gray-50); border-color: var(--sm-gray-200); color: var(--sm-gray-600); }

/* ===== ALERTS ===== */
.alert { border-radius: var(--border-radius-sm); border: none; font-size: .875rem; }
.alert-success { background: var(--sm-emerald-light); color: var(--sm-emerald-dark); }
.alert-danger { background: #fee2e2; color: #991b1b; }
.alert-warning { background: #fef3c7; color: #92400e; }
.alert-info { background: #ffedd5; color: #9a3412; }

/* ===== PROGRESS ===== */
.progress { height: 6px; border-radius: 3px; background: var(--sm-gray-200); }
.progress-bar { background: var(--sm-emerald); border-radius: 3px; }

/* ===== CHARTS ===== */
.chart-container { position: relative; max-width: 100%; overflow: hidden; }
.chart-container canvas { max-width: 100% !important; height: auto !important; }

/* ===== CONTENT CONSTRAINTS ===== */
* { box-sizing: border-box; }
.table-responsive { overflow-x: auto; max-width: 100%; }
.card .table-responsive { margin: 0; }

/* Users page fixes - prevent table overflow */
#admin/users .table, 
.page-content .table { 
  width: 100% !important;
  max-width: 100% !important;
}
.page-content .table th,
.page-content .table td {
  white-space: normal !important;
  word-wrap: break-word !important;
  word-break: break-word !important;
}
.page-content .table td div {
  overflow: hidden;
  text-overflow: ellipsis;
}
.table { table-layout: fixed; }
.table td, .table th { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table td[colspan] { white-space: normal; }

/* ===== DASHBOARD SPECIFIC FIXES ===== */
.investment-counter-dashboard { max-width: 100%; overflow: hidden; }
.digital-value { word-break: break-word; }

/* Force all dashboard content to stay within bounds */
.page-content > div:first-child { 
  max-width: 100% !important; 
  overflow-x: hidden !important; 
  box-sizing: border-box !important; 
}

/* Ensure all rows and columns respect container width */
.page-content .row { 
  margin-left: 0 !important; 
  margin-right: 0 !important; 
  max-width: 100% !important; 
}

.page-content .col-lg-8,
.page-content .col-lg-4,
.page-content .col-md-6,
.page-content .col-12,
.page-content [class*="col-"] { 
  max-width: 100% !important; 
  box-sizing: border-box !important; 
  padding-left: 0.75rem !important;
  padding-right: 0.75rem !important;
}

/* Chart and table specific fixes */
.page-content .chart-container,
.page-content .table-responsive,
.page-content .card,
.page-content .card-body { 
  max-width: 100% !important; 
  overflow-x: hidden !important; 
  box-sizing: border-box !important; 
}

/* Large screen specific dashboard fixes */
@media (min-width: 1200px) {
  .page-content > div:first-child { 
    max-width: calc(100vw - var(--sidebar-width) - 3rem) !important; 
  }
  .page-content .row { 
    max-width: calc(100vw - var(--sidebar-width) - 3rem) !important; 
  }
  .page-content .col-lg-8 { 
    max-width: calc((100vw - var(--sidebar-width) - 3rem) * 0.66) !important; 
  }
  .page-content .col-lg-4 { 
    max-width: calc((100vw - var(--sidebar-width) - 3rem) * 0.33) !important; 
  }
  .page-content .col-12 { 
    max-width: calc(100vw - var(--sidebar-width) - 3rem) !important; 
  }
}

@media (min-width: 1400px) {
  .page-content > div:first-child { 
    max-width: calc(100vw - var(--sidebar-width) - 3rem) !important; 
  }
  .page-content .row { 
    max-width: calc(100vw - var(--sidebar-width) - 3rem) !important; 
  }
  .page-content .col-lg-8 { 
    max-width: calc((100vw - var(--sidebar-width) - 3rem) * 0.66) !important; 
  }
  .page-content .col-lg-4 { 
    max-width: calc((100vw - var(--sidebar-width) - 3rem) * 0.33) !important; 
  }
  .page-content .col-12 { 
    max-width: calc(100vw - var(--sidebar-width) - 3rem) !important; 
  }
}

/* ===== TRANSACTION LIST ===== */
.tx-item { display: flex; align-items: center; gap: 1rem; padding: .875rem 0; border-bottom: 1px solid var(--sm-gray-100); }
.tx-item:last-child { border-bottom: none; }
.tx-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.tx-icon-credit { background: var(--sm-emerald-light); color: var(--sm-emerald-dark); }
.tx-icon-debit { background: #fee2e2; color: #991b1b; }
.tx-info { flex: 1; }
.tx-desc { font-size: .875rem; font-weight: 500; color: var(--sm-charcoal); }
.tx-date { font-size: .75rem; color: var(--sm-gray-400); }
.tx-amount { font-weight: 600; font-size: .9rem; }
.tx-amount.credit { color: var(--sm-emerald); }
.tx-amount.debit { color: var(--sm-red); }

/* ===== QUIZ ===== */
.quiz-card { border-radius: var(--border-radius); overflow: hidden; transition: var(--transition); }
.quiz-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.quiz-category { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.quiz-timer { font-size: 1.5rem; font-weight: 700; color: var(--sm-emerald); font-variant-numeric: tabular-nums; }
.quiz-option { border: 2px solid var(--sm-gray-200); border-radius: var(--border-radius-sm); padding: .875rem 1.25rem; cursor: pointer; transition: var(--transition); font-size: .9rem; }
.quiz-option:hover { border-color: var(--sm-emerald); background: var(--sm-emerald-light); }
.quiz-option.selected { border-color: var(--sm-emerald); background: var(--sm-emerald-light); color: var(--sm-emerald-dark); font-weight: 500; }
.quiz-option.correct { border-color: var(--sm-emerald); background: var(--sm-emerald-light); }
.quiz-option.wrong { border-color: var(--sm-red); background: #fee2e2; }

/* ===== AI CHAT ===== */
.chat-container { height: 500px; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .75rem; }
.chat-bubble { max-width: 75%; padding: .875rem 1.125rem; border-radius: 16px; font-size: .875rem; line-height: 1.5; }
.chat-bubble.user { background: var(--sm-emerald); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.chat-bubble.assistant { background: var(--sm-gray-100); color: var(--sm-charcoal); border-bottom-left-radius: 4px; align-self: flex-start; }
.chat-bubble.typing { background: var(--sm-gray-100); }
.typing-dots span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--sm-gray-400); animation: typing 1.2s infinite; }
.typing-dots span:nth-child(2) { animation-delay: .2s; }
.typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes typing { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }
.ai-badge { background: linear-gradient(135deg, var(--sm-navy) 0%, var(--sm-navy-light) 100%); color: #fff; padding: .2rem .6rem; border-radius: 20px; font-size: .65rem; font-weight: 600; letter-spacing: .05em; }

/* ===== REFERRAL TREE ===== */
.referral-node { background: #fff; border: 1px solid var(--sm-gray-200); border-radius: var(--border-radius-sm); padding: .875rem 1rem; display: flex; align-items: center; gap: .75rem; }
.referral-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--sm-emerald); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-size: .8rem; flex-shrink: 0; }
.referral-level-badge { font-size: .65rem; font-weight: 600; padding: .15rem .5rem; border-radius: 20px; }
.level-1 { background: #ffedd5; color: #9a3412; }
.level-2 { background: #fef3c7; color: #92400e; }
.level-3 { background: var(--sm-emerald-light); color: var(--sm-emerald-dark); }

/* ===== LEADERBOARD ===== */
.rank-1 { color: #f59e0b; }
.rank-2 { color: #94a3b8; }
.rank-3 { color: #cd7c2f; }
.rank-badge { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; }
.rank-badge-1 { background: #fef3c7; color: #92400e; }
.rank-badge-2 { background: var(--sm-gray-100); color: var(--sm-gray-600); }
.rank-badge-3 { background: #fde8d8; color: #9a3412; }

/* ===== MARKETPLACE ===== */
.listing-card { border-radius: var(--border-radius); overflow: hidden; transition: var(--transition); }
.listing-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.listing-img { height: 180px; object-fit: cover; width: 100%; background: var(--sm-gray-100); }
.listing-price { font-size: 1.25rem; font-weight: 700; color: var(--sm-emerald); }
.listing-type-badge { font-size: .7rem; font-weight: 600; padding: .2rem .6rem; border-radius: 20px; }
.listing-type-auction { background: #fef3c7; color: #92400e; }
.listing-type-fixed { background: var(--sm-emerald-light); color: var(--sm-emerald-dark); }

/* ===== NOTIFICATIONS ===== */
.notification-item { padding: .875rem 1rem; border-bottom: 1px solid var(--sm-gray-100); display: flex; gap: .75rem; transition: var(--transition); }
.notification-item:hover { background: var(--sm-gray-50); }
.notification-item.unread { background: #fdf2f8; border-left: 3px solid var(--sm-emerald); }
.notification-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sm-emerald); flex-shrink: 0; margin-top: .4rem; }

/* Dropdown Menu */
.dropdown-menu { display: none; position: absolute; background: #fff; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 1050; min-width: 200px; }
.dropdown-menu.show { display: block !important; }
.dropdown-menu-end { right: 0; left: auto; }

/* ===== MOBILE TOGGLE ===== */
.sidebar-toggle { display: none; background: none; border: none; font-size: 1.25rem; color: var(--sm-gray-600); cursor: pointer; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 999; }

/* ===== RESPONSIVE ===== */
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .main-wrapper { margin-left: 0; width: 100vw; max-width: 100vw; }
  .sidebar-toggle { display: block; }
  .stat-card .stat-value { font-size: 1.15rem; }
  
  /* Profile responsive */
  .profile-card { margin-bottom: 1rem; }
}
@media (max-width: 575.98px) {
  .page-content { padding: 1rem; }
  .topbar { padding: 0 1rem; }
  .card-body { padding: 1rem; }
  
  /* Ensure mobile content doesn't overflow */
  .row > * { padding-left: 0.5rem; padding-right: 0.5rem; }
  
  /* Profile responsive for small screens */
  .profile-avatar { width: 80px; height: 80px; font-size: 2rem; }
  .profile-avatar-wrapper { margin-bottom: 1rem; }
  .profile-card { margin-bottom: 1rem; }
  .card-header { padding: 0.875rem 1rem !important; font-size: 0.95rem; }
  
  /* Form improvements for mobile */
  .row.g-3 > [class*="col-"] { padding-right: 0.5rem; padding-left: 0.5rem; }
  .form-control, .form-select { font-size: 16px; padding: 0.75rem 0.875rem; }
  .btn { width: 100%; padding: 0.75rem 1rem; font-size: 0.9rem; }
  
  /* Info section for mobile */
  .info-row { padding: 0.5rem !important; font-size: 0.8rem; }
  .profile-info-section { padding: 0.25rem !important; }
}

/* ===== UTILITIES ===== */
.rounded-xl { border-radius: var(--border-radius) !important; }
.rounded-2xl { border-radius: 16px !important; }
.bg-emerald { background-color: var(--sm-emerald) !important; }
.bg-navy { background-color: var(--sm-navy) !important; }
.bg-navy-light { background-color: var(--sm-navy-light) !important; }
.border-emerald { border-color: var(--sm-emerald) !important; }
.shadow-emerald { box-shadow: 0 4px 14px rgba(236,72,153,.25) !important; }

/* Warm theme overrides for Bootstrap color utilities */
.text-primary { color: var(--sm-emerald) !important; }
.bg-primary { background-color: rgba(236,72,153,var(--bs-bg-opacity,1)) !important; }
.border-primary { border-color: var(--sm-emerald) !important; }
.btn-outline-primary {
  border-color: var(--sm-emerald) !important;
  color: var(--sm-emerald) !important;
}
.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background-color: var(--sm-emerald) !important;
  border-color: var(--sm-emerald) !important;
  color: #fff !important;
}
.text-info { color: var(--sm-blue) !important; }
.bg-info { background-color: rgba(249,115,22,var(--bs-bg-opacity,1)) !important; }
.border-info { border-color: var(--sm-blue) !important; }
.btn-info {
  background-color: var(--sm-blue) !important;
  border-color: var(--sm-blue) !important;
  color: #fff !important;
}
.btn-info:hover,
.btn-info:focus {
  background-color: #ea580c !important;
  border-color: #ea580c !important;
  color: #fff !important;
}
.text-success { color: var(--sm-emerald) !important; }
.bg-success { background-color: var(--sm-emerald) !important; }
.border-success { border-color: var(--sm-emerald) !important; }
.btn-success {
  background-color: var(--sm-emerald) !important;
  border-color: var(--sm-emerald) !important;
  color: #fff !important;
}
.btn-success:hover,
.btn-success:focus {
  background-color: var(--sm-emerald-dark) !important;
  border-color: var(--sm-emerald-dark) !important;
  color: #fff !important;
}
.btn-outline-success {
  border-color: var(--sm-emerald) !important;
  color: var(--sm-emerald) !important;
}
.btn-outline-success:hover,
.btn-outline-success:focus {
  background-color: var(--sm-emerald) !important;
  border-color: var(--sm-emerald) !important;
  color: #fff !important;
}
.alert-success {
  background: var(--sm-emerald-light) !important;
  color: var(--sm-emerald-dark) !important;
}
.spinner-border.text-success,
.spinner-grow.text-success {
  color: var(--sm-emerald) !important;
}
.cursor-pointer { cursor: pointer; }
.gap-3 { gap: .75rem; }

/* ===== ANIMATIONS ===== */
.fade-in { animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.slide-in { animation: slideIn .3s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: translateX(0); } }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--sm-gray-100); }
::-webkit-scrollbar-thumb { background: var(--sm-gray-400); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--sm-gray-600); }

/* ===== DARK MODE ===== */
@media (prefers-color-scheme: dark) {
  body.dark-mode { background: #2a1020; color: #e2e8f0; }
  body.dark-mode .card { background: #1e293b; border-color: #334155; }
  body.dark-mode .topbar { background: #1e293b; border-color: #334155; }
  body.dark-mode .table td, body.dark-mode .table th { border-color: #334155; }
}
