/* ============================================
 * EKINERJADOSEN - Dark Mode Theme
 * Vibe coding style with mewah palette
 * ============================================ */

:root {
  --bg-primary: #0f172a;        /* Deep navy */
  --bg-secondary: #1e293b;      /* Card */
  --bg-tertiary: #334155;       /* Hover */
  --bg-elevated: #1a2332;
  --border: rgba(99, 102, 241, 0.15);
  --border-strong: rgba(99, 102, 241, 0.3);

  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;

  --accent: #6366f1;            /* Indigo */
  --accent-hover: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.4);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #06b6d4;

  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --gradient-card: linear-gradient(135deg, #1e293b 0%, #1a2332 100%);
  --gradient-glow: radial-gradient(circle at top right, rgba(99,102,241,0.15), transparent 60%);

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 30px var(--accent-glow);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

html, body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-image: var(--gradient-glow);
  background-attachment: fixed;
}

a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-hover); }

button { font-family: inherit; cursor: pointer; border: none; }

/* ===== LOADER SCREEN ===== */
.loader-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-primary);
  z-index: 9999;
}
.loader-content { text-align: center; }
.loader-logo { font-size: 4rem; margin-bottom: 1rem; }
.loader-content h1 { background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 1.5rem; }
.spinner {
  width: 40px; height: 40px; margin: 0 auto 1rem;
  border: 3px solid var(--bg-tertiary);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== AUTH PAGES ===== */
.auth-wrapper {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
}
.auth-card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.auth-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient-primary);
}
.auth-logo { font-size: 3rem; text-align: center; margin-bottom: 1rem; }
.auth-title {
  font-size: 1.75rem; font-weight: 700;
  text-align: center; margin-bottom: .5rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.auth-subtitle { color: var(--text-muted); text-align: center; margin-bottom: 2rem; font-size: .9rem; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block;
  margin-bottom: .5rem;
  color: var(--text-secondary);
  font-size: .875rem;
  font-weight: 500;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: .85rem 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: .95rem;
  font-family: inherit;
  transition: all .2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-textarea { resize: vertical; min-height: 80px; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem;
  padding: .85rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: .95rem;
  transition: all .2s;
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover { box-shadow: 0 0 40px var(--accent-glow); }
.btn-danger { background: var(--danger); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-block { width: 100%; }
.btn-sm { padding: .5rem 1rem; font-size: .85rem; }

/* ===== APP LAYOUT ===== */
.app-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
@media (max-width: 768px) {
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .sidebar.open { display: block; position: fixed; inset: 0; z-index: 100; }
}

.sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
  position: sticky; top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-brand {
  display: flex; align-items: center; gap: .75rem;
  padding: .5rem;
  margin-bottom: 2rem;
  font-size: 1.25rem;
  font-weight: 700;
}
.sidebar-brand-icon { font-size: 1.75rem; }
.sidebar-nav { display: flex; flex-direction: column; gap: .25rem; }
.nav-link {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: .92rem;
  transition: all .2s;
}
.nav-link:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.nav-link.active {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-glow);
}

.main-content {
  padding: 2rem;
  max-width: 1400px;
  width: 100%;
}
@media (max-width: 768px) { .main-content { padding: 1rem; } }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap; gap: 1rem;
}
.page-title {
  font-size: 1.75rem; font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.user-chip {
  display: flex; align-items: center; gap: .75rem;
  padding: .5rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}

/* ===== CARDS & STATS ===== */
.card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all .3s;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 80px; height: 80px;
  background: var(--accent);
  opacity: .08;
  border-radius: 50%;
  filter: blur(20px);
}
.stat-icon { font-size: 1.75rem; margin-bottom: .5rem; }
.stat-value { font-size: 2rem; font-weight: 700; line-height: 1; margin: .25rem 0; }
.stat-label { color: var(--text-muted); font-size: .85rem; }

/* ===== TABLES ===== */
.table-wrap {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: auto;
  margin-bottom: 1.5rem;
}
.table { width: 100%; border-collapse: collapse; }
.table thead th {
  text-align: left;
  padding: 1rem;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: .85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--border);
}
.table tbody td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  font-size: .92rem;
}
.table tbody tr:hover { background: var(--bg-tertiary); }
.table tbody tr:last-child td { border-bottom: none; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex; align-items: center;
  padding: .25rem .75rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.badge-success { background: rgba(16,185,129,.15); color: var(--success); }
.badge-warning { background: rgba(245,158,11,.15); color: var(--warning); }
.badge-danger { background: rgba(239,68,68,.15); color: var(--danger); }
.badge-info { background: rgba(6,182,212,.15); color: var(--info); }

/* ===== TOAST ===== */
.toast-container {
  position: fixed; top: 1.5rem; right: 1.5rem;
  display: flex; flex-direction: column; gap: .5rem;
  z-index: 1000;
}
.toast {
  padding: 1rem 1.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 280px; max-width: 400px;
  animation: slideIn .3s ease;
  border-left: 3px solid var(--accent);
}
.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-info { border-left-color: var(--info); }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== MODAL ===== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center; justify-content: center;
  z-index: 100;
  padding: 1rem;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideIn .3s ease;
}
.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

