/* ==========================================================
   INSIS UI COMPACT / MINIMAL
   Visual override only. Tidak mengubah warna role/portal,
   routing, database, Redis, maupun fungsi modul.
   ========================================================== */

:root{
    --insis-font-size:14px;
    --insis-font-small:12px;
    --insis-control-h:38px;
    --insis-btn-h:36px;
    --insis-radius:9px;
    --insis-radius-lg:14px;
    --insis-border:#dfe5ec;
    --insis-muted:#64748b;
    --insis-shadow:0 4px 14px rgba(15,23,42,.055);
}

html{font-size:14px}
body{
    font-family:Inter,"Segoe UI",Roboto,Helvetica,Arial,sans-serif !important;
    font-size:var(--insis-font-size) !important;
    line-height:1.5;
    -webkit-font-smoothing:antialiased;
    text-rendering:optimizeLegibility;
}

/* Typography: hierarchy clear, tidak terlalu besar/kecil */
h1{font-size:24px;line-height:1.25;margin-top:.35em;margin-bottom:.65em}
h2{font-size:20px;line-height:1.3}
h3{font-size:17px;line-height:1.35}
h4{font-size:15px;line-height:1.4}
h5,h6{font-size:14px;line-height:1.4}
p,li,label{line-height:1.5}
small,.small{font-size:12px}

/* Main page spacing */
.container{
    padding:18px !important;
    border-radius:var(--insis-radius-lg) !important;
}
.form-box{
    padding:16px !important;
    border-radius:var(--insis-radius-lg) !important;
}
.form-box h4{
    font-size:15px !important;
    padding-bottom:8px !important;
    margin-bottom:14px !important;
}

/* Header / navigation */
.navbar{
    min-height:58px;
    padding:10px 16px !important;
    gap:8px 12px !important;
}
.navbar h2{
    font-size:18px !important;
    line-height:1.25;
    letter-spacing:-.01em;
}
.navbar-right,.navbar .user-info{gap:7px !important}
.badge-role{
    padding:4px 8px !important;
    border-radius:999px !important;
    font-size:10px !important;
    line-height:1.2;
    letter-spacing:.03em;
}

/* Buttons: satu ukuran visual yang konsisten */
button,
input[type="button"],
input[type="submit"],
input[type="reset"],
.btn-action,
.btn-logout,
.btn-download,
.btn-lihat-materi,
.btn-lihat-rekap,
.tab-btn,
.pagination a,
.student-module-close{
    min-height:var(--insis-btn-h);
    padding:7px 12px !important;
    border-radius:8px !important;
    font-size:13px !important;
    line-height:1.2 !important;
    font-weight:650 !important;
    letter-spacing:0 !important;
    box-shadow:none;
    transition:background-color .16s ease,border-color .16s ease,box-shadow .16s ease,transform .12s ease !important;
}

.btn-action,
.btn-logout,
.btn-download,
.btn-lihat-materi,
.btn-lihat-rekap,
.tab-btn,
.pagination a{
    width:auto !important;
    display:inline-flex !important;
    align-items:center;
    justify-content:center;
    gap:5px;
    margin:2px !important;
    white-space:nowrap;
    text-decoration:none;
}

button:hover,.btn-action:hover,.tab-btn:hover,.btn-logout:hover{
    filter:brightness(.97);
}
button:active,.btn-action:active,.tab-btn:active{transform:translateY(1px)}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{
    outline:2px solid rgba(59,130,246,.42);
    outline-offset:2px;
}

/* Ikon / tombol aksi kecil tidak menjadi terlalu mungil */
.btn-copy,
.table-export-toolbar button,
.meeting-attendance-btn,
.meeting-attendance-tools button{
    min-height:32px !important;
    padding:6px 9px !important;
    border-radius:7px !important;
    font-size:11.5px !important;
    line-height:1.15 !important;
}
.materi-popup-close,
.jadwal-edit-modal-close,
button[aria-label="Close"],
button[aria-label="Tutup"]{
    min-width:34px !important;
    width:34px !important;
    height:34px !important;
    min-height:34px !important;
    padding:0 !important;
    display:inline-grid !important;
    place-items:center;
}

