/* ===========================================
   SIBARA – STIKES Baramuli
   Modern Dashboard CSS v2
   =========================================== */

/* ── Design Tokens ──────────────────────────── */
:root {
  /* Primary */
  --clr-primary:        #6366f1;
  --clr-primary-light:  #818cf8;
  --clr-primary-dark:   #4f46e5;
  --clr-primary-glow:   rgba(99,102,241,0.25);

  /* Backgrounds */
  --bg-base:            #0f1117;
  --bg-surface:         #161b27;
  --bg-card:            #1c2333;
  --bg-card-hover:      #222a3d;
  --bg-input:           #1a2035;
  --bg-sidebar:         #13172a;

  /* Text */
  --text-primary:       #f0f2ff;
  --text-secondary:     #94a3b8;
  --text-muted:         #4e6080;

  /* Borders */
  --border-color:       rgba(255,255,255,0.07);
  --border-strong:      rgba(255,255,255,0.13);

  /* Accents */
  --accent-green:       #22d3a3;
  --accent-green-bg:    rgba(34,211,163,0.12);
  --accent-amber:       #fbbf24;
  --accent-amber-bg:    rgba(251,191,36,0.12);
  --accent-rose:        #f43f5e;
  --accent-rose-bg:     rgba(244,63,94,0.12);
  --accent-sky:         #38bdf8;
  --accent-sky-bg:      rgba(56,189,248,0.12);
  --accent-violet:      #a78bfa;

  /* 4 Kriteria Colors */
  --krit-1: #6366f1;  /* Budaya Mutu */
  --krit-2: #22d3a3;  /* Relevansi */
  --krit-3: #f59e0b;  /* Akuntabilitas */
  --krit-4: #f43f5e;  /* Diferensiasi Misi */

  /* Shadows */
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.35);
  --shadow-lg:    0 12px 40px rgba(0,0,0,0.5);

  /* Dimensions */
  --sidebar-w:          260px;
  --sidebar-w-collapsed: 70px;
  --header-h:           64px;
  --footer-h:           48px;
  --radius-sm:          8px;
  --radius-md:          12px;
  --radius-lg:          18px;
  --radius-xl:          24px;

  /* Transitions */
  --transition-fast:    0.15s ease;
  --transition-normal:  0.25s ease;
  --transition-slow:    0.4s cubic-bezier(0.4,0,0.2,1);
}

/* ── Light Theme ─────────────────────────────── */
[data-theme="light"] {
  --bg-base:       #f0f4ff;
  --bg-surface:    #e8eeff;
  --bg-card:       #ffffff;
  --bg-card-hover: #f5f7ff;
  --bg-input:      #eef2ff;
  --bg-sidebar:    #ffffff;
  --text-primary:  #1e2a4a;
  --text-secondary:#4b5d80;
  --text-muted:    #8fa3bf;
  --border-color:  rgba(0,0,0,0.07);
  --border-strong: rgba(0,0,0,0.12);
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:     0 4px 16px rgba(0,0,0,0.1);
  --shadow-lg:     0 12px 40px rgba(0,0,0,0.15);
}

/* ── Reset ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--transition-slow), color var(--transition-slow);
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
svg { flex-shrink: 0; }

/* Scrollbar */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

/* ── Sidebar Overlay ─────────────────────────── */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  z-index: 200; opacity: 0; transition: opacity var(--transition-normal);
}
.sidebar-overlay.active { display: block; opacity: 1; }

/* ===== SIDEBAR ============================== */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-w); height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex; flex-direction: column;
  z-index: 300;
  transition: width var(--transition-slow), transform var(--transition-slow);
  overflow: hidden;
}

/* Brand */
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 0 18px; height: var(--header-h);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}
.brand-logo { flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; overflow: hidden; }
.brand-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800; font-size: 1.15rem; letter-spacing: -0.3px;
  background: linear-gradient(135deg, var(--clr-primary-light), var(--accent-violet));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; white-space: nowrap;
}
.brand-sub {
  font-size: 0.68rem; color: var(--text-muted);
  white-space: nowrap; font-weight: 500; letter-spacing: 0.3px;
}
.sidebar-close-btn {
  margin-left: auto; padding: 6px; border-radius: 8px;
  color: var(--text-secondary); display: none;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.sidebar-close-btn:hover { background: var(--border-color); color: var(--text-primary); }

/* Nav */
.sidebar-nav {
  flex: 1; overflow-y: auto; padding: 12px 0;
  scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
}
.nav-section { margin-bottom: 8px; }
.nav-section-label {
  display: block; font-size: 0.63rem; font-weight: 700;
  letter-spacing: 1.2px; color: var(--text-muted);
  padding: 10px 22px 6px; text-transform: uppercase;
}
.nav-list { padding: 0 10px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: 0.86rem; font-weight: 500;
  transition: background var(--transition-fast), color var(--transition-fast);
  position: relative; cursor: pointer; margin-bottom: 2px;
}
.nav-item:hover { background: var(--border-color); color: var(--text-primary); }
.nav-item.active {
  background: linear-gradient(135deg, rgba(99,102,241,0.18), rgba(139,92,246,0.12));
  color: var(--clr-primary-light); font-weight: 600;
}
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--clr-primary); border-radius: 0 3px 3px 0;
}
.nav-icon {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; flex-shrink: 0;
}
.nav-icon-kriteria {
  color: var(--kriteria-clr, var(--clr-primary));
}
.nav-label {
  flex: 1; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 12px 14px; border-top: 1px solid var(--border-color); flex-shrink: 0;
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  transition: background var(--transition-fast); cursor: pointer;
}
.sidebar-user:hover { background: var(--border-color); }
.user-avatar {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--clr-primary), var(--accent-violet));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; color: white; flex-shrink: 0;
}
.user-info { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.user-name {
  font-size: 0.82rem; font-weight: 600; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-role { font-size: 0.7rem; color: var(--text-muted); }
.user-logout-btn {
  padding: 6px; border-radius: 6px; color: var(--text-muted);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.user-logout-btn:hover { background: var(--accent-rose-bg); color: var(--accent-rose); }

/* ===== MAIN WRAPPER ========================= */
.main-wrapper {
  margin-left: var(--sidebar-w);
  display: flex; flex-direction: column; min-height: 100vh; flex: 1;
  transition: margin-left var(--transition-slow);
}

/* ===== HEADER =============================== */
.main-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: rgba(22,27,39,0.85);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; gap: 16px;
  transition: background var(--transition-slow);
}
[data-theme="light"] .main-header { background: rgba(240,244,255,0.88); }

/* Header Left */
.header-left {
  display: flex; align-items: center; gap: 14px;
  flex-shrink: 0; min-width: 0;
}
.sidebar-toggle-btn {
  width: 36px; height: 36px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); color: var(--text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.sidebar-toggle-btn:hover { background: var(--border-color); color: var(--text-primary); }

.header-page-info {
  display: flex; flex-direction: column; min-width: 0;
}
.header-page-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.05rem; font-weight: 700; color: var(--text-primary);
  letter-spacing: -0.3px; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.header-page-desc {
  font-size: 0.72rem; color: var(--text-muted); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Header Right */
.header-right {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}

/* Header Search */
.header-search-wrap {
  position: relative; display: flex; align-items: center;
}
.search-icon {
  position: absolute; left: 10px; color: var(--text-muted); pointer-events: none;
}
.header-search {
  width: 180px; padding: 7px 36px 7px 32px;
  background: var(--bg-input); border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-family: inherit; font-size: 0.8rem; outline: none;
  transition: width var(--transition-normal), border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.header-search::placeholder { color: var(--text-muted); }
.header-search:focus {
  width: 260px; border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px var(--clr-primary-glow);
}
.search-kbd {
  position: absolute; right: 8px;
  font-size: 0.65rem; color: var(--text-muted);
  background: var(--border-color); padding: 1px 5px;
  border-radius: 4px; border: 1px solid var(--border-strong);
  font-family: inherit; pointer-events: none;
}

/* Header Icon Buttons */
.header-icon-btn {
  position: relative; width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); color: var(--text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.header-icon-btn:hover { background: var(--border-color); color: var(--text-primary); }
.notif-dot {
  position: absolute; top: 7px; right: 7px;
  width: 7px; height: 7px; background: var(--accent-rose);
  border-radius: 50%; border: 2px solid var(--bg-surface);
  animation: pulse-notif 2s ease-in-out infinite;
}
@keyframes pulse-notif {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.8); }
}

/* Header User */
.header-user-wrap {
  position: relative;
}
.header-user-menu {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px 5px 5px;
  border-radius: var(--radius-md); border: 1px solid var(--border-color);
  cursor: pointer; transition: background var(--transition-fast), border-color var(--transition-fast);
}
.header-user-menu:hover { background: var(--border-color); border-color: var(--border-strong); }
.header-user-avatar {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--clr-primary), var(--accent-violet));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 700; color: white;
}
.header-user-name { font-size: 0.82rem; font-weight: 600; color: var(--text-primary); }

/* Dropdown User */
.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 220px;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.2s;
  z-index: 1000;
  padding: 8px;
}
.user-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown-header {
  padding: 10px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dropdown-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dropdown-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 6px 0;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition-fast), color var(--transition-fast);
  text-decoration: none;
  box-sizing: border-box;
}
.dropdown-item:hover {
  background: var(--border-color);
  color: var(--text-primary);
}
.dropdown-item svg {
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}
.dropdown-item:hover svg {
  color: var(--clr-primary-light);
}
.dropdown-item.btn-header-logout:hover svg {
  color: var(--accent-rose);
}

