/* ═══════════════════════════════════════════════════
   PEMERIKSA RPH — Premium Dashboard CSS
   Font: Plus Jakarta Sans
   Tema: Deep Indigo + Violet gradients
═══════════════════════════════════════════════════ */

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

:root {
  /* Base */
  --bg:          #09090f;
  --bg-1:        #0f0f1a;
  --bg-2:        #14142a;
  --bg-3:        #1a1a35;
  --surface:     #1c1c30;
  --surface-2:   #24243e;
  --border:      rgba(255,255,255,0.07);
  --border-2:    rgba(255,255,255,0.12);

  /* Text */
  --text:        #f0f0ff;
  --text-2:      #a0a0c0;
  --muted:       #5a5a80;

  /* Brand */
  --indigo:      #6366f1;
  --indigo-2:    #818cf8;
  --violet:      #8b5cf6;
  --violet-2:    #a78bfa;

  /* Status */
  --green:       #10b981;
  --green-2:     #34d399;
  --green-bg:    rgba(16,185,129,0.1);
  --green-bdr:   rgba(16,185,129,0.25);

  --amber:       #f59e0b;
  --amber-2:     #fbbf24;
  --amber-bg:    rgba(245,158,11,0.1);
  --amber-bdr:   rgba(245,158,11,0.25);

  --red:         #ef4444;
  --red-2:       #f87171;
  --red-bg:      rgba(239,68,68,0.1);
  --red-bdr:     rgba(239,68,68,0.25);

  --blue:        #3b82f6;
  --blue-bg:     rgba(59,130,246,0.1);

  /* Layout */
  --sidebar-w:   240px;
  --topbar-h:    64px;
  --radius:      14px;
  --radius-sm:   8px;
  --radius-xs:   6px;
  --shadow:      0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg:   0 12px 48px rgba(0,0,0,0.6);
  --glow-indigo: 0 0 24px rgba(99,102,241,0.25);
  --glow-green:  0 0 20px rgba(16,185,129,0.3);

  --ease: cubic-bezier(0.4,0,0.2,1);
  --t: 0.2s;
}

html { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 14px; background: var(--bg); color: var(--text); height: 100%; -webkit-font-smoothing: antialiased; }
body { height: 100%; overflow: hidden; }
.hidden { display: none !important; }

/* ─────────────────────────────────────────────
   LOGIN SCREEN
───────────────────────────────────────────── */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

/* Animated orbs */
.bg-orbs { position: absolute; inset: 0; pointer-events: none; }
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: floatOrb 8s ease-in-out infinite;
}
.orb-1 { width: 500px; height: 500px; background: rgba(99,102,241,0.15); top: -100px; left: -100px; animation-delay: 0s; }
.orb-2 { width: 400px; height: 400px; background: rgba(139,92,246,0.12); bottom: -80px; right: -80px; animation-delay: -3s; }
.orb-3 { width: 300px; height: 300px; background: rgba(59,130,246,0.08); top: 50%; left: 50%; animation-delay: -5s; }

@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(30px, -20px) scale(1.05); }
  66%       { transform: translate(-20px, 30px) scale(0.95); }
}

.glass {
  background: rgba(20, 20, 48, 0.7);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.08);
}

.login-card {
  width: 100%;
  max-width: 440px;
  border-radius: 24px;
  padding: 40px;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.05);
  animation: riseUp 0.6s var(--ease) both;
}

@keyframes riseUp {
  from { opacity: 0; transform: translateY(32px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glow-indigo);
}

.brand-name { font-size: 17px; font-weight: 700; color: var(--text); }
.brand-tagline { font-size: 11px; color: var(--muted); margin-top: 2px; }

.login-hero { margin-bottom: 32px; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 100px;
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.3);
  color: var(--indigo-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.hero-title {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text);
  letter-spacing: -0.5px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #f0f0ff 40%, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub { font-size: 13px; color: var(--text-2); line-height: 1.7; }

.login-actions { display: flex; flex-direction: column; gap: 12px; }

.btn-primary-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  color: white;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--t) var(--ease);
  box-shadow: 0 4px 20px rgba(99,102,241,0.4);
}

