/* =====================================================
   CBOzetuonline — Main Stylesheet
   PamojaSasa CBO | www.cbozetu.co.ke
   Brand: Green #1E7B3E | Gold #F4A020 | Dark #0F1923
   ===================================================== */

/* CSS Custom Properties */
:root {
  --primary: #1E7B3E;
  --primary-dark: #155C2E;
  --primary-light: #2A9E52;
  --primary-xlight: #E8F5ED;
  --accent: #F4A020;
  --accent-dark: #D4860A;
  --accent-light: #FFC55A;
  --accent-xlight: #FFF8ED;
  --dark: #0F1923;
  --dark-2: #1A2535;
  --dark-3: #253245;
  --text-primary: #1A2535;
  --text-secondary: #4A5568;
  --text-muted: #718096;
  --text-light: #A0AEC0;
  --bg-body: #F7F9FC;
  --bg-white: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-sidebar: #0F1923;
  --bg-sidebar-hover: #1A2535;
  --bg-sidebar-active: #1E7B3E;
  --border: #E2E8F0;
  --border-focus: #1E7B3E;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-md: 0 10px 25px rgba(0,0,0,.08), 0 4px 10px rgba(0,0,0,.06);
  --shadow-lg: 0 20px 50px rgba(0,0,0,.12), 0 8px 20px rgba(0,0,0,.08);
  --shadow-glow: 0 0 0 4px rgba(30,123,62,.15);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  --sidebar-w: 260px;
  --topbar-h: 64px;
  --transition: all .2s cubic-bezier(.4,0,.2,1);
  --transition-slow: all .35s cubic-bezier(.4,0,.2,1);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --success: #16A34A;
  --warning: #D97706;
  --danger: #DC2626;
  --info: #2563EB;
  --success-bg: #F0FDF4;
  --warning-bg: #FFFBEB;
  --danger-bg: #FEF2F2;
  --info-bg: #EFF6FF;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-body: #0F1923;
    --bg-white: #1A2535;
    --bg-card: #1A2535;
    --text-primary: #F1F5F9;
    --text-secondary: #CBD5E1;
    --text-muted: #94A3B8;
    --border: #253245;
  }
}

