:root {
  --sidebar-width: 230px;
  --sidebar-collapsed: 64px;
  --primary: #16a34a;
  --primary-light: #dcfce7;
  --top-nav-height: 60px;
  --orange: #f97316;
}
* { font-family: 'Inter', sans-serif; }
body { background: #f8fafc; color: #1e293b; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: #fff;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  transition: width .3s;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
  flex-shrink: 0;
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar.collapsed .sidebar-brand,
.sidebar.collapsed .sidebar-label { display: none; }
.sidebar.collapsed .sidebar-logo { margin: 0 auto; }
.sidebar.collapsed .sidebar-link { justify-content: center; padding: 10px 0; }
.sidebar.collapsed .sidebar-header { justify-content: center; }

.sidebar-logo { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; }
.sidebar-brand { font-size: .9rem; white-space: nowrap; }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 8px; }
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  color: #64748b; text-decoration: none;
  font-size: .85rem; font-weight: 500;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.sidebar-link:hover { background: #f1f5f9; color: #1e293b; }
.sidebar-link.active { background: #dcfce7; color: #16a34a; font-weight: 600; }
.sidebar-link i { font-size: 1.05rem; flex-shrink: 0; }

/* Top nav */
.top-nav {
  height: var(--top-nav-height);
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 50;
}

/* Main content */
.main-content { min-height: 100vh; overflow-x: hidden; }
.page-content { min-height: calc(100vh - var(--top-nav-height)); }

/* Cards */
.kpi-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 20px;
  transition: box-shadow .2s;
}
.kpi-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.kpi-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.kpi-value { font-size: 1.6rem; font-weight: 800; }
.kpi-sub { font-size: .75rem; color: #94a3b8; margin-top: 4px; }

.kpi-green { border-color: #bbf7d0; background: #f0fdf4; }
.kpi-green .kpi-label { color: #16a34a; }
.kpi-green .kpi-value { color: #15803d; }

.kpi-red { border-color: #fecaca; background: #fef2f2; }
.kpi-red .kpi-label { color: #dc2626; }
.kpi-red .kpi-value { color: #b91c1c; }

.kpi-blue { border-color: #bfdbfe; background: #eff6ff; }
.kpi-blue .kpi-label { color: #2563eb; }
.kpi-blue .kpi-value { color: #1d4ed8; }

.kpi-orange { border-color: #fed7aa; background: #fff7ed; }
.kpi-orange .kpi-label { color: #ea580c; }
.kpi-orange .kpi-value { color: #c2410c; }

.kpi-purple { border-color: #ddd6fe; background: #f5f3ff; }
.kpi-purple .kpi-label { color: #7c3aed; }
.kpi-purple .kpi-value { color: #6d28d9; }

/* Tables */
.table-card { background: #fff; border-radius: 12px; border: 1px solid #e2e8f0; overflow: hidden; }
.table th { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #94a3b8; background: #f8fafc; }
.table td { font-size: .875rem; vertical-align: middle; }

/* Badges */
.badge-status { padding: 4px 10px; border-radius: 20px; font-size: .72rem; font-weight: 600; }
.badge-active   { background: #dcfce7; color: #16a34a; }
.badge-inactive { background: #f1f5f9; color: #64748b; }
.badge-sick     { background: #fef2f2; color: #dc2626; }
.badge-paid     { background: #dcfce7; color: #16a34a; }
.badge-pending  { background: #fef9c3; color: #b45309; }
.badge-partial  { background: #dbeafe; color: #2563eb; }

/* Period tabs */
.period-tabs { display: flex; gap: 6px; background: #fff; border: 1px solid #e2e8f0; padding: 6px; border-radius: 10px; width: fit-content; }
.period-tab { padding: 6px 18px; border-radius: 7px; border: none; background: transparent; font-size: .82rem; font-weight: 500; color: #64748b; cursor: pointer; transition: all .15s; }
.period-tab.active { background: var(--orange); color: #fff; box-shadow: 0 2px 6px rgba(249,115,22,.3); }
.period-tab:hover:not(.active) { background: #f1f5f9; color: #1e293b; }

/* Section header */
.section-header { background: #fff; border-radius: 12px; border: 1px solid #e2e8f0; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; }

/* Danger zone */
.danger-zone { border: 1.5px solid #fecaca; border-radius: 12px; }
.danger-zone .danger-body { background: #fef2f2; border-radius: 0 0 10px 10px; padding: 16px 20px; }

/* Login page */
.login-bg { min-height: 100vh; background: #0a1f11; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.login-logo { width: 96px; height: 96px; border-radius: 20px; object-fit: cover; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.login-card { background: rgba(255,255,255,.97); backdrop-filter: blur(12px); border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.4); }

/* Chart containers */
.chart-wrap { position: relative; height: 220px; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { position: fixed; left: -260px; z-index: 999; transition: left .3s; }
  .sidebar.mobile-open { left: 0; }
  .main-content { width: 100%; }
}