/* ===== MAIN CONTENT ========================= */
.main-content {
  flex: 1; padding: 24px 28px; display: flex; flex-direction: column; gap: 20px;
}

/* ===== HERO BANNER ========================== */
.hero-banner {
  background: linear-gradient(135deg, #1a1f3e 0%, #0f1524 50%, #1e1040 100%);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--radius-xl);
  padding: 36px 40px; display: flex; align-items: center;
  justify-content: space-between; gap: 32px;
  position: relative; overflow: hidden; box-shadow: var(--shadow-lg);
}
.hero-banner::before {
  content: ''; position: absolute; top: -60px; left: -60px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 70%);
  pointer-events: none;
}
.hero-content { flex: 1; z-index: 1; }
.hero-tag {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.75rem; font-weight: 600; color: var(--clr-primary-light);
  background: rgba(99,102,241,0.12); border: 1px solid rgba(99,102,241,0.25);
  padding: 4px 12px; border-radius: 20px; margin-bottom: 14px; letter-spacing: 0.3px;
}
.hero-tag-dot {
  width: 6px; height: 6px; background: var(--accent-green);
  border-radius: 50%; animation: pulse-notif 2s ease-in-out infinite;
}
.hero-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.85rem; font-weight: 800; color: #f0f2ff;
  line-height: 1.25; letter-spacing: -0.5px; margin-bottom: 12px;
}
.hero-highlight {
  background: linear-gradient(135deg, #818cf8, #a78bfa, #38bdf8);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-desc {
  font-size: 0.88rem; color: #8fa3c0; line-height: 1.6;
  max-width: 460px; margin-bottom: 20px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Buttons */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-primary-dark));
  color: white; border-radius: var(--radius-md);
  font-size: 0.86rem; font-weight: 600; font-family: inherit;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  box-shadow: 0 4px 20px rgba(99,102,241,0.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(99,102,241,0.5); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.15);
  color: #c8d5f0; border-radius: var(--radius-md);
  font-size: 0.86rem; font-weight: 600; font-family: inherit;
  backdrop-filter: blur(8px);
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.25);
  transform: translateY(-2px);
}

/* Light theme overrides for hero banner */
[data-theme="light"] .hero-banner {
  background: linear-gradient(135deg, #e0e7ff 0%, #eef2ff 50%, #f5f3ff 100%);
  border-color: rgba(99,102,241,0.25);
  box-shadow: var(--shadow-md);
}
[data-theme="light"] .hero-title {
  color: #1e1b4b;
}
[data-theme="light"] .hero-desc {
  color: #4b5563;
}
[data-theme="light"] .hero-tag {
  background: rgba(99,102,241,0.08);
  border-color: rgba(99,102,241,0.2);
  color: #4f46e5;
}
[data-theme="light"] .btn-secondary {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #334155;
  backdrop-filter: none;
}
[data-theme="light"] .btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}
[data-theme="light"] .hero-float {
  background: rgba(255,255,255,0.9);
  border-color: rgba(0,0,0,0.08);
  box-shadow: var(--shadow-sm);
}

/* Hero Visual */
.hero-visual { position: relative; width: 200px; height: 200px; flex-shrink: 0; }
.hero-ring {
  position: absolute; border-radius: 50%; border: 1px solid;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  animation: ring-spin linear infinite;
}
.hero-ring-1 { width: 130px; height: 130px; border-color: rgba(99,102,241,0.3); animation-duration: 20s; }
.hero-ring-2 { width: 170px; height: 170px; border-color: rgba(99,102,241,0.15); animation-duration: 30s; animation-direction: reverse; }
.hero-ring-3 { width: 200px; height: 200px; border-color: rgba(99,102,241,0.08); animation-duration: 40s; }
@keyframes ring-spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}
.hero-circle-main {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 68px; height: 68px; border-radius: 50%;
  background: linear-gradient(135deg, var(--clr-primary), var(--accent-violet));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 40px rgba(99,102,241,0.5), 0 0 80px rgba(99,102,241,0.2);
}
.hero-float {
  position: absolute; display: flex; align-items: center; gap: 5px;
  padding: 6px 10px; background: rgba(22,27,39,0.9);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: 0.72rem; font-weight: 600; color: var(--text-primary);
  backdrop-filter: blur(12px); white-space: nowrap;
  animation: float-bob 4s ease-in-out infinite;
}
.hero-float-1 { top: 10px; right: 0; color: var(--accent-green); }
.hero-float-2 { bottom: 16px; left: 0; color: var(--clr-primary-light); animation-delay: 1.5s; }
@keyframes float-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ===== STATS GRID ============================ */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); padding: 18px 18px 0;
  overflow: hidden; position: relative;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.stat-card-1::before { background: linear-gradient(90deg, var(--krit-1), var(--accent-violet)); }
