/* ============================================================
   NAKULAKU — Design System v3 (Premium & PWA Sync)
   Burgundy #611329 · Gold #C9A961 · Plus Jakarta Sans
   ============================================================ */

/* ---------- TOKENS ---------- */
:root {
  --maroon:        #7D1D3A;
  --maroon-dark:   #611329;
  --maroon-mid:    #9B2649;
  --maroon-light:  #BC3560;
  --maroon-soft:   #FBEBF0;
  --maroon-faint:  #FDF4F7;

  --gold:          #C9A961;
  --gold-dark:     #B8944D;
  --gold-light:    #DFC68D;
  --gold-soft:     #FBF4E0;

  --bg:            #FCFAF7;
  --surface:       #FFFFFF;
  --ink:           #1C1414;
  --muted:         #6E6060;
  --muted-soft:    #9E9292;
  --border:        #EDE4E4;
  --border-strong: #DDD0D4;

  --success: #15803D;
  --success-soft: #DCFCE7;
  --warning: #B45309;
  --warning-soft: #FEF3C7;
  --danger:  #B91C1C;
  --danger-soft: #FEE2E2;
  --info:    #1E40AF;
  --info-soft: #DBEAFE;

  --r-xs: 6px; --r-sm: 8px; --r-md: 12px; --r-lg: 16px;
  --r-xl: 24px; --r-2xl: 32px; --r-full: 999px;

  --sh-xs: 0 1px 2px rgba(97,19,41,.04);
  --sh-sm: 0 2px 8px rgba(97,19,41,.06);
  --sh-md: 0 8px 20px rgba(97,19,41,.08);
  --sh-lg: 0 16px 32px rgba(97,19,41,.12);
  --sh-xl: 0 24px 64px rgba(97,19,41,.18);
  --sh-glow: 0 0 0 4px rgba(125,29,58,.1);

  --container: 1080px;
  --header-h: 60px;
  --bottom-nav-h: 68px;
  --header-bg: #611329;

  --ease-out: cubic-bezier(.16,1,.3,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
  --t-fast: .15s var(--ease-out);
  --t-norm: .25s var(--ease-out);
  --t-slow: .4s var(--ease-out);
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--maroon); text-decoration: none; transition: color var(--t-fast); }
a:hover { text-decoration: none; }
h1, h2, h3, h4 { font-weight: 800; line-height: 1.2; color: var(--ink); letter-spacing: -0.01em; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--maroon-light); }

/* ---------- LAYOUT GLOBAL (SEMBUNYIKAN DESKTOP DI MOBILE) ---------- */
.desktop-layout { display: block; }
.desktop-sidebar { display: none; }
.desktop-topbar { display: none; }

