:root{
  --bg:#f4f7fb;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --border:#e7eef7;
  --shadow:0 12px 30px rgba(15, 23, 42, .06);
  --radius:18px;

  --sidebar:#0b1220;
  --sidebar2:#0a1631;
  --active:#1d4ed8;
}

*{ box-sizing:border-box; }
body{
  background:var(--bg);
  color:var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

a{ text-decoration:none; }
.cardx{
  background:var(--card);
  border:1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.app-shell{
  display:flex;
  min-height:100vh;
}

/* Sidebar */
.sidebar{
  width:260px;
  background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar2) 100%);
  color:#dbeafe;
  padding:18px 14px;
  position:sticky;
  top:0;
  height:100vh;
}

.brand{
  display:flex;
  gap:12px;
  align-items:center;
  padding:8px 10px 18px;
  border-bottom:1px solid rgba(255,255,255,.08);
  margin-bottom:16px;
}

.brand .logo{
  width:42px;height:42px;border-radius:12px;
  background: radial-gradient(circle at 30% 30%, #a78bfa 0%, #6366f1 40%, #3b82f6 100%);
  display:flex;align-items:center;justify-content:center;
  box-shadow: 0 10px 20px rgba(99,102,241,.25);
  color:white;
}

.brand .logo img{
  width:100%;height:100%;object-fit:contain;
  border-radius:12px;
  background: rgba(255,255,255,.92);
  padding:6px;
}
.brand .title{
  font-weight:800;
  letter-spacing:.2px;
  color:#fff;
  line-height:1.1;
}
.brand .subtitle{
  font-size:12px;
  color:rgba(219,234,254,.7);
}

.nav-section{
  font-size:11px;
  letter-spacing:.12em;
  color:rgba(219,234,254,.55);
  margin:18px 10px 8px;
}

.navlink{
  display:flex;
  align-items:center;
  gap:10px;
  padding:11px 12px;
  margin:6px 6px;
  border-radius:14px;
  color:rgba(219,234,254,.86);
  transition:.18s ease;
}
.navlink i{ font-size:18px; opacity:.95; }
.navlink:hover{
  background: rgba(255,255,255,.06);
  color:#fff;
}
.navlink.active{
  background: rgba(59,130,246,.18);
  outline: 1px solid rgba(59,130,246,.35);
  color:#fff;
}

.sidebar-footer{
  position:absolute;
  left:14px; right:14px;
  bottom:16px;
  padding-top:14px;
  border-top:1px solid rgba(255,255,255,.08);
  display:flex;
  gap:10px;
  align-items:center;
}
.avatar{
  width:38px;height:38px;border-radius:50%;
  background: rgba(99,102,241,.25);
  display:flex;align-items:center;justify-content:center;
  color:#fff; font-weight:700;
}
.admin-meta .name{ color:#fff; font-weight:700; font-size:13px; }
.admin-meta .role{ color:rgba(219,234,254,.7); font-size:12px; }
.logout{
  margin-left:auto;
  width:38px;height:38px;border-radius:12px;
  border:1px solid rgba(255,255,255,.12);
  display:flex;align-items:center;justify-content:center;
  color:#fff;
  background: rgba(255,255,255,.04);
}
.logout:hover{ background: rgba(255,255,255,.08); }

/* Main */
.main{
  flex:1;
  padding:22px 26px;
}

/* Topbar */
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:18px;
}
.page-title h3{
  margin:0;
  font-weight:800;
}
.page-title p{
  margin:4px 0 0;
  color:var(--muted);
}

.top-actions{
  display:flex;
  align-items:center;
  gap:12px;
}
.searchbox{
  width:340px;
  max-width:48vw;
  background:#fff;
  border:1px solid var(--border);
  border-radius: 14px;
  padding:10px 12px;
  display:flex;
  align-items:center;
  gap:10px;
  box-shadow: 0 10px 20px rgba(15,23,42,.04);
}
.searchbox i{ color:#94a3b8; }
.searchbox input{
  border:0; outline:0;
  width:100%;
  font-size:14px;
}
.icon-btn{
  width:42px;height:42px;border-radius:14px;
  border:1px solid var(--border);
  background:#fff;
  display:flex;align-items:center;justify-content:center;
  box-shadow: 0 10px 20px rgba(15,23,42,.04);
  position:relative;
}
.icon-btn .dot{
  position:absolute;
  top:10px; right:10px;
  width:8px;height:8px;border-radius:50%;
  background:#ef4444;
}

/* Stat cards */
.stat-grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:16px;
  margin-bottom:18px;
}
.stat-card{
  border-radius:18px;
  padding:18px;
  color:#fff;
  box-shadow: 0 20px 40px rgba(2,6,23,.12);
  position:relative;
  overflow:hidden;
  min-height:108px;
}
.stat-card .label{ opacity:.92; font-weight:600; }
.stat-card .value{ font-size:34px; font-weight:900; margin-top:6px; line-height:1; }
.stat-card .hint{ margin-top:10px; font-size:12px; opacity:.9; }
.stat-card .badge-icon{
  position:absolute;
  right:14px; top:18px;
  width:46px;height:46px;border-radius:16px;
  background: rgba(255,255,255,.18);
  display:flex;align-items:center;justify-content:center;
  backdrop-filter: blur(6px);
}
.stat-card .badge-icon i{ font-size:22px; color:#fff; }

.bg-purple{ background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%); }
.bg-pink{ background: linear-gradient(135deg, #f472b6 0%, #ef4444 100%); }
.bg-cyan{ background: linear-gradient(135deg, #22d3ee 0%, #0ea5e9 100%); }
.bg-green{ background: linear-gradient(135deg, #34d399 0%, #22c55e 100%); }

/* Content grid */
.content-grid{
  display:grid;
  grid-template-columns: 2fr 1fr;
  gap:16px;
}

/* Table card */
.card-headerx{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:16px 18px 10px;
}
.card-headerx h5{
  margin:0; font-weight:800;
}
.card-headerx a{
  font-size:13px;
  color:#4f46e5;
  font-weight:700;
}
.tablex{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
}
.tablex th{
  font-size:11px;
  letter-spacing:.08em;
  color:#64748b;
  padding:12px 18px;
  border-top:1px solid var(--border);
  border-bottom:1px solid var(--border);
  background:#fbfdff;
}
.tablex td{
  padding:14px 18px;
  border-bottom:1px solid var(--border);
  vertical-align:middle;
  font-size:14px;
}
.namecell{
  display:flex;
  align-items:center;
  gap:12px;
}
.initial{
  width:34px;height:34px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  color:#fff;
  font-weight:800;
  font-size:12px;
}
.ini-blue{ background:#0ea5e9; }
.ini-pink{ background:#ec4899; }
.ini-indigo{ background:#3b82f6; }

.pill{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  background:#dcfce7;
  color:#16a34a;
  font-weight:800;
  font-size:12px;
}

/* Right stats list */
.stats-wrap{ padding:16px 18px 18px; }
.stats-wrap h5{ margin:0 0 12px; font-weight:800; }
.stat-row{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px;
  margin:14px 0 10px;
  color:#334155;
  font-weight:700;
}
.progressx{
  height:6px;
  background:#eaf0ff;
  border-radius:999px;
  overflow:hidden;
}
.progressx > div{
  height:100%;
  background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
  border-radius:999px;
}

/* Page utilities */
.toolbar{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
  margin:12px 0 10px;
}
.search-mini{
  max-width:420px;
  width:100%;
  background:#fff;
  border:1px solid var(--border);
  border-radius: 14px;
  padding:10px 12px;
  display:flex;
  align-items:center;
  gap:10px;
  box-shadow: 0 10px 20px rgba(15,23,42,.04);
}
.search-mini input{ border:0; outline:0; width:100%; font-size:14px; }

.btnx{
  border:1px solid var(--border);
  background:#fff;
  border-radius:14px;
  padding:10px 14px;
  font-weight:800;
  display:inline-flex;
  align-items:center;
  gap:8px;
  box-shadow: 0 10px 20px rgba(15,23,42,.04);
}
.btnx:hover{ filter:brightness(.98); }
.btnx-primary{
  border:0;
  color:#fff;
  background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
}
.btnx-danger{
  border:0;
  color:#fff;
  background: linear-gradient(135deg, #fb7185 0%, #ef4444 100%);
}
.btnx-outline{
  border:1px solid var(--border);
  background:#fff;
  color:#0f172a;
}
.badgex{
  font-size:12px;
  font-weight:800;
  padding:6px 10px;
  border-radius:999px;
  background:#eef2ff;
  color:#4338ca;
}

.form-card{
  padding:18px;
}
.form-label{
  font-weight:800;
  color:#0f172a;
  font-size:13px;
}
.form-control, .form-select{
  border-radius:14px !important;
  border:1px solid var(--border) !important;
  padding:.7rem .9rem !important;
}
.form-control:focus, .form-select:focus{
  box-shadow: 0 0 0 .25rem rgba(99,102,241,.15) !important;
  border-color: rgba(99,102,241,.6) !important;
}

/* Responsive */
@media (max-width: 1100px){
  .stat-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid{ grid-template-columns: 1fr; }
}
@media (max-width: 560px){
  .stat-grid{ grid-template-columns: 1fr; }
  .topbar{ flex-direction:column; align-items:stretch; }
  .searchbox{ width:100%; max-width:100%; }
  .toolbar{ flex-direction:column; align-items:stretch; }
}

/* Alumni table UI (like screenshot) */
.table-card-pad{ padding:14px 18px 18px; }
.table-tools{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin: 6px 0 12px;
}
.tools-right{
  display:flex;
  align-items:center;
  gap:10px;
}
.select-pill{
  border:1px solid var(--border);
  background:#fff;
  border-radius:14px;
  padding:10px 12px;
  font-weight:800;
  box-shadow: 0 10px 20px rgba(15,23,42,.04);
}
.select-pill select{
  border:0; outline:0; background:transparent;
  font-weight:800;
}
.btnx-add{
  border:0;
  color:#fff;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  border-radius:14px;
  padding:10px 14px;
  font-weight:900;
  display:inline-flex;
  align-items:center;
  gap:8px;
  box-shadow: 0 18px 40px rgba(79,70,229,.25);
}
.btnx-add:hover{ filter:brightness(.98); }

.mini-muted{ color: var(--muted); font-size:13px; }

.jk-chip{
  width:22px;height:22px;border-radius:6px;
  display:inline-flex;align-items:center;justify-content:center;
  font-weight:900;font-size:12px;
}
.jk-l{ background:#e0f2fe; color:#0369a1; }
.jk-p{ background:#fde2e8; color:#be123c; }

.doc-chip{
  width:24px;height:24px;border-radius:6px;
  display:inline-flex;align-items:center;justify-content:center;
  font-size:14px;
  background:#eef2ff;
  color:#4338ca;
}
.doc-chip.ok{ background:#dcfce7; color:#15803d; }
.doc-chip.warn{ background:#fee2e2; color:#b91c1c; }
.doc-stack{ display:flex; gap:6px; }

.action-btn{
  width:30px;height:30px;border-radius:8px;
  display:inline-flex;align-items:center;justify-content:center;
  border:1px solid var(--border);
  background:#fff;
  box-shadow: 0 10px 20px rgba(15,23,42,.03);
  color:#334155;
}
.action-btn:hover{ filter:brightness(.98); }
.action-primary{ color:#4f46e5; }
.action-danger{ color:#ef4444; }

/* Pagination look */
.pagination .page-link{
  border:0;
  border-radius:12px !important;
  margin: 0 3px;
  box-shadow: 0 10px 20px rgba(15,23,42,.03);
}
.pagination .page-item.active .page-link{
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

a.doc-chip{ text-decoration:none; }
a.doc-chip:hover{ filter:brightness(.98); transform: translateY(-1px); }
a.doc-chip{ transition: .15s ease; }


/* Modern doc icons + spacing (requested) */
.doc-stack{ display:flex; gap:10px; align-items:center; }
.doc-chip{
  width:30px;height:30px;border-radius:10px;
  display:inline-flex;align-items:center;justify-content:center;
  font-size:15px;
  background:#f1f5f9;
  color:#334155;
  border:1px solid rgba(15,23,42,.06);
  box-shadow: 0 10px 20px rgba(15,23,42,.03);
}
.doc-chip.ok{
  background: linear-gradient(135deg, rgba(34,197,94,.18) 0%, rgba(16,185,129,.20) 100%);
  color:#15803d;
  border:1px solid rgba(34,197,94,.20);
}
a.doc-chip{ text-decoration:none; transition:.15s ease; }
a.doc-chip:hover{
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(15,23,42,.06);
  filter: brightness(.99);
}

/* SIDANIRA special look */
.doc-chip.sdn{
  background: linear-gradient(135deg, rgba(59,130,246,.18) 0%, rgba(99,102,241,.20) 100%);
  color:#1d4ed8;
  border:1px solid rgba(59,130,246,.22);
}
a.doc-chip.sdn:hover{ box-shadow: 0 16px 30px rgba(37,99,235,.12); }


/* FIX tombol simpan agar tidak full width */
button[type="submit"]{
  width: auto !important;
  max-width: none !important;
}


/* Profil Madrasah page */
.profile-wrap{ display:flex; justify-content:center; padding: 10px 0 30px; }
.profile-card{ width: min(860px, 100%); overflow:hidden; }
.profile-head{
  padding: 18px 20px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color:#fff;
  text-align:center;
  font-weight:900;
}
.profile-head-title{ font-size:18px; letter-spacing:.2px; }
.profile-body{ padding: 22px 22px 26px; }

.logo-uploader{
  width: 120px; height: 120px;
  border-radius: 18px;
  border: 2px dashed rgba(148,163,184,.6);
  background: rgba(241,245,249,.6);
  display:flex;
  align-items:center;
  justify-content:center;
  position: relative;
  cursor: pointer;
  overflow:hidden;
}
.logo-placeholder{
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#94a3b8;
  font-size: 44px;
}
.logo-img{
  width:100%;
  height:100%;
  object-fit:cover;
}
.logo-badge{
  position:absolute;
  right:-10px;
  bottom:-10px;
  width:38px;
  height:38px;
  border-radius: 999px;
  background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  border: 4px solid #fff;
  box-shadow: 0 10px 20px rgba(15,23,42,.12);
}


/* Profil Madrasah - modern refinements */
.profile-card{ box-shadow: 0 24px 60px rgba(15,23,42,.06); border: 1px solid rgba(226,232,240,.9); }
.profile-head-sub{ font-size: 12.5px; opacity:.9; margin-top:4px; }
.logo-row{
  display:flex;
  gap: 16px;
  align-items:center;
  justify-content:center;
  padding: 6px 0 2px;
}
.logo-meta{ min-width: 240px; }
.logo-meta-title{ font-weight:800; margin-bottom:2px; }
.logo-meta-sub{ color:#64748b; font-size: 12.5px; }
.logo-meta-file{ color:#334155; font-size: 12.5px; margin-top: 6px; }
.form-actions{
  display:flex;
  justify-content:flex-end;
  padding-top: 6px;
  border-top: 1px solid rgba(226,232,240,.9);
  margin-top: 6px;
}
.form-actions .btnx{ padding: 10px 16px; border-radius: 14px; }
@media (max-width: 576px){
  .logo-row{ justify-content:flex-start; }
  .logo-meta{ min-width: 0; }
  .form-actions{ justify-content:stretch; }
  .form-actions .btnx{ width:100%; justify-content:center; }
}


/* Profil Madrasah - fix logo proportion (force size) */
.logo-uploader{
  width:140px !important;
  height:140px !important;
  flex:0 0 140px !important;
  background:#fff !important;
}
.logo-img{
  width:100% !important;
  height:100% !important;
  object-fit:contain !important;
  padding:10px;
  background:#fff;
}


/* Ubah Password - modern */
.pass-wrap{ max-width: 860px; }
.pass-card{ padding: 0; overflow: hidden; }
.pass-head{
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(226,232,240,.9);
  background: linear-gradient(135deg, rgba(79,70,229,.08), rgba(124,58,237,.08));
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 14px;
}
.pass-badge{ display:flex; gap:12px; align-items:center; }
.pass-badge-icon{
  width: 44px; height: 44px; border-radius: 14px;
  display:flex; align-items:center; justify-content:center;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color:#fff;
  box-shadow: 0 12px 26px rgba(79,70,229,.25);
}
.pass-badge-title{ font-weight: 900; font-size: 14.5px; }
.pass-badge-sub{ color:#64748b; font-size: 12.5px; margin-top: 2px; }
.pass-hint{
  color:#475569;
  font-size: 12.5px;
  display:flex;
  align-items:center;
  gap:8px;
  padding: 8px 10px;
  background: rgba(255,255,255,.7);
  border: 1px solid rgba(226,232,240,.95);
  border-radius: 14px;
  white-space: nowrap;
}
.pass-body{ padding: 18px; }
.input-modern{ position: relative; }
.input-modern .form-control{
  border-radius: 14px;
  height: 46px;
  padding-left: 44px;
  padding-right: 44px;
  border: 1px solid rgba(226,232,240,.95);
  background: rgba(241,245,249,.65);
}
.input-modern .form-control:focus{
  background:#fff;
  border-color: rgba(99,102,241,.55);
  box-shadow: 0 0 0 .2rem rgba(99,102,241,.14);
}
.input-modern-icon{
  position:absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color:#94a3b8;
  pointer-events:none;
}
.input-modern-btn{
  position:absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border:0;
  background: transparent;
  color:#94a3b8;
  padding: 6px;
  border-radius: 10px;
}
.input-modern-btn:hover{ color:#64748b; background: rgba(148,163,184,.15); }
.help-text{ color:#94a3b8; font-size: 12px; margin-top: 6px; }
.pass-actions{
  display:flex;
  justify-content:flex-end;
  padding-top: 6px;
  border-top: 1px solid rgba(226,232,240,.9);
  margin-top: 2px;
}
@media (max-width: 768px){
  .pass-head{ flex-direction: column; align-items:flex-start; }
  .pass-hint{ white-space: normal; width:100%; }
}

.text-end{ text-align:right !important; }

/* Force sidebar logo to stay proportional */
.sidebar .brand .brand-logo-img{max-width:42px;max-height:42px;width:42px;height:42px;object-fit:contain;display:block;}

/* ===== Patch: Foto Alumni 3x4 (public beranda) ===== */
.card-public img{
  width: 100% !important;
  max-width: 180px;
  height: 240px !important;           /* 3x4 look */
  aspect-ratio: 3 / 4;
  object-fit: cover !important;
  object-position: center top !important; /* prevent head cut */
  border-radius: 14px !important;
  display: block;
  margin: 0 auto 12px auto;
  background: #e2e8f0;
}

/* Placeholder (tanpa foto) */
.card-public .foto-placeholder{
  width: 100%;
  max-width: 180px;
  height: 240px;
  border-radius: 14px;
  background: #e2e8f0;
  margin: 0 auto 12px auto;
}
