/* ============================================================
   E-PONPES - Main Stylesheet
   Tema: Islamic Modern - Hijau Pesantren
   ============================================================ */

:root {
  --primary:       #1a5c38;
  --primary-dark:  #13432a;
  --primary-light: #2d8a56;
  --primary-xlight:#e8f5ee;
  --accent:        #c9972a;
  --accent-light:  #f7edd5;
  --danger:        #dc3545;
  --danger-light:  #fde8ea;
  --warning:       #f0ad4e;
  --warning-light: #fff8ec;
  --info:          #17a2b8;
  --info-light:    #e0f7fb;
  --success:       #28a745;
  --success-light: #eaf7ed;
  --white:         #ffffff;
  --bg:            #f4f6f9;
  --card-bg:       #ffffff;
  --border:        #e2e8f0;
  --text:          #2d3748;
  --text-muted:    #718096;
  --text-light:    #a0aec0;
  --sidebar-w:     260px;
  --topbar-h:      60px;
  --radius:        12px;
  --radius-sm:     8px;
  --shadow:        0 2px 12px rgba(0,0,0,0.08);
  --shadow-md:     0 4px 24px rgba(0,0,0,0.12);
  --shadow-lg:     0 8px 40px rgba(0,0,0,0.16);
  --font:          'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-arabic:   'Amiri', serif;
  --transition:    0.25s cubic-bezier(0.4,0,0.2,1);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-light); }
img { max-width: 100%; display: block; }
table { border-collapse: collapse; width: 100%; }
input, select, textarea, button { font-family: var(--font); }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

/* ===== OVERLAY ===== */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%);
  display: flex;
  flex-direction: column;
  z-index: 300;
  overflow: hidden;
  transition: transform var(--transition);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  min-height: 70px;
}
.brand-logo {
  width: 42px; height: 42px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.brand-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #e8b84b);
  display: flex; align-items: center; justify-content: center;
}
.brand-icon span {
  font-family: var(--font-arabic);
  font-size: 20px;
  color: var(--primary-dark);
  font-weight: 700;
}
.brand-text { flex: 1; min-width: 0; }
.brand-name {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.brand-arabic {
  font-family: var(--font-arabic);
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  direction: rtl;
}
.sidebar-close-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  padding: 4px;
  display: none;
  border-radius: 6px;
}
.sidebar-close-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: rgba(255,255,255,0.75);
  font-size: 13.5px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: var(--transition);
}
.nav-item:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border-left-color: rgba(255,255,255,0.3);
}
.nav-item.active {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border-left-color: var(--accent);
  font-weight: 600;
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }
.nav-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  position: relative;
  width: 38px; height: 38px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-placeholder {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}
.status-dot {
  position: absolute;
  bottom: 1px; right: 1px;
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 2px solid var(--primary);
}
.status-dot.online { background: var(--success); }
.status-dot.idle   { background: var(--warning); }
.status-dot.offline{ background: var(--text-light); }

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 12.5px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-level { font-size: 11px; color: rgba(255,255,255,0.6); }

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

/* ===== TOPBAR ===== */
.topbar {
  position: sticky; top: 0;
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  color: var(--text);
  display: none;
  transition: var(--transition);
}
.hamburger:hover { background: var(--bg); }
.hamburger svg { width: 22px; height: 22px; }

.topbar-title { flex: 1; }
.topbar-title h1 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.btn-icon {
  background: none;
  border: none;
  padding: 7px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  transition: var(--transition);
}
.btn-icon:hover { background: var(--bg); color: var(--primary); }
.btn-icon svg { width: 20px; height: 20px; }

