
/* =========================================================
   DASAR
========================================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: #f4f5f8;
    color: #282b33;
    font: 14px/1.5 Inter, system-ui, -apple-system,
          "Segoe UI", Arial, sans-serif;
}

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

/* =========================================================
   SIDEBAR
========================================================= */

.sidebar {
    width: 270px;
    min-height: 100vh;
    background: #641b2c;
    color: #fff;
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
    padding: 8px 8px 24px;
    border-bottom: 1px solid #ffffff24;
}

.brand b {
    display: block;
    font-size: 14px;
    letter-spacing: .6px;
}

.brand small {
    display: block;
    color: #e5cbd1;
    font-size: 10px;
    letter-spacing: 1px;
}

.brand-mark {
    width: 54px;
    height: 54px;
    border-radius: 17px;
    background: #fff;
    color: #641b2c;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 20px;
    letter-spacing: -1px;
    flex-shrink: 0;
}

.small-mark {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    font-size: 16px;
}

.brand-text {
    min-width: 0;
}

.sidebar nav {
    padding-top: 18px;
    flex: 1;
    min-width: 0;
}

/* Menu utama dan submenu */

.nav-link {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 11px 13px;
    margin: 3px 0;
    color: #f7e9ec;
    text-decoration: none;
    border-radius: 9px;
    font-size: 13px;
    line-height: 1.5;
    transition: background .2s ease, color .2s ease;
}

.nav-link:hover,
.nav-link.active {
    background: #8a394d;
    color: #fff;
}

.nav-label {
    display: block;
    min-width: 0;
}

/* Kelompok menu */

.nav-group {
    margin: 13px 0 20px;
}

.nav-heading {
    padding: 10px 12px;
    color: #e6c4cc;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.1px;
    line-height: 1.5;
}

.nav-group .nav-link {
    padding-left: 22px;
}

/* Ikon lama disembunyikan agar karakter rusak tidak muncul */

.nav-icon,
.nav-heading > span {
    display: none !important;
}

/* Tombol keluar */

.logout {
    border-top: 1px solid #ffffff24;
    padding: 16px 10px 4px;
    color: #fff;
    text-decoration: none;
    display: block;
    font-size: 13px;
}

.logout:hover {
    color: #f1cbd4;
}

/* =========================================================
   KONTEN UTAMA
========================================================= */

.main {
    padding: 28px 34px;
    min-width: 0;
    flex: 1;
    max-width: 1700px;
    margin: 0 auto;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 26px;
}

.topbar h1 {
    font-size: 22px;
    margin: 3px 0 0;
    color: #252a35;
}

.eyebrow {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.6px;
    color: #8d5362;
}

.eyebrow.light {
    color: #f1cdd5;
}

/* =========================================================
   INFORMASI PENGGUNA
========================================================= */

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    padding: 8px 13px;
    border-radius: 12px;
    box-shadow: 0 4px 18px #1c22300a;
}

.user-chip b,
.user-chip small {
    display: block;
}

.user-chip small {
    color: #858895;
    font-size: 10px;
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #f2e5e9;
    color: #641b2c;
    display: grid;
    place-items: center;
    font-weight: 800;
    flex-shrink: 0;
}

/* =========================================================
   WELCOME BANNER
========================================================= */