/* ---------- ANIMATIONS ---------- */
@keyframes fade-in-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes scale-in { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: scale(1); } }
@keyframes slide-down { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slide-up { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.anim-in { animation: fade-in-up .4s var(--ease-out) both; }
.anim-in-1 { animation: fade-in-up .4s var(--ease-out) .05s both; }
.anim-in-2 { animation: fade-in-up .4s var(--ease-out) .1s both; }
.anim-in-3 { animation: fade-in-up .4s var(--ease-out) .15s both; }
.anim-fade { animation: fade-in .3s var(--ease-out) both; }

/* ---------- CONTAINER & PAGE ---------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 16px; }
.page { padding-top: 16px; padding-bottom: calc(var(--bottom-nav-h) + 24px + env(safe-area-inset-bottom)); }

/* ---------- ICON ---------- */
.icon { width: 20px; height: 20px; stroke-width: 2; stroke: currentColor; fill: none; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }
.icon-xl { width: 32px; height: 32px; }

/* ---------- BUTTON ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 700; font-size: 14px; padding: 12px 20px; border-radius: var(--r-md);
  border: none; cursor: pointer; transition: all var(--t-norm);
  text-decoration: none; white-space: nowrap; position: relative; overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.btn::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle, rgba(255,255,255,.4) 0%, transparent 70%); opacity: 0; transition: opacity .4s; pointer-events: none; }
.btn:active:not(:disabled)::after { opacity: 1; transition: opacity 0s; }
.btn:active:not(:disabled) { transform: scale(.96); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary { background: var(--maroon); color: white; box-shadow: 0 4px 14px rgba(125,29,58,.25); }
.btn-primary:hover:not(:disabled) { background: var(--maroon-dark); transform: translateY(-1px); box-shadow: 0 8px 20px rgba(125,29,58,.35); }
.btn-secondary { background: var(--surface); color: var(--maroon); border: 1.5px solid var(--border-strong); }
.btn-secondary:hover:not(:disabled) { border-color: var(--maroon); background: var(--maroon-faint); box-shadow: var(--sh-sm); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover:not(:disabled) { background: var(--bg); color: var(--ink); }
.btn-danger { background: var(--danger); color: white; box-shadow: 0 4px 14px rgba(185,28,28,.2); }
.btn-danger:hover:not(:disabled) { background: #991B1B; transform: translateY(-1px); }
.btn-gold { background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%); color: white; box-shadow: 0 4px 14px rgba(201,169,97,.3); }
.btn-gold:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(201,169,97,.4); }

.btn-full { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: var(--r-sm); }
.btn-lg { padding: 14px 24px; font-size: 15px; border-radius: var(--r-lg); }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: var(--r-md); background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; border: none; cursor: pointer; transition: all var(--t-fast); }
.btn-icon:hover { background: var(--bg); color: var(--ink); }

/* ---------- INPUT ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 13px; font-weight: 700; color: var(--ink); }
.input-wrap { position: relative; }
.input-wrap .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input { width: 100%; font-size: 14px; font-weight: 500; padding: 13px 14px; border: 1.5px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); color: var(--ink); transition: all var(--t-norm); box-shadow: inset 0 1px 2px rgba(0,0,0,.02); }
.input.with-icon { padding-left: 44px; }
.input:focus { outline: none; border-color: var(--maroon); box-shadow: var(--sh-glow); background: #FFFFFF; }
.input:focus + .icon, .input-wrap:focus-within .icon { color: var(--maroon); }
.input::placeholder { color: var(--muted-soft); font-weight: 400; }
.input.error { border-color: var(--danger); background: var(--danger-soft); }
.input.success { border-color: var(--success); }

/* ---------- CARD & BADGE ---------- */
.card { background: var(--surface); border-radius: var(--r-lg); padding: 16px; border: 1px solid var(--border); box-shadow: var(--sh-xs); transition: all var(--t-norm); }
.card-lg { padding: 20px; border-radius: var(--r-xl); box-shadow: var(--sh-sm); }
.card-hover:hover { border-color: var(--maroon-light); box-shadow: var(--sh-md); transform: translateY(-2px); }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: var(--r-full); letter-spacing: 0.2px; line-height: 1; white-space: nowrap; }
.badge-maroon { background: var(--maroon-soft); color: var(--maroon); }
.badge-gold { background: var(--gold-soft); color: var(--gold-dark); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }

/* ---------- HEADER (PWA SYNC) ---------- */
.app-header { background: var(--header-bg); color: white; padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top)); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50; min-height: var(--header-h); box-shadow: 0 2px 10px rgba(0,0,0,.15); border-bottom: 1px solid rgba(255,255,255,.05); }
.app-header-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.app-header-logo { width: 40px; height: 40px; background: white; border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--gold); flex-shrink: 0; overflow: hidden; }
.app-header-logo img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.25); }
.app-header-text { min-width: 0; }
.app-header-title { font-size: 15px; font-weight: 800; letter-spacing: 0.5px; color: #FFFFFF; }
.app-header-sub { font-size: 10px; opacity: 0.75; font-weight: 500; }
.header-btn { width: 38px; height: 38px; border-radius: var(--r-md); background: rgba(255,255,255,.1); border: none; color: white; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; transition: all var(--t-fast); }
.header-btn:hover { background: rgba(255,255,255,.2); }
.header-btn:active { transform: scale(.92); }

/* ---------- BOTTOM NAV (RATA TENGAH OTOMATIS) ---------- */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(255,255,255,.95); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--border); display: flex; justify-content: space-around; padding: 8px 4px calc(8px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 24px rgba(97,19,41,.06); z-index: 40; }
.nav-item { flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 2px; color: var(--muted); font-size: 10px; font-weight: 700; cursor: pointer; border-radius: var(--r-md); text-decoration: none; transition: color .15s ease; position: relative; letter-spacing: 0.2px; }
.nav-item .icon { position: relative; z-index: 1; transition: all .2s var(--ease-spring); }
.nav-item.active .icon { transform: translateY(-2px); }
.nav-item.active .icon::before { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 40px; height: 34px; border-radius: 12px; background: var(--maroon-soft); z-index: -1; }
.nav-item.active { color: var(--maroon); }
.nav-item:not(.active):hover { color: var(--ink); }