.btn-primary-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(99,102,241,0.5);
}

.btn-primary-login:active { transform: translateY(0); }

.divider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}
.divider-row::before, .divider-row::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.btn-demo-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border-2);
  color: var(--text-2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t) var(--ease);
}

.btn-demo-login:hover { border-color: var(--indigo-2); color: var(--text); background: var(--surface-2); }

.login-note { text-align: center; margin-top: 24px; font-size: 12px; color: var(--muted); }

/* ─────────────────────────────────────────────
   APP SHELL
───────────────────────────────────────────── */
.app { display: flex; height: 100vh; overflow: hidden; }

/* ─────────────────────────────────────────────
   SIDEBAR
───────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  gap: 4px;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.brand-icon-sm { width: 32px; height: 32px; flex-shrink: 0; border-radius: 8px; overflow: hidden; }
.brand-text { font-size: 14px; font-weight: 700; color: var(--text); }

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--muted);
  padding: 4px 12px;
  margin-top: 4px;
  margin-bottom: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--t) var(--ease);
  position: relative;
  cursor: pointer;
}

.nav-item:hover { background: var(--surface); color: var(--text); }

.nav-item.active {
  background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(139,92,246,0.15));
  color: var(--indigo-2);
  border: 1px solid rgba(99,102,241,0.2);
}

.nav-item svg { flex-shrink: 0; opacity: 0.8; }
.nav-item.active svg { opacity: 1; }

.nav-badge {
  margin-left: auto;
  background: var(--indigo);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 100px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); }

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--t) var(--ease);
}
.user-card:hover { background: var(--surface); }

.user-ava {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(99,102,241,0.3);
}

.user-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--muted); }

/* ─────────────────────────────────────────────
   MAIN CONTENT
───────────────────────────────────────────── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

/* TOP BAR */
.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-1);
  flex-shrink: 0;
  gap: 16px;
}

.page-title { font-size: 17px; font-weight: 700; color: var(--text); }
.page-sub {
  display: inline-block;
  font-size: 11px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  margin-top: 2px;
}

.topbar-right { display: flex; align-items: center; gap: 10px; }

.pending-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 100px;
  background: var(--amber-bg);
  border: 1px solid var(--amber-bdr);
  color: var(--amber-2);
  font-size: 12px;
  font-weight: 600;
}

.pulse-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--amber);
  animation: pulseDot 1.5s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.4); opacity: 0.6; }
}

.btn-refresh {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--t) var(--ease);
}
.btn-refresh:hover { background: var(--surface-2); color: var(--text); }
.btn-refresh.spinning svg { animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn-save {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 18px;
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t) var(--ease);
  box-shadow: 0 2px 12px rgba(99,102,241,0.35);
}
.btn-save:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(99,102,241,0.45); }
.btn-save:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* LOADING */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}
.loader-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.loader-ring {
  width: 44px; height: 44px;
  border: 3px solid var(--surface-2);
  border-top-color: var(--indigo);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.loader-wrap p { color: var(--text-2); font-size: 13px; }

/* VIEWS */
.view-content {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
  position: relative;
}
.view-content::-webkit-scrollbar { width: 6px; }
.view-content::-webkit-scrollbar-track { background: transparent; }
.view-content::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 3px; }