/* ===================== RESET & BASE ===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }
img, svg { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; }
ul, ol { list-style: none; }
h1,h2,h3,h4,h5,h6 { font-weight: 600; line-height: 1.3; color: var(--text-primary); }

/* ===================== UTILITIES ===================== */
.sr-only { position: absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.flex { display: flex; } .flex-col { flex-direction: column; }
.items-center { align-items: center; } .items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; } .justify-center { justify-content: center; }
.flex-1 { flex: 1; } .flex-wrap { flex-wrap: wrap; } .gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.w-full { width: 100%; } .h-full { height: 100%; }
.text-center { text-align: center; } .text-right { text-align: right; }
.font-bold { font-weight: 700; } .font-semibold { font-weight: 600; } .font-medium { font-weight: 500; }
.text-sm { font-size: .875rem; } .text-xs { font-size: .75rem; } .text-lg { font-size: 1.125rem; } .text-xl { font-size: 1.25rem; }
.text-primary { color: var(--primary); } .text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); } .text-danger { color: var(--danger); }
.text-success { color: var(--success); } .text-warning { color: var(--warning); }
.bg-primary { background: var(--primary); } .bg-white { background: var(--bg-white); }
.rounded { border-radius: var(--radius); } .rounded-full { border-radius: var(--radius-full); }
.shadow { box-shadow: var(--shadow); } .shadow-md { box-shadow: var(--shadow-md); }
.overflow-hidden { overflow: hidden; } .overflow-auto { overflow: auto; }
.p-2 { padding: 8px; } .p-3 { padding: 12px; } .p-4 { padding: 16px; } .p-6 { padding: 24px; }
.px-3 { padding-left: 12px; padding-right: 12px; } .px-4 { padding-left: 16px; padding-right: 16px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; } .py-3 { padding-top: 12px; padding-bottom: 12px; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mb-4 { margin-bottom: 16px; }
.ml-auto { margin-left: auto; } .mr-2 { margin-right: 8px; }
.hidden { display: none !important; }
.relative { position: relative; } .absolute { position: absolute; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }

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

/* ===================== SIDEBAR ===================== */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  transition: var(--transition-slow);
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.sidebar-brand-logo {
  width: 40px; height: 40px;
  background: var(--primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: #fff;
  flex-shrink: 0;
}
.sidebar-brand-text { overflow: hidden; }
.sidebar-brand-name {
  font-size: .9rem; font-weight: 700; color: #fff; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-brand-tagline { font-size: .7rem; color: rgba(255,255,255,.5); }

.sidebar-nav { flex: 1; padding: 12px 0; }
.sidebar-section {
  margin-bottom: 4px;
}
.sidebar-section-title {
  font-size: .65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: rgba(255,255,255,.35);
  padding: 8px 20px 4px;
}
.sidebar-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px; cursor: pointer;
  color: rgba(255,255,255,.65); font-size: .875rem; font-weight: 500;
  border-left: 3px solid transparent;
  transition: var(--transition);
  text-decoration: none; position: relative;
  border-radius: 0;
}
.sidebar-nav-item:hover {
  background: var(--bg-sidebar-hover);
  color: #fff;
  border-left-color: rgba(255,255,255,.3);
}
.sidebar-nav-item.active {
  background: rgba(30,123,62,.25);
  color: #fff;
  border-left-color: var(--primary-light);
}
.sidebar-nav-item .nav-icon {
  width: 18px; height: 18px; flex-shrink: 0;
  opacity: .75;
}
.sidebar-nav-item.active .nav-icon { opacity: 1; }
.sidebar-nav-item .nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff; font-size: .65rem; font-weight: 700;
  padding: 1px 6px; border-radius: 99px; min-width: 18px; text-align: center;
}
.sidebar-nav-item .nav-arrow {
  margin-left: auto;
  transition: transform .2s;
  font-size: .7rem; opacity: .5;
}
.sidebar-nav-item.has-children.open .nav-arrow { transform: rotate(180deg); }
.sidebar-submenu {
  background: rgba(0,0,0,.15);
  overflow: hidden;
  max-height: 0;
  transition: max-height .3s ease;
}
.sidebar-submenu.open { max-height: 400px; }
.sidebar-submenu .sidebar-nav-item {
  padding-left: 48px; font-size: .82rem;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}
.sidebar-user:hover { background: var(--bg-sidebar-hover); }
.sidebar-user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 700; flex-shrink: 0;
}
.sidebar-user-info { overflow: hidden; flex: 1; }
.sidebar-user-name { font-size: .82rem; font-weight: 600; color: #fff; truncate: true; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: .7rem; color: rgba(255,255,255,.45); }

/* Mobile sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
}

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

/* ===================== TOPBAR ===================== */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  position: sticky; top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.topbar-toggle {
  display: none;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  align-items: center; justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition);
}
.topbar-toggle:hover { background: var(--bg-body); color: var(--text-primary); }
.topbar-breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: .85rem; color: var(--text-muted); flex: 1;
}
.topbar-breadcrumb .bc-sep { color: var(--text-light); }
.topbar-breadcrumb .bc-current { color: var(--text-primary); font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); background: var(--bg-body);
  border: 1px solid var(--border);
  font-size: .85rem; position: relative;
  transition: var(--transition);
}
.topbar-btn:hover { background: var(--primary-xlight); color: var(--primary); border-color: var(--primary); }
.topbar-btn .badge {
  position: absolute; top: -4px; right: -4px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--danger); color: #fff; font-size: .6rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-white);
}
.lang-selector {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: var(--radius);
  background: var(--bg-body); border: 1px solid var(--border);
  font-size: .8rem; font-weight: 500; color: var(--text-secondary);
  cursor: pointer; transition: var(--transition);
}
.lang-selector:hover { border-color: var(--primary); color: var(--primary); }

/* ===================== PAGE CONTENT ===================== */
.page-content {
  flex: 1;
  padding: 24px;
  max-width: 1400px;
  width: 100%;
}
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.page-title { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); }
.page-subtitle { font-size: .875rem; color: var(--text-muted); margin-top: 2px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===================== CARDS ===================== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow); }
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.card-title { font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.card-subtitle { font-size: .8rem; color: var(--text-muted); }
.card-body { padding: 20px; }
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-body);
  display: flex; align-items: center; justify-content: space-between;
}

/* Stat Cards */
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0;
  width: 4px; height: 100%;
  background: var(--primary);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card.accent::before { background: var(--accent); }
.stat-card.danger::before { background: var(--danger); }
.stat-card.info::before { background: var(--info); }
.stat-card.success::before { background: var(--success); }
.stat-label { font-size: .8rem; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--text-primary); line-height: 1.1; margin: 6px 0 4px; }
.stat-sub { font-size: .8rem; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.stat-icon {
  position: absolute; right: 16px; top: 50%;
  transform: translateY(-50%);
  font-size: 2.5rem; opacity: .1;
}
.stat-trend { font-size: .75rem; font-weight: 600; }
.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }

/* ===================== BUTTONS ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 18px;
  font-size: .875rem; font-weight: 600;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  transition: var(--transition);
  cursor: pointer; white-space: nowrap;
  line-height: 1;
  position: relative; overflow: hidden;
  text-decoration: none;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); border-color: var(--primary-dark); box-shadow: 0 4px 12px rgba(30,123,62,.3); }
.btn-accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-accent:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-secondary { background: var(--bg-body); color: var(--text-primary); border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { background: var(--bg-white); border-color: var(--primary); color: var(--primary); }
.btn-outline-primary { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover:not(:disabled) { background: var(--primary); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: #B91C1C; border-color: #B91C1C; }
.btn-outline-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-outline-danger:hover:not(:disabled) { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-secondary); border-color: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--bg-body); color: var(--text-primary); }
.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: var(--radius); }
.btn-icon-sm { width: 28px; height: 28px; padding: 0; border-radius: var(--radius-sm); }
.btn-loading::after {
  content: '';
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  margin-left: 4px;
}

/* ===================== FORMS ===================== */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; margin-bottom: 6px;
  font-size: .875rem; font-weight: 600; color: var(--text-primary);
}
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-control, .form-select {
  width: 100%;
  padding: 9px 13px;
  font-size: .9rem; color: var(--text-primary);
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
  outline: none;
  appearance: none;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}
.form-control::placeholder { color: var(--text-light); }
.form-control.error { border-color: var(--danger); }
.form-control.success { border-color: var(--success); }
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236B7280'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
  padding-right: 36px;
}
.form-hint { font-size: .78rem; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: .78rem; color: var(--danger); margin-top: 4px; display: none; }
.form-control.error + .form-error { display: block; }
.form-control:focus + .form-error { display: none; }
textarea.form-control { resize: vertical; min-height: 100px; }
.input-group { display: flex; }
.input-group .form-control { border-radius: var(--radius) 0 0 var(--radius); flex: 1; }
.input-group .input-group-btn { border-radius: 0 var(--radius) var(--radius) 0; }
.input-icon { position: relative; }
.input-icon .form-control { padding-left: 38px; }
.input-icon .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: .9rem; pointer-events: none; }
.form-check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.form-check input[type=checkbox], .form-check input[type=radio] {
  width: 17px; height: 17px; cursor: pointer;
  accent-color: var(--primary);
}
.form-check-label { font-size: .875rem; color: var(--text-secondary); cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row.cols-3 { grid-template-columns: repeat(3, 1fr); }

/* ===================== TABLES ===================== */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.table {
  width: 100%; border-collapse: collapse;
  font-size: .875rem;
}
.table th {
  background: var(--bg-body);
  padding: 11px 16px;
  font-size: .8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-muted);
  text-align: left; white-space: nowrap;
  border-bottom: 1px solid var(--border);
  cursor: pointer; user-select: none;
}
.table th:hover { color: var(--primary); }
.table th.sorted { color: var(--primary); }
.table th .sort-icon { margin-left: 4px; opacity: .5; font-size: .7rem; }
.table th.sorted .sort-icon { opacity: 1; }
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary); vertical-align: middle;
}
.table tbody tr { transition: var(--transition); }
.table tbody tr:hover { background: var(--primary-xlight); }
.table tbody tr:last-child td { border-bottom: none; }
.table .actions { display: flex; gap: 6px; align-items: center; }

.table-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 20px;
  background: var(--bg-card); border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.table-search { position: relative; }
.table-search input { padding-left: 36px; width: 240px; }
.table-search .search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