/* ===== UTILITY ===== */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-end { display: flex; justify-content: flex-end; gap: .5rem; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.tabs {
  display: flex; gap: .5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.tab {
  padding: .75rem 1.25rem;
  background: none;
  color: var(--text-muted);
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all .2s;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab:hover { color: var(--text-primary); }
/* ===== PASSWORD TOGGLE EYE ICON ===== */
.password-wrapper {
  position: relative;
  display: block;
}
.password-wrapper input {
  padding-right: 3rem !important;
  width: 100%;
}
.password-toggle {
  position: absolute;
  right: .75rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: .5rem;
  opacity: .55;
  transition: opacity .2s, transform .15s;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}
.password-toggle:hover {
  opacity: 1;
  background: rgba(99, 102, 241, .1);
}
.password-toggle:active {
  transform: translateY(-50%) scale(.92);
}
/* ===== NOTIFICATION BELL ===== */
.bell-wrapper { position:relative; }
.bell-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  width: 42px; height: 42px;
  border-radius: 50%;
  display:flex; align-items:center; justify-content:center;
  font-size: 1.2rem;
  cursor: pointer;
  position: relative;
  transition: all .2s;
}
.bell-btn:hover { background: var(--bg-tertiary); border-color: var(--accent); }
.bell-btn.has-unread { animation: bellShake .5s ease-in-out; }
@keyframes bellShake {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-15deg); }
  75% { transform: rotate(15deg); }
}
.bell-badge {
  position: absolute;
  top: -2px; right: -2px;
  background: var(--danger);
  color: white;
  font-size: .7rem;
  font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px;
  border: 2px solid var(--bg-primary);
}
.bell-dropdown {
  position: absolute;
  top: calc(100% + 8px); right: 0;
  width: 360px; max-width: 90vw;
  max-height: 500px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  overflow: hidden;
  display: none;
  flex-direction: column;
}
.bell-dropdown.open { display: flex; }
.bell-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.bell-header h3 { font-size: 1rem; font-weight: 600; }
.bell-list { overflow-y: auto; flex: 1; }
.notif-item {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .2s;
  border-left: 3px solid transparent;
}
.notif-item:hover { background: var(--bg-tertiary); }
.notif-item.unread { background: rgba(99,102,241,.06); border-left-color: var(--accent); }
.notif-item.success { border-left-color: var(--success); }
.notif-item.error   { border-left-color: var(--danger); }
.notif-item.warning { border-left-color: var(--warning); }
.notif-title { font-weight: 600; font-size: .9rem; margin-bottom: .25rem; }
.notif-msg { font-size: .82rem; color: var(--text-muted); margin-bottom: .25rem; }
.notif-time { font-size: .72rem; color: var(--text-muted); }
.notif-empty { padding: 2rem; text-align: center; color: var(--text-muted); }
/* Hide menu untuk role pimpinan */
body[data-role="pimpinan"] a[href="bkd.html"],
body[data-role="pimpinan"] a[href="elibrary.html"],
body[data-role="pimpinan"] a[href="kalender.html"],
body[data-role="pimpinan"] a[href="profile.html"],
body[data-role="pimpinan"] a[href="sister.html"],
body[data-role="pimpinan"] a[href="kum.html"] {
  display: none !important;
}