.stat-card-2::before { background: linear-gradient(90deg, var(--krit-2), #0ea5e9); }
.stat-card-3::before { background: linear-gradient(90deg, var(--krit-3), #f97316); }
.stat-card-4::before { background: linear-gradient(90deg, var(--krit-4), #e11d48); }
.stat-card:hover {
  transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong);
}
.stat-card-inner {
  display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px;
}
.stat-info { display: flex; flex-direction: column; gap: 3px; }
.stat-label { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; }
.stat-value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.8rem; font-weight: 800; color: var(--text-primary);
  letter-spacing: -1px; line-height: 1;
}
.stat-change {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 0.7rem; font-weight: 500; margin-top: 2px;
}
.stat-change.positive { color: var(--accent-green); }
.stat-change.warning  { color: var(--accent-amber); }
.stat-change.neutral  { color: var(--text-muted); }
.stat-icon-wrap {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-card-1 .stat-icon-wrap { background: rgba(99,102,241,0.1); color: var(--clr-primary-light); }
.stat-card-2 .stat-icon-wrap { background: var(--accent-green-bg); color: var(--accent-green); }
.stat-card-3 .stat-icon-wrap { background: var(--accent-amber-bg); color: var(--accent-amber); }
.stat-card-4 .stat-icon-wrap { background: var(--accent-rose-bg); color: var(--accent-rose); }
.stat-progress {
  height: 4px; background: var(--border-color);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg); overflow: hidden;
}
.stat-progress-bar {
  height: 100%; border-radius: 4px;
  transition: width 1.2s cubic-bezier(0.4,0,0.2,1);
}
.stat-card-1 .stat-progress-bar { background: linear-gradient(90deg, var(--krit-1), var(--accent-violet)); }
.stat-card-2 .stat-progress-bar { background: linear-gradient(90deg, var(--krit-2), #0ea5e9); }
.stat-card-3 .stat-progress-bar { background: linear-gradient(90deg, var(--krit-3), #f97316); }
.stat-card-4 .stat-progress-bar { background: linear-gradient(90deg, var(--krit-4), #e11d48); }

/* ===== CARDS ================================= */
.card {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: border-color var(--transition-fast);
}
.card:hover { border-color: var(--border-strong); }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px; border-bottom: 1px solid var(--border-color);
}
.card-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.9rem; font-weight: 700; color: var(--text-primary); letter-spacing: -0.2px;
}
.card-title svg { color: var(--text-secondary); }
.card-link {
  font-size: 0.78rem; color: var(--clr-primary-light); font-weight: 600;
  transition: color var(--transition-fast);
}
.card-link:hover { color: var(--clr-primary); }
.card-body { padding: 16px 20px 20px; }

/* ===== DASHBOARD GRIDS ====================== */
.dashboard-grid { display: grid; grid-template-columns: 1fr 340px; gap: 20px; }
.dashboard-right-col { display: flex; flex-direction: column; gap: 20px; }
.dashboard-grid-2 { display: grid; grid-template-columns: 1fr 340px; gap: 20px; }

/* ===== UNIT / KRITERIA PROGRESS ============= */
.unit-progress-list { display: flex; flex-direction: column; gap: 14px; }
.unit-progress-item { display: flex; flex-direction: column; gap: 6px; }
.unit-progress-header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.unit-progress-name { display: flex; align-items: center; gap: 8px; font-size: 0.84rem; font-weight: 600; color: var(--text-primary); }
.unit-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.unit-progress-meta { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.unit-progress-pct { font-size: 0.82rem; font-weight: 700; color: var(--text-primary); }
.unit-progress-count { font-size: 0.76rem; color: var(--text-muted); }
.unit-status-badge {
  font-size: 0.68rem; padding: 2px 8px; border-radius: 20px; font-weight: 600;
}
.status-selesai { background: var(--accent-green-bg); color: var(--accent-green); }
.status-proses  { background: var(--accent-amber-bg); color: var(--accent-amber); }
.status-belum   { background: var(--accent-rose-bg);  color: var(--accent-rose); }
.unit-progress-track {
  height: 6px; background: var(--border-color); border-radius: 4px; overflow: hidden;
}
.unit-progress-fill {
  height: 100%; border-radius: 4px;
  transition: width 1s cubic-bezier(0.4,0,0.2,1); position: relative;
}
.unit-progress-fill::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: shimmer 2s infinite;
}
@keyframes shimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}

/* ===== DONUT ================================= */
.donut-body { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.donut-chart-wrap { position: relative; width: 130px; height: 130px; }
.donut-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-bg { stroke: var(--border-color); }
.donut-seg { transition: stroke-dasharray 1.2s cubic-bezier(0.4,0,0.2,1); }
.donut-seg-1 { stroke: var(--accent-green); }
.donut-seg-2 { stroke: var(--accent-amber); }
.donut-seg-3 { stroke: var(--accent-rose); }
.donut-center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center;
}
.donut-center-value {
  display: block; font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.4rem; font-weight: 800; color: var(--text-primary); line-height: 1;
}
.donut-center-label { font-size: 0.66rem; color: var(--text-muted); font-weight: 500; }
.donut-legend { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.legend-item { display: flex; align-items: center; gap: 8px; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.legend-label { flex: 1; font-size: 0.8rem; color: var(--text-secondary); }
.legend-val { font-size: 0.82rem; font-weight: 700; color: var(--text-primary); }

/* ===== ALERTS ================================ */
.alert-list { display: flex; flex-direction: column; gap: 10px; }
.alert-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid;
  transition: transform var(--transition-fast);
}
.alert-item:hover { transform: translateX(3px); }
.alert-item.alert-warning { background: var(--accent-amber-bg); border-color: rgba(251,191,36,0.2); }
.alert-item.alert-danger  { background: var(--accent-rose-bg);  border-color: rgba(244,63,94,0.2); }
.alert-item.alert-info    { background: var(--accent-sky-bg);   border-color: rgba(56,189,248,0.2); }
.alert-icon { flex-shrink: 0; margin-top: 1px; }
.alert-warning .alert-icon { color: var(--accent-amber); }
.alert-danger .alert-icon  { color: var(--accent-rose); }
.alert-info .alert-icon    { color: var(--accent-sky); }
.alert-content { flex: 1; }
.alert-title { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.alert-desc { font-size: 0.74rem; color: var(--text-secondary); line-height: 1.4; }

/* ===== ACTIVITY ============================== */
.activity-list { display: flex; flex-direction: column; position: relative; }
.activity-item {
  display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; position: relative;
}
.activity-item:not(:last-child)::after {
  content: ''; position: absolute; left: 15px; top: 36px; bottom: 0;
  width: 1px; background: var(--border-color);
}
.activity-avatar {
  width: 32px; height: 32px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.68rem; font-weight: 700; color: white; flex-shrink: 0;
  position: relative; z-index: 1;
}
.activity-body { flex: 1; }
.activity-text {
  font-size: 0.82rem; color: var(--text-primary); line-height: 1.4; margin-bottom: 3px;
}
.activity-text strong { font-weight: 600; }
.activity-meta { display: flex; align-items: center; gap: 8px; }
.activity-time { font-size: 0.72rem; color: var(--text-muted); }
.activity-tag {
  font-size: 0.68rem; padding: 1px 7px; border-radius: 20px;
  background: var(--border-color); color: var(--text-muted); font-weight: 500;
}

/* ===== QUICK ACCESS ========================== */
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.quick-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 10px; background: var(--bg-surface);
  border: 1px solid var(--border-color); border-radius: var(--radius-md);
  cursor: pointer; text-align: center;
  transition: background var(--transition-fast), border-color var(--transition-fast),
              transform var(--transition-fast), box-shadow var(--transition-fast);
}
.quick-item:hover {
  background: var(--bg-card-hover); border-color: var(--clr-primary);
  transform: translateY(-3px); box-shadow: 0 6px 20px var(--clr-primary-glow);
}
.quick-icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.quick-label { font-size: 0.76rem; font-weight: 600; color: var(--text-secondary); }

/* ===== FOOTER ================================ */
.main-footer {
  background: var(--bg-surface); border-top: 1px solid var(--border-color);
  padding: 0 28px; height: var(--footer-h); flex-shrink: 0;
}
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 100%; gap: 16px; flex-wrap: wrap;
}
.footer-left { display: flex; align-items: center; gap: 8px; }
.footer-logo-text {
  font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 0.82rem;
  background: linear-gradient(135deg, var(--clr-primary-light), var(--accent-violet));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.footer-sep { color: var(--text-muted); font-size: 0.8rem; }
.footer-copy { font-size: 0.74rem; color: var(--text-muted); }
.footer-center { display: flex; align-items: center; gap: 8px; }
.footer-status {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.74rem; color: var(--accent-green); font-weight: 500;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; }
.status-dot.online { background: var(--accent-green); animation: pulse-notif 2.5s ease-in-out infinite; }
.footer-right { display: flex; align-items: center; gap: 16px; }
.footer-version {
  font-size: 0.72rem; color: var(--text-muted);
  background: var(--border-color); padding: 2px 7px;
  border-radius: 20px; font-family: monospace;
}

/* ===== SIDEBAR COLLAPSED ==================== */
.sidebar.collapsed {
  width: var(--sidebar-w-collapsed);
  overflow: visible !important;
}
.sidebar.collapsed .sidebar-nav {
  overflow: visible !important;
}
.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .user-info,
.sidebar.collapsed .user-logout-btn,
.sidebar.collapsed .nav-chevron {
  opacity: 0; pointer-events: none; width: 0; overflow: hidden;
}

/* Hide nav-section-label completely to fix icon spacing */
.sidebar.collapsed .nav-section-label {
  display: none !important;
}

/* Perfect alignment and spacing for collapsed items */
.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 8px;
  height: 42px;
  margin-bottom: 6px;
}
.sidebar.collapsed .nav-icon { margin: 0; }
.sidebar.collapsed .sidebar-brand { padding: 0; justify-content: center; gap: 0; }
.sidebar.collapsed .brand-logo { margin: 0 auto; }
.sidebar.collapsed .sidebar-user { justify-content: center; padding: 8px 0; gap: 0; }
.sidebar.collapsed + .main-wrapper,
body.sidebar-collapsed .main-wrapper { margin-left: var(--sidebar-w-collapsed); }

/* Floating Submenu when Sidebar is Collapsed */
.sidebar.collapsed .nav-dropdown-wrap {
  position: relative;
}
.sidebar.collapsed .nav-submenu {
  display: none;
  position: absolute;
  left: 100%;
  top: 0;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 210px;
  z-index: 1000;
  opacity: 1 !important;
  pointer-events: auto !important;
  width: auto !important;
  overflow: visible !important;
  padding: 6px 0;
  margin-left: 8px;
}
.sidebar.collapsed .nav-dropdown-wrap .nav-submenu.open {
  display: block !important;
}
.sidebar.collapsed .nav-submenu .nav-subitem {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  width: 100% !important;
  padding: 8px 16px !important;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  transition: background var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
}
.sidebar.collapsed .nav-submenu .nav-subitem:hover {
  background: var(--border-color);
  color: var(--text-primary);
}
.sidebar.collapsed .nav-submenu .nav-subitem span {
  opacity: 1 !important;
  pointer-events: auto !important;
  display: inline !important;
  width: auto !important;
  overflow: visible !important;
}
.sidebar.collapsed .nav-submenu .nav-subitem-count {
  opacity: 1 !important;
  pointer-events: auto !important;
  display: inline-block !important;
  width: auto !important;
  margin-left: auto !important;
  font-size: 0.72rem;
  padding: 2px 6px;
  background: var(--border-color);
  border-radius: 99px;
  color: var(--text-muted);
}

/* ===== RESPONSIVE ============================ */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid, .dashboard-grid-2 { grid-template-columns: 1fr; }
  .dashboard-right-col { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .hero-visual { display: none; }
  .hero-title { font-size: 1.45rem; }
  .dashboard-right-col { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); width: var(--sidebar-w); box-shadow: var(--shadow-lg); }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar-close-btn { display: flex; }
  .main-wrapper { margin-left: 0 !important; }
  .main-content { padding: 16px 14px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .header-search-wrap { display: none; }
  .header-user-name { display: none; }
  .hero-banner { padding: 24px 20px; }
  .hero-title { font-size: 1.3rem; }
  .footer-center { display: none; }
  .footer-right { display: none; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; }
  .hero-title { font-size: 1.2rem; }
}

/* ===== NAV DROPDOWN SUBMENU ================= */
.nav-dropdown-wrap { position: relative; }
.nav-dropdown-toggle {
  width: 100%; text-align: left;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: 0.86rem; font-weight: 500;
  transition: background var(--transition-fast), color var(--transition-fast);
  position: relative; margin-bottom: 2px;
}
.nav-dropdown-toggle:hover { background: var(--border-color); color: var(--text-primary); }
.nav-dropdown-toggle.active {
  background: linear-gradient(135deg, rgba(99,102,241,0.18), rgba(139,92,246,0.12));
  color: var(--clr-primary-light); font-weight: 600;
}
.nav-dropdown-toggle.active::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--clr-primary); border-radius: 0 3px 3px 0;
}
.nav-chevron {
  margin-left: auto; flex-shrink: 0; color: var(--text-muted);
  transition: transform var(--transition-normal);
}
.nav-dropdown-toggle[aria-expanded="true"] .nav-chevron { transform: rotate(180deg); }
.nav-dropdown-toggle[aria-expanded="true"] { color: var(--clr-primary-light); }

.nav-submenu {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.25s ease;
  opacity: 0;
  padding-left: 12px;
}
.nav-submenu.open {
  max-height: 200px;
  opacity: 1;
}
.nav-subitem {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px 7px 12px; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: 0.82rem; font-weight: 500;
  transition: background var(--transition-fast), color var(--transition-fast);
  margin-bottom: 2px; position: relative;
}
.nav-subitem::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 1px; background: var(--border-strong); border-radius: 1px;
}
.nav-subitem:hover { background: var(--border-color); color: var(--text-primary); }
.nav-subitem.active {
  background: rgba(99,102,241,0.12); color: var(--clr-primary-light); font-weight: 600;
}
.nav-subitem.active::before { background: var(--clr-primary); }
.nav-subitem-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.nav-subitem-count {
  margin-left: auto; font-size: 0.65rem; font-weight: 600;
  background: var(--border-color); color: var(--text-muted);
  padding: 1px 6px; border-radius: 20px;
}
.nav-subitem.active .nav-subitem-count {
  background: rgba(99,102,241,0.2); color: var(--clr-primary-light);
}

/* ===== UPLOAD MODAL ========================= */
.upload-modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.65); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition-normal);
}
.upload-modal-overlay.active { opacity: 1; pointer-events: all; }

.upload-modal {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  width: 100%; max-width: 520px;
  box-shadow: var(--shadow-lg);
  transform: translateY(16px) scale(0.98);
  transition: transform var(--transition-normal);
  overflow: hidden;
}
.upload-modal-overlay.active .upload-modal { transform: translateY(0) scale(1); }

.upload-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}
.upload-modal-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1rem; font-weight: 700; color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
}
.upload-modal-title svg { color: var(--clr-primary-light); }
.upload-modal-close {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.upload-modal-close:hover { background: var(--border-color); color: var(--text-primary); }

.upload-modal-body { padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }

.upload-dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  position: relative;
}
.upload-dropzone:hover,
.upload-dropzone.dragover {
  border-color: var(--clr-primary);
  background: rgba(99,102,241,0.05);
}
.upload-dropzone input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.upload-dropzone-icon {
  width: 48px; height: 48px; margin: 0 auto 0.75rem;
  background: rgba(99,102,241,0.12); border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--clr-primary-light);
}
.upload-dropzone p { font-size: 0.875rem; color: var(--text-secondary); margin: 0; line-height: 1.5; }
.upload-dropzone small { font-size: 0.75rem; color: var(--text-muted); }
.upload-dropzone strong { color: var(--clr-primary-light); }