/* ---------- PROFILE, ANNOUNCE, PERTEMUAN ---------- */
.profile-card { background: linear-gradient(135deg, var(--maroon-dark) 0%, var(--maroon-mid) 100%); color: white; border-radius: var(--r-xl); padding: 20px; display: flex; align-items: center; gap: 14px; box-shadow: 0 12px 28px rgba(97,19,41,.25); position: relative; overflow: hidden; }
.profile-card::before { content: ''; position: absolute; top: -40px; right: -40px; width: 140px; height: 140px; border-radius: 50%; background: var(--gold); opacity: 0.12; pointer-events: none; }
.profile-avatar { width: 56px; height: 56px; border-radius: var(--r-md); background: rgba(255,255,255,.18); border: 2px solid var(--gold); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 800; color: white; flex-shrink: 0; overflow: hidden; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-info { flex: 1; min-width: 0; position: relative; z-index: 1; }
.profile-name { font-size: 16px; font-weight: 800; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-school { font-size: 12px; opacity: 0.85; margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.profile-badges .badge { background: rgba(255,255,255,.18); color: white; border: 1px solid rgba(201,169,97,.4); }

.announce { background: var(--surface); border-radius: var(--r-lg); padding: 14px 16px; border: 1px solid var(--border); box-shadow: var(--sh-xs); margin-bottom: 10px; transition: all var(--t-norm); }
.announce:hover { border-color: var(--maroon-light); box-shadow: var(--sh-sm); }
.announce-title { font-size: 14px; font-weight: 800; margin-bottom: 4px; }
.announce-body { font-size: 13px; color: var(--muted); line-height: 1.55; }

.pertemuan-item { background: var(--surface); border-radius: var(--r-lg); padding: 14px; display: flex; align-items: center; gap: 14px; border: 1px solid var(--border); box-shadow: var(--sh-xs); margin-bottom: 10px; cursor: pointer; transition: all var(--t-norm); }
.pertemuan-item:hover { border-color: var(--maroon); transform: translateY(-2px); box-shadow: var(--sh-md); }
.pertemuan-number { width: 48px; height: 48px; border-radius: var(--r-md); background: var(--maroon-soft); color: var(--maroon); display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0; }

/* ---------- TOAST & MODAL ---------- */
.toast-wrap { position: fixed; top: calc(20px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; max-width: calc(100vw - 32px); }
.toast { background: var(--ink); color: white; padding: 12px 18px; border-radius: var(--r-md); font-size: 13.5px; font-weight: 600; box-shadow: var(--sh-lg); animation: slide-down .35s var(--ease-spring) both; pointer-events: auto; display: flex; align-items: center; gap: 10px; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* Modal Pop-up di Tengah (Untuk Konfirmasi & Form) */
.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28,20,20,.5);
  backdrop-filter: blur(2px);
  z-index: 1000;
  animation: fade-in .2s both;
  display: flex;
  align-items: center; /* Ke tengah, bukan ke bawah */
  justify-content: center;
  padding: 20px;
}
.bottom-sheet {
  background: white;
  border-radius: var(--r-xl); /* Sudut penuh */
  padding: 24px;
  width: 100%;
  max-width: 420px; /* Lebar maksimal pop-up */
  max-height: 85vh;
  overflow-y: auto;
  animation: scale-in .25s var(--ease-spring) both; /* Animasi membesar, bukan naik */
  box-shadow: var(--sh-xl);
}
.bottom-sheet-handle {
  display: none; /* Sembunyikan garis kecil di atas */
}

/* ---------- SKELETON & EMPTY ---------- */
.skeleton { background: linear-gradient(90deg, var(--border) 25%, #F7F2F2 50%, var(--border) 75%); background-size: 200% 100%; animation: shimmer 1.6s infinite; border-radius: var(--r-sm); }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); animation: fade-in-up .4s var(--ease-out) both; }
.empty-icon { width: 88px; height: 88px; margin: 0 auto 16px; border-radius: 50%; background: linear-gradient(135deg, var(--maroon-soft) 0%, #F9DDE6 100%); color: var(--maroon); display: flex; align-items: center; justify-content: center; position: relative; }
.empty-title { font-size: 15px; font-weight: 800; margin-bottom: 4px; color: var(--ink); }
.empty-desc { font-size: 13px; max-width: 280px; margin: 0 auto; line-height: 1.5; }

/* ---------- UTILITY ---------- */
.hidden { display: none !important; }
.text-muted { color: var(--muted); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.text-maroon { color: var(--maroon); }
.text-center { text-align: center; }
.w-full { width: 100%; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

/* ============================================================
   DESKTOP (≥ 900px)
   ============================================================ */
@media (min-width: 900px) {
  .bottom-nav { display: none; }
  .page { padding-bottom: 32px; }
  .app-header { display: none; }

  .desktop-layout { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
  
  .desktop-sidebar { background: linear-gradient(180deg, #4A0D1F 0%, var(--maroon) 100%); color: white; padding: 24px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
  .sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 8px 12px; margin-bottom: 20px; }
  .sidebar-brand-logo { width: 44px; height: 44px; background: white; border: 1.5px solid var(--gold); border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; overflow: hidden; }
  .sidebar-brand-logo img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.25); }
  .sidebar-brand-text .name { font-weight: 800; font-size: 14px; letter-spacing: 0.5px; }
  .sidebar-brand-text .sub { font-size: 10px; opacity: 0.7; }
  
  .sidebar-menu { display: flex; flex-direction: column; gap: 4px; }
  .sidebar-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--r-md); color: rgba(255,255,255,.7); font-size: 13.5px; font-weight: 600; cursor: pointer; text-decoration: none; transition: all .2s var(--ease-out); }
  .sidebar-item:hover { background: rgba(255,255,255,.08); color: white; transform: translateX(4px); }
  .sidebar-item.active { background: rgba(255,255,255,.15); color: white; box-shadow: 0 4px 12px rgba(0,0,0,.15); font-weight: 700; }

  .desktop-main { background: var(--bg); min-width: 0; }
  .desktop-topbar { background: rgba(255,255,255,.95); backdrop-filter: blur(12px); padding: 16px 32px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 5; }
  .desktop-topbar h2 { font-size: 18px; color: var(--maroon); font-weight: 800; }
  
  .user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: var(--r-full); background: var(--bg); border: 1px solid var(--border); font-size: 12.5px; font-weight: 700; transition: all var(--t-fast); }
  .user-chip:hover { border-color: var(--maroon-light); background: var(--surface); box-shadow: var(--sh-sm); }
  .user-chip .avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--maroon); color: white; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; overflow: hidden; }
  .user-chip .avatar img { width: 100%; height: 100%; object-fit: cover; }

  .desktop-content { padding: 24px 32px; max-width: 1200px; margin: 0 auto; }
}
/* ============================================
   APP DRAWER (HAMBURGER MENU MOBILE)
   ============================================ */
.hamburger-btn {
  width: 38px; height: 38px;
  border-radius: var(--r-md);
  background: rgba(255,255,255,.1);
  border: none; color: white;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  margin-right: 6px;
  transition: all var(--t-fast);
}
.hamburger-btn:active { transform: scale(.92); }

.app-drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(28,20,20,.5);
  backdrop-filter: blur(2px);
  z-index: 998;
  opacity: 0; visibility: hidden;
  transition: all .25s var(--ease-out);
}
.app-drawer-overlay.open { opacity: 1; visibility: visible; }

.app-drawer {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 280px; max-width: 85vw;
  background: linear-gradient(180deg, #4A0D1F 0%, var(--maroon) 100%);
  color: white;
  z-index: 999;
  transform: translateX(-100%);
  transition: transform .3s var(--ease-out);
  display: flex; flex-direction: column;
  overflow-y: auto;
  box-shadow: 4px 0 24px rgba(0,0,0,.25);
}
.app-drawer.open { transform: translateX(0); }

.drawer-header {
  padding: calc(20px + env(safe-area-inset-top)) 16px 16px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
}
.drawer-brand { display: flex; align-items: center; gap: 12px; }
.drawer-brand-logo {
  width: 42px; height: 42px; background: white;
  border: 1.5px solid var(--gold); border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.drawer-brand-logo img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.25); }
.drawer-brand-name { font-size: 14px; font-weight: 800; letter-spacing: 0.5px; }
.drawer-brand-sub { font-size: 10px; opacity: 0.7; }

.drawer-close {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.1); border: none; color: white;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}

.drawer-menu {
  flex: 1; padding: 16px 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.drawer-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--r-md);
  color: rgba(255,255,255,.75); font-size: 13.5px; font-weight: 600;
  text-decoration: none; transition: all .15s; cursor: pointer;
}
.drawer-item:hover { background: rgba(255,255,255,.08); color: white; }
.drawer-item.active {
  background: rgba(255,255,255,.15); color: white;
  box-shadow: 0 4px 12px rgba(0,0,0,.15); font-weight: 700;
}

.drawer-footer {
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
}
.drawer-user { display: flex; align-items: center; gap: 12px; }
.drawer-user-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.15); color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; overflow: hidden;
  border: 2px solid var(--gold);
}
.drawer-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.drawer-user-name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-user-role { font-size: 10px; opacity: 0.7; }

