@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=IBM+Plex+Sans:wght@300;400;500;600&display=swap');

:root {
  --primary: #1a3a5c;
  --primary-light: #2a5a8c;
  --primary-dark: #0d1f30;
  --accent: #c8960c;
  --accent-light: #e8b420;
  --success: #1a7a4a;
  --danger: #8c1a1a;
  --warning: #7a5c10;
  --info: #1a4a7a;
  --bg: #f0f4f8;
  --bg-card: #ffffff;
  --sidebar-bg: #0d1f30;
  --sidebar-text: #c8d8e8;
  --sidebar-active: #c8960c;
  --text: #1a2a3a;
  --text-muted: #5a7a9a;
  --border: #d0dce8;
  --shadow: 0 2px 12px rgba(13,31,48,0.10);
  --radius: 10px;
  --sidebar-width: 260px;
  --topbar-height: 60px;
  --font-head: 'Playfair Display', Georgia, serif;
  --font-body: 'IBM Plex Sans', 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

.watermark {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 400px; height: 400px;
  background: url('../images/fundlogo.jpg') center/contain no-repeat;
  opacity: 0.03;
  pointer-events: none;
  z-index: 0;
}

/* App Layout */
.app-wrapper { display: flex; min-height: 100vh; position: relative; z-index: 1; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1000;
  transition: transform 0.3s ease;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(200,150,12,0.3) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(200,150,12,0.3); border-radius: 2px; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px;
  background: rgba(200,150,12,0.1);
  border-bottom: 1px solid rgba(200,150,12,0.2);
  flex-shrink: 0;
}
.brand-logo { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; border: 2px solid var(--accent); }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-family: var(--font-head); font-size: 16px; font-weight: 700; color: var(--accent-light); letter-spacing: 1px; }
.brand-sub { font-size: 10px; color: rgba(200,216,232,0.6); letter-spacing: 0.5px; text-transform: uppercase; }

.sidebar-nav { flex: 1; padding: 8px 0; }
.nav-section-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--accent);
  cursor: pointer;
  user-select: none;
  margin-top: 8px;
}
.nav-section-toggle:hover { color: var(--accent-light); }
.toggle-icon { transition: transform 0.2s; }
.toggle-icon.collapsed { transform: rotate(-90deg); }

.nav-list { list-style: none; }
.nav-list li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px 9px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13px;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}
.nav-list li a:hover { background: rgba(200,150,12,0.08); color: #fff; border-left-color: rgba(200,150,12,0.4); }
.nav-list li.active a { background: rgba(200,150,12,0.15); color: var(--accent-light); border-left-color: var(--accent); font-weight: 500; }
.nav-icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }

.badge {
  background: var(--accent);
  color: var(--primary-dark);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: auto;
}
.badge-dot {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
  margin-right: 2px;
}

.sidebar-footer {
  padding: 12px 16px;
  background: rgba(0,0,0,0.2);
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.profile-link { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: 1; overflow: hidden; }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent); flex-shrink: 0; }
.user-avatar-placeholder {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.user-info { display: flex; flex-direction: column; overflow: hidden; }
.user-name { font-size: 12px; color: #fff; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 10px; color: rgba(200,216,232,0.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logout-btn {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(140,26,26,0.3);
  border-radius: 6px;
  text-decoration: none;
  color: #ff8080;
  font-size: 16px;
  flex-shrink: 0;
  transition: background 0.15s;
}
.logout-btn:hover { background: rgba(140,26,26,0.6); }

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

/* Topbar */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(13,31,48,0.06);
}
.sidebar-toggle {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text);
  padding: 4px 8px;
  border-radius: 6px;
  display: none;
}
.topbar-title {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 600;
  color: var(--primary);
  flex: 1;
}
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-icon {
  font-size: 18px;
  text-decoration: none;
  color: var(--text-muted);
  position: relative;
  transition: color 0.15s;
}
.topbar-icon:hover { color: var(--primary); }

.search-global { position: relative; }
.search-global input {
  width: 220px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  background: var(--bg);
  transition: all 0.2s;
  font-family: var(--font-body);
}
.search-global input:focus { outline: none; border-color: var(--primary-light); width: 280px; background: #fff; }
.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 320px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 200;
  display: none;
  max-height: 400px;
  overflow-y: auto;
}
.search-dropdown.show { display: block; }
.search-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  display: block;
  color: var(--text);
  font-size: 13px;
  transition: background 0.1s;
}
.search-item:hover { background: var(--bg); }
.search-item:last-child { border-bottom: none; }
.search-item-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; }