.upload-form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem;
}
.upload-form-group { display: flex; flex-direction: column; gap: 0.375rem; }
.upload-form-group.full { grid-column: 1 / -1; }
.upload-form-label { font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); }
.upload-form-select,
.upload-form-input {
  padding: 0.625rem 0.75rem;
  background: var(--bg-input); border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-family: inherit; font-size: 0.85rem; outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.upload-form-select:focus,
.upload-form-input:focus {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px var(--clr-primary-glow);
}

.upload-file-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 210px; /* Maksimal 5 file, sisanya scrolling */
  overflow-y: auto;
  padding-right: 4px;
}
.upload-file-list::-webkit-scrollbar {
  width: 5px;
}
.upload-file-list::-webkit-scrollbar-track {
  background: transparent;
}
.upload-file-list::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 99px;
}
.upload-file-list::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
.upload-file-item {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-input); border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}
.upload-file-icon { color: var(--clr-primary-light); flex-shrink: 0; }
.upload-file-name { flex: 1; font-size: 0.82rem; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-file-size { font-size: 0.72rem; color: var(--text-muted); flex-shrink: 0; }
.upload-file-remove { color: var(--text-muted); padding: 2px; border-radius: 4px; transition: color var(--transition-fast); }
.upload-file-remove:hover { color: var(--accent-rose); }

.upload-progress-bar-wrap {
  height: 4px; background: var(--border-color); border-radius: 4px; overflow: hidden; display: none;
}
.upload-progress-bar {
  height: 100%; background: linear-gradient(90deg, var(--clr-primary), var(--accent-violet));
  border-radius: 4px; width: 0%; transition: width 0.3s ease;
}

.upload-modal-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem; border-top: 1px solid var(--border-color); gap: 0.75rem;
}
.upload-btn-cancel {
  padding: 0.6rem 1.25rem;
  background: var(--bg-input); border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); color: var(--text-secondary);
  font-family: inherit; font-size: 0.85rem; font-weight: 600;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.upload-btn-cancel:hover { background: var(--border-color); color: var(--text-primary); }
