:root {
  --huduma-navy: #006600;
  --huduma-navy-dark: #004d00;
  --huduma-navy-light: #008000;
  --huduma-green: #006600;
  --huduma-gold: #D49A00;
  --huduma-red: #BB1E10;
  --huduma-black: #000000;
  --huduma-white: #FFFFFF;
  --huduma-bg: #F4F6F9;
  --sidebar-width: 260px;
  --topbar-height: 64px;
}
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--huduma-bg);
  color: #1E293B;
  margin: 0;
}

/* ── PORTAL LAYOUT ── */
.portal-wrapper { display: flex; min-height: 100vh; }

.portal-sidebar {
  width: var(--sidebar-width);
  background-color: #0f0f0f;
  color: #fff;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  display: flex; flex-direction: column;
  overflow-y: auto;
  z-index: 1040;
  transition: transform 0.25s ease;
}
.sidebar-brand { padding: 16px 18px; background: linear-gradient(135deg, #000 0%, #BB1E10 100%); flex-shrink: 0; }
.sidebar-menu { list-style: none; padding: 6px 10px; margin: 0; }
.sidebar-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  color: rgba(255,255,255,0.7); text-decoration: none; border-radius: 7px;
  font-size: 0.875rem; transition: all 0.15s; margin-bottom: 2px;
}
.sidebar-link i { font-size: 1rem; width: 18px; text-align: center; flex-shrink: 0; }
.sidebar-link:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar-link.active { background: var(--huduma-green); color: #fff; font-weight: 600; }

.portal-main {
  margin-left: var(--sidebar-width);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

/* ── TOPBAR ── */
.portal-topbar {
  height: var(--topbar-height);
  background: linear-gradient(135deg, #000 0%, #BB1E10 100%);
  color: #fff;
  border-bottom: 3px solid var(--huduma-green);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  position: sticky; top: 0; z-index: 1030;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.portal-topbar * { color: #fff; }
.portal-topbar .dropdown-menu,
.portal-topbar .dropdown-menu .dropdown-item,
.portal-topbar .dropdown-menu .dropdown-item i,
.portal-topbar .dropdown-menu p,
.portal-topbar .dropdown-menu div,
.portal-topbar .dropdown-menu span { color: #1E293B !important; }
.portal-topbar .dropdown-menu .dropdown-item.text-danger,
.portal-topbar .dropdown-menu .dropdown-item.text-danger i { color: #dc3545 !important; }
.portal-topbar .dropdown-menu .text-muted { color: #64748b !important; }

.portal-content { padding: 20px; }

/* Sidebar overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1039;
}
.sidebar-overlay.show { display: block; }

/* ── MOBILE (≤ 991px) ── */
@media (max-width: 991.98px) {
  .portal-sidebar {
    transform: translateX(-100%);
  }
  .portal-sidebar.sidebar-open {
    transform: translateX(0);
  }
  .portal-main {
    margin-left: 0;
  }
  .portal-content { padding: 16px; }
  .portal-topbar { padding: 0 14px; }
}

/* ── SMALL MOBILE (≤ 575px) ── */
@media (max-width: 575.98px) {
  .portal-content { padding: 12px; }
  .stat-card { padding: 14px; }
  .hide-xs { display: none !important; }
}

/* ── CARDS & COMPONENTS ── */
.stat-card {
  background: #fff; border-radius: 8px;
  border-left: 4px solid var(--huduma-green);
  border-top: 1px solid #E2E8F0; border-right: 1px solid #E2E8F0; border-bottom: 1px solid #E2E8F0;
  padding: 20px; transition: transform 0.15s, box-shadow 0.15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.10); }
.desk-card { background: #fff; border: 1px solid #E2E8F0; border-radius: 8px; padding: 14px; }

/* ── BUTTONS ── */
.btn-huduma { background-color: var(--huduma-black); color: #fff; border: none; }
.btn-huduma:hover { background-color: #333; color: #fff; }
.btn-huduma-green { background-color: var(--huduma-green); color: #fff; border: none; }
.btn-huduma-green:hover { background-color: var(--huduma-navy-light); color: #fff; }
.btn-huduma-red { background-color: var(--huduma-red); color: #fff; border: none; }
.btn-huduma-red:hover { background-color: #9a1208; color: #fff; }

/* ── MISC ── */
.kenya-stripe { height: 6px; width: 100%; background: linear-gradient(to right, #000 33.3%, #BB1E10 33.3%, #BB1E10 66.6%, #006600 66.6%); }
.text-huduma-green { color: var(--huduma-green) !important; }
.text-huduma-red { color: var(--huduma-red) !important; }
.badge-pending { background-color: var(--huduma-gold); color: #000; }
.badge-approved { background-color: var(--huduma-green); color: #fff; }
.badge-rejected { background-color: var(--huduma-red); color: #fff; }

/* ── TABLE RESPONSIVE HELPERS ── */
.table-responsive { -webkit-overflow-scrolling: touch; }
@media (max-width: 767.98px) {
  .table-mobile-sm td, .table-mobile-sm th { font-size: 0.78rem; padding: 8px 10px; }
}
