/* ============================================================
   SPMB — Admin Panel CSS
   ============================================================ */
:root {
  --sidebar-w:   240px;
  --topbar-h:    56px;
  --primary:     #0d47a1;
  --primary-mid: #1565c0;
  --gold:        #FFD700;
  --sidebar-bg:  #0a1929;
  --sidebar-txt: rgba(255,255,255,.75);
  --sidebar-act: rgba(255,255,255,.12);
  --content-bg:  #f0f4f8;
  --card-bg:     #ffffff;
  --border:      #dde5f0;
  --text:        #1a1a2e;
  --text-muted:  #64748b;
  --success:     #2e7d32;
  --danger:      #c62828;
  --warning:     #e65100;
  --info:        #0277bd;
  --radius:      10px;
  --shadow:      0 2px 12px rgba(0,0,0,.08);
  --font:        'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--text); }
a { color: inherit; text-decoration: none; }

/* ---- LAYOUT ---- */
.admin-body   { display: flex; min-height: 100vh; background: var(--content-bg); }
.admin-sidebar {
  width: var(--sidebar-w); min-height: 100vh; background: var(--sidebar-bg);
  display: flex; flex-direction: column; position: fixed; left: 0; top: 0;
  z-index: 200; transition: transform .25s ease;
}
.admin-main {
  margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh;
}
.admin-topbar {
  height: var(--topbar-h); background: var(--card-bg); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px; padding: 0 24px; position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow);
}
.topbar-title { font-weight: 700; font-size: 1rem; color: var(--primary); flex: 1; }
.topbar-right { font-size: .8rem; color: var(--text-muted); }
.admin-content { flex: 1; padding: 24px; }
.admin-footer  { padding: 14px 24px; font-size: .78rem; color: var(--text-muted); border-top: 1px solid var(--border); display: flex; justify-content: space-between; background: var(--card-bg); }