/* Form controls */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
select,
textarea{
    min-height:var(--insis-control-h);
    padding:8px 10px !important;
    border-radius:8px !important;
    font-size:13.5px !important;
    line-height:1.35 !important;
    border-color:#cfd8e3 !important;
    box-shadow:none !important;
}
textarea{min-height:88px;resize:vertical}
input[type="checkbox"],input[type="radio"]{accent-color:var(--primary)}
label{font-size:12.5px;font-weight:600;color:#475569}

/* Select2 dibuat sama tinggi dengan input biasa */
.select2-container .select2-selection--single{
    height:var(--insis-control-h) !important;
    min-height:var(--insis-control-h) !important;
    border-radius:8px !important;
    border-color:#cfd8e3 !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered{
    line-height:36px !important;
    padding-left:10px !important;
    padding-right:30px !important;
    font-size:13.5px !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow{
    height:36px !important;
}
.select2-container--default .select2-results__option{font-size:13px;padding:7px 10px}

/* Tabs */
.tab-controls{
    gap:5px !important;
    padding-bottom:1px;
}
.tab-btn{
    min-height:34px;
    padding:7px 11px !important;
    border-radius:8px 8px 0 0 !important;
    font-size:12px !important;
}

/* Section headings */
.jadwal-title{
    font-size:16px !important;
    padding-bottom:8px !important;
    margin-bottom:14px !important;
    gap:8px !important;
}

/* Tables: compact tetapi tetap nyaman dibaca */
table{font-size:13px !important}
th,td{
    padding:8px 9px !important;
    line-height:1.4;
}
th{font-size:12.5px;font-weight:700}
.table-responsive{
    border-radius:10px !important;
    border-color:var(--insis-border) !important;
}
.table-matrix th,.table-matrix td{padding:7px 8px !important}

/* Alerts, badges, pills */
.alert{
    padding:9px 12px !important;
    border-radius:9px !important;
    margin-bottom:14px !important;
    font-size:12.5px !important;
    font-weight:600 !important;
}
.badge-status-belum,.badge-status-selesai,.badge-dosen-sakit,.badge-dosen-izin,.badge-dosen-libur,
.badge-gabungan-card,.badge-mahasiswa-card,.badge-kelas-card,.badge-cakupan-card{
    min-height:22px;
    padding:4px 7px !important;
    border-radius:999px !important;
    font-size:10px !important;
    line-height:1.2 !important;
    display:inline-flex;
    align-items:center;
}

/* Statistik / cards */
.stat-card{
    padding:13px 10px !important;
    border-radius:11px !important;
    box-shadow:var(--insis-shadow) !important;
}
.stat-icon{font-size:23px !important;margin-bottom:4px !important}
.stat-value{font-size:20px !important}
.stat-label{font-size:10.5px !important;letter-spacing:.035em !important}
.stat-percent,.stat-period{font-size:10px !important}

/* Popup/modal: header dan padding konsisten */
.materi-popup-box,.jadwal-edit-modal-box{
    border-radius:14px !important;
    box-shadow:0 18px 45px rgba(15,23,42,.20) !important;
}
.materi-popup-header,.jadwal-edit-modal-header{
    padding:11px 14px !important;
}
.materi-popup-header h3{font-size:16px !important}
.materi-popup-content,.jadwal-edit-modal-body{padding:14px !important}

/* Beranda aplikasi: lebih minimal dan tidak terlalu besar */
.student-app-home{
    max-width:1060px !important;
    margin:8px auto 24px !important;
}
.student-app-hero{
    padding:20px 22px !important;
    margin-bottom:16px !important;
    border-radius:16px !important;
    box-shadow:0 8px 22px rgba(31,58,95,.13) !important;
}
.student-app-hero h2{
    font-size:21px !important;
    margin-bottom:5px !important;
}
.student-app-hero p{
    font-size:12.5px !important;
    line-height:1.5 !important;
}
.student-app-grid{
    grid-template-columns:repeat(5,minmax(0,1fr));
    gap:10px !important;
}
.student-app-icon{
    min-height:132px !important;
    padding:14px 9px 11px !important;
    border-radius:14px !important;
    box-shadow:var(--insis-shadow) !important;
}
.student-app-icon:hover{
    transform:translateY(-2px) !important;
    box-shadow:0 7px 18px rgba(15,23,42,.09) !important;
}
.student-app-icon-symbol{
    width:54px !important;
    height:54px !important;
    margin-bottom:8px !important;
    border-radius:14px !important;
    font-size:25px !important;
}
.student-app-icon strong{font-size:12.5px !important;line-height:1.25 !important}
.student-app-icon small{font-size:10px !important;line-height:1.3 !important;margin-top:4px !important}

/* Module popup/topbar */
.student-module-topbar{
    top:12px !important;
    height:50px !important;
    padding:6px 8px 6px 12px !important;
    border-radius:13px !important;
}
.student-module-title-icon{
    width:34px !important;
    height:34px !important;
    flex-basis:34px !important;
    border-radius:10px !important;
    font-size:18px !important;
}
.student-module-title strong{font-size:13px !important}
.student-module-title small{font-size:9.5px !important}
.student-module-close{
    min-width:96px !important;
    min-height:34px !important;
    padding:6px 10px !important;
    font-size:11.5px !important;
}
.student-app-mode.student-module-open .container>.tab-content.active{
    top:72px !important;
    padding:17px !important;
    border-radius:16px !important;
}

/* Summernote mengikuti proporsi form lain tanpa merusak toolbar */
.note-editor{border-radius:9px !important;overflow:hidden}
.note-editor .note-toolbar{padding:5px 6px !important}
.note-editor .note-btn{
    min-height:30px !important;
    padding:4px 7px !important;
    font-size:12px !important;
    border-radius:6px !important;
}
.note-editor .note-editable{font-size:13.5px !important;line-height:1.55 !important}

/* Desktop: toolbar aksi tidak renggang */
.action-bar,.generator-actions,.table-export-toolbar{
    gap:5px !important;
    align-items:center;
    flex-wrap:wrap;
}

@media (max-width:900px){
    .student-app-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
}

@media (max-width:700px){
    body{font-size:13.5px !important}
    .navbar{min-height:54px;padding:9px 12px !important}
    .navbar h2{font-size:16px !important}
    .container{padding:13px !important;border-radius:12px !important}
    .form-box{padding:13px !important}
    h1{font-size:21px} h2{font-size:18px} h3{font-size:16px}

    button,input[type="button"],input[type="submit"],input[type="reset"],
    .btn-action,.btn-logout,.btn-download,.btn-lihat-materi,.btn-lihat-rekap,.tab-btn,.pagination a{
        min-height:36px;
        font-size:12.5px !important;
    }

    .student-app-hero{padding:17px 16px !important;border-radius:14px !important}
    .student-app-hero h2{font-size:18px !important}
    .student-app-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px !important}
    .student-app-icon{min-height:112px !important;padding:11px 5px 9px !important;border-radius:12px !important}
    .student-app-icon-symbol{width:46px !important;height:46px !important;font-size:22px !important;border-radius:12px !important;margin-bottom:6px !important}
    .student-app-icon strong{font-size:11px !important}
    .student-app-icon small{display:none !important}

    th,td{padding:7px 8px !important}
    .student-module-topbar{top:7px !important;height:48px !important}
    .student-module-close{min-width:40px !important;width:40px !important;height:34px !important;font-size:0 !important;padding:0 !important}
    .student-module-close::after{content:"×";font-size:21px;line-height:1}
    .student-app-mode.student-module-open .container>.tab-content.active{
        top:62px !important;
        left:7px !important;
        right:7px !important;
        bottom:7px !important;
        padding:13px 10px 16px !important;
        border-radius:13px !important;
    }
}

@media (max-width:420px){
    .student-app-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
    .student-app-icon{min-height:106px !important}
    .student-app-icon-symbol{width:43px !important;height:43px !important;font-size:20px !important}
    .student-app-icon strong{font-size:10.5px !important}
}

@media print{
    body{font-size:11pt !important}
    .navbar,.tab-controls,.student-app-home{display:none !important}
    .container{padding:0 !important;box-shadow:none !important;border-radius:0 !important}
}

/* ==========================================================
   BUTTON UNIFICATION v2
   Diletakkan sebagai stylesheet TERAKHIR oleh layout.php.
   Tujuan: semua modul memakai proporsi tombol yang sama,
   tanpa mengubah warna/status/fungsi tombol yang sudah ada.
   ========================================================== */
:root{
    --insis-btn-height:34px;
    --insis-btn-height-compact:32px;
    --insis-btn-font:12.5px;
    --insis-btn-font-compact:12px;
    --insis-btn-pad-x:11px;
    --insis-btn-gap:5px;
    --insis-btn-radius:8px;
}

/* Semua tombol umum, termasuk kelas-kelas legacy tiap modul. */
button:not(.note-btn):not(.select2-selection__clear),
input[type="button"],
input[type="submit"],
input[type="reset"],
a.btn,
.btn,
.btn-action,
.btn-jurnal,
.btn-edit,
.btn-delete,
.btn-monitor,
.btn-update,
.btn-download,
.btn-lihat-materi,
.btn-lihat-rekap,
.btn-logout,
.btn-admin,
.btn-primary,
.btn-outline-light,
.btn-glow,
.btn-full,
.btn-print,
.btn-close,
.btn-copy,
.btn-video-modal,
.btn-whatsapp,
.btn-hapus-pengampu-mandiri,
.btn-hapus-pengampu-generator,
.selera-btn,
.selera-main-btn,
.keu-btn,
.cbt-btn,
.live-class-btn,
.mon-btn,
.mon-action,
.mon-absence-btn,
.rek-mhs-detail-btn,
.keu-detail-btn,
.meeting-attendance-btn,
.jadwal-rutin-status-btn,
.insis-btn-link,
.insis-button,
.mhs-native-submit,
.general-meeting-submit,
.tab-btn,
.pagination a,
.pagination button {
    box-sizing:border-box !important;
    min-height:var(--insis-btn-height) !important;
    height:auto !important;
    width:auto !important;
    min-width:0 !important;
    padding:6px var(--insis-btn-pad-x) !important;
    margin:2px !important;
    border-radius:var(--insis-btn-radius) !important;
    font-family:inherit !important;
    font-size:var(--insis-btn-font) !important;
    font-weight:650 !important;
    line-height:1.15 !important;
    letter-spacing:0 !important;
    text-transform:none !important;
    text-decoration:none !important;
    white-space:nowrap !important;
    vertical-align:middle !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    gap:var(--insis-btn-gap) !important;
    cursor:pointer;
    box-shadow:none !important;
    transform:none;
}

/* Hilangkan bentuk pill/besar dari style lama, kecuali badge. */
.selera-btn,
.selera-main-btn,
.btn-glow,
.btn-outline-light {
    border-radius:var(--insis-btn-radius) !important;
    font-size:var(--insis-btn-font) !important;
    padding:6px var(--insis-btn-pad-x) !important;
    box-shadow:none !important;
}
.selera-btn:hover,
.selera-main-btn:hover,
.btn-glow:hover,
.btn-outline-light:hover {
    transform:none !important;
}

/* Tombol aksi di tabel/card dibuat compact tetapi tetap terbaca. */
td .btn,
td .btn-action,
td .btn-jurnal,
td .btn-edit,
td .btn-delete,
td .btn-monitor,
td .btn-download,
td .btn-lihat-rekap,
td .keu-btn,
td .cbt-btn,
td .live-class-btn,
.table-actions button,
.table-actions a,
.action-bar button,
.action-bar a,
.generator-actions button,
.generator-actions a,
.cbt-actions button,
.cbt-actions a,
.keu-bill-actions button,
.keu-bill-actions a {
    min-height:var(--insis-btn-height-compact) !important;
    padding:5px 9px !important;
    font-size:var(--insis-btn-font-compact) !important;
    border-radius:7px !important;
}

/* Varian sm tidak boleh terlalu kecil. */
.btn-sm,
.keu-btn.sm,
button.btn-sm,
a.btn-sm {
    min-height:var(--insis-btn-height-compact) !important;
    padding:5px 9px !important;
    font-size:var(--insis-btn-font-compact) !important;
    border-radius:7px !important;
}

/* Varian lg tetap sedikit lebih besar, bukan oversized. */
.btn-lg,
button.btn-lg,
a.btn-lg {
    min-height:38px !important;
    padding:7px 13px !important;
    font-size:13px !important;
    border-radius:9px !important;
}

/* Icon-only / close: kotak konsisten. */
.materi-popup-close,
.jadwal-edit-modal-close,
.meeting-attendance-close,
.keu-detail-close,
.kaldik-detail-close,
.mhs-native-popover-close,
.student-module-close,
.close-btn,
button[aria-label="Close"],
button[aria-label="Tutup"] {
    width:32px !important;
    min-width:32px !important;
    height:32px !important;
    min-height:32px !important;
    padding:0 !important;
    margin:2px !important;
    border-radius:8px !important;
    display:inline-grid !important;
    place-items:center !important;
    font-size:14px !important;
    line-height:1 !important;
}

/* Full-width hanya ketika memang diminta oleh layout. */
.btn-full,
button.btn-full,
a.btn-full {
    width:100% !important;
}

/* Link/tab yang berfungsi seperti tombol. */
.keu-tabs a,
.nav-actions a,
.insis-actions a {
    min-height:var(--insis-btn-height) !important;
    padding:6px var(--insis-btn-pad-x) !important;
    border-radius:var(--insis-btn-radius) !important;
    font-size:var(--insis-btn-font) !important;
    line-height:1.15 !important;
    font-weight:650 !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    gap:var(--insis-btn-gap) !important;
    box-sizing:border-box !important;
    text-decoration:none !important;
    white-space:nowrap !important;
}

/* Summernote: toolbar compact dan konsisten, tanpa mengganggu tombol aplikasi. */
.note-toolbar .note-btn {
    min-height:30px !important;
    height:30px !important;
    min-width:30px !important;
    padding:4px 7px !important;
    margin:1px !important;
    border-radius:6px !important;
    font-size:12px !important;
    line-height:1 !important;
    box-shadow:none !important;
}

/* Group tombol: jarak seragam. */
.cbt-actions,
.keu-inline,
.keu-bill-actions,
.live-class-actions,
.live-class-stage-actions,
.generator-actions,
.action-bar,
.mon-action-stack {
    gap:6px !important;
    align-items:center !important;
}

/* Disabled tetap jelas tetapi tidak berubah ukuran. */
button:disabled,
.btn.disabled,
.btn[aria-disabled="true"] {
    opacity:.55 !important;
    cursor:not-allowed !important;
    transform:none !important;
}

/* Mobile: sedikit lebih tinggi untuk sentuhan, tetap minimal. */
@media (max-width:700px){
    :root{
        --insis-btn-height:36px;
        --insis-btn-height-compact:34px;
        --insis-btn-font:12.5px;
        --insis-btn-font-compact:12px;
    }
    button:not(.note-btn):not(.select2-selection__clear),
    input[type="button"],
    input[type="submit"],
    input[type="reset"],
    .btn,
    .btn-action,
    .keu-btn,
    .cbt-btn,
    .live-class-btn,
    .selera-btn,
    .selera-main-btn {
        max-width:100%;
    }
}

/* ==========================================================
   BERANDA / MINIMAL TEXT CLEANUP v3
   - tombol Beranda menjadi icon home saja
   - teks pendamping yang tidak perlu disembunyikan
   ========================================================== */
.user-info .user-name-compact{
    display:inline-flex !important;
    align-items:center !important;
    padding:0 2px !important;
    font-size:13px !important;
    color:#0f172a !important;
}
.user-info .user-name-compact strong{
    font-weight:700 !important;
}

.btn-icon-only,
.btn-home-shortcut{
    width:34px !important;
    min-width:34px !important;
    height:34px !important;
    min-height:34px !important;
    padding:0 !important;
    display:inline-grid !important;
    place-items:center !important;
    border-radius:8px !important;
    font-size:15px !important;
    line-height:1 !important;
    overflow:hidden;
}

.student-module-close.btn-home-shortcut{
    width:34px !important;
    min-width:34px !important;
    height:34px !important;
    min-height:34px !important;
    font-size:16px !important;
}

/* Beranda dibuat lebih bersih: hanya ikon + judul modul. */
.student-app-icon{
    min-height:106px !important;
    padding:13px 8px 10px !important;
}
.student-app-icon small,
.student-module-title small,
.student-app-hero p,
.insis-eyebrow{
    display:none !important;
}
.student-app-icon strong{
    margin-top:1px !important;
}

@media (max-width:700px){
    .btn-icon-only,
    .btn-home-shortcut,
    .student-module-close.btn-home-shortcut{
        width:36px !important;
        min-width:36px !important;
        height:36px !important;
        min-height:36px !important;
    }
    .student-app-icon{
        min-height:94px !important;
    }
}

.student-module-close.btn-home-shortcut::after{content:none !important;}