/* Sembunyikan bottom-nav saat drawer aktif di halaman yg pakai app-nav.js */
body.app-nav-active .bottom-nav { display: none !important; }
body.app-nav-active .page { padding-bottom: calc(24px + env(safe-area-inset-bottom)) !important; }
/* Tombol Hamburger Khusus Admin (karena admin tidak pakai .app-header) */
.admin-menu-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--r-md);
  background: rgba(255,255,255,.12);
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--t-fast);
}
.admin-menu-btn:active {
  transform: scale(.92);
}
.admin-menu-btn:hover {
  background: rgba(255,255,255,.22);
}

/* ============================================================
   COMPONENT EXTENSIONS v3
   Tambahan dari upgrade multi-halaman — reusable across pages
   ============================================================ */

/* ═══════════════════════════════════════
   LINK PILL — Platform-aware
   Untuk menampilkan link eksternal tanpa URL panjang
   Pemakaian: <a class="link-pill youtube" href="...">
   ═══════════════════════════════════════ */
.link-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: all .15s var(--ease-out);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  line-height: 1.2;
}
.link-pill .pi { width: 14px; height: 14px; flex-shrink: 0; }
.link-pill .pl {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.link-pill .pe {
  width: 11px; height: 11px;
  opacity: 0.65;
  flex-shrink: 0;
  margin-left: 1px;
}

.link-pill.youtube {
  background: #FEE2E2; color: #DC2626;
  border-color: rgba(220,38,38,.15);
}
.link-pill.youtube:hover {
  background: #DC2626; color: white;
  border-color: #DC2626;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220,38,38,.25);
}

.link-pill.drive {
  background: #FEF3C7; color: #D97706;
  border-color: rgba(217,119,6,.15);
}
.link-pill.drive:hover {
  background: #D97706; color: white;
  border-color: #D97706;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(217,119,6,.25);
}

.link-pill.docs {
  background: #DBEAFE; color: #2563EB;
  border-color: rgba(37,99,235,.15);
}
.link-pill.docs:hover {
  background: #2563EB; color: white;
  border-color: #2563EB;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,99,235,.25);
}

.link-pill.form {
  background: #F3E8FF; color: #7C3AED;
  border-color: rgba(124,58,237,.15);
}
.link-pill.form:hover {
  background: #7C3AED; color: white;
  border-color: #7C3AED;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124,58,237,.25);
}

.link-pill.pdf {
  background: #FEE2E2; color: #B91C1C;
  border-color: rgba(185,28,28,.15);
}
.link-pill.pdf:hover {
  background: #B91C1C; color: white;
  border-color: #B91C1C;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(185,28,28,.25);
}

.link-pill.image {
  background: #D1FAE5; color: #059669;
  border-color: rgba(5,150,105,.15);
}
.link-pill.image:hover {
  background: #059669; color: white;
  border-color: #059669;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(5,150,105,.25);
}

.link-pill.web {
  background: var(--bg); color: var(--muted);
  border-color: var(--border);
}
.link-pill.web:hover {
  background: var(--maroon); color: white;
  border-color: var(--maroon);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(125,29,58,.25);
}

/* ═══════════════════════════════════════
   FAB — Floating Action Button
   Untuk tombol aksi utama di admin pages
   Pemakaian: <button class="fab"><span class="icon-wrap">+</span></button>
   ═══════════════════════════════════════ */
.fab {
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom));
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--maroon) 0%, var(--maroon-mid) 100%);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(125,29,58,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  transition: all .2s var(--ease-out);
}
.fab:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 32px rgba(125,29,58,.5);
}
.fab:active { transform: scale(.95); }
.fab .icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}
.fab .icon-wrap svg {
  width: 24px;
  height: 24px;
  stroke-width: 2.5;
}
@media (min-width: 900px) {
  .fab { bottom: 28px; right: 28px; }
}