.upload-btn-submit {
  padding: 0.6rem 1.5rem;
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-primary-dark));
  color: white; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 0.85rem; font-weight: 700;
  display: flex; align-items: center; gap: 0.5rem;
  box-shadow: 0 4px 16px var(--clr-primary-glow);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}
.upload-btn-submit:hover:not(:disabled) { opacity: 0.9; transform: translateY(-1px); }
.upload-btn-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.upload-toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 600;
  display: flex; align-items: center; gap: 0.625rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-card); border: 1px solid var(--border-strong);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  font-size: 0.85rem; font-weight: 600; color: var(--text-primary);
  transform: translateY(100px); opacity: 0;
  transition: transform var(--transition-normal), opacity var(--transition-normal);
  pointer-events: none;
}
.upload-toast.show { transform: translateY(0); opacity: 1; }
.upload-toast.toast-success { border-color: rgba(34,211,163,0.3); }
.upload-toast.toast-error   { border-color: rgba(244,63,94,0.3); }
.upload-toast-icon.success { color: var(--accent-green); }
.upload-toast-icon.error   { color: var(--accent-rose); }

/* ===== FOCUS & ANIMATION ==================== */
:focus-visible { outline: 2px solid var(--clr-primary); outline-offset: 2px; border-radius: 4px; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-banner      { animation: fade-up 0.4s ease both; }
.stats-grid       { animation: fade-up 0.45s 0.05s ease both; }
.dashboard-grid   { animation: fade-up 0.45s 0.1s ease both; }
.dashboard-grid-2 { animation: fade-up 0.45s 0.15s ease both; }

/* ===== ACCORDION CARD (dokumen.html) ========= */
#unitGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1rem;
  align-items: start;
}

/* Card wrapper */
.acc-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  animation: fade-up 0.3s ease both;
}
.acc-card:hover { border-color: var(--border-strong); }
.acc-card.acc-open { box-shadow: var(--shadow-md); border-color: var(--border-strong); }

/* Header */
.acc-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.125rem;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background var(--transition-fast);
}
.acc-header:hover { background: var(--bg-card-hover); }
.acc-card.acc-open .acc-header { background: var(--bg-card-hover); }

.acc-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.acc-avatar {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 0.82rem;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0.03em;
}