/* ─────────────────────────────────────────────
   KPI CARDS
───────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all var(--t) var(--ease);
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--t) var(--ease);
  border-radius: inherit;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi-card:hover::before { opacity: 1; }

.kpi-total::before { background: linear-gradient(135deg, rgba(99,102,241,0.05), transparent); }
.kpi-green::before { background: linear-gradient(135deg, rgba(16,185,129,0.05), transparent); }
.kpi-amber::before { background: linear-gradient(135deg, rgba(245,158,11,0.05), transparent); }
.kpi-red::before   { background: linear-gradient(135deg, rgba(239,68,68,0.05), transparent); }

.kpi-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.kpi-total .kpi-icon { background: rgba(99,102,241,0.15); color: var(--indigo-2); }
.kpi-green .kpi-icon { background: var(--green-bg);  color: var(--green-2); }
.kpi-amber .kpi-icon { background: var(--amber-bg); color: var(--amber-2); }
.kpi-red   .kpi-icon { background: var(--red-bg);   color: var(--red-2); }

.kpi-body { display: flex; flex-direction: column; gap: 3px; }
.kpi-num {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
  color: var(--text);
}
.kpi-label { font-size: 12px; color: var(--text-2); font-weight: 500; }

.kpi-bar-wrap { height: 4px; background: var(--bg-3); border-radius: 2px; overflow: hidden; }
.kpi-bar { height: 100%; border-radius: 2px; width: 0; transition: width 1s var(--ease); }
.kpi-bar-green { background: linear-gradient(90deg, var(--green), var(--green-2)); }
.kpi-bar-amber { background: linear-gradient(90deg, var(--amber), var(--amber-2)); }
.kpi-bar-red   { background: linear-gradient(90deg, var(--red), var(--red-2)); }

/* ─────────────────────────────────────────────
   PANELS
───────────────────────────────────────────── */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.full-panel { min-height: calc(100vh - 200px); }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}

.panel-title { font-size: 14px; font-weight: 700; color: var(--text); }
.panel-sub   { font-size: 12px; color: var(--muted); }
.panel-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ─────────────────────────────────────────────
   GURU LIST (Dashboard)
───────────────────────────────────────────── */
.search-box-sm {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  transition: border-color var(--t) var(--ease);
}
.search-box-sm:focus-within { border-color: var(--indigo); }
.search-box-sm svg { color: var(--muted); flex-shrink: 0; }
.search-box-sm input { background: none; border: none; outline: none; color: var(--text); font-family: inherit; font-size: 12px; width: 140px; }
.search-box-sm input::placeholder { color: var(--muted); }

.guru-list { overflow-y: auto; flex: 1; max-height: 420px; }
.guru-list::-webkit-scrollbar { width: 4px; }
.guru-list::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 2px; }

.guru-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  transition: background var(--t) var(--ease);
  cursor: default;
}
.guru-row:hover { background: rgba(255,255,255,0.02); }
.guru-row.filtered-out { display: none; }

.guru-num {
  width: 22px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  flex-shrink: 0;
}

.guru-ava {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  color: white;
  flex-shrink: 0;
  font-weight: 700;
}

.guru-info { flex: 1; min-width: 0; }
.guru-nama { font-weight:600; color:var(--text-color); margin-bottom:4px; font-size:15px; line-height:1.4; white-space:normal; }
.guru-stat-row { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.guru-stat-mini { font-size: 10px; color: var(--muted); }

.guru-pct-wrap { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.guru-pct-bar { width: 60px; height: 5px; background: var(--bg-3); border-radius: 3px; overflow: hidden; }
.guru-pct-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--green), var(--green-2)); transition: width 0.8s var(--ease); }
.guru-pct-num { font-size: 12px; font-weight: 700; color: var(--text-2); min-width: 34px; text-align: right; }