/* ═══════════════════════════════════════
   STAT CARDS — Dashboard statistics
   Pemakaian: <div class="stats-grid"><div class="stat-card">...</div></div>
   ═══════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
@media (min-width: 768px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}
.stat-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all .2s var(--ease-out);
}
.stat-card:hover {
  border-color: var(--maroon-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(125,29,58,.08);
}
.stat-card.active-filter {
  border-color: var(--maroon);
  background: var(--maroon-faint);
}
.stat-icon {
  width: 32px; height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--maroon-soft);
  color: var(--maroon);
}
.stat-icon.green { background: var(--success-soft); color: var(--success); }
.stat-icon.blue,
.stat-icon.info { background: var(--info-soft); color: var(--info); }
.stat-icon.gold { background: var(--gold-soft); color: var(--gold-dark); }
.stat-icon.gray { background: var(--border); color: var(--muted); }
.stat-val {
  font-size: 24px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.5px;
  line-height: 1;
}
.stat-label {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ═══════════════════════════════════════
   SEARCH WRAP — Input dengan icon kiri/kanan
   Pemakaian: <div class="search-wrap">
                <span class="icon-left" data-icon="search"></span>
                <input type="text" />
                <button class="icon-clear">×</button>
              </div>
   ═══════════════════════════════════════ */