.acc-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.acc-unit-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.acc-unit-pj {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.acc-header-right {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
}

/* Progress ring */
.acc-progress-ring {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}
.acc-ring-svg {
  width: 40px;
  height: 40px;
  transform: rotate(-90deg);
}
.acc-ring-bg {
  fill: none;
  stroke: var(--border-color);
  stroke-width: 3;
}
.acc-ring-fill {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 0 100;
  transition: stroke-dasharray 0.8s cubic-bezier(0.4,0,0.2,1);
}
.acc-ring-pct {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.58rem;
  font-weight: 800;
  font-family: 'Plus Jakarta Sans', sans-serif;
  line-height: 1;
  white-space: nowrap;
}

/* Stats badges */
.acc-stats {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-end;
}
.acc-count-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.acc-status-badge {
  font-size: 0.63rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* Chevron */
.acc-chevron {
  color: var(--text-muted);
  transition: transform var(--transition-normal), color var(--transition-fast);
  display: flex;
  align-items: center;
}
.acc-chevron.open {
  transform: rotate(180deg);
  color: var(--clr-primary-light);
}

/* Thin progress bar */
.acc-progress-bar-wrap {
  height: 3px;
  background: var(--border-color);
  overflow: hidden;
}
.acc-progress-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}

/* Body collapsible */
.acc-body {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.38s cubic-bezier(0.4,0,0.2,1),
              opacity 0.25s ease;
}
.acc-body.open {
  max-height: 2000px; /* cukup besar untuk semua konten */
  opacity: 1;
}

.acc-body-inner {
  padding: 0 0 0.5rem;
  border-top: 1px solid var(--border-color);
}

/* Summary bar */
.acc-summary {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.625rem 1.125rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
}
.acc-summary-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 600;
}
.acc-summary-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Doc list */
.acc-doc-list {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
  max-height: 190px; /* Maksimal 5 file, sisanya scrolling */
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.acc-doc-list::-webkit-scrollbar {
  width: 5px;
}
.acc-doc-list::-webkit-scrollbar-track {
  background: transparent;
}
.acc-doc-list::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 99px;
}
.acc-doc-list::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ─── Doc item: layout tidak bertabrakan ─── */
.acc-doc-item {
  display: grid;
  /* num | dot | nama (flex) | badge+dl (fixed) */
  grid-template-columns: 24px 10px 1fr auto;
  align-items: center;
  gap: 0.375rem;
  padding: 0.45rem 1rem;
  transition: background var(--transition-fast);
  cursor: default;
  min-width: 0;
}
.acc-doc-item:hover { background: var(--bg-card-hover); }

.acc-doc-num {
  font-size: 0.63rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: right;
  flex-shrink: 0;
  line-height: 1;
}

.acc-doc-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  justify-self: center;
}

.acc-doc-detail {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}
.acc-doc-name {
  font-size: 0.8rem;
  color: var(--text-primary);
  line-height: 1.35;
  display: block;
  /* Potong teks panjang — satu baris */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.acc-doc-name:hover {
  /* Saat hover, tampilkan teks lengkap via tooltip title di JS */
  white-space: normal;
  overflow: visible;
  background: var(--bg-card);
  position: relative;
  z-index: 1;
  border-radius: 4px;
}
.acc-doc-kriteria {
  font-size: 0.62rem;
  color: var(--clr-primary-light);
  background: rgba(99,102,241,0.12);
  padding: 1px 5px;
  border-radius: 4px;
  display: inline-block;
  font-weight: 600;
  align-self: flex-start;
  white-space: nowrap;
}
.acc-doc-ket {
  font-size: 0.66rem;
  color: var(--text-muted);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Area kanan: badge + lihat + download — lebar tetap, tidak tercompress */
.acc-doc-right {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
  min-width: 150px;     /* cukup untuk badge + 3 icon */
  justify-content: flex-end;
}

.badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}
.badge-success { background: rgba(34,211,163,0.15);  color: #22d3a3; }
.badge-warning { background: rgba(251,191,36,0.15);  color: #f59e0b; }
.badge-danger  { background: rgba(244,63,94,0.15);   color: #f43f5e; }
.badge-muted   { background: var(--bg-input); color: var(--text-muted); }

.acc-doc-view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(34, 211, 163, 0.1);
  color: #22d3a3;
  transition: background var(--transition-fast);
  text-decoration: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
.acc-doc-view:hover:not(.disabled) { background: rgba(34, 211, 163, 0.25); }
.acc-doc-view.disabled {
  opacity: 0.25;
  cursor: not-allowed;
}
.acc-doc-view svg {
  width: 13px;
  height: 13px;
  display: block;
}

.acc-doc-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(99,102,241,0.1);
  color: var(--clr-primary-light);
  transition: background var(--transition-fast);
  text-decoration: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
.acc-doc-download:hover:not(.disabled) { background: rgba(99,102,241,0.25); }
.acc-doc-download.disabled {
  opacity: 0.25;
  cursor: not-allowed;
}
.acc-doc-download svg {
  width: 13px;
  height: 13px;
  display: block;
}

.acc-doc-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(244, 63, 94, 0.08);
  color: var(--accent-rose);
  transition: all var(--transition-fast);
  text-decoration: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
.acc-doc-delete:hover:not(.disabled) {
  background: var(--accent-rose);
  color: #fff;
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.35);
}
.acc-doc-delete.disabled {
  opacity: 0.25;
  cursor: not-allowed;
}
.acc-doc-delete svg {
  width: 13px;
  height: 13px;
  display: block;
}

/* Tombol Upload PDF — biru muda (dokumen baru) */
.acc-doc-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.13);
  color: #38bdf8;
  transition: background var(--transition-fast), color var(--transition-fast);
  text-decoration: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
.acc-doc-upload:hover { background: rgba(56, 189, 248, 0.28); }
.acc-doc-upload svg { width: 13px; height: 13px; display: block; }

/* Mode perbarui — amber/oranye (sudah ada file, replace) */
.acc-doc-upload.update-mode {
  background: rgba(251, 191, 36, 0.13);
  color: #f59e0b;
}
.acc-doc-upload.update-mode:hover { background: rgba(251, 191, 36, 0.28); }

/* Info teks upload (siapa & kapan) di bawah nama dokumen */
.acc-doc-upload-info {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}


/* Responsive */
@media (max-width: 640px) {
  #unitGrid { grid-template-columns: 1fr; }
  .acc-stats { display: none; }
  .acc-progress-ring { display: none; }
  .acc-doc-item { grid-template-columns: 20px 8px 1fr auto; padding: 0.4rem 0.75rem; }
  .acc-doc-right { min-width: 100px; }
}

/* SIBARA Premium Document Viewer Modal */
.sibara-viewer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  animation: viewerFadeIn 0.25s ease-out;
}
@keyframes viewerFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.sibara-viewer-window {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  width: 100%;
  max-width: 1100px;
  height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  animation: viewerSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes viewerSlideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.sibara-viewer-header {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(30, 41, 59, 0.4);
  gap: 1rem;
}
.sibara-viewer-title-area {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1;
}
.sibara-viewer-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sibara-viewer-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.sibara-viewer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  gap: 0.3rem;
}
.sibara-viewer-btn.btn-close {
  background: rgba(244, 63, 94, 0.15);
  color: #f43f5e;
}
.sibara-viewer-btn.btn-close:hover {
  background: #f43f5e;
  color: #fff;
}
.sibara-viewer-btn.btn-download {
  background: rgba(99, 102, 241, 0.15);
  color: var(--clr-primary-light);
}
.sibara-viewer-btn.btn-download:hover {
  background: var(--clr-primary-light);
  color: #fff;
}
.sibara-viewer-body {
  flex: 1;
  overflow: auto;
  position: relative;
  background: #0f172a;
  padding: 1.5rem;
  display: flex;
  align-items: flex-start; /* Dimulai dari paling atas (halaman 1) */
  justify-content: center;
}
.sibara-viewer-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  color: var(--text-muted);
  margin: auto; /* Pusatkan secara vertikal & horizontal */
}
.sibara-viewer-spinner {
  width: 36px;
  height: 36px;
  border: 3.5px solid rgba(99, 102, 241, 0.15);
  border-top: 3.5px solid var(--clr-primary-light);
  border-radius: 50%;
  animation: viewerSpin 0.8s linear infinite;
}
@keyframes viewerSpin {
  to { transform: rotate(360deg); }
}
.sibara-viewer-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
  border-radius: 8px;
  display: block;
}
.sibara-viewer-rendered {
  width: 100%;
  height: 100%;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  box-sizing: border-box;
}