/* Pagination */
.pagination {
  display: flex; align-items: center; gap: 4px;
  padding: 12px 20px;
  background: var(--bg-card); border-top: 1px solid var(--border);
  justify-content: space-between;
}
.pagination-info { font-size: .8rem; color: var(--text-muted); }
.pagination-btns { display: flex; gap: 4px; }
.page-btn {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 600; color: var(--text-secondary);
  border: 1px solid var(--border); background: var(--bg-white);
  cursor: pointer; transition: var(--transition);
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-xlight); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ===================== BADGES / CHIPS ===================== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: var(--radius-full);
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-primary { background: var(--primary-xlight); color: var(--primary); }
.badge-accent { background: var(--accent-xlight); color: var(--accent-dark); }
.badge-dark { background: var(--dark-3); color: #fff; }
.badge-secondary { background: var(--bg-body); color: var(--text-muted); border: 1px solid var(--border); }

/* ===================== MODALS ===================== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45); backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.modal-backdrop.active { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px;
  max-height: 90vh; display: flex; flex-direction: column;
  transform: translateY(20px) scale(.97);
  transition: transform .25s cubic-bezier(.175,.885,.32,1.275);
  overflow: hidden;
}
.modal-backdrop.active .modal {
  transform: translateY(0) scale(1);
}
.modal.modal-lg { max-width: 860px; }
.modal.modal-xl { max-width: 1100px; }
.modal.modal-sm { max-width: 420px; }
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-shrink: 0;
}
.modal-title { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }
.modal-close {
  width: 32px; height: 32px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); background: var(--bg-body);
  cursor: pointer; transition: var(--transition);
}
.modal-close:hover { background: var(--danger-bg); color: var(--danger); }
.modal-body {
  padding: 24px;
  overflow-y: auto; flex: 1;
}
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  flex-shrink: 0; background: var(--bg-body);
}
/* Nested modal */
.modal-backdrop.nested { z-index: 1010; background: rgba(0,0,0,.35); }

/* ===================== ALERTS ===================== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  border-left: 4px solid;
  display: flex; align-items: flex-start; gap: 10px;
  font-size: .875rem;
  margin-bottom: 16px;
}
.alert-success { background: var(--success-bg); border-color: var(--success); color: var(--success); }
.alert-warning { background: var(--warning-bg); border-color: var(--warning); color: var(--warning); }
.alert-danger { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.alert-info { background: var(--info-bg); border-color: var(--info); color: var(--info); }
.alert-text { color: var(--text-primary); }

/* ===================== TOASTS ===================== */
.toast-container {
  position: fixed; top: 20px; right: 20px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
  max-width: 360px; width: 100%;
}
.toast {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--primary);
  padding: 14px 16px;
  display: flex; align-items: flex-start; gap: 10px;
  animation: toastIn .3s ease;
  position: relative;
}
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
.toast.warning { border-color: var(--warning); }
.toast.info { border-color: var(--info); }
.toast-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info .toast-icon { color: var(--info); }
.toast-content { flex: 1; }
.toast-title { font-size: .875rem; font-weight: 700; color: var(--text-primary); }
.toast-message { font-size: .8rem; color: var(--text-muted); margin-top: 2px; }
.toast-close {
  color: var(--text-muted); cursor: pointer; font-size: .8rem;
  transition: var(--transition); padding: 2px;
}
.toast-close:hover { color: var(--text-primary); }
.toast-progress {
  position: absolute; bottom: 0; left: 0; height: 3px;
  border-bottom-left-radius: var(--radius-md);
  background: currentColor; animation: toastProgress 4s linear;
  opacity: .3;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: none; } }
@keyframes toastProgress { from { width: 100%; } to { width: 0; } }

/* ===================== DROPDOWN ===================== */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  min-width: 200px; z-index: 200;
  padding: 6px;
  opacity: 0; pointer-events: none;
  transform: translateY(-8px);
  transition: all .2s;
}
.dropdown-menu.open { opacity: 1; pointer-events: all; transform: none; }
.dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  font-size: .875rem; color: var(--text-secondary);
  cursor: pointer; transition: var(--transition);
  text-decoration: none;
}
.dropdown-item:hover { background: var(--bg-body); color: var(--text-primary); }
.dropdown-item.danger:hover { background: var(--danger-bg); color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }
.dropdown-label { padding: 6px 12px 4px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }

/* ===================== TABS ===================== */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab-btn {
  padding: 9px 16px; font-size: .875rem; font-weight: 600;
  color: var(--text-muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: var(--transition); border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.tab-btn:hover { color: var(--primary); background: var(--primary-xlight); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); background: var(--primary-xlight); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ===================== PROGRESS ===================== */
.progress-bar-wrap {
  height: 8px; background: var(--bg-body); border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-bar {
  height: 100%; border-radius: var(--radius-full);
  background: var(--primary);
  transition: width .5s ease;
}
.progress-bar.accent { background: var(--accent); }
.progress-bar.danger { background: var(--danger); }
.progress-bar.info { background: var(--info); }

/* ===================== NOTIFICATIONS PANEL ===================== */
.notifications-panel {
  width: 360px; max-height: 480px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  position: absolute; top: calc(100% + 8px); right: 0;
  z-index: 300; overflow: hidden;
  flex-direction: column; display: none;
}
.notifications-panel.open { display: flex; }
.notif-header { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.notif-list { overflow-y: auto; flex: 1; }
.notif-item { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; gap: 10px; cursor: pointer; transition: var(--transition); }
.notif-item:hover { background: var(--bg-body); }
.notif-item.unread { background: var(--primary-xlight); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex-shrink: 0; margin-top: 5px; }
.notif-text { font-size: .82rem; color: var(--text-secondary); }
.notif-time { font-size: .7rem; color: var(--text-muted); margin-top: 3px; }

/* ===================== LANDING PAGE ===================== */
.landing-nav {
  position: fixed; top: 0; left: 0; right: 0;
  padding: 14px 40px;
  display: flex; align-items: center; gap: 16px;
  z-index: 200;
  transition: var(--transition-slow);
  background: transparent;
}
.landing-nav.scrolled {
  background: rgba(255,255,255,.95); backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}
.landing-nav .nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.landing-nav .nav-logo { width: 38px; height: 38px; border-radius: 8px; background: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 800; color: #fff; }
.landing-nav .nav-name { font-size: 1rem; font-weight: 800; color: var(--text-primary); }
.landing-nav .nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.landing-nav .nav-link { padding: 7px 14px; font-size: .875rem; font-weight: 500; color: var(--text-secondary); border-radius: var(--radius); transition: var(--transition); }
.landing-nav .nav-link:hover { color: var(--primary); background: var(--primary-xlight); }
.landing-nav .nav-actions { display: flex; gap: 8px; margin-left: 8px; }

.hero-section {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 40%, #1A3A28 100%);
  display: flex; align-items: center;
  position: relative; overflow: hidden;
  padding: 100px 40px 60px;
}
.hero-bg-pattern {
  position: absolute; inset: 0;
  background-image: radial-gradient(circle at 20% 80%, rgba(30,123,62,.2) 0%, transparent 50%), radial-gradient(circle at 80% 20%, rgba(244,160,32,.1) 0%, transparent 50%);
  pointer-events: none;
}
.hero-grid-bg {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}
.hero-content { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; width: 100%; position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(30,123,62,.25); border: 1px solid rgba(30,123,62,.4);
  color: #6EE7A0; padding: 5px 12px; border-radius: var(--radius-full);
  font-size: .78rem; font-weight: 600; margin-bottom: 20px;
}
.hero-title {
  font-size: 3.2rem; font-weight: 800; color: #fff; line-height: 1.1;
  margin-bottom: 20px;
}
.hero-title span { color: var(--accent); }
.hero-desc { font-size: 1.1rem; color: rgba(255,255,255,.7); line-height: 1.7; margin-bottom: 32px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 24px; margin-top: 36px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.1); }
.hero-stat { }
.hero-stat-val { font-size: 1.6rem; font-weight: 800; color: #fff; }
.hero-stat-label { font-size: .75rem; color: rgba(255,255,255,.5); }
.hero-visual {
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.hero-card {
  background: rgba(255,255,255,.08); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-xl);
  padding: 24px; width: 100%; max-width: 400px;
}
.hero-card-title { font-size: .85rem; font-weight: 700; color: rgba(255,255,255,.7); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 16px; }
.hero-metric { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.07); }
.hero-metric:last-child { border-bottom: none; }
.hero-metric-label { font-size: .85rem; color: rgba(255,255,255,.6); }
.hero-metric-val { font-size: .9rem; font-weight: 700; color: #fff; }

/* Features section */
.features-section { padding: 100px 40px; background: var(--bg-white); }
.section-header { text-align: center; max-width: 640px; margin: 0 auto 60px; }
.section-tag { display: inline-block; padding: 4px 14px; background: var(--primary-xlight); color: var(--primary); font-size: .78rem; font-weight: 700; border-radius: var(--radius-full); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px; }
.section-title { font-size: 2.2rem; font-weight: 800; color: var(--text-primary); line-height: 1.2; margin-bottom: 12px; }
.section-desc { font-size: 1rem; color: var(--text-muted); line-height: 1.7; }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; max-width: 1200px; margin: 0 auto; }
.feature-card {
  padding: 28px; border-radius: var(--radius-lg);
  border: 1px solid var(--border); background: var(--bg-body);
  transition: var(--transition);
}
.feature-card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); border-color: var(--primary); }
.feature-icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--primary-xlight); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; margin-bottom: 16px;
}
.feature-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; }
.feature-desc { font-size: .875rem; color: var(--text-muted); line-height: 1.6; }

/* Pricing section */
.pricing-section { padding: 100px 40px; background: var(--bg-body); }
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; max-width: 1000px; margin: 0 auto; }
.pricing-card {
  background: var(--bg-white); border-radius: var(--radius-lg);
  border: 2px solid var(--border); padding: 32px; position: relative;
  transition: var(--transition);
}
.pricing-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.pricing-card.featured { border-color: var(--primary); }
.pricing-featured-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--primary); color: #fff; padding: 3px 16px; border-radius: var(--radius-full); font-size: .75rem; font-weight: 700; white-space: nowrap; }
.pricing-name { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.pricing-price { font-size: 2.4rem; font-weight: 800; color: var(--text-primary); line-height: 1; margin-bottom: 4px; }
.pricing-price sup { font-size: 1rem; vertical-align: top; margin-top: 8px; }
.pricing-period { font-size: .8rem; color: var(--text-muted); margin-bottom: 20px; }
.pricing-features { list-style: none; }
.pricing-features li { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: .875rem; color: var(--text-secondary); border-bottom: 1px solid var(--border); }
.pricing-features li:last-child { border-bottom: none; }
.pricing-features .check { color: var(--success); }
.pricing-features .cross { color: var(--text-light); }

/* ===================== COMPLIANCE CALENDAR ===================== */
.compliance-timeline { display: flex; flex-direction: column; gap: 0; }
.compliance-item {
  display: flex; gap: 16px; padding: 14px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.compliance-item:last-child { border-bottom: none; }
.compliance-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--primary); flex-shrink: 0; margin-top: 4px;
}
.compliance-dot.overdue { background: var(--danger); }
.compliance-dot.due-soon { background: var(--warning); }
.compliance-dot.completed { background: var(--success); }
.compliance-info { flex: 1; }
.compliance-title { font-size: .9rem; font-weight: 600; color: var(--text-primary); }
.compliance-deadline { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }
.compliance-status { flex-shrink: 0; }

/* ===================== CHARTS ===================== */
.chart-container { position: relative; width: 100%; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.chart-legend-item { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--text-muted); }
.chart-legend-dot { width: 10px; height: 10px; border-radius: 50%; }