.search-wrap {
  position: relative;
  margin-bottom: 10px;
}
.search-wrap input {
  width: 100%;
  height: 44px;
  padding: 0 40px 0 42px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
  font-weight: 600;
  outline: none;
  transition: all .15s;
  box-sizing: border-box;
}
.search-wrap input::placeholder {
  color: var(--muted-soft);
  font-weight: 500;
}
.search-wrap input:focus {
  border-color: var(--maroon);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(125,29,58,.08);
}
.search-wrap .icon-left {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  pointer-events: none;
  z-index: 1;
}
.search-wrap .icon-left svg {
  width: 16px;
  height: 16px;
  display: block;
  stroke-width: 2;
}
.search-wrap .icon-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg);
  border: none;
  color: var(--muted);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all .15s;
  z-index: 1;
}
.search-wrap .icon-clear svg { width: 13px; height: 13px; }
.search-wrap .icon-clear:hover {
  background: var(--maroon-soft);
  color: var(--maroon);
}
.search-wrap.has-value .icon-clear { display: flex; }

/* ═══════════════════════════════════════
   FILTER CHIPS — Kategori/filter horizontal
   Pemakaian: <div class="filter-chips">
                <button class="f-chip active" data-filter="">Semua <span class="count">5</span></button>
              </div>
   ═══════════════════════════════════════ */
.filter-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.filter-chips::-webkit-scrollbar { display: none; }
.f-chip {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all .15s;
  white-space: nowrap;
  font-family: inherit;
}
.f-chip:hover {
  border-color: var(--maroon-light);
  color: var(--maroon);
}
.f-chip.active {
  background: var(--maroon);
  border-color: var(--maroon);
  color: white;
}
.f-chip .count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--border);
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1;
}
.f-chip.active .count {
  background: rgba(255,255,255,.25);
  color: white;
}

/* ═══════════════════════════════════════
   FILTER AREA — Container untuk search + chips
   ═══════════════════════════════════════ */