/* Custom DOCX overrides inside container */
.sibara-viewer-rendered .docx-wrapper {
  background: transparent !important;
  padding: 0 !important;
  display: flex;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
}
.sibara-viewer-rendered .docx {
  background: #ffffff !important;
  color: #1e293b !important;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.3) !important;
  border-radius: 8px !important;
  padding: 3rem 2.5rem !important;
  max-width: 820px !important;
  width: 100% !important;
  box-sizing: border-box;
  text-align: left !important;
}

/* SheetJS Spreadsheet rendering style */
.xlsx-container-wrap {
  width: 100%;
  max-width: 100%;
  background: #ffffff;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.3);
  overflow: auto;
}
.xlsx-viewer-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  color: #1e293b;
  font-size: 0.85rem;
}
.xlsx-viewer-table th, .xlsx-viewer-table td {
  border: 1px solid #cbd5e1;
  padding: 6px 12px;
  text-align: left;
}
.xlsx-viewer-table th {
  background: #f1f5f9;
  font-weight: 600;
}
.xlsx-viewer-table tr:nth-child(even) {
  background: #f8fafc;
}

/* Beautiful Fallback Card */
.sibara-viewer-fallback {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2.5rem 2rem;
  max-width: 450px;
  width: 100%;
  text-align: center;
  box-shadow: 0 15px 30px rgba(0,0,0,0.4);
  margin: auto; /* Pusatkan secara vertikal & horizontal */
}
.sibara-viewer-fallback-icon {
  font-size: 3rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  display: inline-block;
}
.sibara-viewer-fallback-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}
.sibara-viewer-fallback-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

@media (max-width: 640px) {
  .sibara-viewer-overlay { padding: 0.5rem; }
  .sibara-viewer-window { height: 95vh; }
  .sibara-viewer-rendered .docx { padding: 1.5rem 1rem !important; }
}

/* ===== USER PROFILE FOTO (SIBARA) ===== */
.user-avatar.has-image, .header-user-avatar.has-image, .acc-avatar.has-image, .activity-avatar.has-image {
  padding: 0 !important;
  overflow: hidden !important;
  background: none !important;
}
.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: inherit;
  display: block;
  background-color: rgba(15, 23, 42, 0.15); /* Premium soft backdrop for uncropped portrait photos */
}

/* ===== OVERLAPPING AVATAR STACK ===== */
.acc-avatar-group {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: 0.25rem;
}
.acc-avatar-item {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 0.72rem;
  color: #fff;
  flex-shrink: 0;
  border: 2px solid var(--card-bg);
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  margin-left: -10px;
  transition: transform 0.2s ease, z-index 0.2s ease;
  position: relative;
}
.acc-avatar-item:first-child {
  margin-left: 0;
}
.acc-avatar-item:hover {
  transform: translateY(-2px);
  z-index: 50 !important;
}
.acc-avatar-item.has-image {
  padding: 0 !important;
  overflow: hidden !important;
  background: none !important;
}

/* ===== CHAT AI SIBARA ===== */
.chat-window {
  display: flex;
  flex-direction: row;
  height: calc(100vh - 200px);
  min-height: 500px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.chat-sidebar {
  width: 260px;
  border-right: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.chat-sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}
.btn-new-chat {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--border-color);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-fast);
}
.btn-new-chat:hover {
  background: var(--clr-primary);
  color: white;
  border-color: var(--clr-primary);
  box-shadow: 0 4px 12px var(--clr-primary-glow);
}
.chat-sessions-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  list-style: none;
  margin: 0;
}
.chat-session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
  font-size: 0.85rem;
  gap: 8px;
  position: relative;
}
.chat-session-item:hover {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
}
.chat-session-item.active {
  background: rgba(99, 102, 241, 0.1);
  color: var(--clr-primary);
  font-weight: 500;
}
.chat-session-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.btn-delete-session {
  opacity: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-session-item:hover .btn-delete-session {
  opacity: 1;
}
.btn-delete-session:hover {
  color: var(--accent-red);
  background: rgba(239, 68, 68, 0.1);
}
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* Responsive Chat */
@media (max-width: 768px) {
  .chat-sidebar {
    display: none;
  }
}
.chat-header {
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
}
.chat-agent-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--clr-primary), var(--accent-sky));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  font-weight: 700;
  box-shadow: 0 4px 12px var(--clr-primary-glow);
}
.chat-agent-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.chat-agent-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}
.chat-agent-status {
  font-size: 0.75rem;
  color: var(--accent-green);
  display: flex;
  align-items: center;
  gap: 6px;
}
.chat-agent-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}
.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: rgba(0, 0, 0, 0.02);
}
.message-bubble {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  line-height: 1.5;
  font-size: 0.9rem;
  position: relative;
  animation: message-fade-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes message-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.message-wrapper.incoming {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  align-self: flex-start;
  max-width: 75%;
  animation: message-fade-in 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.message-wrapper.incoming .message-bubble {
  max-width: 100%;
  animation: none; /* Avoid double animation */
}
.message-avatar {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2);
  background: var(--bg-surface);
  border: 1px solid rgba(99, 102, 241, 0.25);
}
/* Premium Robot Avatar Animations */
.avatar-robot-face {
  transform-origin: 50px 55px;
  animation: avatar-bobbing 3.5s ease-in-out infinite;
}
.avatar-eye-left {
  transform-origin: 43px 51px;
  animation: avatar-blink 4.5s infinite;
}
.avatar-eye-right {
  transform-origin: 57px 51px;
  animation: avatar-blink 4.5s infinite;
}
.avatar-antenna-light {
  transform-origin: 50px 26px;
  animation: antenna-pulse 2s infinite ease-in-out;
}

@keyframes avatar-bobbing {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-2.2px) rotate(1.5deg);
  }
}

@keyframes avatar-blink {
  0%, 88%, 94%, 100% {
    transform: scaleY(1);
  }
  91% {
    transform: scaleY(0.1);
  }
}

@keyframes antenna-pulse {
  0%, 100% {
    opacity: 0.65;
    transform: scale(0.9);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

.message-bubble.incoming {
  align-self: flex-start;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-top-left-radius: 4px;
}
.message-bubble.outgoing {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-primary-dark));
  color: white;
  border-top-right-radius: 4px;
  box-shadow: 0 4px 12px var(--clr-primary-glow);
}
.message-meta {
  font-size: 0.72rem;
  margin-top: 6px;
  text-align: right;
  opacity: 0.6;
}
.chat-input-area {
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.01);
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
  align-items: center;
}
.chat-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 0.9rem;
  resize: none;
  height: 48px;
  line-height: 22px;
  font-family: inherit;
  transition: border-color var(--transition-fast);
  box-sizing: border-box;
}
.chat-input:focus {
  outline: none;
  border-color: var(--clr-primary);
}
.btn-chat-send {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-primary-dark));
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast), filter var(--transition-fast);
  box-shadow: 0 4px 12px var(--clr-primary-glow);
  flex-shrink: 0;
}
.btn-chat-send:hover {
  filter: brightness(1.1);
}
.btn-chat-send:active {
  transform: scale(0.95);
}
.typing-indicator {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
  padding: 4px 0;
}
.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-secondary);
  animation: typing-bounce 1.4s infinite ease-in-out both;
}
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes typing-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1.0); }
}

