/* ==================================================
   MONEY CULTURE CRM — Premium Enterprise Stylesheet
   Version 5.3 (Footer Redesign)
   ================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&display=swap');

/* ---------- ROOT VARIABLES ---------- */
:root {
  /* Premium palette — "Money Culture Private Wealth"
     Deep navy ink + antique gold + warm ivory. Named tokens below feed
     every page in the CRM (this stylesheet loads globally). */
  --primary: #8A6D1F;              /* antique bronze-gold — accessible on white (4.9:1) */
  --primary-dark: #6B5518;         /* pressed / hover */
  --primary-light: rgba(138, 109, 31, 0.1);
  --secondary: #C6A15B;            /* champagne gold — gradients, decorative, icon tints */
  --gold-tint: #F3E9D3;            /* pale gold background for badges/highlights */
  --success: #1C7A54;              /* deep emerald */
  --success-light: rgba(28, 122, 84, 0.12);
  --warning: #A85C2E;              /* burnt amber — kept distinct from primary gold */
  --warning-light: rgba(168, 92, 46, 0.12);
  --danger: #B3261E;               /* brick red */
  --danger-light: rgba(179, 38, 30, 0.1);
  --info: #2E5C8A;                 /* steel navy-blue */
  --muted: #6B655A;
  
  /* Global UI Colors */
  --bg: #FAF7F0;                   /* warm ivory, not cold SaaS grey */
  --card: #FFFFFF;
  --sidebar: #0E1A2E;              /* deep navy-ink */
  --sidebar-hover: #17263F;
  --text: #16202E;
  --text-light: #6B655A;
  --border: #E8E1D2;

  /* Typography */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Radiuses */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-btn: 16px;
  --radius-input: 16px;
  --radius-card: 20px;
  --radius-full: 9999px;
  
  /* Shadows — warm-tinted (ink), not neutral black: reads more premium */
  --shadow-sm: 0 4px 15px rgba(22, 20, 12, 0.04);
  --shadow: 0 12px 35px rgba(22, 20, 12, 0.09);
  --shadow-hover: 0 20px 45px rgba(22, 20, 12, 0.14);
  
  /* Utilities */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --gap: 24px;
  --padding-card: 24px;
  
  /* Z-Index */
  --z-topbar: 900;
  --z-sidebar: 1000;
  --z-mobile-toggle: 1100;
  --z-dropdown: 1200;
  --z-modal: 2000;
  --z-toast: 2100;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; transition: var(--transition); }
button, input, textarea, select { font: inherit; outline: none; }
button { cursor: pointer; border: none; background: none; }
ul { list-style: none; }
table { border-collapse: collapse; width: 100%; }

/* ---------- SCROLLBAR ---------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* ---------- TYPOGRAPHY ---------- */
h1, h2, h3 { font-family: var(--font-display); }
h1 { font-size: 32px; font-weight: 700; line-height: 1.2; letter-spacing: -0.3px; }
h2 { font-size: 26px; font-weight: 700; letter-spacing: -0.2px; }
h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.1px; }
h4 { font-size: 18px; font-weight: 600; }
h5 { font-size: 16px; font-weight: 600; }
h6 { font-size: 14px; font-weight: 600; }
p { color: var(--text-light); }
small { color: var(--muted); }

/* ---------- UTILITIES ---------- */
.container { width: 100%; max-width: 1400px; margin: auto; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.gap-4 { gap: 32px; }
.hidden { display: none !important; }
.w-100 { width: 100%; }

/* ---------- ANIMATIONS ---------- */
.fade-up {
  animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.float {
  animation: float 4s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.card-hover {
  transition: var(--transition);
}
.card-hover:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}

/* ---------- APP LAYOUT ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

/* ---------- SIDEBAR ---------- */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 280px;
  background: var(--sidebar);
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: var(--z-sidebar);
  box-shadow: 4px 0 24px rgba(0,0,0,0.06);
  transition: transform 0.3s ease, width 0.3s ease;
}

.sidebar-brand {
  padding: 32px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid rgba(198,161,91,0.12);
}
.brand-mark-img {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.brand-name {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  color: #FFFFFF;
  letter-spacing: -0.3px;
}
.brand-sub {
  font-size: 11px;
  color: var(--secondary);
  margin-top: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.6px;
}

.sidebar-nav {
  padding: 24px 16px;
  flex: 1;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  margin-bottom: 8px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 14px;
  color: #9CA6BA;
  transition: var(--transition);
  position: relative;
}
.sidebar-nav a:hover {
  background: var(--sidebar-hover);
  color: #FFFFFF;
  transform: translateX(4px);
}
.sidebar-nav a.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #17130A;
  box-shadow: 0 8px 20px rgba(138, 109, 31, 0.35);
}
.nav-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}
.sidebar-nav a.active .nav-icon {
  color: #17130A;
}
.nav-badge {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--danger);
  color: #FFF;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.sidebar-footer {
  padding: 24px 16px;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-btn);
  background: rgba(255,255,255,0.03);
  margin-bottom: 16px;
  border: 1px solid rgba(255,255,255,0.05);
}
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.avatar-sm { width: 34px; height: 34px; font-size: 13px; }
.avatar-lg { width: 68px; height: 68px; font-size: 24px; }
.sidebar-user-name { font-size: 14px; font-weight: 700; color: #FFF; }
.sidebar-user-role { font-size: 12px; color: #9CA3AF; margin-top: 2px; }

.logout-link {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 14px;
  border-radius: var(--radius-btn);
  background: rgba(239, 68, 68, 0.1);
  color: #FCA5A5;
  font-weight: 600;
  font-size: 14px;
  transition: var(--transition);
}
.logout-link:hover {
  background: var(--danger);
  color: #FFF;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

/* ---------- MAIN CONTENT ---------- */
.main-content {
  margin-left: 280px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh; /* Ensures footer is pushed to bottom */
}

/* ==================================================
   PREMIUM SAAS TOPBAR (HEADER)
   ================================================== */
.topbar {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  background: rgba(250, 247, 240, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  gap: 20px;
}

/* Dashboard Title Area (20%) */
.topbar-left {
  flex: 0 0 20%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-title {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.3px;
  margin: 0;
  position: relative;
  display: inline-block;
  padding-bottom: 6px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.topbar-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 26px;
  height: 2.5px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

/* Global Search Bar (55%) */
.topbar-center {
  flex: 0 0 55%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 16px;
}
.search-box {
  display: flex;
  align-items: center;
  position: relative;
  width: 100%;
  max-width: 650px;
}
.search-box input {
  width: 100%;
  height: 52px;
  padding-left: 50px;
  padding-right: 20px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: #FFFFFF;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
  font-size: 15px;
  color: var(--text);
  transition: var(--transition);
}
.search-box input::placeholder {
  color: #94A3B8;
  font-weight: 400;
}
.search-box input:hover {
  border-color: #E2E8F0;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}
.search-box input:focus {
  outline: none;
  background: #FFFFFF;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(138, 109, 31, 0.12), 0 4px 15px rgba(0, 0, 0, 0.04);
}
.search-box i {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 18px;
  color: #94A3B8;
  pointer-events: none;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
}
.search-box:focus-within i {
  color: var(--primary);
}
#searchResults {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  width: 100%;
  max-height: 420px;
  overflow-y: auto;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-hover);
  display: none;
  z-index: var(--z-dropdown);
  padding: 8px;
}
.search-item {
  display: block;
  padding: 14px 18px;
  border-radius: 12px;
  transition: var(--transition);
  margin-bottom: 4px;
}
.search-item:hover, .search-item.active {
  background: var(--bg);
}
.search-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 4px;
}
.search-meta { font-size: 12px; color: var(--text-light); }
.search-empty { padding: 24px; text-align: center; color: var(--muted); font-weight: 500; }

/* Right Actions (25%) */
.topbar-right {
  flex: 0 0 25%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
}
.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), #c6a15b);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 8px 20px rgba(138, 109, 31, 0.25);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.quick-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(138, 109, 31, 0.35);
}
.bell-link {
  position: relative;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  border: 1px solid var(--border);
  color: var(--text-light);
  transition: var(--transition);
}
.bell-link:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(138, 109, 31, 0.15);
}
.bell-dot {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid #fff;
}
.profile-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 16px;
  border-left: 1px solid var(--border);
  cursor: pointer;
  transition: opacity 0.3s ease;
}
.profile-menu:hover { opacity: 0.8; }
.profile-details { display: flex; flex-direction: column; }
.profile-name { font-size: 14px; font-weight: 700; color: var(--text); }
.profile-role { font-size: 12px; color: var(--text-light); font-weight: 500; }