.welcome {
    background: linear-gradient(115deg, #641b2c, #8b354b);
    border-radius: 18px;
    padding: 28px 32px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
}

.welcome h2 {
    font-size: 25px;
    margin: 8px 0;
}

.welcome p {
    color: #f0dce1;
    margin: 0;
}

.welcome-badge {
    width: 90px;
    height: 90px;
    border: 1px solid #ffffff55;
    border-radius: 28px;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 27px;
    color: #f6e4e9;
    background: #ffffff10;
    transform: rotate(8deg);
    flex-shrink: 0;
}

/* =========================================================
   KARTU STATISTIK
========================================================= */

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.stat-card,
.panel {
    background: #fff;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 24px #1c223008;
}

.stat-card span,
.stat-card small {
    display: block;
    color: #777d8a;
}

.stat-card strong {
    display: block;
    font-size: 30px;
    margin: 8px 0;
    color: #641b2c;
}

.stat-card small {
    font-size: 11px;
}

/* =========================================================
   PANEL
========================================================= */

.panel {
    margin-top: 18px;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 18px;
}

.panel h3 {
    margin: 0 0 5px;
    font-size: 17px;
}

.panel p {
    color: #7b808b;
    margin: 0;
}

.pill {
    display: inline-block;
    background: #f7e9ed;
    color: #74283b;
    border-radius: 30px;
    padding: 6px 11px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

/* =========================================================
   GRID MODUL
========================================================= */

.module-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.module-tile {
    border: 1px solid #ececf0;
    border-radius: 11px;
    padding: 13px 12px;
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 600;
    font-size: 12px;
    min-width: 0;
}

.tile-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9b5265;
    flex-shrink: 0;
}

/* =========================================================
   TABEL
========================================================= */

.table-wrap {
    overflow-x: auto;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th,
td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid #eee;
}

th {
    color: #7a7f8b;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
    white-space: nowrap;
}

td {
    color: #363a43;
}

/* =========================================================
   FORM
========================================================= */

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0 25px;
}

.form-grid label,
.auth-card label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #565b66;
}

.form-grid input,
.form-grid select,
.auth-card input {
    display: block;
    width: 100%;
    margin-top: 6px;
    border: 1px solid #dfe1e7;
    border-radius: 8px;
    padding: 11px 12px;
    font: inherit;
    background: #fff;
}

.form-grid input:focus,
.form-grid select:focus,
.auth-card input:focus {
    outline: none;
    border-color: #8a394d;
    box-shadow: 0 0 0 3px #8a394d18;
}

/* =========================================================
   TOMBOL
========================================================= */

.btn {
    border: 0;
    border-radius: 9px;
    padding: 11px 16px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn.primary {
    background: #701f34;
    color: #fff;
}

.btn.primary:hover {
    background: #8a394d;
}

.btn.full {
    width: 100%;
    margin-top: 18px;
}

/* =========================================================
   PESAN
========================================================= */

.notice {
    padding: 12px 14px;
    border-radius: 9px;
    margin: 14px 0;
}

.notice.success {
    background: #e8f5ee;
    color: #236342;
}

.notice.danger {
    background: #fbeaec;
    color: #8e2635;
}

/* =========================================================
   HALAMAN LOGIN
========================================================= */

.auth-bg {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 22px;
    background: linear-gradient(135deg, #f8f1f3, #f0f1f5);
}

.auth-card {
    width: min(100%, 440px);
    background: #fff;
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 18px 60px #3d16231a;
}

.auth-card .brand-mark {
    margin: 0 auto 18px;
}

.auth-card h1 {
    text-align: center;
    font-size: 23px;
    margin: 5px 0 22px;
}

.auth-card .eyebrow {
    text-align: center;
}

.auth-card label {
    margin-top: 14px;
}

.auth-card input {
    padding: 12px;
}

/* =========================================================
   TEKS DAN FOOTER
========================================================= */

.muted {
    color: #7c818c;
}

.center {
    text-align: center;
}

.small {
    font-size: 11px;
    margin-top: 22px;
}

footer {
    padding: 25px 0;
    color: #9296a0;
    font-size: 11px;
}

/* =========================================================
   RESPONSIVE TABLET
========================================================= */

@media (max-width: 1100px) {

    .sidebar {
        width: 230px;
    }

    .main {
        padding: 24px;
    }

    .module-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

}

/* =========================================================
   RESPONSIVE HP
========================================================= */

@media (max-width: 760px) {

    .layout {
        display: block;
    }

    .sidebar {
        width: 100%;
        min-height: auto;
        max-height: 75vh;
        padding: 16px;
    }

    .sidebar nav {
        display: block;
        overflow-y: auto;
        padding-top: 12px;
    }

    .nav-group {
        margin: 8px 0 14px;
    }

    .nav-group .nav-link {
        display: flex;
        margin: 3px 0;
    }

    .logout {
        margin-top: 10px;
    }

    .main {
        padding: 20px 15px;
    }

    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .module-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .welcome {
        padding: 22px;
    }

    .welcome h2 {
        font-size: 21px;
    }

    .welcome-badge {
        width: 65px;
        height: 65px;
        font-size: 21px;
    }

    .panel-head {
        flex-direction: column;
    }

}

/* =========================================================
   RESPONSIVE HP KECIL
========================================================= */

@media (max-width: 420px) {

    .stats {
        grid-template-columns: 1fr;
    }

    .module-grid {
        grid-template-columns: 1fr;
    }

    .user-chip {
        max-width: 100%;
    }

    .welcome-badge {
        display: none;
    }

}

/* =========================================================
   LOGO KAMPUS - ATURAN GLOBAL DESKTOP DAN MOBILE
========================================================= */

.brand {
    min-width: 0;
}

.brand-mark {
    width: 54px;
    height: 54px;
    min-width: 54px;
    max-width: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex: 0 0 54px;
    overflow: hidden;
    padding: 4px;
    background: #fff;
    border-radius: 15px;
    isolation: isolate;
}

.brand-mark.small-mark {
    width: 42px;
    height: 42px;
    min-width: 42px;
    max-width: 42px;
    flex-basis: 42px;
    border-radius: 12px;
}

.brand-mark img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
}

.welcome-badge {
    width: 90px;
    height: 90px;
    min-width: 90px;
    max-width: 90px;
    flex: 0 0 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 7px;
    border: 1px solid #ffffff55;
    border-radius: 25px;
    background: #ffffff10;
    isolation: isolate;
}

.welcome-badge img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
}