/* ===== NEW MODERN DOCUMENT SELECTOR ===== */
.doc-selector-wrap {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  max-width: 480px;
  transition: all var(--transition-fast);
}
.doc-selector-wrap:focus-within {
  border-color: var(--clr-primary);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 12px var(--clr-primary-glow);
}
.doc-selector-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.doc-select-input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 500;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  max-width: 300px;
  text-overflow: ellipsis;
}
.doc-select-input option {
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 8px;
}

/* Active Document Badge Floating */
.active-doc-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.08));
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
  margin: 16px 20px 0 20px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  animation: slide-down-fade 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes slide-down-fade {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.active-doc-icon {
  font-size: 1.2rem;
  animation: pulse-icon 2s ease-in-out infinite;
}
@keyframes pulse-icon {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}
.active-doc-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.active-doc-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}
.active-doc-meta {
  font-size: 0.72rem;
  color: var(--clr-primary);
  font-weight: 600;
}
.btn-convert-pdf {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-md);
  color: var(--clr-primary);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast) ease;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.05);
}
.btn-convert-pdf:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.6);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}
.btn-convert-pdf:active {
  transform: translateY(0);
}
.btn-convert-pdf svg {
  color: var(--clr-primary);
  transition: transform var(--transition-fast) ease;
}
.btn-convert-pdf:hover svg {
  transform: rotate(-10deg) scale(1.1);
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.btn-clear-active-doc {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.btn-clear-active-doc:hover {
  background: var(--accent-red);
  color: white;
  border-color: var(--accent-red);
}

/* Chat Header Welcome Card */
.welcome-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.01), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.02);
}
.welcome-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.welcome-desc {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-secondary);
}
.welcome-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}
@media (max-width: 768px) {
  .doc-selector-wrap {
    display: none;
  }
}

/* ===== SIBARA AI VISUAL DASHBOARD GRID ===== */
.chat-dashboard {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  max-width: 800px;
  margin: 0 auto;
  gap: 36px;
  width: 100%;
  animation: slide-up-fade 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.dashboard-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}
.dashboard-avatar-3d {
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 8px;
}
.avatar-robot-face-3d {
  transform-origin: 50px 55px;
  animation: avatar-bobbing-3d 3.2s ease-in-out infinite;
}
.avatar-face-track {
  transform-origin: 50px 55px;
  will-change: transform;
}
.avatar-3d-shadow {
  transform-origin: 50px 98px;
  animation: avatar-shadow-3d 3.2s ease-in-out infinite;
}
.avatar-arm-wave {
  transform-origin: 65px 77px;
  animation: robot-wave 2s ease-in-out infinite;
  will-change: transform;
}

@keyframes robot-wave {
  0%, 100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-18deg);
  }
  50% {
    transform: rotate(-4deg);
  }
  75% {
    transform: rotate(-18deg);
  }
}

@keyframes avatar-bobbing-3d {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(2deg);
  }
}

@keyframes avatar-shadow-3d {
  0%, 100% {
    transform: scale(1);
    opacity: 0.28;
  }
  50% {
    transform: scale(0.72);
    opacity: 0.12;
  }
}
.dashboard-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}
.dashboard-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  max-width: 480px;
  line-height: 1.5;
}
.dashboard-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 100%;
}
.dashboard-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 28px 20px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(0,0,0,0.02);
  position: relative;
}
.dashboard-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: transparent;
  transition: background var(--transition-fast);
}
.dashboard-card:hover {
  transform: translateY(-6px);
  border-color: var(--clr-primary);
  box-shadow: 0 12px 30px var(--clr-primary-glow);
}
.dashboard-card:hover::before {
  background: linear-gradient(90deg, var(--clr-primary), var(--accent-sky));
}
.dashboard-card .card-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: rgba(99, 102, 241, 0.08);
  color: var(--clr-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: all var(--transition-fast);
}
.dashboard-card:hover .card-icon {
  background: var(--clr-primary);
  color: white;
  box-shadow: 0 4px 12px var(--clr-primary-glow);
}
.dashboard-card h3 {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}
.dashboard-card p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0;
}

/* Header Back Button */
.btn-back-dashboard {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  margin-left: auto;
  transition: all var(--transition-fast);
}
.btn-back-dashboard:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

/* ===== PREMIUM OVERLAY MODALS ===== */
.chat-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.chat-modal.show {
  opacity: 1;
  pointer-events: auto;
}
.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  width: 92%;
  max-width: 580px;
  max-height: 82vh;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  transform: scale(0.94);
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
.chat-modal.show .modal-content {
  transform: scale(1);
  opacity: 1;
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.01);
}
.modal-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
}
.btn-close-modal {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  transition: color var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}
.btn-close-modal:hover {
  color: var(--text-primary);
}
.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.modal-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  box-sizing: border-box;
}
.modal-search-box:focus-within {
  border-color: var(--clr-primary);
  box-shadow: 0 0 10px var(--clr-primary-glow);
}
.modal-search-input {
  border: none;
  background: transparent;
  color: var(--text-primary);
  outline: none;
  font-size: 0.85rem;
  flex: 1;
  font-family: inherit;
}
.modal-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.modal-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
  gap: 16px;
}
.modal-list-item:hover {
  background: rgba(99, 102, 241, 0.04);
  border-color: var(--clr-primary);
  transform: translateX(4px);
}
.modal-item-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow: hidden;
}
.modal-item-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.modal-item-sub {
  font-size: 0.72rem;
  color: var(--text-secondary);
}
.btn-delete-modal-item {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-delete-modal-item:hover {
  color: var(--accent-red);
  background: rgba(239, 68, 68, 0.08);
}
@media (max-width: 580px) {
  .dashboard-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* Ensure dashboard card grid and cards are layered properly */
.dashboard-cards-wrap {
  position: relative;
  z-index: 5;
  width: 100%;
}

.dashboard-card {
  position: relative;
  background: var(--bg-card);
}

/* SIBARA Welcome Banner Avatar Wrapper & Presentation GIF */
.dashboard-avatar-wrap {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 24px;
  margin-bottom: 8px;
}

.presentasi-gif-container {
  width: 108px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  animation: presentasi-bobbing 3.2s ease-in-out infinite;
  animation-delay: -0.6s;
  will-change: transform;
}

.presentasi-gif {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.15));
}

@keyframes presentasi-bobbing {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-6px);
  }
}

/* Responsive Hide for Mobile Screens */
@media (max-width: 580px) {
  .presentasi-gif-container {
    display: none !important;
  }
  .dashboard-avatar-wrap {
    gap: 0;
  }
}