/* ---------- CONTENT ---------- */
.content-area {
  padding: 40px;
  flex: 1;
}

/* ---------- MOBILE ---------- */
.mobile-toggle {
  display: none;
  position: fixed;
  left: 16px;
  top: 16px;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #FFF;
  border: 1px solid var(--border);
  color: var(--text);
  z-index: var(--z-mobile-toggle);
  box-shadow: var(--shadow-sm);
}

/* ---------- DASHBOARD GRID ---------- */
.dashboard { display: flex; flex-direction: column; gap: var(--gap); }

/* ---------- SHARED CARD STYLES ---------- */
/* Unifying all card variants to use the exact same premium container */
.card, .stat-card, .form-card, .sidebar-card, .profile-card, .report-card, .team-card, .member-card, .notif-card, .calendar, .chat-window {
  background: var(--card);
  border-radius: var(--radius-card);
  padding: var(--padding-card);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.5);
  transition: var(--transition);
}

/* ---------- STATISTICS GRID & KPI CARDS ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--gap);
  margin-bottom: 8px;
}
.stat-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.stat-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}
.stat-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  margin-bottom: 24px;
  font-size: 24px;
}
.icon-indigo { background: var(--primary-light); color: var(--primary); }
.icon-green { background: var(--success-light); color: var(--success); }
.icon-orange { background: var(--warning-light); color: var(--warning); }
.icon-amber { background: rgba(168, 92, 46, 0.12); color: #D97706; }
.icon-red { background: var(--danger-light); color: var(--danger); }
.icon-cyan { background: rgba(6, 182, 212, 0.12); color: #0891B2; }

.stat-value {
  font-size: 36px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 8px;
  color: var(--text);
}
.stat-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
}
.stat-growth {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
}
.growth-up { background: var(--success-light); color: var(--success); }
.growth-down { background: var(--danger-light); color: var(--danger); }

/* ---------- GRID LAYOUTS ---------- */
.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }

/* ---------- CARD HEADERS ---------- */
.card:hover { transform: translateY(-4px); }
.card-header, .section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.section-title { font-family: var(--font-display); font-size: 19px; font-weight: 600; color: var(--text); }
.card-title { font-family: var(--font-display); font-size: 21px; font-weight: 600; color: var(--text); }
.card-subtitle { font-size: 14px; color: var(--text-light); margin-top: 6px; }
.stat-card-link { display: block; text-decoration: none; color: inherit; }

/* ---------- ANALYTICS BOX ---------- */
.analytics-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  margin-bottom: 16px;
  border-radius: 16px;
  background: #F8FAFC;
  border: 1px solid var(--border);
}
.analytics-title { font-size: 14px; font-weight: 600; color: var(--muted); }
.analytics-value { font-size: 28px; font-weight: 800; color: var(--text); }

/* ---------- PROGRESS BARS ---------- */
.progress-track {
  height: 8px;
  width: 100%;
  border-radius: var(--radius-full);
  background: #E5E7EB;
  overflow: hidden;
  margin-top: 12px;
}
.progress-row { margin-top: 16px; }
.progress-row-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 8px;
}
.range-full { width: 100%; }
.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--primary);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-fill.success { background: var(--success); }
.progress-fill.warning { background: var(--warning); }
.progress-fill.danger { background: var(--danger); }

/* ---------- LIST ITEMS (Tasks, Members) ---------- */
.task-list { display: flex; flex-direction: column; gap: 12px; }
.task-item, .member-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-radius: 16px;
  transition: var(--transition);
  border: 1px solid transparent;
  cursor: pointer;
  background: #FFF;
}
.task-item:hover, .member-item:hover {
  background: #F8FAFC;
  border-color: rgba(138, 109, 31, 0.15);
  transform: translateX(4px);
}
.member-item { border-bottom: 1px solid var(--border); border-radius: 0; padding: 16px 0; }
.member-item:hover { transform: none; background: transparent; opacity: 0.8; }
.member-item:last-child { border: none; }

.task-left, .member-left { display: flex; align-items: center; gap: 16px; }
.task-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.task-title, .member-name { font-weight: 700; font-size: 15px; color: var(--text); }
.task-meta, .member-role { font-size: 13px; color: var(--muted); margin-top: 4px; font-weight: 500; }
.member-progress { width: 160px; }

/* ---------- QUICK ACTIONS ---------- */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.quick-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  border-radius: 18px;
  background: #F8FAFC;
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
}
.quick-card:hover {
  background: var(--card);
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-4px);
}
.quick-card i { font-size: 28px; color: var(--primary); }
.quick-card span { font-size: 14px; font-weight: 700; color: var(--text); }

/* ---------- EMPTY STATE ---------- */
.empty-state { padding: 80px 20px; text-align: center; }
.empty-state .emoji { font-size: 72px; margin-bottom: 24px; }
.empty-state h3 { font-size: 24px; margin-bottom: 12px; font-weight: 700; }
.empty-state p { max-width: 460px; margin: auto; color: var(--muted); font-size: 15px; }