/* ---- SIDEBAR ---- */
.sidebar-brand {
  display: flex; align-items: center; gap: 12px; padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-logo   { font-size: 2rem; }
.brand-title  { font-size: .95rem; font-weight: 800; color: var(--gold); }
.brand-sub    { font-size: .73rem; color: rgba(255,255,255,.5); }
.sidebar-nav  { flex: 1; padding: 16px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-section-label { font-size: .68rem; text-transform: uppercase; letter-spacing: 1.5px; color: rgba(255,255,255,.3); padding: 8px 10px 4px; }
.mt-2 { margin-top: 16px; }
.sidebar-link {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-radius: 8px; color: var(--sidebar-txt); font-size: .88rem;
  transition: all .2s;
}
.sidebar-link:hover { background: var(--sidebar-act); color: #fff; }
.sidebar-link.active { background: var(--primary); color: #fff; font-weight: 600; }
.link-icon { font-size: 1rem; width: 20px; text-align: center; }
.sidebar-footer {
  padding: 16px; border-top: 1px solid rgba(255,255,255,.08);
  display: flex; flex-direction: column; gap: 10px;
}
.admin-info { display: flex; align-items: center; gap: 10px; }
.admin-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .95rem; flex-shrink: 0; }
.admin-name { font-size: .85rem; font-weight: 600; color: #fff; }
.admin-role { font-size: .72rem; color: rgba(255,255,255,.45); }
.btn-logout { display: flex; align-items: center; gap: 6px; background: rgba(198,40,40,.15); color: #ef9a9a; border: 1px solid rgba(198,40,40,.3); border-radius: 8px; padding: 8px 14px; font-size: .82rem; transition: all .2s; cursor: pointer; }
.btn-logout:hover { background: rgba(198,40,40,.25); color: #fff; }
.sidebar-toggle { display: none; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--primary); }

/* ---- LOGIN PAGE ---- */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg,#002171,#0d47a1); padding: 20px; }
.login-wrap  { width: 100%; max-width: 400px; }
.login-card  { background: #fff; border-radius: 16px; padding: 40px; box-shadow: 0 16px 48px rgba(0,0,0,.25); }
.login-header { text-align: center; margin-bottom: 28px; }
.login-logo { font-size: 3rem; margin-bottom: 10px; }
.login-header h1 { font-size: 1.5rem; color: var(--primary); margin-bottom: 4px; }
.login-header p { color: var(--text-muted); font-size: .88rem; }
.alert-login { background: rgba(198,40,40,.08); border: 1px solid rgba(198,40,40,.3); color: var(--danger); padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-size: .88rem; }
.login-field { margin-bottom: 18px; }
.login-field label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; color: var(--text); }
.login-field input { width: 100%; padding: 11px 16px; border: 2px solid var(--border); border-radius: 8px; font-size: .95rem; transition: border-color .2s; }
.login-field input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,71,161,.1); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px; }
.pw-toggle { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; font-size: 1.1rem; color: var(--text-muted); }
.btn-login { width: 100%; padding: 13px; background: var(--primary); color: #fff; border: none; border-radius: 30px; font-size: 1rem; font-weight: 700; cursor: pointer; transition: background .2s; margin-top: 4px; }
.btn-login:hover { background: var(--primary-mid); }
.login-back { text-align: center; margin-top: 20px; font-size: .85rem; }
.login-back a { color: var(--primary); text-decoration: underline; }

/* ---- STATS GRID ---- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--card-bg); border-radius: var(--radius); padding: 20px; display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow); border: 1px solid var(--border); border-left: 4px solid; }
.stat-total    { border-left-color: var(--primary); }
.stat-pending  { border-left-color: var(--info); }
.stat-verified { border-left-color: var(--warning); }
.stat-accepted { border-left-color: var(--success); }
.stat-rejected { border-left-color: var(--danger); }
.stat-today    { border-left-color: #7b1fa2; }
.stat-icon { font-size: 2rem; flex-shrink: 0; }
.stat-num   { font-size: 1.8rem; font-weight: 900; color: var(--primary); line-height: 1; }
.stat-label { font-size: .75rem; color: var(--text-muted); margin-top: 4px; font-weight: 600; }

/* ---- DASHBOARD GRID ---- */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dash-card { background: var(--card-bg); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; }
.mt-3 { margin-top: 20px; }
.dash-card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.dash-card-header h3 { font-size: .95rem; font-weight: 700; color: var(--primary); }
.dash-link { font-size: .82rem; color: var(--primary); text-decoration: underline; }
.dash-card-body { padding: 16px 20px; }
.empty-state { color: var(--text-muted); font-size: .88rem; padding: 20px 0; text-align: center; }

/* Recent list */
.recent-list { display: flex; flex-direction: column; }
.recent-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); transition: background .15s; border-radius: 6px; padding: 10px 8px; }
.recent-item:hover { background: var(--content-bg); }
.recent-foto { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.recent-foto img { width: 100%; height: 100%; object-fit: cover; }
.foto-placeholder { width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .9rem; }
.recent-info { flex: 1; min-width: 0; }
.recent-name { font-size: .9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-meta { font-size: .75rem; color: var(--text-muted); }
.recent-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.recent-date { font-size: .72rem; color: var(--text-muted); }

/* Quick actions */
.quick-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.quick-btn { display: flex; align-items: center; gap: 8px; padding: 10px 18px; background: var(--content-bg); border: 1px solid var(--border); border-radius: 8px; font-size: .88rem; font-weight: 600; color: var(--text); transition: all .2s; position: relative; }
.quick-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.quick-btn-success:hover { background: var(--success); border-color: var(--success); }
.quick-badge { background: var(--danger); color: #fff; border-radius: 20px; padding: 2px 8px; font-size: .72rem; font-weight: 700; }

/* ---- FILTER BAR ---- */
.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; padding: 16px; background: var(--card-bg); border-radius: var(--radius); border: 1px solid var(--border); }
.filter-form { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; }
.filter-input  { flex: 1; min-width: 200px; padding: 9px 14px; border: 2px solid var(--border); border-radius: 8px; font-size: .88rem; }
.filter-input:focus { outline: none; border-color: var(--primary); }
.filter-select { padding: 9px 14px; border: 2px solid var(--border); border-radius: 8px; font-size: .88rem; background: #fff; min-width: 150px; }
.btn-filter       { padding: 9px 20px; background: var(--primary); color: #fff; border: none; border-radius: 8px; font-size: .88rem; font-weight: 600; cursor: pointer; }
.btn-filter-reset { padding: 9px 14px; background: var(--content-bg); color: var(--text-muted); border: 1px solid var(--border); border-radius: 8px; font-size: .88rem; }
.filter-actions { display: flex; gap: 8px; }
.btn-export { padding: 9px 16px; background: #1b5e20; color: #fff; border-radius: 8px; font-size: .88rem; font-weight: 600; border: none; display: flex; align-items: center; gap: 6px; }
.btn-export:hover { background: #2e7d32; }
.list-summary { font-size: .85rem; color: var(--text-muted); margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.filter-active-badge { background: var(--primary); color: #fff; padding: 2px 10px; border-radius: 20px; font-size: .75rem; font-weight: 600; }

/* ---- ADMIN TABLE ---- */
.table-wrap { background: var(--card-bg); border-radius: var(--radius); border: 1px solid var(--border); overflow: auto; box-shadow: var(--shadow); }
.admin-table { width: 100%; border-collapse: collapse; min-width: 800px; }
.admin-table th { background: #f8fafc; font-size: .78rem; text-transform: uppercase; letter-spacing: .8px; color: var(--text-muted); font-weight: 700; padding: 12px 14px; border-bottom: 2px solid var(--border); text-align: left; white-space: nowrap; }
.admin-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: .88rem; vertical-align: middle; }
.admin-table-hover tbody tr:hover { background: #f8faff; }
.td-nisn  { font-family: monospace; font-weight: 700; color: var(--primary); }
.td-nama  { max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.td-foto  { width: 52px; }
.tbl-foto { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.foto-placeholder-sm { width: 38px; height: 38px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .85rem; }
.jurusan-badge { background: var(--content-bg); color: var(--primary); padding: 3px 10px; border-radius: 20px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.wa-link { color: #25D366; font-weight: 600; }
.btn-tbl-action { background: var(--primary); color: #fff; padding: 5px 12px; border-radius: 6px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.btn-tbl-action:hover { background: var(--primary-mid); }
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-sm     { font-size: .8rem; }
.fw-bold     { font-weight: 700; }
.badge-num   { background: var(--primary); color: #fff; border-radius: 20px; padding: 2px 10px; font-weight: 700; font-size: .82rem; }

/* ---- STATUS BADGES ---- */
.status-badge { display: inline-block; padding: 3px 12px; border-radius: 20px; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.status-lg    { font-size: .85rem; padding: 5px 16px; }
.status-menunggu-verifikasi { background: rgba(2,119,189,.1);  color: var(--info);    border: 1px solid rgba(2,119,189,.3); }
.status-diverifikasi        { background: rgba(230,81,0,.1);   color: var(--warning); border: 1px solid rgba(230,81,0,.3); }
.status-diterima            { background: rgba(46,125,50,.1);  color: var(--success); border: 1px solid rgba(46,125,50,.3); }
.status-ditolak             { background: rgba(198,40,40,.1);  color: var(--danger);  border: 1px solid rgba(198,40,40,.3); }

/* ---- PAGINATION ---- */
.pagination { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.page-btn { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid var(--border); background: var(--card-bg); font-size: .88rem; font-weight: 600; color: var(--text); transition: all .2s; }
.page-btn:hover, .page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---- DETAIL PAGE ---- */
.breadcrumb { font-size: .85rem; color: var(--text-muted); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.breadcrumb a { color: var(--primary); text-decoration: underline; }
.detail-layout { display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: start; }
.detail-main, .detail-side { display: flex; flex-direction: column; gap: 16px; }

.detail-header-card { background: var(--card-bg); border-radius: var(--radius); padding: 24px; display: flex; align-items: flex-start; gap: 20px; box-shadow: var(--shadow); border: 1px solid var(--border); flex-wrap: wrap; }
.detail-foto-wrap { flex-shrink: 0; }
.detail-foto { width: 96px; height: 96px; border-radius: 12px; object-fit: cover; border: 3px solid var(--border); }
.detail-foto-placeholder { width: 96px; height: 96px; border-radius: 12px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 900; }
.detail-header-info h2 { font-size: 1.3rem; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.detail-header-info { flex: 1; }
.detail-nisn { font-size: .88rem; color: var(--text-muted); margin-bottom: 10px; font-family: monospace; }
.detail-quick-wa { margin-left: auto; align-self: center; }
.btn-wa-admin { background: #25D366; color: #fff; padding: 10px 20px; border-radius: 24px; font-weight: 700; font-size: .88rem; display: flex; align-items: center; gap: 6px; }
.btn-wa-admin:hover { background: #1da851; }

.detail-section { background: var(--card-bg); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.detail-section-title { font-size: .9rem; font-weight: 800; color: var(--primary); margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--content-bg); }
.detail-table { width: 100%; border-collapse: collapse; }
.detail-table tr td { padding: 9px 0; border-bottom: 1px solid var(--content-bg); font-size: .88rem; vertical-align: top; }
.detail-table tr td:first-child { width: 160px; color: var(--text-muted); font-weight: 600; font-size: .82rem; padding-right: 16px; }
.inline-link { color: var(--primary); font-size: .8rem; margin-left: 8px; text-decoration: underline; }

.berkas-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.berkas-item { text-align: center; }
.berkas-label { font-size: .78rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.berkas-foto-preview { border: 2px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 8px; }
.berkas-foto-img { width: 100%; height: 120px; object-fit: cover; display: block; }
.berkas-pdf { background: var(--content-bg); border: 2px solid var(--border); border-radius: 8px; padding: 20px; font-size: 1.5rem; margin-bottom: 8px; }
.berkas-empty { background: var(--content-bg); border: 2px dashed var(--border); border-radius: 8px; padding: 20px; color: var(--text-muted); font-size: .82rem; margin-bottom: 8px; }
.berkas-download { display: block; background: var(--primary); color: #fff; border-radius: 6px; padding: 6px 12px; font-size: .78rem; font-weight: 600; text-align: center; }
.berkas-download:hover { background: var(--primary-mid); }

.detail-meta { font-size: .8rem; color: var(--text-muted); display: flex; flex-direction: column; gap: 4px; padding: 12px 0; border-top: 1px solid var(--border); }

/* ---- SIDE CARDS ---- */
.side-card { background: var(--card-bg); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.side-card h4 { font-size: .95rem; font-weight: 700; color: var(--primary); margin-bottom: 14px; }
.side-note { font-size: .85rem; color: var(--text-muted); margin-bottom: 12px; }

.sf-group   { margin-bottom: 14px; }
.sf-group label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; }
.sf-select, .sf-textarea { width: 100%; border: 2px solid var(--border); border-radius: 8px; padding: 9px 12px; font-size: .9rem; font-family: var(--font); }
.sf-select:focus, .sf-textarea:focus { outline: none; border-color: var(--primary); }
.sf-textarea { resize: vertical; min-height: 80px; }
.btn-update-status { width: 100%; padding: 12px; background: var(--primary); color: #fff; border: none; border-radius: 8px; font-size: .95rem; font-weight: 700; cursor: pointer; }
.btn-update-status:hover { background: var(--primary-mid); }

/* Log */
.log-list { display: flex; flex-direction: column; gap: 12px; max-height: 300px; overflow-y: auto; }
.log-item { display: flex; gap: 10px; }
.log-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); flex-shrink: 0; margin-top: 4px; }
.log-change { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 2px; }
.log-status-old  { font-size: .78rem; color: var(--text-muted); text-decoration: line-through; }
.log-arrow       { font-size: .8rem; color: var(--text-muted); }
.log-status-new  { font-size: .82rem; font-weight: 700; color: var(--primary); }
.log-note        { font-size: .8rem; color: var(--text-muted); font-style: italic; }
.log-meta        { font-size: .75rem; color: var(--text-muted); }

/* WA Templates */
.wa-templates { display: flex; flex-direction: column; gap: 8px; }
.wa-template-btn { display: block; background: rgba(37,211,102,.08); border: 1px solid rgba(37,211,102,.3); color: #1da851; padding: 9px 14px; border-radius: 8px; font-size: .85rem; font-weight: 600; }
.wa-template-btn:hover { background: #25D366; color: #fff; border-color: #25D366; }

/* ---- FLASH MESSAGE ---- */
.flash-msg { padding: 14px 20px; border-radius: 8px; margin-bottom: 16px; font-size: .9rem; transition: opacity .5s; }
.flash-success { background: rgba(46,125,50,.1); border: 1px solid rgba(46,125,50,.3); color: var(--success); }
.flash-error   { background: rgba(198,40,40,.1); border: 1px solid rgba(198,40,40,.3); color: var(--danger); }

/* ---- FORM PHOTO UPLOAD (public) ---- */
.foto-zone { border-color: #9c27b0; }
.foto-zone:hover { border-color: #7b1fa2; background: #fce4ff; }
.foto-preview-wrap { text-align: center; padding: 10px; }
.foto-preview-wrap img { max-width: 160px; max-height: 160px; border-radius: 8px; border: 2px solid var(--border); margin-bottom: 6px; }
.foto-name { font-size: .82rem; color: var(--text-muted); }

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .detail-layout  { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .sidebar-toggle { display: block; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .berkas-grid { grid-template-columns: 1fr; }
  .filter-form { flex-direction: column; }
  .filter-input, .filter-select { width: 100%; }
  body.sidebar-open::after { content: ''; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 199; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .admin-content { padding: 14px; }
}