.user-topbar-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 5px 12px 5px 5px;
  cursor: pointer;
  transition: var(--transition);
}
.user-topbar-btn:hover { background: var(--primary-xlight); border-color: var(--primary); }
.user-avatar-sm {
  width: 28px; height: 28px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.user-avatar-sm img { width: 100%; height: 100%; object-fit: cover; }
.avatar-placeholder-sm { font-size: 12px; font-weight: 700; color: #fff; }
.user-name-sm { font-size: 13px; font-weight: 600; }
.user-topbar-btn svg { width: 14px; height: 14px; color: var(--text-muted); }

/* ===== DROPDOWN ===== */
.topbar-dropdown { position: relative; }
.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  min-width: 200px;
  z-index: 500;
  overflow: hidden;
  animation: fadeIn 0.15s ease;
}
.dropdown-menu.dropdown-right { left: auto; right: 0; }
.dropdown-menu.open { display: block; }
.dropdown-header {
  padding: 10px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dropdown-header strong { color: var(--text); font-size: 13px; }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 13.5px;
  color: var(--text);
  transition: var(--transition);
  border: none;
  background: none;
  width: 100%;
  cursor: pointer;
}
.dropdown-item:hover { background: var(--primary-xlight); color: var(--primary); }
.dropdown-item.text-danger { color: var(--danger); }
.dropdown-item.text-danger:hover { background: var(--danger-light); }
.dropdown-item svg { width: 15px; height: 15px; }
.dropdown-divider { border-top: 1px solid var(--border); margin: 2px 0; }
.notif-empty { color: var(--text-muted); font-size: 12px; text-align: center; padding: 20px 14px; }

/* ===== FLASH ===== */
.flash-container { padding: 0 20px; }
.flash-message {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin: 12px 0 0;
  font-size: 13.5px;
  font-weight: 500;
  animation: slideIn 0.4s ease;
}
.flash-success { background: var(--success-light); color: #155724; border: 1px solid #c3e6cb; }
.flash-error   { background: var(--danger-light);  color: #721c24; border: 1px solid #f5c6cb; }
.flash-warning { background: var(--warning-light); color: #856404; border: 1px solid #ffc107; }
.flash-message svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ===== PAGE CONTENT ===== */
.page-content { padding: 20px; flex: 1; }

/* ===== CARDS ===== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title svg { width: 18px; height: 18px; color: var(--primary); }
.card-body { padding: 20px; }

/* ===== STAT CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-icon {
  width: 50px; height: 50px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 24px; height: 24px; }
.stat-icon.green  { background: var(--primary-xlight); color: var(--primary); }
.stat-icon.blue   { background: var(--info-light);     color: var(--info); }
.stat-icon.yellow { background: var(--warning-light);  color: var(--accent); }
.stat-icon.red    { background: var(--danger-light);   color: var(--danger); }
.stat-icon.purple { background: #f3e8ff; color: #7c3aed; }
.stat-icon.teal   { background: #e0f7fa; color: #00796b; }
.stat-info {}
.stat-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}
.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn svg { width: 15px; height: 15px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary   { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-accent    { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-accent:hover { opacity: 0.9; color: #fff; }
.btn-success   { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { opacity: 0.9; color: #fff; }
.btn-danger    { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { opacity: 0.9; color: #fff; }
.btn-warning   { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-info      { background: var(--info); color: #fff; border-color: var(--info); }
.btn-outline   { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { background: var(--bg); }
.btn-outline-primary { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; border-radius: 5px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-icon-only { padding: 7px; }
.btn-whatsapp { background: #25D366; color: #fff; border-color: #25D366; }
.btn-whatsapp:hover { background: #128C7E; color: #fff; }
.btn-excel { background: #217346; color: #fff; border-color: #217346; }
.btn-excel:hover { opacity: 0.9; color: #fff; }
.btn-print { background: #6c757d; color: #fff; border-color: #6c757d; }
.btn-print:hover { opacity: 0.9; color: #fff; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-control {
  display: block;
  width: 100%;
  padding: 9px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text);
  background: var(--white);
  transition: var(--transition);
  -webkit-appearance: none;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,92,56,0.12);
}
.form-control:disabled { background: var(--bg); opacity: 0.7; }
.form-control.is-invalid { border-color: var(--danger); }
.form-text { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }
.invalid-feedback { font-size: 11.5px; color: var(--danger); margin-top: 4px; }
.input-group { display: flex; }
.input-group .form-control { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-prefix {
  display: flex; align-items: center;
  padding: 0 12px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  font-size: 13px;
  color: var(--text-muted);
}
.input-prefix + .form-control { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ===== TABLES ===== */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.table th {
  background: var(--bg);
  padding: 10px 12px;
  text-align: left;
  font-weight: 700;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}
.table tbody tr:hover { background: var(--primary-xlight); }
.table tbody tr:last-child td { border-bottom: none; }
.table td.no-data { text-align: center; color: var(--text-muted); padding: 40px; }
.table .actions { display: flex; gap: 6px; flex-wrap: nowrap; }
.td-thumb { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); }
.td-thumb-placeholder {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.badge-success { background: var(--success-light); color: #155724; }
.badge-danger  { background: var(--danger-light);  color: #721c24; }
.badge-warning { background: var(--warning-light); color: #856404; }
.badge-info    { background: var(--info-light);    color: #004085; }
.badge-primary { background: var(--primary-xlight); color: var(--primary); }
.badge-secondary { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.badge-online  { background: var(--success-light); color: #155724; }
.badge-idle    { background: var(--warning-light); color: #856404; }
.badge-offline { background: var(--bg); color: var(--text-muted); }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(3px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}
.modal-box {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.25s ease;
}
.modal-sm  { max-width: 380px; text-align: center; padding: 32px 24px; }
.modal-md  { max-width: 560px; }
.modal-lg  { max-width: 800px; }
.modal-xl  { max-width: 1100px; }
.modal-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.modal-icon svg { width: 30px; height: 30px; }
.logout-icon { background: var(--danger-light); color: var(--danger); }
.delete-icon  { background: var(--danger-light); color: var(--danger); }
.modal-sm h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.modal-sm p  { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }
.modal-actions { display: flex; gap: 12px; justify-content: center; }
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h4 { font-size: 15px; font-weight: 700; }
.modal-body { padding: 20px; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.btn-modal-close {
  background: none; border: none;
  padding: 5px;
  cursor: pointer;
  border-radius: 6px;
  color: var(--text-muted);
}
.btn-modal-close:hover { background: var(--bg); }
.btn-modal-close svg { width: 18px; height: 18px; }

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  bottom: 20px; right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  min-width: 280px;
  animation: slideInRight 0.3s ease;
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error   { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast svg { width: 18px; height: 18px; flex-shrink: 0; }
.toast.success svg { color: var(--success); }
.toast.error   svg { color: var(--danger); }

/* ===== FOTO UPLOAD PREVIEW ===== */
.foto-upload-wrapper { position: relative; display: inline-block; }
.foto-preview {
  width: 100px; height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
}
.foto-upload-btn {
  position: absolute;
  bottom: 0; right: 0;
  width: 30px; height: 30px;
  background: var(--primary);
  border: 2px solid var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.foto-upload-btn svg { width: 14px; height: 14px; color: #fff; }
.foto-upload-input { display: none; }

/* ===== FILTER BAR ===== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-bar .form-control { width: auto; min-width: 140px; }
.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.search-box input { padding-left: 38px; }
.search-box .search-icon {
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.search-box .search-icon svg { width: 16px; height: 16px; }

/* ===== PAGINATION ===== */
.pagination-nav { margin-top: 16px; }
.pagination { display: flex; align-items: center; gap: 4px; list-style: none; justify-content: center; }
.pagination li a {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
}
.pagination li a:hover { border-color: var(--primary); color: var(--primary); }
.pagination li.active a { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination li a svg { width: 14px; height: 14px; }

/* ===== TABS ===== */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 20px; gap: 2px; }
.tab-btn {
  padding: 9px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition);
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ===== ORNAMENT ISLAMIC ===== */
.islamic-divider {
  text-align: center;
  color: var(--accent);
  font-family: var(--font-arabic);
  font-size: 18px;
  margin: 8px 0;
  opacity: 0.6;
}

/* ===== KWITANSI PRINT ===== */
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .main-wrapper { margin-left: 0 !important; }
  .page-content { padding: 0 !important; }
  body { background: #fff; }
}

/* ===== CALENDAR ===== */
.calendar-widget { /* used in pembayaran */ }
.date-range-picker { display: flex; align-items: center; gap: 8px; }
.date-range-picker span { color: var(--text-muted); font-size: 13px; }

/* ===== UTILITIES ===== */
.d-none { display: none !important; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-primary { color: var(--primary); }
.text-danger  { color: var(--danger); }
.text-muted   { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-accent  { color: var(--accent); }
.fw-bold { font-weight: 700; }
.fw-600  { font-weight: 600; }
.fs-12   { font-size: 12px; }
.fs-13   { font-size: 13px; }
.fs-11   { font-size: 11px; }
.w-100   { width: 100%; }
.flex-1  { flex: 1; }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn   { from { opacity: 0; }             to { opacity: 1; } }
@keyframes slideIn  { from { transform: translateY(-12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideOut { from { transform: translateY(0);  opacity: 1; } to { transform: translateY(-12px); opacity: 0; } }
@keyframes slideUp  { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Loading spinner */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== DETAIL PANEL (klik nama santri) ===== */
.detail-panel { }
.detail-section { margin-bottom: 20px; }
.detail-section h5 {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.detail-row { display: flex; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--bg); }
.detail-label { font-size: 12.5px; color: var(--text-muted); width: 140px; flex-shrink: 0; }
.detail-value { font-size: 13px; font-weight: 500; color: var(--text); flex: 1; }

/* ===== CHART CONTAINER ===== */
.chart-container { position: relative; }
.chart-container canvas { max-height: 300px; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.empty-state svg { width: 60px; height: 60px; opacity: 0.3; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }
