/* ========== RESET & BASE ========== */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{font-size:16px;scroll-behavior:smooth}
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,sans-serif;background:#f0f4f8;color:#1e293b;line-height:1.6;min-height:100vh;display:flex;flex-direction:column}

/* ========== NAVBAR ========== */
.navbar{background:#1e3a5f;color:#fff;position:sticky;top:0;z-index:100;box-shadow:0 2px 8px rgba(0,0,0,.15)}
.nav-inner{max-width:1280px;margin:0 auto;padding:0 20px;display:flex;align-items:center;height:56px;gap:24px}
.nav-brand{font-weight:700;font-size:1.15rem;color:#fff;text-decoration:none;letter-spacing:.3px}
.nav-links{display:flex;gap:8px}
.nav-links a{color:#cbd5e1;text-decoration:none;padding:6px 14px;border-radius:6px;font-size:.9rem;transition:all .15s}
.nav-links a:hover,.nav-links a.active{background:rgba(255,255,255,.12);color:#fff}
.nav-toggle{display:none;background:none;border:none;color:#fff;font-size:1.4rem;cursor:pointer;margin-left:auto;padding:4px 8px}

/* ========== LOGIN SCREEN ========== */
.login-overlay{display:none;position:fixed;inset:0;z-index:9999;background:#f0f4f8;justify-content:center;align-items:center;padding:20px}
.login-card{background:#fff;border-radius:16px;padding:40px 32px;text-align:center;box-shadow:0 4px 24px rgba(0,0,0,.1);border:1px solid #e2e8f0;max-width:380px;width:100%}
.login-icon{font-size:2.4rem;margin-bottom:8px}
.login-title{font-size:1.3rem;font-weight:700;color:#1e3a5f;line-height:1.4;margin-bottom:4px}
.login-sub{font-size:.85rem;color:#64748b;margin-bottom:24px}
.login-form{display:flex;flex-direction:column;gap:12px}
.login-input{width:100%;padding:12px 16px;border:1px solid #cbd5e1;border-radius:10px;font-size:1rem;text-align:center;outline:none;transition:border-color .15s}
.login-input:focus{border-color:#3b82f6;box-shadow:0 0 0 3px rgba(59,130,246,.15)}
.login-btn{width:100%;padding:12px;font-size:1rem;justify-content:center;border-radius:10px}
.login-error{color:#dc2626;font-size:.82rem;margin-top:12px;display:none}

/* ========== FILTER OVERLAY & FAB ========== */
.filter-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.3);z-index:199}
.filter-overlay.open{display:block}

.filter-fab{position:fixed;bottom:24px;right:24px;z-index:200;width:52px;height:52px;border-radius:50%;background:#1e3a5f;color:#fff;border:none;font-size:1.3rem;cursor:pointer;box-shadow:0 4px 14px rgba(0,0,0,.25);transition:all .2s;display:flex;align-items:center;justify-content:center}
.filter-fab:hover{transform:scale(1.08);background:#152d4a}
.filter-fab.active{background:#dc2626;transform:rotate(90deg)}

/* ========== FILTER PANEL (floating) ========== */
.filter-bar{display:none;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:200;background:#fff;border-radius:16px;padding:24px;width:92%;max-width:640px;max-height:80vh;overflow-y:auto;box-shadow:0 20px 60px rgba(0,0,0,.25)}
.filter-bar.open{display:block}
.filter-bar .filter-inner{width:100%}
.filter-bar .filter-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}
.filter-bar .filter-head h3{font-size:1rem;font-weight:600;color:#1e293b}
.filter-bar .filter-close{background:none;border:none;font-size:1.4rem;cursor:pointer;color:#64748b;padding:4px;line-height:1}
.filter-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.filter-row+.filter-row{margin-top:10px}
.filter-row label{font-size:.82rem;color:#475569;display:flex;align-items:center;gap:4px;width:100%}
.filter-bar select,.filter-bar input[type="date"]{padding:8px 12px;border:1px solid #cbd5e1;border-radius:8px;font-size:.88rem;background:#f8fafc;color:#1e293b;min-width:0;width:100%;cursor:pointer}
.filter-bar select:focus,.filter-bar input:focus{outline:2px solid #3b82f6;outline-offset:-1px;border-color:#3b82f6}
.filter-search{flex:1;min-width:0;width:100%;padding:8px 12px;border:1px solid #cbd5e1;border-radius:8px;font-size:.88rem}
.filter-count{font-size:.82rem;color:#64748b;padding:4px 0;display:block;text-align:center;margin-top:8px}
.filter-bar .filter-actions{display:flex;gap:8px;margin-top:12px}
.filter-bar .filter-actions .btn{flex:1;justify-content:center}

/* ========== MAIN ========== */
main{flex:1;max-width:1280px;margin:0 auto;padding:24px 20px;width:100%}

/* ========== LOADING ========== */
.loading{text-align:center;padding:60px 20px;color:#64748b;font-size:1.1rem}

/* ========== STATS CARDS ========== */
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:16px;margin-bottom:28px}
.stat-card{background:#fff;border-radius:12px;padding:20px;text-align:center;box-shadow:0 1px 4px rgba(0,0,0,.06);border:1px solid #e2e8f0}
.stat-card .num{font-size:1.8rem;font-weight:700;color:#1e3a5f;line-height:1.2}
.stat-card .label{font-size:.82rem;color:#64748b;margin-top:4px}

/* ========== SECTION HEADER ========== */
.section-header{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:12px;margin-bottom:20px}
.section-header h2{font-size:1.25rem;color:#1e293b;font-weight:600}
.section-header .sub{color:#64748b;font-size:.85rem}

/* ========== BATCH CARDS ========== */
.batch-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:16px}
.batch-card{background:#fff;border-radius:12px;padding:20px;box-shadow:0 1px 4px rgba(0,0,0,.06);border:1px solid #e2e8f0;cursor:pointer;transition:all .15s}
.batch-card:hover{box-shadow:0 4px 12px rgba(0,0,0,.1);border-color:#93c5fd;transform:translateY(-2px)}
.batch-card h3{font-size:1rem;font-weight:600;color:#1e3a5f;margin-bottom:8px}
.batch-card .meta{font-size:.82rem;color:#64748b;display:flex;flex-wrap:wrap;gap:4px 16px}
.batch-card .meta span{white-space:nowrap}
.batch-card .badge{display:inline-block;background:#dbeafe;color:#1e40af;font-size:.75rem;padding:2px 10px;border-radius:999px;font-weight:500}

/* ========== TABLE ========== */
.table-wrap{overflow-x:auto;background:#fff;border-radius:12px;box-shadow:0 1px 4px rgba(0,0,0,.06);border:1px solid #e2e8f0}
table{width:100%;border-collapse:collapse;font-size:.88rem}
thead{background:#f8fafc}
th{padding:12px 14px;text-align:left;font-weight:600;color:#475569;border-bottom:2px solid #e2e8f0;white-space:nowrap;cursor:pointer;user-select:none}
th:hover{color:#1e3a5f}
th .sort{opacity:.4;margin-left:4px}
th.sorted .sort{opacity:1;color:#3b82f6}
td{padding:10px 14px;border-bottom:1px solid #f1f5f9;color:#334155}
tr:hover td{background:#f8fafc}
tr.row-date-alt td{background:#fef9c3}
tr.row-date-alt:hover td{background:#fef08a}
th.sortable{cursor:pointer;user-select:none;transition:color .15s}
th.sortable:hover{color:#1e40af}
th.sortable .sort-indicator{opacity:.3;margin-left:4px;font-size:.7rem}
th.sortable.sorted{color:#1e3a5f}
th.sortable.sorted .sort-indicator{opacity:1;color:#2563eb}
.sort-controls{display:flex;align-items:center;gap:8px}
.sort-label{font-size:.85rem;color:#475569;display:flex;align-items:center;gap:6px}
.sort-label select{padding:5px 10px;border:1px solid #cbd5e1;border-radius:6px;font-size:.85rem;background:#f8fafc;cursor:pointer}

.status-badge{display:inline-block;padding:2px 10px;border-radius:999px;font-size:.75rem;font-weight:500}
.status-staff{background:#dbeafe;color:#1e40af}
.status-eksternal{background:#f3e8ff;color:#6b21a8}
.status-wi{background:#dcfce7;color:#166534}
.status-struktural{background:#fef3c7;color:#92400e}

/* ========== TEACHER CARD ========== */
.teacher-header{background:#fff;border-radius:12px;padding:24px;box-shadow:0 1px 4px rgba(0,0,0,.06);border:1px solid #e2e8f0;margin-bottom:20px}
.teacher-header h2{font-size:1.3rem;color:#1e3a5f;margin-bottom:8px}
.teacher-header .meta{display:flex;flex-wrap:wrap;gap:20px;font-size:.85rem;color:#64748b}

/* ========== BACK BUTTON ========== */
.btn{display:inline-flex;align-items:center;gap:6px;padding:8px 18px;border-radius:8px;font-size:.88rem;font-weight:500;cursor:pointer;border:none;transition:all .15s;text-decoration:none}
.btn-primary{background:#1e3a5f;color:#fff}
.btn-primary:hover{background:#152d4a}
.btn-outline{background:transparent;border:1px solid #cbd5e1;color:#475569}
.btn-outline:hover{background:#f1f5f9;border-color:#94a3b8}
.btn-sm{padding:5px 12px;font-size:.8rem}

/* ========== SEARCH RESULTS ========== */
.search-highlight{background:#fef08a;padding:0 2px;border-radius:2px}
.empty-state{text-align:center;padding:60px 20px;color:#94a3b8}
.empty-state p{font-size:1rem;margin-top:8px}

/* ========== NOTES / CATATAN ========== */
.note-card{background:#fff;border-radius:12px;padding:24px;margin-bottom:20px;box-shadow:0 1px 4px rgba(0,0,0,.06);border:1px solid #e2e8f0}
.note-card h3{font-size:1.05rem;color:#1e3a5f;margin-bottom:16px;padding-bottom:8px;border-bottom:2px solid #e2e8f0}
.note-card h4{font-size:.95rem;color:#334155;margin:16px 0 8px}
.note-card p{font-size:.88rem;color:#475569;line-height:1.7;margin-bottom:10px}
.note-card p:last-child{margin-bottom:0}
.note-card ul,.note-card ol{margin:8px 0 12px;padding-left:20px;font-size:.88rem;color:#475569}
.note-card li{margin-bottom:4px;line-height:1.6}
.note-card code{background:#f1f5f9;padding:1px 6px;border-radius:4px;font-size:.82rem;color:#b91c1c;font-family:'SF Mono',Consolas,monospace}
.note-card strong{color:#1e293b}
.note-card table{width:100%;border-collapse:collapse;font-size:.85rem;margin:12px 0}
.note-card th{background:#f8fafc;padding:8px 12px;text-align:left;font-weight:600;color:#475569;border:1px solid #e2e8f0;white-space:nowrap}
.note-card td{padding:8px 12px;border:1px solid #e2e8f0;color:#334155}
.note-card tr:nth-child(even) td{background:#f8fafc}
.note-card hr{border:none;border-top:1px solid #e2e8f0;margin:20px 0}
.note-badge{display:inline-block;padding:2px 10px;border-radius:999px;font-size:.72rem;font-weight:600;margin-left:8px}
.note-badge.issue{background:#dbeafe;color:#1e40af}
.note-badge.pr{background:#dcfce7;color:#166534}
.note-meta{display:flex;align-items:center;gap:12px;margin-bottom:12px;flex-wrap:wrap}
.note-meta span{font-size:.78rem;color:#94a3b8}
.note-link{font-size:.82rem;color:#2563eb;text-decoration:none}
.note-link:hover{text-decoration:underline}

/* ========== PERSONALIZATION CARD ========== */
.personalize-card{background:linear-gradient(135deg,#eff6ff,#dbeafe);border-radius:12px;padding:20px 24px;border:1px solid #bfdbfe;margin-bottom:24px;display:flex;flex-wrap:wrap;gap:12px;align-items:center}
.personalize-card strong{color:#1e40af;font-size:.9rem}
.personalize-card span{color:#475569;font-size:.85rem}
.personalize-card .tag{background:#fff;padding:2px 12px;border-radius:999px;font-size:.78rem;border:1px solid #bfdbfe;color:#1e40af}

/* ========== RESPONSIVE ========== */
@media(max-width:768px){
  .nav-toggle{display:block}
  .nav-links{display:none;position:absolute;top:56px;left:0;right:0;background:#1e3a5f;flex-direction:column;padding:8px 16px 16px;box-shadow:0 4px 12px rgba(0,0,0,.2)}
  .nav-links.open{display:flex}
  .filter-fab{bottom:16px;right:16px;width:48px;height:48px;font-size:1.1rem}
  .stats{grid-template-columns:repeat(2,1fr)}
  .batch-grid{grid-template-columns:1fr}
  .section-header{flex-direction:column;align-items:flex-start}
  .personalize-card{flex-direction:column;align-items:flex-start}
  th,td{padding:8px 10px;font-size:.82rem}
}
@media(max-width:480px){
  .stats{grid-template-columns:1fr 1fr}
  .stat-card .num{font-size:1.4rem}
  .nav-inner{padding:0 12px}
  main{padding:16px 12px}
}

/* ========== FOOTER ========== */
.footer{margin-top:auto;background:#fff;border-top:1px solid #e2e8f0;padding:14px 20px}
.footer-inner{max-width:1280px;margin:0 auto;display:flex;justify-content:space-between;align-items:center;font-size:.78rem;color:#94a3b8}
.footer-source{font-size:.78rem;color:#94a3b8}
.footer-source a{color:#64748b;text-decoration:none}
.footer-source a:hover{color:#1e40af;text-decoration:underline}
.footer-live{display:flex;align-items:center;gap:4px}
.footer-live.live{color:#16a34a}
.footer-live.static{color:#94a3b8}