.filter-area {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 16px;
  box-shadow: 0 2px 12px rgba(97,19,41,.04);
}
@media (max-width: 767px) {
  .filter-area { position: sticky; top: 60px; z-index: 15; }
}
@media (min-width: 768px) {
  .filter-area { position: sticky; top: 0; z-index: 15; }
}

/* ═══════════════════════════════════════
   TAB SWITCH — Tab pill (untuk halaman detail)
   Pemakaian: <div class="tab-switch">
                <button class="tsw active"><span data-icon="..."></span> Tab <span class="tsw-count">3</span></button>
              </div>
   ═══════════════════════════════════════ */
.tab-switch {
  display: flex;
  gap: 4px;
  background: var(--bg);
  padding: 4px;
  border-radius: 14px;
  margin-bottom: 16px;
  border: 1.5px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
  position: sticky;
  top: 60px;
  z-index: 15;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.tab-switch::-webkit-scrollbar { display: none; }
@media (min-width: 900px) {
  .tab-switch { top: 0; }
}
.tsw {
  flex: 1;
  min-width: 84px;
  padding: 11px 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  border-radius: 10px;
  cursor: pointer;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
  transition: all .15s;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.tsw:hover { background: rgba(125,29,58,.04); }
.tsw.active {
  background: var(--surface);
  color: var(--maroon);
  box-shadow: 0 2px 8px rgba(125,29,58,.08);
}
.tsw-count {
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--border);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all .2s;
}
.tsw.active .tsw-count {
  background: var(--maroon-soft);
  color: var(--maroon);
}
.tsw-count.urgent {
  background: var(--danger);
  color: white;
  animation: pulse 2s infinite;
}

/* ═══════════════════════════════════════
   MODAL STANDARD — untuk form/dialog
   Pemakaian: <div class="modal-backdrop"><div class="modal">...</div></div>
   ═══════════════════════════════════════ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(28,20,20,.55);
  backdrop-filter: blur(3px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fade-in .2s both;
}
.modal {
  background: var(--surface);
  border-radius: 20px;
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,.3);
  animation: slide-up .3s var(--ease-out) both;
}
@keyframes slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.modal-header {
  padding: 18px 22px 14px;
  border-bottom: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}
.modal-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--maroon);
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-title.danger { color: var(--danger); }
.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: 14px 22px;
  border-top: 1.5px solid var(--border);
  background: var(--bg);
  border-radius: 0 0 20px 20px;
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.modal-footer .btn { flex: 1; }

/* ═══════════════════════════════════════
   BOTTOM SHEET EXTENSIONS
   Base .bottom-sheet sudah ada di nakula.css v3
   Ini tambahan modifier + komponen internal
   ═══════════════════════════════════════ */
.bottom-sheet.lg { max-width: 540px; }

.sheet-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
}
.sheet-header-row > div { flex: 1; min-width: 0; }
.sheet-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--maroon);
  margin-bottom: 4px;
}
.sheet-title.danger { color: var(--danger); }
.sheet-subtitle {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.5;
}

/* ═══════════════════════════════════════
   FORM HELPERS — untuk modal/bottom sheet
   ═══════════════════════════════════════ */
.form-field-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.form-row .field { margin: 0; }

.modal-alert {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(185,28,28,.2);
}
.modal-alert.hidden { display: none; }

.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}
.modal-actions .btn { flex: 1; }