/* ---------- TABLES ---------- */
.table-wrap {
  background: var(--card);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table thead { background: #F8FAFC; }
.data-table th {
  padding: 20px 24px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
}
.data-table td {
  padding: 20px 24px;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
  transition: var(--transition);
  color: var(--text);
  font-weight: 500;
}
.data-table tbody tr { transition: var(--transition); }
.data-table tbody tr:hover { background: #F8FAFC; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.02); }
.data-table tbody tr:last-child td { border-bottom: none; }

.task-title-cell { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.task-description { font-size: 13px; color: var(--muted); line-height: 1.5; margin-top: 4px; }
.task-link { display: block; color: inherit; transition: var(--transition); }
.task-link:hover { color: var(--primary); }

.assignee { display: flex; align-items: center; gap: 12px; }
.assignee-name { font-weight: 600; font-size: 14px; }
.assignee-email { font-size: 12px; color: var(--muted); }

.date { font-size: 14px; font-weight: 600; }
.date.overdue { color: var(--danger); }
.date.today { color: var(--warning); }
.date.completed { color: var(--success); }

/* ---------- BADGES ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: capitalize;
}
.badge-low { background: var(--success-light); color: var(--success); }
.badge-medium { background: var(--warning-light); color: var(--warning); }
.badge-high { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.badge-urgent { background: var(--danger); color: #FFF; }

.badge-pending { background: #F1F5F9; color: #475569; }
.badge-progress { background: var(--primary-light); color: var(--primary); }
.badge-completed { background: var(--success-light); color: var(--success); }
.badge-hold { background: var(--warning-light); color: var(--warning); }
.badge-overdue { background: var(--danger-light); color: var(--danger); }

.badge-link { cursor: pointer; transition: var(--transition); }
.badge-link:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }

/* ---------- FILTER BAR ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  align-items: center;
  background: var(--card);
  padding: 16px;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
}
.filter-group { display: flex; flex-direction: column; gap: 8px; }
.filter-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.filter-bar input, .filter-bar select {
  height: 48px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-input);
  background: #F1F5F9;
  transition: var(--transition);
  font-weight: 500;
}
.filter-bar input:focus, .filter-bar select:focus {
  background: #FFF;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(138, 109, 31, 0.15);
}

/* ---------- ACTION BUTTONS / ICONS ---------- */
.table-actions { display: flex; gap: 10px; }
.icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #FFF;
  border: 1px solid var(--border);
  transition: var(--transition);
  cursor: pointer;
  color: var(--muted);
}
.icon-btn:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); transform: scale(1.05); }
.icon-btn.delete:hover { background: var(--danger-light); border-color: var(--danger); color: var(--danger); }

/* ---------- DROPDOWN ---------- */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  top: 110%;
  right: 0;
  background: #FFF;
  border-radius: 16px;
  box-shadow: var(--shadow-hover);
  border: 1px solid var(--border);
  min-width: 200px;
  display: none;
  overflow: hidden;
  z-index: var(--z-dropdown);
  padding: 8px;
}
.dropdown:hover .dropdown-menu { display: block; animation: fadeUp 0.2s ease; }
.dropdown-menu a {
  display: block;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  transition: var(--transition);
}
.dropdown-menu a:hover { background: #F8FAFC; color: var(--primary); }

/* ---------- PAGINATION ---------- */
.pagination { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 32px; }
.page-link {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px; background: #FFF; border: 1px solid var(--border);
  font-weight: 600; transition: var(--transition); color: var(--text);
}
.page-link:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.page-link.active { background: var(--primary); color: #FFF; border-color: var(--primary); box-shadow: 0 4px 12px rgba(138, 109, 31, 0.3); }

/* ---------- EMPTY TABLE ---------- */
.table-empty { padding: 80px 20px; text-align: center; color: var(--muted); font-weight: 500; }
.table-empty i { font-size: 56px; margin-bottom: 16px; display: block; color: #CBD5E1; }

/* ---------- BUTTONS ---------- */
.btn, .btn-danger, .btn-success, .btn-info, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius-btn);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover, .btn-danger:hover, .btn-success:hover, .btn-info:hover, .btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}
.btn:active, .btn-danger:active, .btn-success:active, .btn-info:active, .btn-secondary:active {
  transform: translateY(1px);
}
.btn-primary { background: var(--primary); color: #FFF; box-shadow: 0 4px 15px rgba(138, 109, 31, 0.3); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #FFF; box-shadow: 0 4px 15px rgba(28, 122, 84, 0.3); }
.btn-danger { background: var(--danger); color: #FFF; box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3); }
.btn-warning { background: var(--warning); color: #FFF; box-shadow: 0 4px 15px rgba(168, 92, 46, 0.3); }
.btn-info { background: var(--info); color: #FFF; box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3); }
.btn-secondary { background: #374151; color: #FFF; }
.btn-secondary:hover { background: #1F2937; }

.btn-outline { background: #FFF; border: 1px solid var(--border); color: var(--text); box-shadow: var(--shadow-sm); }
.btn-outline:hover { background: #F8FAFC; border-color: #CBD5E1; color: var(--primary); }
.btn-sm { padding: 10px 18px; font-size: 13px; }
.btn-lg { padding: 16px 32px; font-size: 16px; }
.btn-block { display: flex; width: 100%; }

/* ---------- FORM CARDS ---------- */
.form-card { max-width: 800px; margin: 0 auto; }
.form-title { font-size: 26px; font-weight: 800; margin-bottom: 10px; }
.form-subtitle { color: var(--muted); margin-bottom: 32px; font-size: 15px; }
.form-actions { display: flex; gap: 12px; margin-top: 24px; }

/* ---------- FORMS ---------- */
.form-group { margin-bottom: 24px; }
.form-label { display: block; margin-bottom: 10px; font-size: 14px; font-weight: 700; color: var(--text); }
.form-control, .form-select, textarea {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-input);
  background: #F1F5F9;
  font-size: 15px;
  color: var(--text);
  transition: var(--transition);
}
textarea { resize: vertical; min-height: 140px; }
.form-control:focus, .form-select:focus, textarea:focus {
  background: #FFF;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(138, 109, 31, 0.15);
}

.checkbox-group { display: flex; align-items: center; gap: 12px; font-weight: 500; cursor: pointer; }
.checkbox-group input { width: 20px; height: 20px; accent-color: var(--primary); cursor: pointer; }
.radio-group { display: flex; gap: 24px; align-items: center; font-weight: 500; cursor: pointer; }
.radio-group input { width: 20px; height: 20px; accent-color: var(--primary); cursor: pointer; }

.input-icon { position: relative; }
.input-icon i { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 18px; }
.input-icon input { padding-left: 50px; }
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }

/* ---------- ALERTS ---------- */
.alert {
  padding: 18px 24px;
  border-radius: 16px;
  margin-bottom: 24px;
  font-size: 15px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 16px;
}
.alert-success { background: var(--success-light); color: var(--success); border: 1px solid rgba(28, 122, 84, 0.2); }
.alert-danger, .alert-error { background: var(--danger-light); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.2); }
.alert-warning { background: var(--warning-light); color: var(--warning); border: 1px solid rgba(168, 92, 46, 0.2); }
.alert-info { background: rgba(59, 130, 246, 0.12); color: var(--info); border: 1px solid rgba(59, 130, 246, 0.2); }

/* ---------- LOGIN PAGE ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 40px;
}
.login-card {
  width: 100%;
  max-width: 480px;
  background: #FFF;
  padding: 48px;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-hover);
  border: 1px solid rgba(255,255,255,0.6);
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo img { width: 80px; margin: 0 auto 20px; border-radius: 20px; box-shadow: var(--shadow-sm); }
.login-title { font-size: 32px; font-weight: 800; text-align: center; margin-bottom: 8px; letter-spacing: -0.5px; }
.login-subtitle { text-align: center; color: var(--muted); margin-bottom: 32px; font-size: 15px; }

/* ---------- MODAL ---------- */
.modal {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
  padding: 24px; z-index: var(--z-modal);
}
.modal.show { display: flex; }
.modal-content {
  width: 100%; max-width: 600px;
  background: #FFF;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 24px 32px; border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 22px; font-weight: 800; }
.modal-body { padding: 32px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 16px;
  padding: 24px 32px; background: #F8FAFC; border-top: 1px solid var(--border);
}

/* ---------- LOADER ---------- */
.loader {
  width: 48px; height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: auto;
}

/* ---------- TASK DETAIL ---------- */
.task-detail { display: grid; grid-template-columns: 2fr 1fr; gap: 32px; align-items: start; }
.task-header { margin-bottom: 32px; }
.task-header-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; }
.task-heading { font-size: 32px; font-weight: 800; line-height: 1.3; margin-bottom: 12px; letter-spacing: -0.5px; }
.task-subtitle { color: var(--muted); font-size: 16px; line-height: 1.7; }
.task-meta-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-top: 32px; }
.meta-box { padding: 20px; background: #F8FAFC; border-radius: 16px; border: 1px solid transparent; transition: var(--transition); }
.meta-box:hover { background: #FFF; border-color: var(--border); box-shadow: var(--shadow-sm); }
.meta-title { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; margin-bottom: 8px; letter-spacing: 0.5px; }
.meta-value { font-weight: 800; font-size: 16px; color: var(--text); }

.sidebar-title { font-size: 20px; font-weight: 800; margin-bottom: 24px; }
.checklist { display: flex; flex-direction: column; gap: 16px; }
.check-item { display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: 16px; transition: var(--transition); background: #F8FAFC; font-weight: 500; }
.check-item:hover { background: #F1F5F9; }
.check-item input { width: 22px; height: 22px; accent-color: var(--primary); cursor: pointer; }
.check-item.completed { opacity: 0.6; text-decoration: line-through; }

/* ---------- TIMELINE ---------- */
.timeline { position: relative; padding-left: 36px; }
.timeline::before { content: ""; position: absolute; left: 14px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 32px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute; left: -30px; top: 4px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--primary); border: 4px solid #FFF;
  box-shadow: 0 0 0 2px var(--primary-light);
}
.timeline-content { background: #F8FAFC; padding: 20px; border-radius: 16px; transition: var(--transition); }
.timeline-content:hover { background: #FFF; box-shadow: var(--shadow-sm); }
.timeline-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.timeline-time { font-size: 13px; color: var(--muted); margin-bottom: 12px; font-weight: 500; }
.timeline-text { font-size: 14px; color: var(--text); line-height: 1.6; }

/* ---------- COMMENTS ---------- */
.comment-list { display: flex; flex-direction: column; gap: 24px; }
.comment { display: flex; gap: 16px; align-items: flex-start; }
.comment-avatar { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #FFF; background: var(--primary); flex-shrink: 0; box-shadow: var(--shadow-sm); }
.comment-body { flex: 1; background: #F8FAFC; padding: 20px; border-radius: 20px; border-top-left-radius: 4px; }
.comment-author { font-weight: 800; font-size: 15px; margin-bottom: 4px; }
.comment-date { font-size: 12px; color: var(--muted); margin-bottom: 12px; font-weight: 500; }
.comment-text { line-height: 1.7; color: var(--text); font-size: 14px; }
.comment-actions { display: flex; gap: 16px; margin-top: 16px; font-size: 13px; }
.comment-actions a { color: var(--primary); font-weight: 700; }
.comment-form { margin-top: 32px; }

/* ---------- ATTACHMENTS ---------- */
.attachment-list { display: flex; flex-direction: column; gap: 16px; }
.attachment { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background: #F8FAFC; border-radius: 16px; transition: var(--transition); border: 1px solid transparent; }
.attachment:hover { background: #FFF; border-color: var(--primary-light); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.attachment-left { display: flex; align-items: center; gap: 16px; }
.file-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--primary-light); display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--primary); }
.file-name { font-weight: 700; font-size: 14px; }
.file-size { font-size: 13px; color: var(--muted); font-weight: 500; }

/* ---------- CHAT ---------- */
.chat-window { display: flex; flex-direction: column; height: 650px; padding: 0; overflow: hidden; }
.chat-header { padding: 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; background: #FFF; z-index: 10; }
.chat-title { font-size: 20px; font-weight: 800; }
.chat-messages { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 20px; background: #F8FAFC; }
.message { max-width: 75%; padding: 16px 20px; border-radius: 20px; font-size: 14px; line-height: 1.6; position: relative; font-weight: 500; }
.message-left { align-self: flex-start; background: #FFF; border: 1px solid var(--border); border-bottom-left-radius: 4px; box-shadow: var(--shadow-sm); }
.message-right { align-self: flex-end; background: var(--primary); color: #FFF; border-bottom-right-radius: 4px; box-shadow: 0 4px 15px rgba(138, 109, 31, 0.2); }
.message-time { margin-top: 8px; font-size: 11px; opacity: 0.7; font-weight: 600; }
.chat-input { display: flex; gap: 16px; padding: 20px 24px; border-top: 1px solid var(--border); background: #FFF; z-index: 10; }
.chat-input input { flex: 1; height: 52px; padding: 0 24px; border: 1px solid transparent; border-radius: var(--radius-full); background: #F1F5F9; font-size: 15px; transition: var(--transition); }
.chat-input input:focus { background: #FFF; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); }
.chat-send { width: 52px; height: 52px; border-radius: 50%; background: var(--primary); color: #FFF; display: flex; align-items: center; justify-content: center; transition: var(--transition); box-shadow: 0 4px 15px rgba(138, 109, 31, 0.3); }
.chat-send:hover { transform: scale(1.05); background: var(--primary-dark); }

/* ---------- IMAGE PREVIEW ---------- */
.image-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; margin-top: 24px; }
.image-preview img { width: 100%; height: 140px; object-fit: cover; border-radius: 16px; transition: var(--transition); cursor: pointer; }
.image-preview img:hover { transform: scale(1.03); box-shadow: var(--shadow); }

/* ---------- NOTIFICATIONS ---------- */
.notif-card { padding: 32px; }
.notif-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.notif-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.notif-filter-btn { background: #F1F5F9; color: var(--muted); font-size: 13px; font-weight: 600; padding: 10px 20px; border-radius: var(--radius-full); transition: var(--transition); }
.notif-filter-btn:hover { background: #E5E7EB; color: var(--text); }
.notif-filter-btn.active { background: var(--primary); color: #FFF; box-shadow: 0 4px 12px rgba(138, 109, 31, 0.3); }
.notif-list { display: flex; flex-direction: column; gap: 12px; }
.notif-item-card, .notification-item { display: flex; align-items: flex-start; gap: 16px; padding: 20px; border-radius: 20px; background: #FFF; border: 1px solid var(--border); transition: var(--transition); text-decoration: none; color: inherit; position: relative; cursor: pointer; }
.notif-item-card:hover, .notification-item:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: rgba(138, 109, 31, 0.1); }
.notif-item-card.is-unread { background: #F8FAFC; border-left: 4px solid var(--primary); }
.notif-item-icon, .notification-icon { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; font-size: 20px; }
.mc-blue, .notification-primary { background: var(--primary-light); color: var(--primary); }
.mc-green, .notification-success { background: var(--success-light); color: var(--success); }
.mc-amber, .notification-warning { background: var(--warning-light); color: var(--warning); }
.mc-purple { background: rgba(168,85,247,0.1); color: #A855F7; }
.mc-red, .notification-danger { background: var(--danger-light); color: var(--danger); }
.notif-item-body, .notification-content { flex: 1; min-width: 0; padding-top: 2px; }
.notif-item-title, .notification-title { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.5; margin-bottom: 4px; }
.notification-text { font-size: 14px; color: var(--muted); line-height: 1.6; }
.notif-item-time, .notification-time { font-size: 13px; color: var(--muted); font-weight: 500; margin-top: 6px; }
.notif-unread-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); flex: 0 0 auto; margin-top: 6px; }
.notif-empty-filtered { text-align: center; padding: 40px; color: var(--muted); font-size: 15px; font-weight: 500; }

/* ---------- PROFILE ---------- */
.profile-cover { height: 200px; background: linear-gradient(135deg, var(--primary), var(--secondary)); }
.profile-body { padding: 40px; text-align: center; }
.profile-avatar { width: 130px; height: 130px; margin: -105px auto 24px; border-radius: 50%; background: #FFF; padding: 6px; box-shadow: var(--shadow); }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 32px; }
.profile-stat { padding: 24px; background: #F8FAFC; border-radius: 20px; transition: var(--transition); border: 1px solid transparent; }
.profile-stat:hover { background: #FFF; border-color: var(--border); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.profile-stat-number { font-size: 32px; font-weight: 800; color: var(--text); }
.profile-stat-label { font-size: 13px; color: var(--muted); margin-top: 6px; font-weight: 600; text-transform: uppercase; }

/* ---------- TEAM MEMBERS ---------- */
.members-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.members-toolbar-count { font-size: 15px; font-weight: 600; color: var(--muted); }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--gap); }
.member-card, .team-card { text-align: center; display: flex; flex-direction: column; }
.member-card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.member-status-pill { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: var(--radius-full); }
.member-status-pill .dot { width: 8px; height: 8px; border-radius: 50%; }
.member-status-pill.is-active { background: var(--success-light); color: var(--success); }
.member-status-pill.is-active .dot { background: var(--success); }
.member-status-pill.is-inactive { background: #F1F5F9; color: var(--muted); }
.member-status-pill.is-inactive .dot { background: #9CA3AF; }
.team-avatar { width: 90px; height: 90px; margin: auto; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; color: #FFF; font-size: 32px; font-weight: 700; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.member-name, .team-name { font-size: 20px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.member-role, .team-role { font-size: 13px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 16px; }
.member-email, .team-email { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 24px; font-weight: 500; word-break: break-all; }
.member-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 20px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.member-stat { text-align: center; }
.member-stat-value { font-size: 22px; font-weight: 800; color: var(--text); }
.member-stat-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }
.member-progress, .team-progress { margin-top: 0; margin-bottom: 24px; }
.member-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: auto; }
.member-actions .btn { flex: 1 1 auto; padding: 12px; font-size: 13px; }

/* ---------- REPORTS ---------- */
.reports-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 24px; margin-bottom: 32px; }
.reports-header-left h1 { margin: 0; font-size: 32px; font-weight: 800; color: var(--text); letter-spacing: -0.5px; }
.reports-header-left p { margin-top: 8px; color: var(--muted); font-size: 15px; font-weight: 500; }
.reports-header-right { display: flex; gap: 12px; flex-wrap: wrap; }
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--gap); }
.report-card { text-align: left; }
.report-title { font-size: 16px; font-weight: 700; color: var(--muted); margin-bottom: 16px; }
.report-value { font-size: 42px; font-weight: 800; color: var(--text); margin-bottom: 16px; line-height: 1; }
.report-change { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: var(--radius-full); font-size: 13px; font-weight: 700; }
.report-positive { background: var(--success-light); color: var(--success); }
.report-negative { background: var(--danger-light); color: var(--danger); }
.chart-box { height: 380px; display: flex; align-items: center; justify-content: center; border: 2px dashed var(--border); border-radius: 20px; background: #F8FAFC; font-size: 15px; color: var(--muted); font-weight: 600; }

/* ---------- EXPORTS ---------- */
.export-dropdown { position: relative; }
.export-menu { position: absolute; top: 110%; right: 0; min-width: 240px; background: #FFF; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-hover); display: block; visibility: hidden; opacity: 0; transform: translateY(-10px); transition: var(--transition); z-index: var(--z-dropdown); padding: 8px; }
.export-menu.show { visibility: visible; opacity: 1; transform: translateY(0); }
.export-menu a { display: flex; align-items: center; gap: 12px; padding: 14px 16px; font-size: 14px; font-weight: 600; color: var(--text); transition: var(--transition); border-radius: 12px; }
.export-menu a:hover { background: #F8FAFC; color: var(--primary); padding-left: 20px; }
.export-menu-icon { font-size: 18px; line-height: 1; }
.export-menu a small { margin-left: auto; font-weight: 600; color: var(--muted); font-size: 11px; }
.export-menu a:hover small { color: var(--primary); }

.export-loading { position: fixed; inset: 0; background: rgba(17, 24, 39, 0.4); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 99999; opacity: 0; visibility: hidden; transition: var(--transition); }
.export-loading.show { opacity: 1; visibility: visible; }
.export-loading-box { background: #FFF; border-radius: var(--radius-card); padding: 32px 40px; display: flex; align-items: center; gap: 20px; font-weight: 700; color: var(--text); font-size: 16px; box-shadow: var(--shadow-hover); }
.export-spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--primary); animation: spin 0.8s linear infinite; flex-shrink: 0; }

/* ---------- CALENDAR ---------- */
.calendar-header { display: flex; justify-content: space-between; align-items: center; padding: 24px 32px; border-bottom: 1px solid var(--border); }
.calendar-title { font-size: 20px; font-weight: 800; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.calendar-day-name { padding: 20px; text-align: center; font-size: 13px; font-weight: 700; background: #F8FAFC; color: var(--muted); border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: 0.5px; }
.calendar-day { height: 110px; padding: 12px; border-right: 1px solid #F1F5F9; border-bottom: 1px solid #F1F5F9; position: relative; transition: var(--transition); cursor: pointer; }
.calendar-day:hover { background: #F8FAFC; }
.calendar-day.today { background: var(--primary-light); }
.calendar-date { font-size: 14px; font-weight: 700; color: var(--text); }
.calendar-event { margin-top: 10px; padding: 6px 10px; font-size: 11px; font-weight: 600; border-radius: var(--radius-sm); background: var(--primary); color: #FFF; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- STATS MINI CARD ---------- */
.mini-stat { display: flex; align-items: center; justify-content: space-between; padding: 24px; border-radius: var(--radius-card); background: var(--card); box-shadow: var(--shadow-sm); border: 1px solid rgba(255,255,255,0.5); margin-bottom: 20px; transition: var(--transition); }
.mini-stat:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.mini-stat-icon { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; border-radius: 16px; background: var(--primary-light); color: var(--primary); font-size: 24px; }
.mini-stat-value { font-size: 32px; font-weight: 800; color: var(--text); line-height: 1.1; }
.mini-stat-label { font-size: 14px; font-weight: 600; color: var(--muted); margin-top: 4px; }

/* ---------- TOAST NOTIFICATIONS ---------- */
.toast-container { position: fixed; top: 32px; right: 32px; z-index: var(--z-toast); display: flex; flex-direction: column; gap: 16px; }
.toast { display: flex; align-items: center; gap: 16px; min-width: 340px; padding: 20px 24px; background: #FFF; border-radius: 16px; border: 1px solid var(--border); box-shadow: var(--shadow-hover); animation: toastSlide 0.4s cubic-bezier(0.16, 1, 0.3, 1); font-weight: 600; font-size: 14px; }
@keyframes toastSlide { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: translateX(0); } }
.toast-success { border-left: 6px solid var(--success); }
.toast-warning { border-left: 6px solid var(--warning); }
.toast-danger { border-left: 6px solid var(--danger); }
.toast-info { border-left: 6px solid var(--info); }
.update-toast { position: fixed; right: 32px; bottom: 32px; width: 340px; background: #FFF; padding: 24px; border-radius: var(--radius-card); box-shadow: var(--shadow-hover); z-index: 99999; animation: fadeUp 0.4s ease; border: 1px solid var(--border); }
.update-toast button { margin-top: 20px; padding: 14px; background: var(--primary); color: #FFF; border-radius: var(--radius-btn); font-weight: 600; width: 100%; transition: var(--transition); }
.update-toast button:hover { background: var(--primary-dark); transform: translateY(-2px); }

/* ---------- SKELETON LOADING ---------- */
.skeleton { position: relative; overflow: hidden; background: #E5E7EB; border-radius: var(--radius-sm); }
.skeleton::after { content: ""; position: absolute; top: 0; left: -150%; width: 150%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent); animation: skeletonMove 1.5s ease-in-out infinite; }
@keyframes skeletonMove { 100% { left: 150%; } }

/* ---------- AVATAR GROUP ---------- */
.avatar-group { display: flex; align-items: center; }
.avatar-group .avatar { margin-left: -12px; border: 3px solid #FFF; transition: var(--transition); }
.avatar-group .avatar:hover { transform: translateY(-4px); z-index: 10; }
.avatar-group .avatar:first-child { margin-left: 0; }

/* ---------- DIVIDERS ---------- */
.divider { height: 1px; background: var(--border); margin: 32px 0; }
.vertical-divider { width: 1px; background: var(--border); align-self: stretch; }

/* ---------- BADGES EXTRA ---------- */
.badge-outline { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.badge-round { border-radius: var(--radius-full); }

/* ---------- HELPERS ---------- */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: var(--shadow); }
.shadow-lg { box-shadow: var(--shadow-hover); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded { border-radius: var(--radius-btn); }
.rounded-lg { border-radius: var(--radius-card); }
.rounded-full { border-radius: var(--radius-full); }
.flex { display: flex; } .inline-flex { display: inline-flex; }
.block { display: block; } .inline-block { display: inline-block; }
.grid { display: grid; }
.items-center { align-items: center; } .items-start { align-items: flex-start; } .items-end { align-items: flex-end; }
.justify-center { justify-content: center; } .justify-end { justify-content: flex-end; }
.w-auto { width: auto; } .w-25 { width: 25%; } .w-50 { width: 50%; } .w-75 { width: 75%; }
.h-100 { height: 100%; }
.p-0 { padding: 0; } .p-1 { padding: 8px; } .p-2 { padding: 16px; } .p-3 { padding: 24px; } .p-4 { padding: 32px; }
.m-0 { margin: 0; } .m-1 { margin: 8px; } .m-2 { margin: 16px; } .m-3 { margin: 24px; } .m-4 { margin: 32px; }
.text-primary { color: var(--primary); } .text-success { color: var(--success); } .text-warning { color: var(--warning); } .text-danger { color: var(--danger); } .text-muted { color: var(--muted); }
.font-bold { font-weight: 700; } .font-black { font-weight: 800; }
.text-xs { font-size: 12px; } .text-sm { font-size: 14px; } .text-md { font-size: 16px; } .text-lg { font-size: 20px; } .text-xl { font-size: 28px; }
.bg-white { background: #FFF; } .bg-light { background: #F8FAFC; }
.bg-primary { background: var(--primary); color: #FFF; } .bg-success { background: var(--success); color: #FFF; } .bg-warning { background: var(--warning); color: #FFF; } .bg-danger { background: var(--danger); color: #FFF; }

/* ---------- FOOTER ---------- */
.mc-footer {
  background: #FFFFFF;
  border-top: 1px solid #E5E7EB;
  margin-top: auto; 
  width: 100%;
}
.mc-footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}
.mc-footer-brand {
  font-size: 20px;
  font-weight: 700;
  color: var(--text, #111827);
}
.mc-footer-tagline {
  font-size: 14px;
  color: #6B7280;
}
.mc-footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
}
.mc-footer-nav a {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-light, #6B7280);
  text-decoration: none;
  transition: color 0.2s ease, text-decoration 0.2s ease;
}
.mc-footer-nav a:hover {
  color: var(--primary, #8A6D1F);
  text-decoration: underline;
}
.mc-footer-copy {
  font-size: 13px;
  color: #9CA3AF;
  margin-top: 8px;
}

/* ---------- ACCESSIBILITY ---------- */
:focus-visible { outline: 3px solid rgba(138, 109, 31, 0.4); outline-offset: 2px; }
button:disabled, input:disabled, select:disabled, textarea:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- PRINT ---------- */
@media print {
  .sidebar, .topbar, .btn, .pagination, .filter-bar, .mobile-toggle, .toast-container, .export-loading, .export-menu, .mc-footer { display: none !important; }
  .main-content { margin: 0; }
  .content-area { padding: 0; }
  .card, .table-wrap, .stat-card { box-shadow: none; border: 1px solid #CCC; break-inside: avoid; }
  body { background: #FFF; color: #000; font-size: 12pt; }
}

/* ---------- DARK MODE (Prepared for modern styling) ---------- */
body.dark {
  --bg: #0B1120;
  --card: #111827;
  --text: #F9FAFB;
  --text-light: #9CA3AF;
  --border: #1F2937;
  background: var(--bg);
  color: var(--text);
}
body.dark .card, body.dark .table-wrap, body.dark .sidebar-card, body.dark .form-card, body.dark .modal-content, body.dark .profile-card, body.dark .report-card, body.dark .team-card, body.dark .member-card, body.dark .notif-card, body.dark .calendar, body.dark .chat-window, body.dark .stat-card {
  background: var(--card); border-color: var(--border); box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
body.dark .topbar, body.dark .mc-footer { background: rgba(17, 24, 39, 0.85); border-color: var(--border); }
body.dark .data-table thead, body.dark .data-table th { background: #1F2937; color: var(--text-light); }
body.dark .data-table td { border-bottom-color: var(--border); }
body.dark .data-table tbody tr:hover { background: rgba(255,255,255,0.02); }
body.dark input, body.dark textarea, body.dark select, body.dark .search-box input { background: #1F2937; color: #FFF; border-color: transparent; }
body.dark .task-item:hover, body.dark .member-item:hover, body.dark .comment-body, body.dark .timeline-content { background: #1F2937; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1400px) {
  .content-area { padding: 32px; }
  .search-box { max-width: 480px; }
}

@media (max-width: 1200px) {
  .stats-grid, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .search-box { max-width: 380px; }
}

@media (max-width: 992px) {
  .sidebar { width: 88px; }
  .sidebar-brand { padding: 24px 0; justify-content: center; }
  .sidebar-brand > div { display: none; }
  .sidebar-nav { padding: 16px 12px; }
  .sidebar-nav a { justify-content: center; padding: 14px 0; gap: 0; }
  .sidebar-nav a > span:not(.nav-icon) { display: none; }
  .nav-icon { margin: 0; }
  .sidebar-user { justify-content: center; padding: 12px; }
  .sidebar-user > div:not(.avatar) { display: none; }
  .logout-link { font-size: 0; padding: 14px; }
  .main-content { margin-left: 88px; }
  .content-area { padding: 24px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .task-detail, .task-meta-grid, .report-grid, .team-grid { grid-template-columns: 1fr; }
  .btn, .icon-btn, .page-link, .quick-action-btn, .bell-link { min-height: 48px; }

  /* The topbar's 20% / 55% / 25% split was tuned for a full-width
     desktop sidebar. Once the sidebar shrinks to an icon rail there's
     materially less room, so let the title and actions size to their
     own content instead of a fixed fraction that squeezes them. */
  .topbar { padding: 0 24px; gap: 12px; }
  .topbar-left { flex: 1 1 auto; }
  .topbar-center { flex: 1 1 auto; min-width: 0; }
  .topbar-right { flex: 0 0 auto; gap: 12px; }
  .search-box { max-width: 100%; }
  .profile-menu { padding-left: 12px; gap: 8px; }
}

@media (max-width: 768px) {
  .sidebar { width: 280px; transform: translateX(-100%); z-index: var(--z-sidebar); }
  .sidebar.open { transform: translateX(0); box-shadow: 20px 0 50px rgba(0,0,0,0.5); }
  .sidebar-brand > div, .sidebar-nav a > span:not(.nav-icon), .sidebar-user > div:not(.avatar) { display: flex; }
  .sidebar-brand { justify-content: flex-start; padding: 32px 24px; }
  .sidebar-nav a { justify-content: flex-start; padding: 14px 18px; gap: 14px; }
  .logout-link { font-size: 14px; }
  .main-content { margin-left: 0; }
  .mobile-toggle { display: flex; align-items: center; justify-content: center; }
  .topbar { padding-left: 80px; padding-right: 16px; height: auto; min-height: 88px; flex-wrap: wrap; padding-top: 16px; padding-bottom: 16px; gap: 10px; }
  .topbar-center { order: 3; width: 100%; flex-basis: 100%; padding: 4px 0 0; }
  .search-box { width: 100%; max-width: 100%; }
  .topbar-right { gap: 8px; }
  .quick-action-btn { padding: 0 14px; }
  .quick-action-btn span { display: none; }
  .profile-details { display: none; }
  .profile-menu { padding-left: 8px; gap: 6px; }
  .stats-grid, .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .card, .stat-card, .form-card, .sidebar-card, .member-card, .notif-card { padding: 24px; }
  .content-area { padding: 24px; }
  .quick-actions { grid-template-columns: 1fr; }
  .member-progress { width: 100px; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar input, .filter-bar select { width: 100%; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { min-width: 800px; }
  .table-actions { flex-wrap: wrap; }
  .form-row, .profile-stats { grid-template-columns: 1fr; }
  .toast { min-width: calc(100vw - 48px); }
  .btn { width: 100%; justify-content: center; }
  .export-dropdown { width: 100%; }
  .export-menu { min-width: 100%; }
}

@media (max-width: 576px) {
  .content-area { padding: 16px; }
  .task-header, .card, .form-card, .stat-card, .member-card, .notif-card { padding: 20px; }
  .modal-content { max-width: 95%; }
  .modal-header, .modal-body, .modal-footer { padding: 18px 20px; }
  .modal-footer { flex-wrap: wrap; }
  .modal-footer .btn { flex: 1 1 auto; }
  .chat-window { height: 500px; }
  .stat-value { font-size: 32px; }
  .topbar-title { font-size: 20px; }
  .member-actions .btn { flex: 1 1 100%; }
  .notif-toolbar { flex-direction: column; align-items: stretch; }
  .reports-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 400px) {
  .stat-card { padding: 16px; }
  .stat-value { font-size: 28px; }
  .stat-icon { width: 48px; height: 48px; font-size: 20px; }
  .avatar { width: 36px; height: 36px; }
  .topbar { padding-left: 70px; }
  .mobile-toggle { left: 12px; top: 12px; width: 44px; height: 44px; }
}
/* ==================================================
   ENTERPRISE SIDEBAR NAVIGATION — collapsible groups
   (additive only, nothing above this line was changed)
   ================================================== */

/* Quick-add CTA sits between Dashboard and the groups, visually
   distinct so it reads as an action rather than a nav destination. */
.nav-quick-add {
  border: 1px dashed rgba(255,255,255,0.14);
}
.nav-quick-add:hover {
  border-color: rgba(255,255,255,0.28);
}

.sidebar-group { display: flex; flex-direction: column; }

.sidebar-group-toggle {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 14px 18px; margin-bottom: 8px; border-radius: var(--radius-btn);
  font-weight: 600; font-size: 14px; color: #9CA3AF;
  background: none; border: none; cursor: pointer; transition: var(--transition);
  text-align: left;
}
.sidebar-group-toggle:hover { background: var(--sidebar-hover); color: #FFF; }
.sidebar-group-toggle:focus-visible { outline: 2px solid rgba(255,255,255,0.5); outline-offset: -2px; }
.sidebar-group-toggle.active { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #FFF; box-shadow: 0 8px 20px rgba(138, 109, 31, 0.3); }

.sidebar-group-toggle .sidebar-group-chevron {
  margin-left: auto; width: 16px; height: 16px; flex-shrink: 0;
  transition: transform 250ms ease;
}
.sidebar-group.open .sidebar-group-toggle .sidebar-group-chevron { transform: rotate(180deg); }

.sidebar-subnav {
  max-height: 0; overflow: hidden; display: flex; flex-direction: column;
  padding-left: 40px; transition: max-height 250ms ease, opacity 250ms ease;
  opacity: 0;
}
.sidebar-group.open .sidebar-subnav { max-height: 640px; opacity: 1; }

.sidebar-subnav a {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px; font-size: 13.5px; font-weight: 600; color: #9CA3AF;
  border-radius: 10px; margin-bottom: 4px; transition: var(--transition);
}
.sidebar-subnav a:hover { color: #FFF; background: var(--sidebar-hover); transform: translateX(4px); }
.sidebar-subnav a.active { color: #FFF; background: var(--primary); }
.sidebar-subnav a .nav-badge { margin-left: auto; padding: 2px 8px; font-size: 10px; }

/* ---------- COLLAPSED ICON RAIL (matches the flat nav-item rail
   behaviour already defined above at the 992px breakpoint) ---------- */
@media (max-width: 992px) {
  .sidebar-group-toggle { justify-content: center; padding: 14px 0; gap: 0; }
  .sidebar-group-toggle > span:not(.nav-icon) { display: none; }
  .sidebar-group-toggle .sidebar-group-chevron { display: none; }
  .sidebar-subnav { display: none; }
}

/* ---------- MOBILE OVERLAY SIDEBAR: restore full group layout ---------- */
@media (max-width: 768px) {
  .sidebar-group-toggle { justify-content: flex-start; padding: 14px 18px; gap: 14px; }
  .sidebar-group-toggle > span:not(.nav-icon) { display: flex; }
  .sidebar-group-toggle .sidebar-group-chevron { display: block; }
  .sidebar-subnav { display: flex; }
}

/* ============================================================
   Money Culture CRM — Notification Bell / Popover v2
   ============================================================ */
.notification-menu{position:relative;display:flex;align-items:center}
.bell-link{position:relative}
.notification-count{position:absolute;top:-7px;right:-8px;min-width:18px;height:18px;padding:0 4px;border-radius:999px;background:#b42318;color:#fff;font-size:10px;font-weight:800;line-height:18px;text-align:center;border:2px solid #fff;display:none}
.notification-count.has-count{display:block}
.notification-panel{position:absolute;right:0;top:calc(100% + 12px);width:380px;background:#fff;border:1px solid #e2e8f0;border-radius:18px;box-shadow:0 20px 50px rgba(15,23,42,.16);z-index:1200;overflow:hidden}
.notification-panel[hidden]{display:none}
.notification-panel-head{display:flex;align-items:center;justify-content:space-between;padding:16px 17px;border-bottom:1px solid #eef2f7}
.notification-panel-head strong{display:block;font-size:15px;color:#0f172a}
.notification-panel-head span{display:block;margin-top:2px;font-size:11px;color:#64748b}
.notification-panel-head>a{font-size:12px;font-weight:700;color:#8a6d1f;text-decoration:none}
.notification-panel-list{max-height:360px;overflow:auto}
.notification-panel-item{display:flex;align-items:flex-start;gap:11px;padding:13px 15px;text-decoration:none;border-bottom:1px solid #f1f5f9;position:relative;transition:background .18s ease}
.notification-panel-item:hover{background:#f8fafc}
.notification-panel-item.is-unread{background:#fffdf5}
.notification-panel-icon{width:34px;height:34px;border-radius:11px;display:flex;align-items:center;justify-content:center;background:#f3f4f6;color:#64748b;flex:none}
.notification-panel-icon svg{width:16px;height:16px}
.notification-panel-icon.type-task,.notification-panel-icon.type-tasks{background:#fff7ed;color:#c2410c}
.notification-panel-icon.type-comment,.notification-panel-icon.type-comments{background:#eff6ff;color:#2563eb}
.notification-panel-icon.type-chat{background:#f5f3ff;color:#7c3aed}
.notification-panel-copy{min-width:0;flex:1}
.notification-panel-copy strong{display:block;font-size:12.5px;line-height:1.45;color:#1e293b;font-weight:650;white-space:normal}
.notification-panel-copy small{display:block;margin-top:4px;color:#94a3b8;font-size:10.5px}
.notification-panel-unread{width:7px;height:7px;border-radius:50%;background:#b42318;flex:none;margin-top:6px}
.notification-panel-empty{display:flex;align-items:center;justify-content:center;gap:8px;padding:32px 15px;color:#94a3b8;font-size:12px}
.notification-panel-empty svg{width:17px;height:17px}
.notification-panel-foot{padding:11px 15px;background:#fafbfc;border-top:1px solid #eef2f7}
.notification-panel-foot a{display:flex;align-items:center;justify-content:center;gap:6px;color:#8a6d1f;text-decoration:none;font-size:12px;font-weight:750}
.notification-panel-foot svg{width:14px;height:14px}
@media(max-width:640px){
 .notification-panel{position:fixed;left:12px;right:12px;top:72px;width:auto;max-height:calc(100vh - 88px)}
 .notification-panel-list{max-height:calc(100vh - 210px)}
}


/* ============================================================
   NOTIFICATION POPOVER — VIEWPORT-SAFE FIX
   UI-only: keeps existing notification logic and markup unchanged.
   ============================================================ */
.notification-panel{
  position:fixed;
  top:100px;
  right:24px;
  left:auto;
  width:min(380px, calc(100vw - 32px));
  max-width:calc(100vw - 32px);
  max-height:calc(100dvh - 120px);
  overflow:hidden;
  box-sizing:border-box;
  z-index:9999;
}

.notification-panel-list{
  max-height:min(420px, calc(100dvh - 250px));
  overflow-y:auto;
  overflow-x:hidden;
  -webkit-overflow-scrolling:touch;
}

.notification-panel-item{
  min-width:0;
  box-sizing:border-box;
}

.notification-panel-copy{
  min-width:0;
  max-width:100%;
  overflow:hidden;
}

.notification-panel-copy strong{
  overflow-wrap:anywhere;
  word-break:break-word;
  white-space:normal;
}

.notification-panel-copy small{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

@media (max-width:768px){
  .notification-panel{
    top:calc(64px + env(safe-area-inset-top));
    right:12px;
    left:12px;
    width:auto;
    max-width:none;
    max-height:calc(100dvh - 88px - env(safe-area-inset-top));
    border-radius:16px;
  }

  .notification-panel-list{
    max-height:calc(100dvh - 230px - env(safe-area-inset-top));
  }
}

@media (max-width:400px){
  .notification-panel{
    right:8px;
    left:8px;
  }
}



/* ============================================================
   MONEY CULTURE CRM — LEVEL 1 GLOBAL SHELL
   Sidebar is rendered by includes/header.php in this project.
   Visual/layout layer only; existing functionality preserved.
   ============================================================ */

html,body{min-height:100%}
body{background:#F5F8F7;color:#18231F}

/* Full-height app shell */
.app-shell{min-height:100vh}

/* Sidebar: fixed-height, independently scrollable navigation */
.sidebar{
  height:100vh;
  min-height:100vh;
  background:#082F25;
  color:#fff;
  overflow:hidden;
}
.sidebar-nav{
  overflow-y:auto;
  overflow-x:hidden;
  height:calc(100vh - 150px);
  padding-bottom:12px;
  scrollbar-width:thin;
  scrollbar-color:rgba(255,255,255,.20) transparent;
}
.sidebar-nav::-webkit-scrollbar{width:5px}
.sidebar-nav::-webkit-scrollbar-track{background:transparent}
.sidebar-nav::-webkit-scrollbar-thumb{
  background:rgba(255,255,255,.20);
  border-radius:10px;
}

/* Compact brand area */
.sidebar-brand{
  min-height:76px;
  padding:14px 18px;
}

/* Compact navigation rhythm */
.sidebar-nav>a,
.sidebar-group-toggle{
  min-height:42px;
  border-radius:9px;
}
.sidebar-nav>a:hover,
.sidebar-group-toggle:hover{
  background:rgba(54,168,117,.15);
}
.sidebar-nav>a.active,
.sidebar-group-toggle.active{
  background:#0F6B4F!important;
  color:#fff!important;
  box-shadow:none!important;
}
.sidebar-subnav a{
  min-height:36px;
}

/* Bottom/user controls stay accessible where the existing shell provides them */
.sidebar-user,
.sidebar-footer,
.sidebar-bottom{
  flex-shrink:0;
}

/* Global top/header area */
.topbar,.main-header,.mc-topbar{
  background:#fff;
  border-bottom:1px solid #E1E9E5;
}

/* Main content uses the available horizontal space */
.main-content,.content-area,.page-content{
  width:100%;
  max-width:none;
}

/* Primary actions: remove gold as the global primary */
.btn-primary,
button.btn-primary,
a.btn-primary{
  background:#0F6B4F!important;
  border-color:#0F6B4F!important;
  color:#fff!important;
  box-shadow:none!important;
}
.btn-primary:hover,
button.btn-primary:hover,
a.btn-primary:hover{
  background:#0B5741!important;
  border-color:#0B5741!important;
}

/* Standard focus */
input:focus,select:focus,textarea:focus,
.form-control:focus,.form-select:focus{
  border-color:#36A875!important;
  box-shadow:0 0 0 3px rgba(54,168,117,.14)!important;
  outline:0;
}

/* Responsive shell */
@media (max-width:900px){
  .sidebar{height:100dvh;min-height:100dvh}
  .sidebar-nav{height:calc(100dvh - 145px)}
}
@media (max-width:640px){
  .sidebar-brand{min-height:68px;padding:12px 15px}
  .main-content,.content-area,.page-content{
    padding-left:16px!important;
    padding-right:16px!important;
  }
}



/* ============================================================
   MONEY CULTURE CRM — LEVEL 2 PAGE SYSTEM
   Global page-header, actions, filters and component hierarchy.
   Visual/layout only. No business logic.
   ============================================================ */

:root{
  --mc-page-pad:clamp(16px,2.2vw,32px);
  --mc-section-gap:24px;
  --mc-card-radius:15px;
  --mc-control-height:42px;
  --mc-title-size:clamp(26px,2.2vw,32px);
}

/* Standard page header */
.page-header,.mc-page-header{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:20px;
  width:100%;
  margin:0 0 20px;
  padding:0;
}
.page-header-content,.mc-page-header-content{
  min-width:0;
  flex:1 1 auto;
}
.page-eyebrow,.mc-page-eyebrow,.page-header .eyebrow{
  margin:0 0 5px;
  color:#0F6B4F;
  font-size:11px;
  line-height:1.2;
  font-weight:750;
  letter-spacing:.09em;
  text-transform:uppercase;
}
.page-header h1,.page-title,.mc-page-title{
  margin:0;
  color:#18231F;
  font-size:var(--mc-title-size);
  line-height:1.15;
  font-weight:700;
  letter-spacing:-.02em;
}
.page-description,.mc-page-description,.page-header .description{
  margin:7px 0 0;
  max-width:760px;
  color:#728079;
  font-size:14px;
  line-height:1.5;
}

/* Page action groups */
.page-actions,.mc-page-actions,.page-header-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
  gap:8px;
  flex:0 0 auto;
}
.page-actions .btn,.mc-page-actions .btn,.page-header-actions .btn,.btn{
  min-height:40px;
  border-radius:9px;
  font-weight:600;
}

/* Secondary actions */
.btn-secondary,.btn-outline-secondary,
button.btn-secondary,a.btn-secondary{
  background:#fff!important;
  border-color:#E1E9E5!important;
  color:#30413A!important;
  box-shadow:none!important;
}
.btn-secondary:hover,.btn-outline-secondary:hover,
button.btn-secondary:hover,a.btn-secondary:hover{
  background:#F5F8F7!important;
  border-color:#CBD8D2!important;
}

/* Search/filter bar */
.filter-bar,.filters-bar,.search-filter-bar,.mc-filter-bar{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:10px;
  width:100%;
  margin:0 0 var(--mc-section-gap);
  padding:14px;
  background:#fff;
  border:1px solid #E1E9E5;
  border-radius:14px;
  box-shadow:0 1px 2px rgba(24,35,31,.03);
}
.filter-bar .form-control,.filter-bar .form-select,
.filters-bar .form-control,.filters-bar .form-select,
.search-filter-bar .form-control,.search-filter-bar .form-select,
.mc-filter-bar .form-control,.mc-filter-bar .form-select{
  min-height:var(--mc-control-height);
  border:1px solid #E1E9E5;
  border-radius:9px;
  background:#fff;
}

/* Search field */
.page-search,.mc-page-search,.filter-search{
  position:relative;
  min-width:220px;
  flex:1 1 280px;
}
.page-search input,.mc-page-search input,.filter-search input{
  width:100%;
  min-height:var(--mc-control-height);
  padding-left:40px;
  border:1px solid #E1E9E5;
  border-radius:9px;
  background:#fff;
}

/* Active filter chips */
.filter-chip,.filter-tag,.mc-filter-chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-height:30px;
  padding:4px 10px;
  border:1px solid #D5E9DF;
  border-radius:999px;
  background:#EAF7F0;
  color:#0B5741;
  font-size:12px;
  font-weight:650;
}
.filter-chip button,.filter-tag button,.mc-filter-chip button{
  border:0;
  background:transparent;
  color:inherit;
  cursor:pointer;
  padding:0;
}

/* Cards and panels */
.card,.mc-card,.panel{
  border:1px solid #E1E9E5;
  border-radius:var(--mc-card-radius);
  background:#fff;
  box-shadow:0 1px 2px rgba(24,35,31,.03);
}
.card-header,.mc-card-header{
  background:#fff;
  border-bottom:1px solid #EAF0ED;
}

/* Tables */
.table-responsive{
  width:100%;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}
.table thead th{
  background:#F5F8F7;
  color:#52625B;
  font-size:11px;
  font-weight:750;
  letter-spacing:.04em;
  text-transform:uppercase;
  border-bottom:1px solid #E1E9E5;
  white-space:nowrap;
}
.table tbody td{
  color:#273730;
  vertical-align:middle;
  border-color:#EDF2EF;
}
.table tbody tr:hover{background:#FAFCFB}

/* Status badges */
.badge,.status-badge,.mc-status-badge{
  border-radius:999px;
  font-weight:650;
}

/* Page sections */
.page-section,.mc-page-section{margin-bottom:var(--mc-section-gap)}
.page-section:last-child,.mc-page-section:last-child{margin-bottom:0}

/* Responsive */
@media (max-width:900px){
  .page-header,.mc-page-header{
    align-items:flex-start;
    flex-direction:column;
  }
  .page-actions,.mc-page-actions,.page-header-actions{
    width:100%;
    justify-content:flex-start;
  }
}
@media (max-width:640px){
  .page-header,.mc-page-header{gap:12px;margin-bottom:16px}
  .page-header h1,.page-title,.mc-page-title{font-size:25px}
  .filter-bar,.filters-bar,.search-filter-bar,.mc-filter-bar{
    padding:10px;
    gap:8px;
  }
  .page-search,.mc-page-search,.filter-search{
    min-width:100%;
    flex-basis:100%;
  }
}



/* ============================================================
   MONEY CULTURE CRM — LEVEL 3 WORKSPACE SYSTEM
   Responsive workspace layouts. No business logic.
   ============================================================ */

:root{
  --mc-work-gap:20px;
  --mc-work-side:320px;
}

/* Generic workspace containers */
.mc-workspace{
  display:grid;
  grid-template-columns:minmax(0,1fr) var(--mc-work-side);
  gap:var(--mc-work-gap);
  width:100%;
  align-items:start;
}
.mc-workspace-main{min-width:0}
.mc-workspace-side{min-width:0}

/* Wide data workspace */
.mc-data-workspace{
  display:grid;
  grid-template-columns:minmax(0,3fr) minmax(260px,1fr);
  gap:var(--mc-work-gap);
  width:100%;
  align-items:start;
}
.mc-data-main,.mc-data-side{min-width:0}

/* Full-width analytics */
.mc-workspace-full{
  width:100%;
  min-width:0;
}

/* KPI row */
.mc-kpi-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:16px;
  width:100%;
  margin-bottom:20px;
}
.mc-kpi-card{
  min-width:0;
  padding:18px;
  background:#fff;
  border:1px solid #E1E9E5;
  border-radius:15px;
  box-shadow:0 1px 2px rgba(24,35,31,.03);
}
.mc-kpi-label{
  color:#728079;
  font-size:12px;
  font-weight:650;
}
.mc-kpi-value{
  margin-top:5px;
  color:#18231F;
  font-size:27px;
  line-height:1.1;
  font-weight:750;
}
.mc-kpi-meta{
  margin-top:7px;
  color:#0F6B4F;
  font-size:12px;
  font-weight:650;
}

/* Intelligence/sidebar cards */
.mc-intelligence-stack{
  display:flex;
  flex-direction:column;
  gap:16px;
}
.mc-intelligence-card{
  padding:18px;
  background:#fff;
  border:1px solid #E1E9E5;
  border-radius:15px;
  box-shadow:0 1px 2px rgba(24,35,31,.03);
}
.mc-intelligence-title{
  margin:0 0 12px;
  color:#18231F;
  font-size:14px;
  font-weight:700;
}

/* Pipeline */
.mc-pipeline{
  display:grid;
  grid-template-columns:repeat(4,minmax(220px,1fr));
  gap:14px;
  width:100%;
  overflow-x:auto;
  padding-bottom:4px;
}
.mc-pipeline-column{
  min-width:220px;
  padding:12px;
  background:#F5F8F7;
  border:1px solid #E1E9E5;
  border-radius:14px;
}
.mc-pipeline-column-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  margin-bottom:10px;
  color:#30413A;
  font-size:12px;
  font-weight:750;
}
.mc-pipeline-card{
  padding:13px;
  margin-bottom:9px;
  background:#fff;
  border:1px solid #E1E9E5;
  border-radius:11px;
}
.mc-pipeline-card:last-child{margin-bottom:0}

/* Detail workspace */
.mc-detail-workspace{
  display:grid;
  grid-template-columns:minmax(0,2.1fr) minmax(280px,1fr);
  gap:20px;
  align-items:start;
}
.mc-detail-main,.mc-detail-side{min-width:0}

/* Timeline */
.mc-timeline{
  position:relative;
  display:flex;
  flex-direction:column;
  gap:14px;
}
.mc-timeline-item{
  position:relative;
  padding:14px 16px 14px 20px;
  background:#fff;
  border:1px solid #E1E9E5;
  border-radius:12px;
}
.mc-timeline-dot{
  position:absolute;
  left:-6px;
  top:18px;
  width:11px;
  height:11px;
  border:2px solid #fff;
  border-radius:50%;
  background:#0F6B4F;
  box-shadow:0 0 0 1px #BFDCCD;
}

/* Empty state */
.mc-empty-state{
  display:flex;
  min-height:240px;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap:8px;
  padding:30px;
  text-align:center;
  background:#fff;
  border:1px dashed #CBD8D2;
  border-radius:15px;
}
.mc-empty-title{
  color:#18231F;
  font-weight:700;
}
.mc-empty-text{
  max-width:460px;
  color:#728079;
  font-size:13px;
}

/* Mobile/tablet */
@media (max-width:1100px){
  .mc-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .mc-workspace,
  .mc-data-workspace,
  .mc-detail-workspace{
    grid-template-columns:minmax(0,1fr);
  }
  .mc-workspace-side,
  .mc-data-side,
  .mc-detail-side{
    width:100%;
  }
}
@media (max-width:640px){
  .mc-kpi-grid{grid-template-columns:1fr}
  .mc-pipeline{grid-template-columns:repeat(4,minmax(250px,1fr))}
  .mc-intelligence-card,.mc-kpi-card{padding:15px}
}