/* Avatar colors cycle */
.ava-0 { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.ava-1 { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.ava-2 { background: linear-gradient(135deg, #10b981, #059669); }
.ava-3 { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.ava-4 { background: linear-gradient(135deg, #ec4899, #8b5cf6); }

/* ─────────────────────────────────────────────
   WEEK CHART (Dashboard)
───────────────────────────────────────────── */
.week-chart { padding: 16px 20px; overflow-y: auto; flex: 1; max-height: 420px; }
.week-chart::-webkit-scrollbar { width: 4px; }
.week-chart::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 2px; }

.week-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.week-bar-row:last-child { border-bottom: none; }

.week-label { font-size: 12px; font-weight: 600; color: var(--text-2); width: 56px; flex-shrink: 0; }
.week-date  { font-size: 10px; color: var(--muted); width: 36px; flex-shrink: 0; }

.week-track { flex: 1; height: 8px; background: var(--bg-3); border-radius: 4px; overflow: hidden; position: relative; }
.week-fill-green { position: absolute; left: 0; top: 0; height: 100%; background: linear-gradient(90deg, var(--green), var(--green-2)); border-radius: 4px; transition: width 1s var(--ease); }
.week-fill-amber { position: absolute; top: 0; height: 100%; background: var(--amber); border-radius: 4px; transition: all 1s var(--ease); }
.week-fill-red   { position: absolute; top: 0; height: 100%; background: var(--red); border-radius: 4px; transition: all 1s var(--ease); }

.week-pct { font-size: 12px; font-weight: 700; color: var(--text-2); width: 38px; text-align: right; flex-shrink: 0; }

/* ─────────────────────────────────────────────
   TABLE VIEW
───────────────────────────────────────────── */
.select-sm {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-2);
  font-family: inherit;
  font-size: 12px;
  padding: 6px 10px;
  cursor: pointer;
  outline: none;
  transition: border-color var(--t) var(--ease);
}
.select-sm:focus { border-color: var(--indigo); }

.legend-inline { display: flex; align-items: center; gap: 6px; }
.chip {
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
}
.chip-green { background: var(--green-bg); color: var(--green-2); border: 1px solid var(--green-bdr); }
.chip-amber { background: var(--amber-bg); color: var(--amber-2); border: 1px solid var(--amber-bdr); }
.chip-red   { background: var(--red-bg);   color: var(--red-2);   border: 1px solid var(--red-bdr); }

.table-scroll { overflow: auto; flex: 1; }
.table-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.table-scroll::-webkit-scrollbar-track { background: transparent; }
.table-scroll::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 3px; }

.data-table { border-collapse: collapse; min-width: max-content; width: 100%; }

thead { position: sticky; top: 0; z-index: 3; }

.data-table thead tr:first-child th {
  background: var(--bg-2);
  border-bottom: 1px solid var(--border-2);
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 10px 10px;
  text-align: center;
  white-space: nowrap;
}

.data-table thead tr:nth-child(2) th {
  background: var(--surface);
  border-bottom: 1px solid var(--border-2);
  font-size: 11px;
  font-weight: 600;
  color: var(--amber-2);
  padding: 7px 10px;
  text-align: center;
  white-space: nowrap;
}

/* Sticky columns - Re-added as per user request */
th.col-bil, td.col-bil {
  width: 48px; text-align: center;
  position: sticky; left: 0;
  z-index: 2;
}
th.col-name, td.col-name {
  min-width: 210px; max-width: 250px; text-align: left;
  border-right: 1px solid var(--border-2);
  position: sticky; left: 48px;
  z-index: 2;
}
th.col-summary, td.col-summary {
  min-width: 100px; text-align: center;
  border-left: 1px solid var(--border-2);
}

.data-table thead tr:first-child th.col-bil,
.data-table thead tr:first-child th.col-name { z-index: 5; background: var(--bg-2); }
.data-table thead tr:first-child th.col-summary { z-index: 4; background: var(--bg-2); }

.data-table thead tr:nth-child(2) th.col-bil,
.data-table thead tr:nth-child(2) th.col-name { z-index: 5; background: var(--surface); }
.data-table thead tr:nth-child(2) th.col-summary { z-index: 4; background: var(--surface); }

.data-table td { background: var(--surface); }
.data-table tbody tr td.col-bil,
.data-table tbody tr td.col-name,
.data-table tbody tr td.col-summary { background: var(--surface); }

.data-table tbody tr:hover td { background: var(--surface-2); }

.data-table td {
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  padding: 0;
}
.data-table td.col-bil { height: 52px; font-size: 11px; font-weight: 700; color: var(--muted); padding: 0 6px; }
.data-table td.col-name { padding: 0 16px; height: 52px; }

.name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.name-ava {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: white; flex-shrink: 0;
}
.name-text { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }

/* STATUS CELL BUTTONS */
.cell-btn {
  width: 100%;
  height: 52px;
  min-width: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  background: transparent;
  transition: background var(--t) var(--ease);
  outline: none;
  position: relative;
}
.cell-btn:hover { background: rgba(255,255,255,0.03); }
.cell-btn:focus-visible { box-shadow: inset 0 0 0 2px var(--indigo); border-radius: 4px; }

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 26px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  transition: all var(--t) var(--ease);
  gap: 3px;
  padding: 0 8px;
}

.cell-btn[data-value="2"] .status-pill {
  background: var(--green-bg);
  color: var(--green-2);
  border: 1px solid var(--green-bdr);
}
.cell-btn[data-value="2"]:hover .status-pill {
  background: rgba(16,185,129,0.2);
  box-shadow: 0 0 10px rgba(16,185,129,0.25);
}

.cell-btn[data-value="1"] .status-pill {
  background: var(--amber-bg);
  color: var(--amber-2);
  border: 1px solid var(--amber-bdr);
}
.cell-btn[data-value="1"]:hover .status-pill {
  background: rgba(245,158,11,0.2);
  box-shadow: 0 0 10px rgba(245,158,11,0.25);
}

.cell-btn[data-value="3"] .status-pill {
  background: var(--red-bg);
  color: var(--red-2);
  border: 1px solid var(--red-bdr);
}
.cell-btn[data-value="3"]:hover .status-pill {
  background: rgba(239,68,68,0.2);
  box-shadow: 0 0 10px rgba(239,68,68,0.25);
}

.cell-btn[data-value="0"] .status-pill {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

/* Changed indicator */
.cell-btn.changed::after {
  content: '';
  position: absolute;
  top: 6px; right: 8px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--amber);
  border: 1.5px solid var(--surface);
}

/* Summary cell */
.sum-cell { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 12px; }
.sum-pct { font-size: 13px; font-weight: 800; }
.sum-pct.good { color: var(--green-2); }
.sum-pct.warn { color: var(--amber-2); }
.sum-pct.bad  { color: var(--red-2); }
.sum-bar { width: 56px; height: 4px; background: var(--bg-3); border-radius: 2px; overflow: hidden; }
.sum-fill { height: 100%; border-radius: 2px; }
.sum-fill.good { background: linear-gradient(90deg, var(--green), var(--green-2)); }
.sum-fill.warn { background: linear-gradient(90deg, var(--amber), var(--amber-2)); }
.sum-fill.bad  { background: linear-gradient(90deg, var(--red), var(--red-2)); }

/* filtered */
.data-table tbody tr.filtered-out { display: none; }

/* ─────────────────────────────────────────────
   WEEKS VIEW
───────────────────────────────────────────── */
.weeks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  padding: 20px;
}

.week-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all var(--t) var(--ease);
  cursor: pointer;
}
.week-card:hover { border-color: var(--indigo); transform: translateY(-2px); box-shadow: 0 4px 20px rgba(99,102,241,0.15); }

.week-card-header { display: flex; align-items: flex-start; justify-content: space-between; }
.week-num { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.week-date-badge {
  font-size: 10px; font-weight: 600;
  color: var(--indigo-2);
  background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.2);
  padding: 2px 8px; border-radius: 100px;
}

.week-big-pct { font-size: 28px; font-weight: 800; letter-spacing: -1px; color: var(--text); }

.week-mini-bars { display: flex; flex-direction: column; gap: 5px; }
.wbar-row { display: flex; align-items: center; gap: 8px; }
.wbar-label { font-size: 10px; color: var(--muted); width: 44px; flex-shrink: 0; }
.wbar-track { flex: 1; height: 5px; background: var(--bg-3); border-radius: 3px; overflow: hidden; }
.wbar-fill-green { height: 100%; background: var(--green-2); border-radius: 3px; }
.wbar-fill-amber { height: 100%; background: var(--amber-2); border-radius: 3px; }
.wbar-fill-red   { height: 100%; background: var(--red-2);   border-radius: 3px; }
.wbar-n { font-size: 10px; font-weight: 600; color: var(--text-2); width: 20px; text-align: right; }

/* ─────────────────────────────────────────────
   TOAST
───────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  padding: 12px 22px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 100px;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─────────────────────────────────────────────
   MODAL
───────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 100;
}

.modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 90%; max-width: 480px;
  background: var(--bg-1);
  border: 1px solid var(--border-2);
  border-radius: 20px;
  z-index: 101;
  box-shadow: var(--shadow-lg);
  animation: riseUp 0.3s var(--ease) both;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 24px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.modal-title-wrap { display: flex; align-items: center; gap: 14px; }
.modal-icon { font-size: 22px; }
.modal-title { font-size: 16px; font-weight: 700; color: var(--text); }
.modal-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.modal-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: var(--surface); border-radius: var(--radius-xs);
  color: var(--text-2); cursor: pointer;
  transition: all var(--t) var(--ease);
  flex-shrink: 0;
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }

.modal-body { padding: 24px; display: flex; flex-direction: column; gap: 20px; }

.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.form-input {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 11px 13px;
  outline: none;
  transition: border-color var(--t) var(--ease);
}
.form-input:focus { border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(99,102,241,0.12); }
.form-hint { font-size: 11px; color: var(--muted); }

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 24px 24px;
}

.btn-ghost {
  padding: 9px 18px;
  background: transparent;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: all var(--t) var(--ease);
}
.btn-ghost:hover { background: var(--surface); color: var(--text); }

.btn-primary {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 20px;
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  border: none; border-radius: var(--radius-sm);
  color: white;
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: all var(--t) var(--ease);
  box-shadow: 0 2px 12px rgba(99,102,241,0.35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(99,102,241,0.45); }

/* ─────────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────────── */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-row { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  :root { --sidebar-w: 200px; }
}
@media (max-width: 700px) {
  .sidebar { display: none; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .view-content { padding: 16px; }
  .topbar { padding: 0 16px; }
}

/* ─────────────────────────────────────────────
   PEMERIKSA FILTER (Sidebar)
───────────────────────────────────────────── */
.pemeriksa-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pemeriksa-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 12px;
  border-radius: var(--radius-xs);
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--t) var(--ease);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pemeriksa-btn:hover { background: var(--surface); color: var(--text); }
.pemeriksa-btn.active {
  background: rgba(99,102,241,0.15);
  color: var(--indigo-2);
  font-weight: 600;
}

/* ─────────────────────────────────────────────
   GURU LIST ENHANCEMENTS
───────────────────────────────────────────── */
.pemeriksa-tag {
  font-size: 10px;
  color: var(--muted);
  background: var(--bg-3);
  padding: 1px 6px;
  border-radius: 4px;
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
}
.stat-tag.red   { background: var(--red-bg);   color: var(--red-2); }
.stat-tag.amber { background: var(--amber-bg); color: var(--amber-2); }

/* Guru row status border-left indicator */
.guru-row.danger { border-left: 3px solid var(--red); }
.guru-row.warn   { border-left: 3px solid var(--amber); }
.guru-row.perfect { border-left: 3px solid var(--green); }

/* PCT bar color variants */
.guru-pct-fill.pct-good    { background: linear-gradient(90deg, var(--green), var(--green-2)); }
.guru-pct-fill.pct-warn    { background: linear-gradient(90deg, var(--amber), var(--amber-2)); }
.guru-pct-fill.pct-danger  { background: linear-gradient(90deg, var(--red),   var(--red-2));   }
.guru-pct-fill.pct-perfect { background: linear-gradient(90deg, var(--green), var(--green-2)); }

/* ─────────────────────────────────────────────
   TABLE — PEMERIKSA COLUMN + HIDDEN
───────────────────────────────────────────── */
th.col-pemeriksa, td.col-pemeriksa {
  min-width: 160px;
  max-width: 200px;
  text-align: left;
  border-left: 1px solid var(--border-2);
}

.data-table tbody tr:hover td.col-pemeriksa { background: var(--surface-2); }

.pemeriksa-cell {
  font-size: 11px;
  color: var(--text-2);
  padding: 0 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table tbody tr.pemeriksa-hidden,
.data-table tbody tr.filtered-out { display: none; }

/* ─────────────────────────────────────────────
   SUMMARY CELL — LINK BUTTON
───────────────────────────────────────────── */
.link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  text-decoration: none;
  padding: 1px 4px;
  border-radius: 4px;
  transition: all var(--t) var(--ease);
  margin-top: 3px;
  opacity: 0.6;
}
.link-btn:hover { opacity: 1; background: var(--blue-bg); }

/* ─────────────────────────────────────────────
   WEEK CARD — ALERTS
───────────────────────────────────────────── */
.week-alert {
  font-size: 10px;
  color: var(--red-2);
  background: var(--red-bg);
  border: 1px solid var(--red-bdr);
  border-radius: 6px;
  padding: 5px 8px;
  line-height: 1.5;
}
.week-warn {
  font-size: 10px;
  color: var(--amber-2);
  background: var(--amber-bg);
  border: 1px solid var(--amber-bdr);
  border-radius: 6px;
  padding: 5px 8px;
  line-height: 1.5;
}

/* ─────────────────────────────────────────────
   SIDEBAR ID (for JS querySelector)
───────────────────────────────────────────── */
#sidebar-nav { display: contents; }


/* ─────────────────────────────────────────────
   MOBILE RESPONSIVENESS & UTILITIES
───────────────────────────────────────────── */
.name-main, .guru-nama {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: normal;
  word-break: break-word;
  line-height: 1.3;
}

@media (max-width: 768px) {
  .app {
    flex-direction: column;
    padding-bottom: 70px; /* Space for bottom nav */
  }
  
  .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 70px;
    background: var(--bg-1);
    border-top: 1px solid var(--border);
    border-right: none;
    flex-shrink: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
  }
  
  .sidebar-brand { display: none; }
  .sidebar-header { display: none; }
  .sidebar-footer { display: none; }
  
  .sidebar-nav, #sidebar-nav {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 0 8px;
    gap: 0;
  }
  
  .nav-item {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 8px 4px;
    gap: 4px;
    font-size: 11px;
    flex: 1;
    margin: 0;
    border-radius: 8px;
  }
  
  .nav-item svg {
    margin: 0;
    width: 22px;
    height: 22px;
  }
  
  .nav-section-label {
    display: none !important;
  }
  
  .pemeriksa-section {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    padding: 8px 12px;
    gap: 8px;
    border-top: none;
    align-items: center;
    background: var(--bg-2);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 900;
    border-bottom: 1px solid var(--border);
  }
  
  .main-content {
    margin-top: 50px; /* if pemeriksa-section is fixed at top */
  }
  
  .pemeriksa-btn {
    white-space: nowrap;
    margin: 0;
    padding: 6px 12px;
    font-size: 12px;
  }
  
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 16px;
    gap: 12px;
  }
  
  .topbar-right {
    width: 100%;
    justify-content: space-between;
  }
  
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  
  .charts-row {
    flex-direction: column;
  }
  
  .monthly-grid > div {
    min-width: 100% !important;
  }
  
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}


/* Logout Modal */
#logout-modal .modal-content {
  background: var(--card-bg);
  padding: 24px;
  border-radius: 16px;
  width: 90%;
  max-width: 320px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.btn-cancel {
  padding: 10px 16px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-color);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
}
.btn-confirm {
  padding: 10px 16px;
  border: none;
  background: var(--danger-color, #ef4444);
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
}