/* Pastikan sidebar tidak memakai gambar sebagai latar */
.sidebar {
    background-image: none !important;
}

@media (max-width: 760px) {
    .brand-mark.small-mark {
        width: 42px;
        height: 42px;
        min-width: 42px;
        max-width: 42px;
        flex-basis: 42px;
    }
}


/* PENGELOLAAN PROGRAM STUDI */
.section-subtitle { margin: 8px 0 0; font-size: 15px; }
.program-form { align-items: end; }
.program-submit { display: flex; align-items: end; }
.program-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.program-actions form { margin: 0; }
.small-btn { padding: 7px 10px; font-size: 11px; background: #f0eef1; color: #641b2c; }
.danger-btn { background: #fbeaec; color: #9b2437; }
.status-chip { display: inline-block; border-radius: 20px; padding: 4px 9px; font-size: 11px; font-weight: 700; }
.status-chip.is-active { background: #e8f5ee; color: #236342; }
.status-chip.is-inactive { background: #f1f1f3; color: #777d8a; }
.program-note { margin-top: 16px !important; font-size: 11px; }
@media (max-width: 760px) {
  .program-actions { min-width: 130px; }
}


/* Branding halaman login: logo kampus dan background yang dapat diatur */
.auth-bg {
    position: relative;
    isolation: isolate;
    background: linear-gradient(135deg, #f8f1f3, #f0f1f5);
}
.auth-bg::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    background-image: var(--login-bg-image, none);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    opacity: var(--login-bg-opacity, 0);
    pointer-events: none;
}
.auth-card { position: relative; z-index: 1; }
.auth-campus-logo {
    display: block;
    width: auto;
    height: auto;
    max-width: 112px;
    max-height: 100px;
    object-fit: contain;
    margin: 0 auto 18px;
}

/* FIX: login background image tidak menggunakan inline-style yang diblokir CSP */
.auth-bg {
    position: relative;
    isolation: isolate;
    overflow-x: hidden;
    background: linear-gradient(135deg, #f8f1f3, #f0f1f5);
}
.auth-bg-image {
    position: fixed;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
}
.auth-card { position: relative; z-index: 1; }
.auth-bg-image.opacity-0 { opacity: 0.00; }
.auth-bg-image.opacity-5 { opacity: 0.05; }
.auth-bg-image.opacity-10 { opacity: 0.10; }
.auth-bg-image.opacity-15 { opacity: 0.15; }
.auth-bg-image.opacity-20 { opacity: 0.20; }
.auth-bg-image.opacity-25 { opacity: 0.25; }
.auth-bg-image.opacity-30 { opacity: 0.30; }
.auth-bg-image.opacity-35 { opacity: 0.35; }
.auth-bg-image.opacity-40 { opacity: 0.40; }
.auth-bg-image.opacity-45 { opacity: 0.45; }
.auth-bg-image.opacity-50 { opacity: 0.50; }
.auth-bg-image.opacity-55 { opacity: 0.55; }
.auth-bg-image.opacity-60 { opacity: 0.60; }
.auth-bg-image.opacity-65 { opacity: 0.65; }
.auth-bg-image.opacity-70 { opacity: 0.70; }
.auth-bg-image.opacity-75 { opacity: 0.75; }
.auth-bg-image.opacity-80 { opacity: 0.80; }
.auth-bg-image.opacity-85 { opacity: 0.85; }
.auth-bg-image.opacity-90 { opacity: 0.90; }
.auth-bg-image.opacity-95 { opacity: 0.95; }
.auth-bg-image.opacity-100 { opacity: 1.00; }

.student-module .hr-inner { margin-top: 18px; }
.student-actions { min-width: 210px; }
.student-actions form { display: inline-block; margin: 2px; }
.student-actions .btn, .student-status-editor summary { font-size: 12px; }
.student-status-editor { margin: 4px 0; }
.student-status-editor form { min-width: 280px; padding: 12px; background: #faf7f8; border-radius: 10px; }
.student-module textarea { width: 100%; min-height: 72px; padding: 10px; border: 1px solid #dfe1e7; border-radius: 8px; font: inherit; }
.student-module .form-grid { align-items: end; }
.student-module .form-grid label { min-width: 0; }

.student-activity-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin:8px 0 18px; }
.student-activity-heading h3 { margin:0 0 6px; color:#38a8d6; }
.student-activity-heading p { margin:0; color:#697386; }
.activity-table th, .activity-table td { text-align:center; white-space:nowrap; }
.activity-table th { background:#fbf9fa; }
.activity-note { margin-top:12px; font-size:12px; }
@media(max-width:760px) { .student-activity-heading { display:block; } .activity-table { min-width:760px; } }

/* Data mahasiswa: daftar dan navigasi detail per mahasiswa */
.student-filter { display:flex; flex-wrap:wrap; align-items:end; gap:12px; margin:14px 0 18px; }
.student-filter label { display:flex; flex-direction:column; gap:6px; min-width:190px; font-size:12px; font-weight:700; color:#565b66; }
.student-filter select { border:1px solid #dfe1e7; border-radius:8px; padding:10px 12px; background:#fff; font:inherit; }
.student-detail-nav { display:flex; flex-wrap:wrap; gap:8px; margin:14px 0 18px; }
.student-detail-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.student-detail-grid > div { border:1px solid #ececf0; border-radius:10px; padding:12px; min-width:0; }
.student-detail-grid small,.student-detail-grid strong { display:block; }
.student-detail-grid small { color:#777d8a; margin-bottom:5px; }
.student-detail-grid strong { overflow-wrap:anywhere; color:#282b33; font-weight:650; }
.student-actions { min-width:180px; }
.student-actions form { display:inline-block; margin:2px; }
@media(max-width:760px) { .student-detail-grid { grid-template-columns:1fr; } .student-filter { align-items:stretch; flex-direction:column; } }

.student-status-card { margin:18px 0 22px; padding:16px; border:1px solid #eadde1; border-radius:12px; background:#fffafb; }
.student-status-card .panel-head { margin-bottom:12px; }
.student-status-form { margin-bottom:0; }
.student-status-history { margin-top:24px; }
.student-status-history h3 { margin:0 0 12px; }
.student-status-history table { min-width:760px; }

.student-main-actions { display:flex; flex-wrap:wrap; gap:10px; margin:14px 0; }
.student-main-actions .btn { display:inline-flex; align-items:center; justify-content:center; min-height:42px; }
#student-form, #student-import { scroll-margin-top:18px; }
