/* admin/assets/admin.css — Keuangan Madrasah Umi */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #4f8ef7;
  --primary-hover: #3a7ae8;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --surface: #1c2030;
  --surface2: #252a3a;
  --border: #2d3349;
  --text-primary: #e2e8f8;
  --text-muted: #7c86a8;
  --font: 'Plus Jakarta Sans', sans-serif;
  --radius: 10px;
  --sidebar-w: 256px;
  --topbar-h: 60px;
}
[data-theme="light"] {
  --bg-primary: #f0f4ff;
  --bg-secondary: #e8edf8;
  --surface: #ffffff;
  --surface2: #f5f7ff;
  --border: #dde2f2;
  --text-primary: #1a2040;
  --text-muted: #5a6282;
}

html, body { height: 100%; }
body { font-family: var(--font); background: var(--bg-primary); color: var(--text-primary); font-size: 14px; line-height: 1.6; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* SIDEBAR */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w);
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 100; transition: transform .25s;
}
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 20px 16px; border-bottom: 1px solid var(--border);
}
.sidebar-logo { display: flex; align-items: center; gap: 12px; }
.logo-icon-wrap {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--primary); display: flex; align-items: center;
  justify-content: center; color: #fff; font-size: 18px;
}
.logo-title { font-size: 14px; font-weight: 700; line-height: 1.2; }
.logo-sub { font-size: 11px; color: var(--text-muted); }
.sidebar-close { display: none; background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 18px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px; }
.nav-section-label {
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  color: var(--text-muted); text-transform: uppercase; padding: 12px 8px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: var(--radius); color: var(--text-muted); text-decoration: none;
  font-size: 13px; font-weight: 500; transition: all .15s; margin-bottom: 2px;
}
.nav-item:hover { background: var(--surface2); color: var(--text-primary); }
.nav-item.active { background: rgba(79,142,247,.12); color: var(--primary); font-weight: 600; }
.nav-icon { font-size: 15px; width: 20px; text-align: center; }
.badge-count { margin-left: auto; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 10px; }
.sidebar-footer { padding: 16px; border-top: 1px solid var(--border); }
.admin-info { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.admin-avatar {
  width: 36px; height: 36px; background: linear-gradient(135deg, var(--primary), #7c5cf4);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.admin-name { font-size: 13px; font-weight: 600; }
.admin-role { font-size: 11px; color: var(--text-muted); }
.btn-logout {
  display: block; width: 100%; text-align: center;
  background: var(--surface2); color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 8px; font-size: 13px; font-weight: 500; text-decoration: none; transition: all .15s;
}
.btn-logout:hover { background: rgba(239,68,68,.1); color: var(--danger); border-color: var(--danger); }

/* TOPBAR */
.topbar {
  position: sticky; top: 0; z-index: 50; height: var(--topbar-h);
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 20px; gap: 12px;
}
.hamburger { display: none; background: none; border: none; cursor: pointer; font-size: 20px; color: var(--text-primary); }
.topbar-title { font-size: 16px; font-weight: 700; flex: 1; }
.topbar-actions { display: flex; gap: 8px; }
.topbar-btn {
  position: relative; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 15px; text-decoration: none; color: var(--text-primary); transition: background .15s;
}
.topbar-btn:hover { background: var(--border); }
.notif-dot {
  position: absolute; top: -3px; right: -3px;
  background: var(--danger); color: #fff; width: 16px; height: 16px;
  border-radius: 50%; font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* MAIN */
.main-wrapper { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.page-content { padding: 24px; flex: 1; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 99; }

/* PAGE HEADER */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-title { font-size: 22px; font-weight: 800; margin: 0 0 4px; }
.page-subtitle { color: var(--text-muted); font-size: 13px; margin: 0; }

/* STAT CARDS */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
  display: flex; align-items: center; gap: 14px;
}
.stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.stat-content { flex: 1; min-width: 0; }
.stat-value { font-size: 20px; font-weight: 800; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* CARD */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 20px; }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; gap: 10px;
  font-weight: 700; font-size: 14px;
}
.card-body { padding: 20px; }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--border); }

/* TABLE */
.table-wrapper { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table thead th {
  background: var(--surface2); padding: 10px 14px; text-align: left;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-muted); white-space: nowrap;
}
.table tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--surface2); }

/* BADGE */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.badge-success  { background: rgba(34,197,94,.12);  color: var(--success); }
.badge-warning  { background: rgba(245,158,11,.12); color: var(--warning); }
.badge-danger   { background: rgba(239,68,68,.12);  color: var(--danger); }
.badge-info     { background: rgba(79,142,247,.12); color: var(--primary); }
.badge-secondary{ background: var(--surface2); color: var(--text-muted); }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer; border: none; text-decoration: none;
  transition: all .15s; font-family: var(--font); white-space: nowrap;
}
.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface2); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(1.1); }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); }
.btn-warning   { background: var(--warning); color: #fff; }
.btn-info      { background: var(--primary); color: #fff; }
.btn-sm        { padding: 5px 10px; font-size: 12px; }
.btn:disabled  { opacity: .5; cursor: not-allowed; }

/* FORMS */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.form-control {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 12px; color: var(--text-primary);
  font-family: var(--font); font-size: 14px; outline: none;
  transition: border-color .2s; width: 100%;
}
.form-control:focus { border-color: var(--primary); }
select.form-control option { background: var(--surface2); }
textarea.form-control { resize: vertical; min-height: 80px; }

/* MODAL */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 200; align-items: center; justify-content: center; padding: 16px; }
.modal.open { display: flex; }
.modal-dialog { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 20px; line-height: 1; }
.modal-body { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ALERT */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; display: flex; align-items: flex-start; gap: 8px; }
.alert-success { background: rgba(34,197,94,.1);  color: var(--success); border: 1px solid rgba(34,197,94,.2); }
.alert-danger  { background: rgba(239,68,68,.1);  color: var(--danger);  border: 1px solid rgba(239,68,68,.2); }
.alert-warning { background: rgba(245,158,11,.1); color: var(--warning); border: 1px solid rgba(245,158,11,.2); }
.alert-info    { background: rgba(79,142,247,.1); color: var(--primary); border: 1px solid rgba(79,142,247,.2); }

/* UTILS */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger)  !important; }
.text-warning { color: var(--warning) !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-center  { text-align: center; }
.fw-bold      { font-weight: 700; }
.mb-3         { margin-bottom: 12px; }
.mb-0         { margin-bottom: 0; }

/* FILTER TABS */
.filter-tabs { display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-tab {
  padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 500;
  text-decoration: none; color: var(--text-muted);
  background: var(--surface2); border: 1px solid var(--border); transition: all .15s;
}
.filter-tab.active, .filter-tab:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* PAGINATION */
.pagination { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; margin-top: 16px; }

/* PROGRESS */
.progress-bar { height: 6px; background: var(--surface2); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 3px; transition: width .3s; }

/* RESPONSIVE */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { display: none; }
  .sidebar-overlay.open { display: block; }
  .sidebar-close { display: block; }
  .main-wrapper { margin-left: 0; }
  .hamburger { display: flex; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .page-content { padding: 16px; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 16px; }
}