/* ===================== AUTH PAGES ===================== */
.auth-layout {
  min-height: 100vh;
  display: grid; grid-template-columns: 1fr 1fr;
}
.auth-left {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 50%, #162B1E 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 40px; position: relative; overflow: hidden;
}
.auth-left-bg {
  position: absolute; inset: 0;
  background-image: radial-gradient(circle at 30% 70%, rgba(30,123,62,.3) 0%, transparent 60%);
  pointer-events: none;
}
.auth-left-content { position: relative; z-index: 1; text-align: center; max-width: 380px; }
.auth-logo-large { width: 64px; height: 64px; border-radius: 16px; background: var(--primary); display: inline-flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 900; color: #fff; margin-bottom: 20px; }
.auth-tagline { font-size: 1.8rem; font-weight: 800; color: #fff; line-height: 1.2; margin-bottom: 12px; }
.auth-sub { font-size: .9rem; color: rgba(255,255,255,.6); line-height: 1.6; }
.auth-features { display: flex; flex-direction: column; gap: 12px; margin-top: 32px; text-align: left; }
.auth-feature { display: flex; align-items: center; gap: 10px; }
.auth-feature-icon { width: 28px; height: 28px; border-radius: 8px; background: rgba(30,123,62,.35); color: #6EE7A0; display: flex; align-items: center; justify-content: center; font-size: .85rem; flex-shrink: 0; }
.auth-feature-text { font-size: .85rem; color: rgba(255,255,255,.75); }
.auth-right {
  display: flex; align-items: center; justify-content: center;
  padding: 40px; background: var(--bg-body);
}
.auth-card {
  width: 100%; max-width: 440px;
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 40px;
}
.auth-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 4px; }
.auth-subtitle { font-size: .875rem; color: var(--text-muted); margin-bottom: 28px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; }
.auth-divider-line { flex: 1; height: 1px; background: var(--border); }
.auth-divider-text { font-size: .78rem; color: var(--text-muted); white-space: nowrap; }
.auth-footer { text-align: center; margin-top: 20px; font-size: .875rem; color: var(--text-muted); }

/* ===================== FUND ACCOUNTING ===================== */
.fund-card {
  border-radius: var(--radius-md); border: 1px solid var(--border);
  overflow: hidden; transition: var(--transition);
}
.fund-card:hover { box-shadow: var(--shadow-md); }
.fund-header { padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; }
.fund-name { font-size: .9rem; font-weight: 700; }
.fund-type { font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-full); }
.fund-type.restricted { background: var(--danger-bg); color: var(--danger); }
.fund-type.unrestricted { background: var(--success-bg); color: var(--success); }
.fund-body { padding: 16px; }
.fund-balance { font-size: 1.6rem; font-weight: 800; color: var(--text-primary); }
.fund-currency { font-size: .85rem; color: var(--text-muted); }
.fund-progress { margin-top: 12px; }
.fund-progress-label { display: flex; justify-content: space-between; font-size: .75rem; color: var(--text-muted); margin-bottom: 4px; }

/* ===================== EMPTY STATES ===================== */
.empty-state {
  text-align: center; padding: 60px 20px;
  display: flex; flex-direction: column; align-items: center;
}
.empty-icon { font-size: 3.5rem; margin-bottom: 16px; opacity: .5; }
.empty-title { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.empty-text { font-size: .875rem; color: var(--text-muted); max-width: 300px; line-height: 1.6; }

/* ===================== LOADING ===================== */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--bg-body) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s infinite;
  border-radius: var(--radius);
}
@keyframes skeleton { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-heading { height: 22px; margin-bottom: 12px; }
.skeleton-full { width: 100%; }
.skeleton-75 { width: 75%; }
.skeleton-50 { width: 50%; }
.page-loader {
  display: flex; align-items: center; justify-content: center;
  min-height: 200px; flex-direction: column; gap: 12px;
}
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.spinner-sm { width: 18px; height: 18px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===================== PROFILE / AVATAR ===================== */
.avatar {
  border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center;
  font-weight: 700; color: #fff; flex-shrink: 0;
  background: var(--primary);
}
.avatar-xs { width: 24px; height: 24px; font-size: .65rem; }
.avatar-sm { width: 32px; height: 32px; font-size: .75rem; }
.avatar-md { width: 40px; height: 40px; font-size: .9rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.2rem; }
.avatar-xl { width: 80px; height: 80px; font-size: 1.6rem; }
.avatar-group { display: flex; }
.avatar-group .avatar { border: 2px solid var(--bg-white); margin-left: -8px; }
.avatar-group .avatar:first-child { margin-left: 0; }

/* ===================== STEPPER ===================== */
.stepper { display: flex; align-items: center; gap: 0; margin-bottom: 28px; }
.step { display: flex; flex-direction: column; align-items: center; flex: 1; position: relative; }
.step:not(:last-child)::after {
  content: '';
  position: absolute; top: 16px; left: calc(50% + 16px);
  width: calc(100% - 32px); height: 2px;
  background: var(--border);
}
.step.completed:not(:last-child)::after { background: var(--primary); }
.step-circle {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700;
  border: 2px solid var(--border); background: var(--bg-white);
  color: var(--text-muted); z-index: 1;
}
.step.active .step-circle { border-color: var(--primary); color: var(--primary); background: var(--primary-xlight); }
.step.completed .step-circle { border-color: var(--primary); background: var(--primary); color: #fff; }
.step-label { font-size: .72rem; color: var(--text-muted); margin-top: 6px; text-align: center; font-weight: 600; }
.step.active .step-label { color: var(--primary); }

/* ===================== KANBAN (for project tracking) ===================== */
.kanban-board { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 16px; }
.kanban-col { min-width: 280px; background: var(--bg-body); border-radius: var(--radius-md); padding: 12px; flex-shrink: 0; }
.kanban-col-header { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); padding: 4px 0 10px; display: flex; justify-content: space-between; align-items: center; }
.kanban-card { background: var(--bg-white); border-radius: var(--radius); border: 1px solid var(--border); padding: 12px; margin-bottom: 8px; cursor: pointer; transition: var(--transition); }
.kanban-card:hover { box-shadow: var(--shadow); border-color: var(--primary); }

/* ===================== SEARCH ===================== */
.global-search {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,.5); backdrop-filter: blur(6px);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 80px; opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.global-search.open { opacity: 1; pointer-events: all; }
.global-search-box {
  width: 100%; max-width: 640px; background: var(--bg-white);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.global-search-input {
  width: 100%; padding: 16px 20px; font-size: 1.1rem;
  border: none; outline: none; background: transparent;
  color: var(--text-primary);
}
.global-search-results { max-height: 400px; overflow-y: auto; border-top: 1px solid var(--border); }
.search-result-item { display: flex; gap: 12px; padding: 12px 20px; cursor: pointer; transition: var(--transition); }
.search-result-item:hover { background: var(--primary-xlight); }

/* ===================== RTL ARABIC SUPPORT ===================== */
[dir="rtl"] .sidebar { left: auto; right: 0; }
[dir="rtl"] .main-content { margin-left: 0; margin-right: var(--sidebar-w); }
[dir="rtl"] .stat-card::before { left: auto; right: 0; }
[dir="rtl"] .sidebar-nav-item { border-left: none; border-right: 3px solid transparent; padding-right: 20px; padding-left: 16px; }
[dir="rtl"] .sidebar-nav-item.active { border-right-color: var(--primary-light); }
[dir="rtl"] .sidebar-submenu .sidebar-nav-item { padding-right: 48px; padding-left: 20px; }
[dir="rtl"] .input-icon .form-control { padding-left: 13px; padding-right: 38px; }
[dir="rtl"] .input-icon .icon { left: auto; right: 12px; }
[dir="rtl"] .toast-container { right: auto; left: 20px; }
[dir="rtl"] .dropdown-menu { right: auto; left: 0; }
[dir="rtl"] .notifications-panel { right: auto; left: 0; }
[dir="rtl"] .table th, [dir="rtl"] .table td { text-align: right; }

/* ===================== ANIMATIONS ===================== */
.fade-in { animation: fadeIn .3s ease; }
.slide-up { animation: slideUp .3s ease; }
.slide-down { animation: slideDown .3s ease; }
.zoom-in { animation: zoomIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: none; } }
@keyframes zoomIn { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: none; } }
.pulse { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }
.hover-lift { transition: var(--transition); }
.hover-lift:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

/* ===================== FOOTER ===================== */
.landing-footer {
  background: var(--dark);
  color: rgba(255,255,255,.65);
  padding: 60px 40px 30px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; max-width: 1200px; margin: 0 auto 40px; }
.footer-brand-desc { font-size: .85rem; line-height: 1.7; margin-top: 12px; }
.footer-heading { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #fff; margin-bottom: 14px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-link { font-size: .85rem; color: rgba(255,255,255,.5); transition: var(--transition); text-decoration: none; }
.footer-link:hover { color: var(--accent); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.1); font-size: .8rem; flex-wrap: wrap; gap: 8px; }

/* ===================== MOBILE RESPONSIVE ===================== */
@media (max-width: 1024px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .pricing-grid { grid-template-columns: 1fr; max-width: 400px; }
  .hero-content { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { display: none; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar-overlay.active { display: block; }
  [dir="rtl"] .sidebar { transform: translateX(100%); }
  [dir="rtl"] .sidebar.mobile-open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  [dir="rtl"] .main-content { margin-right: 0; }
  .topbar-toggle { display: flex; }
  .topbar { padding: 0 14px; }
  .page-content { padding: 14px; }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .landing-nav { padding: 14px 20px; }
  .landing-nav .nav-links { display: none; }
  .hero-section { padding: 80px 20px 50px; }
  .hero-title { font-size: 2rem; }
  .features-section, .pricing-section { padding: 60px 20px; }
  .features-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .form-row.cols-3 { grid-template-columns: 1fr; }
  .table-toolbar { flex-direction: column; align-items: stretch; }
  .table-search input { width: 100%; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .modal { margin: 8px; }
  .modal.modal-lg, .modal.modal-xl { max-width: 98vw; }
  .pagination { flex-direction: column; gap: 8px; }
  .hero-stats { flex-wrap: wrap; gap: 16px; }
  .page-header { flex-direction: column; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 1.7rem; }
  .stat-value { font-size: 1.5rem; }
  .auth-card { padding: 28px 20px; }
  .modal-body { padding: 16px; }
  .modal-header, .modal-footer { padding: 14px 16px; }
  .toast-container { left: 10px; right: 10px; max-width: none; }
  .landing-footer { padding: 40px 20px 20px; }
  .kanban-board { flex-direction: column; }
  .kanban-col { min-width: auto; }
}

/* Print styles */
@media print {
  .sidebar, .topbar, .page-actions, .modal-backdrop { display: none !important; }
  .main-content { margin-left: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; }
  body { background: #fff; color: #000; }
}