/* Page Content */
.page-content { padding: 24px; flex: 1; }

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 20px;
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, rgba(26,58,92,0.03), rgba(200,150,12,0.03));
}
.card-title {
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
}
.card-body { padding: 20px; }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(13,31,48,0.12); }
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
}
.stat-card.blue::before { background: var(--primary-light); }
.stat-card.green::before { background: var(--success); }
.stat-card.red::before { background: var(--danger); }
.stat-card.gold::before { background: var(--accent); }
.stat-icon { font-size: 28px; margin-bottom: 10px; }
.stat-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 4px; }
.stat-value { font-size: 22px; font-weight: 700; color: var(--primary); font-family: var(--font-head); }
.stat-sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* Tables */
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  background: var(--primary);
  color: #fff;
  padding: 11px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
thead th:first-child { border-radius: 0; }
tbody tr { border-bottom: 1px solid var(--border); transition: background 0.1s; }
tbody tr:hover { background: rgba(26,58,92,0.03); }
tbody td { padding: 11px 14px; vertical-align: middle; }
tbody tr:last-child { border-bottom: none; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.15s;
  font-family: var(--font-body);
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); }
.btn-accent { background: var(--accent); color: var(--primary-dark); }
.btn-accent:hover { background: var(--accent-light); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #1f9458; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #aa2020; }
.btn-warning { background: #e8a010; color: #fff; }
.btn-warning:hover { background: #f0b030; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-icon { padding: 6px 8px; }
.btn-group { display: flex; gap: 6px; flex-wrap: wrap; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-weight: 500; font-size: 13px; color: var(--text); margin-bottom: 5px; }
.form-label.required::after { content: ' *'; color: var(--danger); }
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text);
  background: var(--bg-card);
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: var(--font-body);
}
.form-control:focus { outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(42,90,140,0.1); }
.form-control:disabled { background: var(--bg); color: var(--text-muted); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 11px; color: var(--danger); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.input-group { display: flex; }
.input-group .form-control { border-radius: 6px 0 0 6px; }
.input-group .btn { border-radius: 0 6px 6px 0; }
.input-addon {
  padding: 9px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 6px 0 0 6px;
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}
.input-addon + .form-control { border-radius: 0 6px 6px 0; }

/* Select with search */
.select-search-wrapper { position: relative; }
.select-search-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%235a7a9a'/%3E%3C/svg%3E") no-repeat right 10px center / 10px 6px, #fff;
}
.select-dropdown {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 6px 6px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 50;
  display: none;
  box-shadow: 0 8px 24px rgba(13,31,48,0.1);
}
.select-dropdown.open { display: block; }
.select-dropdown-search { padding: 8px; border-bottom: 1px solid var(--border); }
.select-dropdown-search input { width: 100%; padding: 6px 10px; border: 1px solid var(--border); border-radius: 4px; font-size: 12px; }
.select-option { padding: 9px 12px; cursor: pointer; font-size: 13px; transition: background 0.1s; }
.select-option:hover, .select-option.selected { background: rgba(26,58,92,0.06); }

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert-success { background: rgba(26,122,74,0.1); border: 1px solid rgba(26,122,74,0.25); color: #0d5c38; }
.alert-danger { background: rgba(140,26,26,0.1); border: 1px solid rgba(140,26,26,0.25); color: #6a1010; }
.alert-warning { background: rgba(200,150,12,0.1); border: 1px solid rgba(200,150,12,0.25); color: #6a4800; }
.alert-info { background: rgba(26,74,122,0.1); border: 1px solid rgba(26,74,122,0.25); color: #0d3060; }

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.status-pending { background: rgba(200,150,12,0.15); color: #7a5000; }
.status-active { background: rgba(26,122,74,0.15); color: #0d5c38; }
.status-approved { background: rgba(26,122,74,0.15); color: #0d5c38; }
.status-rejected { background: rgba(140,26,26,0.15); color: #6a1010; }
.status-completed { background: rgba(26,74,122,0.15); color: #0d3060; }
.status-distributed { background: rgba(26,122,74,0.15); color: #0d5c38; }

/* Pagination */
.pagination { display: flex; gap: 4px; align-items: center; margin-top: 16px; }
.page-item {
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
  text-decoration: none;
  transition: all 0.15s;
}
.page-item:hover, .page-item.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-item.disabled { opacity: 0.4; cursor: not-allowed; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13,31,48,0.6);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
}
.modal-overlay.show { opacity: 1; visibility: visible; }
.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.2s;
  box-shadow: 0 20px 60px rgba(13,31,48,0.25);
}
.modal-overlay.show .modal { transform: scale(1) translateY(0); }
.modal-lg { max-width: 800px; }
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
}
.modal-title { font-family: var(--font-head); font-size: 17px; color: #fff; font-weight: 600; }
.modal-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  transition: color 0.15s;
}
.modal-close:hover { color: #fff; }
.modal-body { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* Filter / toolbar */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar-search {
  flex: 1;
  min-width: 200px;
  max-width: 300px;
}
.filter-group { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab-item {
  padding: 10px 18px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.tab-item:hover { color: var(--primary); }
.tab-item.active { color: var(--primary); border-bottom-color: var(--accent); font-weight: 600; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Contract editor */
.contract-preview {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  background: #fff;
  min-height: 300px;
  font-size: 14px;
  line-height: 1.8;
}
.contract-preview .watermark-preview {
  position: relative;
  z-index: 1;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.4; }
.empty-state-text { font-size: 15px; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.empty-state-sub { font-size: 13px; }

/* Print / PDF */
@media print {
  .sidebar, .topbar, .btn, .toolbar { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .page-content { padding: 0 !important; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}

/* Responsive */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: block; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .page-content { padding: 14px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .search-global input { width: 140px; }
}

/* Login page */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../images/fundlogo.jpg') center/300px no-repeat;
  opacity: 0.05;
}
.login-card {
  background: rgba(255,255,255,0.97);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.3);
  position: relative;
  z-index: 1;
}
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo img { width: 80px; height: 80px; object-fit: cover; border-radius: 50%; border: 3px solid var(--accent); }
.login-title { font-family: var(--font-head); font-size: 22px; font-weight: 700; color: var(--primary); text-align: center; margin-bottom: 6px; }
.login-sub { text-align: center; color: var(--text-muted); font-size: 13px; margin-bottom: 28px; }

/* Tooltip */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary-dark);
  color: #fff;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 100;
}
[data-tooltip]:hover::after { opacity: 1; }

/* Blurred button */
.btn-blurred {
  filter: blur(3px);
  pointer-events: none;
  user-select: none;
  opacity: 0.5;
}

/* RWF amount display */
.amount-rwf { font-weight: 600; color: var(--primary); font-variant-numeric: tabular-nums; }
.amount-rwf.positive { color: var(--success); }
.amount-rwf.negative { color: var(--danger); }

/* Dashboard welcome */
.welcome-banner {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.welcome-banner .avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 3px solid rgba(200,150,12,0.5);
  object-fit: cover;
  flex-shrink: 0;
}
.welcome-banner .avatar-placeholder {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700;
  flex-shrink: 0;
}
.welcome-text h2 { font-family: var(--font-head); font-size: 20px; margin-bottom: 4px; }
.welcome-text p { font-size: 13px; opacity: 0.8; }

/* Loading */
.loading-spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid rgba(26,58,92,0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Chart area */
.chart-container { position: relative; height: 250px; }

/* ── User-search dropdown (shared across accountant pages) ──────────────── */
.us-results {
  position: absolute;
  left: 0; right: 0; top: 100%;
  z-index: 9999;
  background: #fff;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 240px;
  overflow-y: auto;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  display: none;
}
.us-item {
  padding: 9px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  line-height: 1.4;
}
.us-item:last-child { border-bottom: none; }
.us-item:hover { background: var(--bg); }
.us-item strong { display: block; font-size: 14px; color: var(--text); }
.us-item small  { font-size: 12px; color: var(--text-muted); }
.us-item.us-empty { color: var(--text-muted); font-style: italic; cursor: default; }
.us-item.us-empty:hover { background: transparent; }
/* Wrapper that the dropdown is relative to */
.us-wrap { position: relative; }