/* Info/Warning box di dalam modal */
.info-box {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 14px;
}
.info-box.sukses {
  background: linear-gradient(135deg, var(--success-soft) 0%, #ECFDF5 100%);
  border: 1px solid rgba(21,128,61,.15);
  color: var(--success);
}
.info-box.danger {
  background: linear-gradient(135deg, var(--danger-soft) 0%, #FEF2F2 100%);
  border: 1px solid rgba(185,28,28,.15);
  color: var(--danger);
}

/* ═══════════════════════════════════════
   EMPTY PANEL — Empty state dengan reset button
   Pemakaian: <div class="empty-panel">
                <div class="big-icon">...</div>
                <h3>Judul</h3>
                <p>Deskripsi</p>
                <button class="reset-btn">Reset</button>
              </div>
   ═══════════════════════════════════════ */
.empty-panel {
  text-align: center;
  padding: 50px 20px;
}
.empty-panel .big-icon {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--maroon-soft) 0%, #F9DDE6 100%);
  color: var(--maroon);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.empty-panel .big-icon.success {
  background: linear-gradient(135deg, var(--success-soft) 0%, #D1FAE5 100%);
  color: var(--success);
}
.empty-panel .big-icon svg { width: 36px; height: 36px; }
.empty-panel h3 {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 6px;
}
.empty-panel p {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 320px;
  margin: 0 auto 16px;
}
.empty-panel .reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: var(--maroon);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.empty-panel .reset-btn:hover {
  background: var(--maroon-dark);
  box-shadow: 0 6px 16px rgba(125,29,58,.25);
}
/* ═══════════════════════════════════════════════
   HEADER ALIGNMENT FIX — rata kiri konsisten
   Override default center agar semua header
   judul + deskripsi rata kiri dekat hamburger.
   ═══════════════════════════════════════════════ */

/* ── Header guru/KS/public ── */
.app-header-brand {
  justify-content: flex-start;
}
.app-header-text,
.app-header-title,
.app-header-sub {
  text-align: left;
}

/* ── Header admin ── */
.admin-header-left {
  justify-content: flex-start;
}
.admin-header-title,
.admin-header-title-1,
.admin-header-title-2 {
  text-align: left;
}

/* ── Header KS (jika ada) ── */
.ks-header-title,
.ks-header-sub {
  text-align: left;
}

/* ── Desktop topbar (judul halaman) ── */
.desktop-topbar h2,
.admin-topbar-title {
  text-align: left;
}
/* ═══════════════════════════════════════════════
   EXTRA: Custom header class rata kiri
   Cover halaman yang pakai class selain .app-header
   ═══════════════════════════════════════════════ */
.page-header,
.page-header-text,
.page-header-title,
.page-header-sub,
.hero-header,
.hero-header-text,
.hero-header-title,
.hero-header-sub,
.detail-header,
.detail-header-text,
.detail-header-title,
.detail-header-sub,
.header-title,
.header-sub,
.header-text {
  text-align: left;
}

.page-header,
.hero-header,
.detail-header {
  justify-content: flex-start;
}

/* ═══════════════════════════════════════════════
   BULLETPROOF HEADER — override semua
   ═══════════════════════════════════════════════ */
.app-header-brand {
  justify-content: flex-start !important;
}
.app-header-text,
.app-header-title,
.app-header-sub {
  text-align: left !important;
}

.admin-header-left {
  justify-content: flex-start !important;
}
.admin-header-title,
.admin-header-title-1,
.admin-header-title-2 {
  text-align: left !important;
}

.desktop-topbar,
.desktop-topbar h1,
.desktop-topbar h2,
.desktop-topbar h3,
.admin-topbar,
.admin-topbar h1,
.admin-topbar h2,
.admin-topbar-title {
  text-align: left !important;
}

.app-header-text {
  align-items: flex-start !important;
}

/* ═══════════════════════════════════════════════
   NUCLEAR FIX: PAKSA HEADER KIRI (ANTI-CENTER)
   ═══════════════════════════════════════════════ */
header.app-header .app-header-brand {
  justify-content: flex-start !important;
  flex: 1 1 auto !important;
  width: 100% !important;
}

header.app-header .app-header-text {
  text-align: left !important;
  align-items: flex-start !important;
  justify-content: center !important;
  flex: 1 1 auto !important;
  width: 100% !important;
}

header.app-header .app-header-title,
header.app-header .app-header-sub {
  text-align: left !important;
  width: 100% !important;
}

/* ═══════════════════════════════════════════════
   ANTI-CENTER: override .app-nav-active di body
   ═══════════════════════════════════════════════ */
body.app-nav-active .app-header-brand {
  justify-content: flex-start !important;
  text-align: left !important;
  flex: 1 1 auto !important;
}

body.app-nav-active .app-header-text {
  text-align: left !important;
  align-items: flex-start !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  width: auto !important;
}

body.app-nav-active .app-header-title,
body.app-nav-active .app-header-sub {
  text-align: left !important;
  width: auto !important;
  margin: 0 !important;
}
