/* === BASE STYLE=== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background:
    radial-gradient(1100px circle at 88% -8%, rgba(0,74,116,0.07), transparent 55%),
    radial-gradient(900px circle at -8% 95%, rgba(201,162,39,0.06), transparent 55%),
    #f8fafc;
  background-attachment: fixed;
  color: #0f172a;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* === CSS VARIABLES === */
/* Tema: Biru UGM + Kuning UGM (institusional, tetap segar) */
:root {
  --primary:       #004A74;
  --primary-dark:  #003654;
  --primary-light: #e8f1f5;
  --accent:        #C9A227;
  --accent-dark:   #A8841A;
  --success:       #059669;
  --warning:       #f97316;
  --danger:        #dc2626;
  --bg:            #f8fafc;
  --card:          #ffffff;
  --border:        #e4eaf4;
  --text:          #0f172a;
  --muted:         #64748b;
  --sidebar-bg:    #0a0f1e;
  --sidebar-w:     260px;
  --global-topbar-bg: #ffffff;
  /* BUG FIX #1: tambah variabel shadow yang benar */
  --shadow-card:   0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* === HIDDEN === */
.hidden { display: none !important; }

/* === UTILITY === */
.font-display { font-family: 'Inter', sans-serif; }

/* ============================================================
   SPLASH SCREEN
   ============================================================ */
#splashScreen {
  position: fixed; inset: 0; z-index: 99999;
  background: linear-gradient(135deg, #0a0f1e 0%, #003654 60%, #004A74 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
}
.splash-logo {
  width: 72px; height: 72px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(10px);
  animation: splashPulse 2s ease-in-out infinite;
}
@keyframes splashPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.1); }
  50% { box-shadow: 0 0 0 12px rgba(255,255,255,0); }
}
.splash-progress-track {
  width: 200px; height: 3px;
  background: rgba(255,255,255,0.12);
  border-radius: 10px; overflow: hidden;
}
.splash-progress-bar {
  height: 100%; border-radius: 10px;
  background: linear-gradient(90deg, #60a5fa, #fff);
  animation: progress 2.5s ease-in-out infinite;
}
@keyframes progress {
  0%   { width: 0%; opacity: 1; }
  70%  { width: 85%; opacity: 1; }
  100% { width: 100%; opacity: 0; }
}

/* ============================================================
   LOGIN PAGE — split-screen: ilustrasi (kiri) + form (kanan)
   ============================================================ */
#loginPage {
  min-height: 100vh;
  display: flex;
  background: #f8fafc;
}

/* ── Panel kiri: ilustrasi lab ── */
.login-visual {
  flex: 1 1 70%;
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #0a0f1e 0%, #003654 55%, #004A74 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 40px;
  min-width: 0;
}
.login-visual-hex { position: absolute; inset: 0; width: 100%; height: 100%; }
.login-visual-glow { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-58%); pointer-events: none; }
.login-visual-inner { position: relative; width: 100%; max-width: 360px; aspect-ratio: 340/320; z-index: 1; }
.login-visual-illust { position: relative; width: 100%; height: 100%; filter: drop-shadow(0 20px 40px rgba(0,0,0,0.35)); }
.login-visual-text {
  position: relative; z-index: 1; text-align: center; max-width: 380px; margin-top: 8px;
  color: #fff;
}
.login-visual-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px; padding: 6px 14px 6px 8px;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.3px; color: #cfe4ee;
  margin-bottom: 18px;
}
.login-visual-text h1 {
  font-family: 'Inter', sans-serif; font-size: 30px; font-weight: 800;
  letter-spacing: -0.6px; margin-bottom: 10px;
}
.login-visual-text p {
  font-size: 13.5px; line-height: 1.6; color: rgba(255,255,255,0.68); font-weight: 400;
}

/* Animasi proses pembacaan spektrofotometer — titik cahaya melintasi
   kuvet, kurva absorbansi "tergambar" di layar, indikator status
   menyala saat pembacaan selesai, angka hasil (λ/Abs) bergantian. */
.login-spectro-dot {
  animation: spectroSweep 3.2s ease-in-out infinite;
}
@keyframes spectroSweep {
  0%   { transform: translateX(0);    opacity: 0; }
  8%   { opacity: 1; }
  46%  { transform: translateX(72px); opacity: 1; }
  54%  { opacity: 0; }
  100% { transform: translateX(72px); opacity: 0; }
}

.login-spectro-curve {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: spectroDraw 3.2s ease-in-out infinite;
}
@keyframes spectroDraw {
  0%   { stroke-dashoffset: 100; opacity: 0.9; }
  50%  { stroke-dashoffset: 0;   opacity: 1; }
  78%  { stroke-dashoffset: 0;   opacity: 1; }
  100% { stroke-dashoffset: 100; opacity: 0; }
}

.login-spectro-led {
  animation: spectroLed 3.2s ease-in-out infinite;
}
@keyframes spectroLed {
  0%, 40%   { opacity: 0.35; }
  50%       { opacity: 1; }
  70%, 100% { opacity: 0.35; }
}

.login-spectro-val-a, .login-spectro-val-b { animation-duration: 3.2s; animation-iteration-count: infinite; }
.login-spectro-val-a { animation-name: spectroValA; }
.login-spectro-val-b { animation-name: spectroValB; }
@keyframes spectroValA { 0%, 45% { opacity: 1; } 55%, 100% { opacity: 0; } }
@keyframes spectroValB { 0%, 45% { opacity: 0; } 55%, 100% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .login-spectro-dot, .login-spectro-curve, .login-spectro-led,
  .login-spectro-val-a, .login-spectro-val-b { animation: none; }
  .login-spectro-curve { stroke-dashoffset: 0; opacity: 1; }
  .login-spectro-val-a { opacity: 1; }
  .login-spectro-val-b { opacity: 0; }
}

/* ── Panel kanan: form login ── */
.login-panel {
  flex: 1 1 30%;
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
  min-width: 0;
}
.login-card-icon-mobile { display: none; }
.login-card {
  background: #fff;
  border-radius: 24px;
  padding: 40px;
  width: 400px;
  max-width: 100%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  position: relative; z-index: 1;
  animation: slideUp 0.5s ease forwards;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

.login-hint-box summary::-webkit-details-marker { display: none; }
.login-hint-box summary { outline: none; }
.login-hint-chevron { transition: transform 0.2s ease; }
.login-hint-box[open] .login-hint-chevron { transform: rotate(180deg); }

/* Sisi kiri disembunyikan di layar sempit (tablet portrait & HP) —
   form tetap full-screen seperti sebelumnya. */
@media (max-width: 900px) {
  .login-visual { display: none; }
  .login-panel { flex: 1 1 100%; padding: 0; }
  .login-card-icon-mobile { display: inline-flex; }
}
.login-input {
  width: 100%;
  border: 1.5px solid #e4eaf4;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: #0f172a;
  background: #f8fafc;
  transition: all 0.2s;
  outline: none;
}
.login-input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0,74,116,0.1);
}
.login-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #004A74, #003654);
  color: #fff;
  font-family: 'Inter', sans-serif; font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.3px;
  border: none; border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.login-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(0,74,116,0.35); }
.login-btn:active { transform: translateY(0); }

/* ============================================================
   SIDEBAR
   ============================================================ */
#sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  position: fixed; left: 0; top: 0;
  background: linear-gradient(165deg, #0a0f1e 0%, #0d1f2e 45%, #0a0f1e 100%);
  display: flex; flex-direction: column;
  z-index: 1000;
  transition: transform 0.3s ease;
  border-radius: 0;
  box-shadow: 4px 0 20px rgba(0,0,0,0.12);
  overflow: hidden;
}
#sidebar::before {
  content: '';
  position: absolute; top: -60px; right: -60px;
  width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(201,162,39,0.16), transparent 70%);
  pointer-events: none;
}
.sidebar-brand {
  padding: 20px 18px 14px;
  display: flex; align-items: center; gap: 12px;
}
.sidebar-brand-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, #C9A227, #A8841A);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-brand-icon svg { width: 18px; height: 18px; color: white; }
.sidebar-brand-name { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 14px; color: #fff; letter-spacing: -0.3px; }
.sidebar-brand-sub { font-size: 10px; color: #64748b; margin-top: 2px; font-weight: 400; line-height: 1.35; }
.sidebar-profile-card {
  margin: 0 8px 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.06);
  text-align: left;
}
.sidebar-profile-name { font-size: 12.5px; font-weight: 600; color: #e2e8f0; letter-spacing: -0.1px; }
.sidebar-profile-role { font-size: 11px; color: #94a3b8; margin-top: 1px; }
.nav-scroller {
  flex: 1; overflow-y: auto; padding: 4px 0 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.14) transparent;
}
.nav-scroller::-webkit-scrollbar { width: 5px; }
.nav-scroller::-webkit-scrollbar-track { background: transparent; }
.nav-scroller::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 10px; }
.nav-scroller::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.28); }
.nav-group-label { font-size: 10px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: #334155; padding: 14px 20px 6px; }
.nav-item-wrap { padding: 2px 10px; }
.nav-link {
  color: #64748b;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 13.5px; font-weight: 500;
  text-decoration: none;
  transition: all 0.18s;
  cursor: pointer;
  position: relative;
}
.nav-link i { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }
.nav-link:hover { background: rgba(255,255,255,0.06); color: #e2e8f0; }
.nav-link.active {
  background: rgba(201,162,39,0.14);
  color: #f2c94c !important; font-weight: 600;
}
.nav-link.active i { color: #C9A227; }
.nav-badge { background: #dc2626; color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 10px; margin-left: auto; min-width: 18px; text-align: center; }
.sidebar-footer { padding: 10px 10px 14px; border-top: 1px solid rgba(255,255,255,0.06); }
.sidebar-user { display: none; }
.sidebar-user-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #004A74, #1c7ba3); color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-family: 'Inter', sans-serif; }
.sidebar-user-name { font-size: 12.5px; font-weight: 600; color: #e2e8f0; }
.sidebar-user-role { font-size: 10.5px; color: #475569; margin-top: 1px; }

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
#mainContent { margin-left: var(--sidebar-w); padding: 28px 32px; padding-top: calc(28px + 52px); min-height: 100vh; transition: margin-left 0.3s ease; }

/* ============================================================
   TOP BAR
   ============================================================ */
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.topbar-title { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 21px; letter-spacing: -0.5px; }
.topbar-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ============================================================
   GLOBAL TOPBAR — strip tunggal, menyatu, mepet ke atas.
   Terpisah dari judul menu (.topbar-title di bawahnya).
   ============================================================ */
#globalTopbar {
  position: fixed; top: 0;
  left: var(--sidebar-w); right: 0;
  height: 52px; z-index: 900;
  display: flex; align-items: center; justify-content: flex-end; gap: 16px;
  padding: 0 32px;
  background: var(--global-topbar-bg);
  border-bottom: 1px solid var(--border);
}

.global-topbar-date { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.global-topbar-divider { width: 1px; height: 20px; background: var(--border); flex-shrink: 0; }

/* Identitas login — tombol dropdown, menyatu dengan strip (tanpa card terpisah) */
.topbar-user-wrap { position: relative; }
.topbar-user {
  position: relative; display: flex; align-items: center; gap: 9px;
  padding: 5px 10px 5px 5px; border-radius: 999px;
  background: transparent; border: 1px solid transparent;
  cursor: pointer; font: inherit; text-align: left;
  transition: background 0.15s;
}
.topbar-user:hover { background: rgba(15,23,42,0.05); }
.topbar-avatar{ width:34px; height:34px; border-radius:50%; overflow:hidden; flex-shrink:0; background:linear-gradient(135deg,#004A74,#1c7ba3); color:#fff; font-size:13px; font-weight:700; display:flex; align-items:center; justify-content:center; font-family:'Inter',sans-serif; }
.topbar-user-text { line-height: 1.25; }
.topbar-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; color: var(--text); }
.topbar-role { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.topbar-user-caret { font-size: 11px; color: var(--muted); margin-left: 2px; transition: transform 0.18s; }
.topbar-user-wrap.open .topbar-user-caret { transform: rotate(180deg); }

.topbar-user-menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 50;
  min-width: 200px; padding: 6px;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 16px 40px rgba(15,23,42,0.22);
}
.topbar-user-menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px;
  font-size: 13px; font-weight: 500; color: var(--text, #1e293b);
  cursor: pointer; text-decoration: none;
}
.topbar-user-menu-item i { font-size: 14px; width: 16px; text-align: center; color: var(--muted); }
.topbar-user-menu-item:hover { background: #f1f5f9; }
.topbar-user-menu-divider { height: 1px; background: var(--border); margin: 5px 4px; }
.topbar-user-menu-danger { color: #dc2626; }
.topbar-user-menu-danger i { color: #dc2626; }
.topbar-user-menu-danger:hover { background: #fef2f2; }

/* ============================================================
   CARD COMPONENT
   ============================================================ */
/* BUG FIX #1: box-shadow: var(--card) diganti dengan var(--shadow-card) */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 22px; box-shadow: var(--shadow-card); margin-bottom: 20px; }
.card-title { font-family: 'Inter', sans-serif; font-size: 14.5px; font-weight: 700; letter-spacing: -0.2px; margin-bottom: 16px; }

/* ============================================================
   STAT CARDS
   ============================================================ */
/* BUG FIX #1: box-shadow: var(--card) diganti dengan var(--shadow-card) */
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 18px 20px; box-shadow: var(--shadow-card); transition: all 0.2s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
.stat-icon { width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 12px; }
.stat-val { font-family: 'Inter', sans-serif; font-size: 28px; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 3px; }
.stat-action { font-size: 11.5px; color: var(--primary); font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 3px; margin-top: 8px; text-decoration: none; }
.stat-action:hover { text-decoration: underline; }

/* ============================================================
   BADGE
   ============================================================ */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; font-family: 'Inter', sans-serif; }
.b-green  { background: #dcfce7; color: #166534; }
.b-amber  { background: #fef3c7; color: #92400e; }
.b-red    { background: #fee2e2; color: #991b1b; }
.b-blue   { background: #dceef2; color: #003654; }
.b-gray   { background: #f1f5f9; color: #475569; }
.b-purple { background: #ede9fe; color: #6d28d9; }
.b-teal   { background: #ccfbf1; color: #0f766e; }
.b-accent { background: #ffedd5; color: #c2410c; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 20px; border-radius: 999px; font-size: 13.5px; font-weight: 600; font-family: 'Inter', sans-serif; border: none; cursor: pointer; transition: all 0.18s; text-decoration: none; line-height: 1; }
.btn-primary { background: linear-gradient(135deg, #004A74, #003654); color: #fff; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,74,116,0.35); }
.btn-success { background: linear-gradient(135deg, #059669, #047857); color: #fff; }
.btn-success:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(5,150,105,0.3); }
.btn-warning { background: linear-gradient(135deg, #f97316, #c2410c); color: #fff; }
.btn-warning:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(249,115,22,0.3); }
.btn-accent  { background: linear-gradient(135deg, #C9A227, #A8841A); color: #fff; }
.btn-accent:hover  { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(201,162,39,0.35); }
.btn-danger  { background: linear-gradient(135deg, #dc2626, #b91c1c); color: #fff; }
.btn-danger:hover  { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(220,38,38,0.3); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn-sm  { padding: 5px 14px; font-size: 12px; border-radius: 999px; }
.btn-xs  { padding: 4px 11px; font-size: 11px; border-radius: 999px; }
.btn-icon { width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 15px; }

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-label { font-size: 12.5px; font-weight: 600; margin-bottom: 5px; display: block; color: #374151; }
.form-control, .form-select { border: 1.5px solid var(--border); border-radius: 9px; padding: 9px 13px; font-size: 13.5px; font-family: 'Inter', sans-serif; width: 100%; background: #fff; color: var(--text); transition: all 0.18s; outline: none; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,74,116,0.1); }
.form-control::placeholder { color: #94a3b8; }

/* Input password dengan tombol tampil/sembunyi (Ganti Password) */
.gp-input-wrap { position: relative; }
.gp-input-wrap .form-control { padding-right: 40px; }
.gp-eye-btn {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border: none; background: transparent;
  color: var(--muted); cursor: pointer; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.gp-eye-btn:hover { background: #f1f5f9; color: var(--text); }
.search-wrap { display: flex; align-items: center; background: #fff; border: 1.5px solid var(--border); border-radius: 24px; padding: 7px 14px; gap: 8px; transition: all 0.18s; }
.search-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,74,116,0.08); }
.search-wrap input { border: none; outline: none; font-size: 13.5px; font-family: 'Inter', sans-serif; background: transparent; flex: 1; }
.search-wrap i { color: var(--muted); font-size: 14px; }
.sel-badge { border: none; border-radius: 20px; font-size: 11px; font-weight: 600; padding: 4px 22px 4px 9px; cursor: pointer; outline: none; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 7px center; font-family: 'Inter', sans-serif; }
.sel-green { background-color: #dcfce7; color: #166534; }
.sel-amber { background-color: #fef3c7; color: #92400e; }
.sel-red   { background-color: #fee2e2; color: #991b1b; }

/* ============================================================
   TABLES
   ============================================================ */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.tbl thead th { background: #f8fafc; color: #475569; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.7px; padding: 11px 14px; border-bottom: 1px solid var(--border); position: sticky; top: 0; overflow: hidden; text-overflow: ellipsis; text-align: left; vertical-align: middle; }
.tbl thead th:first-child { border-radius: 8px 0 0 0; }
.tbl thead th:last-child { border-radius: 0 8px 0 0; }
.tbl tbody tr { border-bottom: 1px solid #f1f5f9; transition: background 0.15s; }
.tbl tbody tr:hover { background: #f8fafc; }
.tbl tbody tr:hover td:first-child { border-radius: 12px 0 0 12px; }
.tbl tbody tr:hover td:last-child { border-radius: 0 12px 12px 0; }
.tbl tbody tr:last-child { border-bottom: none; }
.tbl td { padding: 11px 14px; font-size: 13.5px; vertical-align: middle; overflow: hidden; text-align: left; }
.tbl-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--border); }
.tbl th.tc, .tbl td.tc { text-align: center; }

/* ============================================================
   TAB NAVIGATION
   ============================================================ */
.tab-nav { display: flex; gap: 3px; padding: 4px; background: #f1f5f9; border-radius: 999px; width: fit-content; margin-bottom: 18px; }
.tab-btn { padding: 8px 18px; border-radius: 999px; font-size: 13px; font-weight: 600; font-family: 'Inter', sans-serif; border: none; cursor: pointer; transition: all 0.18s; background: transparent; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.tab-btn.active { background: #fff; color: var(--primary); box-shadow: 0 1px 4px rgba(0,0,0,0.08); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay { position: fixed; inset: 0; background: rgba(10,15,30,0.6); z-index: 9000; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(3px); animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box { background: var(--card); border-radius: 24px; box-shadow: 0 20px 60px rgba(0,0,0,0.2), 0 0 0 1px rgba(255,255,255,0.5); padding: 28px; max-height: 92vh; overflow-y: auto; position: relative; animation: slideUp 0.25s ease; }
.modal-box::-webkit-scrollbar { width: 4px; }
.modal-box::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 4px; }
.modal-w-sm { width: 380px; }
.modal-w-md { width: 520px; }
.modal-w-lg { width: 700px; }
.modal-w-xl { width: 860px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-head h5 { font-family: 'Inter', sans-serif; font-size: 16px; font-weight: 800; margin: 0; }
.modal-close { background: #f1f5f9; border: none; width: 30px; height: 30px; border-radius: 8px; font-size: 18px; cursor: pointer; color: var(--muted); display: flex; align-items: center; justify-content: center; transition: all 0.15s; }
.modal-close:hover { background: #fee2e2; color: var(--danger); }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination-wrap { display: flex; align-items: center; justify-content: space-between; padding: 14px 4px 0; flex-wrap: wrap; gap: 8px; }
.pagination-info { font-size: 12.5px; color: var(--muted); }
.pagination-btns { display: flex; gap: 3px; flex-wrap: wrap; }
.pg-btn { min-width: 32px; height: 32px; padding: 0 8px; border-radius: 7px; border: 1.5px solid var(--border); background: #fff; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--text); transition: all 0.15s; display: inline-flex; align-items: center; justify-content: center; font-family: 'Inter', sans-serif; }
.pg-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.pg-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pg-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 24px; text-align: center; }
.empty-state-icon { width: 72px; height: 72px; border-radius: 22px; background: #f1f5f9; display: flex; align-items: center; justify-content: center; font-size: 32px; margin-bottom: 16px; }
.empty-state-title { font-family: 'Inter', sans-serif; font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.empty-state-sub { font-size: 13px; color: var(--muted); margin-bottom: 16px; max-width: 280px; }

/* ============================================================
   ALERT / CALLOUT
   ============================================================ */
.callout { border-radius: 16px; padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.callout-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.callout-info    { background: #e8f1f5; border: 1px solid #bcd8e2; }
.callout-warning { background: #fffbeb; border: 1px solid #fde68a; }
.callout-success { background: #f0fdf4; border: 1px solid #bbf7d0; }
.callout-danger  { background: #fff5f5; border: 1px solid #fecaca; }
.callout-title { font-size: 13px; font-weight: 700; margin-bottom: 3px; }
.callout-body  { font-size: 12.5px; line-height: 1.5; }

/* ============================================================
   PROFILE CARD (Mahasiswa)
   ============================================================ */
.profile-hero { background: linear-gradient(135deg, #003654 0%, #004A74 60%, #1c7ba3 100%); border-radius: 14px; padding: 24px; color: #fff; position: relative; overflow: hidden; }
.profile-hero::before { content: ''; position: absolute; top: -40px; right: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,0.05); }
.profile-hero::after { content: ''; position: absolute; bottom: -30px; right: 60px; width: 100px; height: 100px; border-radius: 50%; background: rgba(255,255,255,0.04); }
.profile-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 12.5px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.profile-row:last-child { border-bottom: none; }
.profile-row .lbl { color: rgba(255,255,255,0.55); }
.profile-row .val { font-weight: 600; text-align: right; max-width: 60%; }

/* ============================================================
   EXPORT CARD
   ============================================================ */
.export-card { border: 2px solid var(--border); border-radius: 18px; padding: 20px 16px; cursor: pointer; text-align: center; transition: all 0.2s; }
.export-card:hover { border-color: var(--primary); background: var(--primary-light); transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,74,116,0.12); }

/* ============================================================
   PAYMENT SUMMARY
   ============================================================ */
.pay-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.pay-row:last-child { border-bottom: none; }
.pay-total { background: linear-gradient(135deg, #003654, #004A74); color: #fff; border-radius: 10px; padding: 13px 16px; margin-top: 14px; display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 14px; }

/* ============================================================
   SKELETON LOADER
   ============================================================ */
.skeleton { background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 6px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ============================================================
   CHECKLIST
   ============================================================ */
.checklist-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; border: 1.5px solid var(--border); transition: all 0.2s; cursor: pointer; }
.checklist-item.done { background: #f0fdf4; border-color: #bbf7d0; }
.checklist-step { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; font-family: 'Inter', sans-serif; }

/* ============================================================
   SECTION FORM
   ============================================================ */
.section-form { background: #f8fafc; border: 1.5px solid var(--border); border-radius: 18px; padding: 18px 20px; margin-bottom: 20px; }

/* ============================================================
   IDENTITY CARD
   ============================================================ */
.identity-card { background: #fff; border: 1.5px solid var(--border); border-radius: 18px; padding: 14px 16px; transition: all 0.18s; }
.identity-card:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,74,116,0.08); }

/* ============================================================
   RESPONSIVE — Mobile
   ============================================================ */
@media (max-width: 768px) {
  #sidebar { transform: translateX(-260px); }
  #mainContent { margin-left: 0 !important; padding-top: 28px; }
  .topbar { display: none; }
  #globalTopbar { display: none; }
  .modal-box { width: 95vw !important; max-width: 95vw; padding: 18px; }
}

/* ============================================================
   MOBILE TOP BAR
   ============================================================ */
#mobileTopbar { 
  display: none; 
}
@media (max-width: 768px) { #mobileTopbar { display: flex; } }

/* ============================================================
   BOTTOM NAVIGATION (mobile) - hapus, ganti sidebar
   ============================================================ */
/*#bottomNav { display: none; position: fixed; bottom: 0; left: 0; right: 0; height: 60px; background: #0a0f1e; z-index: 2000; border-top: 1px solid rgba(255,255,255,0.07); overflow-x: auto; -webkit-overflow-scrolling: touch; }
#bottomNav::-webkit-scrollbar { display: none; }
#bottomNav .bn-inner { display: flex; align-items: center; height: 100%; min-width: max-content; padding: 0 6px; }
#bottomNav .bn-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 0 12px; height: 100%; cursor: pointer; color: #475569; transition: color 0.18s; min-width: 56px; border: none; background: none; }
#bottomNav .bn-item.active { color: #60a5fa; }
#bottomNav .bn-item i { font-size: 19px; }
#bottomNav .bn-item span { font-size: 9px; font-weight: 600; white-space: nowrap; font-family: 'Inter', sans-serif; }
@media (max-width: 768px) { #bottomNav { display: block; } }
*/
/* ============================================================
   MISC
   ============================================================ */
code { background: #f1f5f9; color: var(--primary); padding: 2px 7px; border-radius: 5px; font-size: 12px; }
.divider { border-top: 1px solid var(--border); margin: 14px 0; }
.chart-wrap { height: 300px; position: relative; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.detail-hero-grid { display: grid; grid-template-columns: auto 1fr; }

/* .stat-grid: dipakai untuk kartu ringkasan (Dashboard Dosen, Publikasi Riset,
   Rekap Publikasi Lab, dll). Pakai auto-fit supaya jumlah kolom otomatis
   menyesuaikan lebar layar tanpa perlu breakpoint manual — di HP kecil
   otomatis turun ke 1 kolom, di layar lebar bisa sampai 4 kolom. */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

@media (max-width: 900px) {
  .grid-5 { grid-template-columns: repeat(2,1fr); }
  .grid-4 { grid-template-columns: repeat(2,1fr); }
  .grid-3 { grid-template-columns: repeat(2,1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
/* Layar HP kecil (di bawah ~480px): turunkan lagi jadi 1 kolom penuh
   supaya kartu/statistik tidak sempit-berdesakan. Berlaku untuk SEMUA
   halaman yang memakai class .grid-2/.grid-3/.grid-4/.grid-5, termasuk
   yang di-render lewat JS (dashboard, tagihan, dll). */
@media (max-width: 480px) {
  .grid-5, .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .detail-hero-grid {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
}

/* ============================================================
   INVENTARIS — SORT & FILTER KOLOM
   ============================================================ */

/* ── Tombol filter di header ── */
.inv-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border: none;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  color: #94a3b8;
  font-size: 11px;
  padding: 0;
  vertical-align: middle;
  transition: background 0.15s, color 0.15s;
}
.inv-filter-btn:hover {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
}
.inv-filter-btn.inv-filter-active {
  color: var(--primary);
  background: rgba(37, 99, 235, 0.1);
}

/* ── Dropdown panel ── */
.inv-filter-drop {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 800;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: 10px;
  min-width: 180px;
  white-space: nowrap;
}
.inv-filter-drop.align-right {
  left: auto;
  right: 0;
  transform: none;
}

/* ── Select di dalam dropdown ── */
.inv-filter-select {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  padding: 6px 28px 6px 10px;
  font-size: 12.5px;
  font-family: 'Inter', sans-serif;
  background: #f8fafc;
  color: var(--text);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color 0.18s;
}
.inv-filter-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,74,116,0.1);
  background-color: #fff;
}

/* ── Tombol hapus filter di dalam dropdown ── */
.inv-filter-clear {
  display: block;
  width: 100%;
  margin-top: 7px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  color: var(--danger);
  background: #fff5f5;
  border: 1px solid #fecaca;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s;
}
.inv-filter-clear:hover {
  background: #fee2e2;
}

/* ── Indikator filter aktif di header ── */
.tbl thead th .inv-filter-active-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary);
  margin-left: 3px;
  vertical-align: middle;
}

/* ============================================================
   DASHBOARD MAHASISWA
   ============================================================ */

/* BUG FIX #3,4,5: Tambahkan base style untuk class yang sebelumnya
   hanya ada di dalam media query mobile                          */

/* ── Row layout ── */
.db-top-row {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

/* BUG FIX #3: .db-mid-row kini punya definisi desktop */
.db-mid-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

/* ── Profile card ── */
.db-profile-card {
  background: linear-gradient(135deg, #003654 0%, #004A74 70%, #1c7ba3 100%);
  border-radius: 14px;
  padding: 22px 20px;
  color: #fff;
  position: relative;
  overflow: hidden;
  min-width: 0;
}
.db-profile-card::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 110px; height: 110px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}
.db-profile-card::after {
  content: '';
  position: absolute;
  bottom: -20px; right: 20px;
  width: 70px; height: 70px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
}
.db-prof-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.22);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Inter', sans-serif;
  font-size: 18px; font-weight: 800;
  margin-bottom: 10px;
  position: relative; z-index: 1;
  overflow: hidden;
}
.db-prof-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.db-prof-name {
  font-family: 'Inter', sans-serif;
  font-size: 15px; font-weight: 800;
  margin-bottom: 2px;
  position: relative; z-index: 1;
  word-break: break-word;
}
.db-prof-nim {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  margin-bottom: 12px;
  position: relative; z-index: 1;
}
.db-profile-card .profile-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  font-size: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  position: relative; z-index: 1;
}
.db-profile-card .profile-row:last-child { border-bottom: none; }
.db-profile-card .profile-row .lbl {
  color: rgba(255,255,255,0.55);
  flex-shrink: 0;
  white-space: nowrap;
}
.db-profile-card .profile-row .val {
  font-weight: 600;
  color: #fff;
  text-align: right;
  word-break: break-word;
  max-width: 65%;
}

/* ── Stat cards ── */
.db-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.db-stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.db-stat-icon {
  width: 32px; height: 32px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  margin-bottom: 6px;
}
.db-stat-value {
  font-family: 'Inter', sans-serif;
  font-size: 21px; font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.db-stat-label { font-size: 11px; color: var(--muted); margin-top: 2px; }
.db-stat-pill {
  font-size: 10px; font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: #dcfce7; color: #166534;
  width: fit-content;
  margin-top: 4px;
}

/* BUG FIX #4,5: Base style untuk tracker & card dashboard */
.db-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 16px;
}
.db-card-title {
  font-family: 'Inter', sans-serif;
  font-size: 14px; font-weight: 700;
  margin-bottom: 14px;
  color: var(--text);
}
.db-tracker-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
}
.db-tracker-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.db-donut-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}
.db-tracker-stats { display: flex; flex-direction: column; gap: 6px; }
.db-tracker-stat  { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); }
.db-tracker-stat:last-child { border-bottom: none; }
.db-tstat-label { font-size: 12px; color: var(--muted); }
.db-tstat-value { font-size: 13px; font-weight: 700; color: var(--text); }

.db-action-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  margin-bottom: 8px;
  transition: all 0.18s;
  cursor: pointer;
}
.db-action-item:hover { border-color: var(--primary); background: var(--primary-light); }
.db-action-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.db-action-text p    { font-size: 13px; font-weight: 600; margin: 0 0 2px; }
.db-action-text span { font-size: 11px; color: var(--muted); }

/* BUG FIX #6: Base style untuk onboarding callout */
#onboardingCallout {
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

/* ============================================================
   RESPONSIVE — 1100px
   ============================================================ */
@media (max-width: 1100px) {
  .db-top-row { grid-template-columns: 320px 1fr; }
}

/* ============================================================
   RESPONSIVE — 900px
   ============================================================ */
@media (max-width: 900px) {
  .db-top-row    { grid-template-columns: 1fr; }
  .db-stats-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================
   RESPONSIVE — 400px (layar sangat kecil)
   ============================================================ */
@media (max-width: 400px) {
  .db-stats-grid   { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .db-stat-value   { font-size: 16px; }
  .db-tracker-body { flex-direction: column; align-items: center; }
  .db-donut-wrap svg { width: 90px; height: 90px; }
  .db-prof-name    { font-size: 13px; }
}

/* ============================================================
   RIPPLE ANIMATION (tap effect di mobile)
   ============================================================ */
@keyframes mobileRipple {
  from { transform: scale(0); opacity: 1; }
  to   { transform: scale(4); opacity: 0; }
}
.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  width: 60px; height: 60px;
  margin-top: -30px; margin-left: -30px;
  animation: mobileRipple 0.5s linear;
  pointer-events: none;
}
