/* Gaya minimal portal — sengaja tanpa framework, sama seperti HRIS. */
:root {
    --bg: #f4f6f8;
    --card: #ffffff;
    --border: #dfe3e8;
    --text: #1f2933;
    --muted: #6b7280;
    --primary: #1d4ed8;
    --danger: #b91c1c;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

/* ---------------------------------------------------------------- Login */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 32px 16px;
    /* Gradien diagonal biru tua -> biru muda, mengikuti _desain/form_login.png.
       fixed supaya warnanya tidak ikut bergeser saat halaman pendek discroll di ponsel. */
    background: linear-gradient(135deg, #1c63d2 0%, #3f8fe0 45%, #a9dcf2 100%);
    background-attachment: fixed;
}

.login-wrap {
    width: 100%;
    max-width: 460px;
}

.login-card {
    background: var(--card);
    border: 0;
    border-radius: 26px;
    padding: 44px 40px 40px;
    box-shadow: 0 24px 60px rgba(12, 42, 92, .28);
}

.login-head { text-align: center; margin-bottom: 34px; }

.login-title {
    margin: 0;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: .5px;
    color: #101828;
}

.login-subtitle {
    margin: 2px 0 0;
    font-size: 17px;
    font-weight: 700;
    color: #101828;
}

.login-brand {
    margin: 26px 0 0;
    font-size: 33px;
    font-weight: 800;
    letter-spacing: .5px;
    color: #101828;
}

.brand-accent { color: #e5091b; }

.field { margin-bottom: 18px; }

.login-card label {
    display: block;
    margin-bottom: 7px;
    font-size: 14px;
    font-weight: 500;
    color: #475467;
}

/* Pembungkus relatif: ikon dan tombol mata diposisikan terhadap kotak ini, bukan
   terhadap input — supaya tinggi input bebas berubah tanpa menggeser ikonnya. */
.input-wrap { position: relative; display: flex; align-items: center; }

.login-card input {
    width: 100%;
    height: 50px;
    padding: 0 14px 0 46px;
    border: 1px solid #e4e7ec;
    border-radius: 11px;
    font-size: 15px;
    color: var(--text);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}

.login-card input::placeholder { color: #98a2b3; }

.login-card input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, .12);
}

/* Password punya tombol mata di kanan — beri ruang supaya teks tidak tertimpa. */
#password { padding-right: 46px; }

.input-icon {
    position: absolute;
    left: 15px;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #98a2b3;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.input-action {
    position: absolute;
    right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.input-action svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: #98a2b3;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.input-action:hover svg { stroke: #667085; }

.btn-login {
    width: 100%;
    height: 52px;
    margin-top: 8px;
    background: linear-gradient(90deg, #17307e 0%, #2447c8 55%, #1d4ed8 100%);
    color: #fff;
    border: 0;
    border-radius: 11px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 3px;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(29, 78, 216, .38);
    transition: filter .15s, box-shadow .15s;
}

.btn-login:hover:not(:disabled) { filter: brightness(1.08); }
.btn-login:disabled { opacity: .65; cursor: default; box-shadow: none; letter-spacing: 1px; }

.login-foot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: 22px;
    color: #fff;
    font-size: 13.5px;
    line-height: 1.45;
    text-align: center;
    text-shadow: 0 1px 2px rgba(9, 35, 78, .25);
}

.foot-icon {
    flex: none;
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: .9;
}

@media (max-width: 420px) {
    .login-card { padding: 32px 22px 28px; border-radius: 20px; }
    .login-title { font-size: 24px; }
    .login-subtitle { font-size: 15px; }
    .login-brand { font-size: 26px; margin-top: 20px; }
}

/* ---------------------------------------------------------------- Shell */
/* Latar biru dalam mengikuti _desain/dashboard.png. Diterapkan ke SELURUH shell
   (topbar + isi + footer), bukan cuma beranda, supaya /access tidak jadi tema kedua
   yang berdiri sendiri — kartu putihnya justru terbaca sebagai panel di atas biru. */
body.shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(ellipse 120% 90% at 50% 20%, #1a68b8 0%, #0f4c94 45%, #0a3568 100%);
    background-attachment: fixed;
    color: #fff;
}

.topbar {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 28px;
    background: rgba(6, 34, 68, .35);
    border-bottom: 1px solid rgba(255, 255, 255, .16);
}

.topbar-brand { font-size: 19px; font-weight: 600; }
.brand-link { color: inherit; text-decoration: none; }

.topbar-user { display: flex; align-items: center; gap: 22px; }

.nav-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, .92);
    font-size: 15px;
    text-decoration: none;
    white-space: nowrap;
}

.nav-button {
    padding: 0;
    background: none;
    border: 0;
    font: inherit;
    font-size: 15px;
    cursor: pointer;
}

a.nav-item:hover, .nav-button:hover { color: #fff; }

.nav-icon {
    width: 19px;
    height: 19px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.content-area {
    position: relative;
    z-index: 1;
    flex: 1;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 56px 24px 72px;
}

.hero { margin-bottom: 34px; }

.hero-title {
    margin: 0 0 8px;
    font-size: 46px;
    font-weight: 500;
    letter-spacing: -.5px;
}

.hero-subtitle {
    margin: 0;
    font-size: 17px;
    color: rgba(255, 255, 255, .82);
}

/* Dipakai halaman selain beranda (mis. /access) — ukurannya lebih tenang. */
.page-title { margin: 0 0 6px; font-size: 28px; font-weight: 500; }
.page-subtitle { margin: 0 0 26px; font-size: 15px; color: rgba(255, 255, 255, .8); }
.muted { color: var(--muted); }
.loading-note { color: rgba(255, 255, 255, .75); }

.footer {
    position: relative;
    z-index: 2;
    padding: 18px 24px;
    background: rgba(6, 34, 68, .3);
    border-top: 1px solid rgba(255, 255, 255, .12);
    color: rgba(255, 255, 255, .75);
    font-size: 13px;
    text-align: center;
}

/* ------------------------------------------------------- Hiasan latar */
/* Murni dekoratif (aria-hidden di header.php). pointer-events:none supaya tidak pernah
   mencuri klik dari tile aplikasi yang ada di belakangnya. */
.confetti {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.confetti .c {
    position: absolute;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    opacity: .85;
}

.confetti .c1  { top: 22%; left: 13%; background: #f2c14e; }
.confetti .c2  { top: 30%; left: 9%;  background: #6ec8f0; width: 7px; height: 7px; }
.confetti .c3  { top: 27%; left: 16%; background: #5fbf7f; }
.confetti .c4  { top: 34%; left: 15%; background: #e2574c; border-radius: 2px; width: 12px; height: 12px; }
.confetti .c5  { top: 25%; left: 11%; background: #7fd6a6; border-radius: 2px; }
.confetti .c6  { top: 37%; left: 19%; background: #9ad9f5; width: 7px; height: 7px; }
.confetti .c7  { top: 12%; right: 14%; background: #f2c14e; }
.confetti .c8  { top: 16%; right: 19%; background: #5fbf7f; }
.confetti .c9  { top: 14%; right: 11%; background: #e2574c; border-radius: 2px; width: 12px; height: 12px; }
.confetti .c10 { top: 19%; right: 16%; background: #9ad9f5; width: 7px; height: 7px; }
.confetti .c11 { top: 21%; right: 9%;  background: #6ec8f0; border-radius: 2px; }
.confetti .c12 { top: 17%; right: 22%; background: #7fd6a6; width: 7px; height: 7px; }

.sparkle { position: absolute; fill: rgba(255, 255, 255, .55); }
.sparkle.s1 { width: 40px; height: 40px; bottom: 14%; right: 9%; }
.sparkle.s2 { width: 26px; height: 26px; top: 9%;  right: 6%; opacity: .7; }

/* Layar sempit: hiasan cuma menambah keramaian, dan titik di kiri menabrak teks. */
@media (max-width: 820px) {
    .confetti { display: none; }
}

/* ------------------------------------------------------------ Launcher */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 22px;
}

.app-card {
    display: flex;
    flex-direction: column;
    min-height: 210px;
    padding: 26px 28px;
    text-align: left;
    color: #fff;
    background:
        /* Tekstur titik halus seperti di desain — dibuat dari gradien, bukan file
           gambar, supaya halaman tidak perlu permintaan tambahan. */
        radial-gradient(rgba(255, 255, 255, .10) 1px, transparent 1px) 0 0 / 7px 7px,
        linear-gradient(160deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .10));
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 14px;
    cursor: pointer;
    font: inherit;
    transition: transform .15s, border-color .15s, box-shadow .15s;
}

.app-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, .6);
    box-shadow: 0 14px 34px rgba(4, 26, 56, .38);
}

.app-card:disabled { opacity: .6; cursor: default; transform: none; }

.app-icon { font-size: 42px; line-height: 1; }
/* Nama & deskripsi didorong ke bawah kartu, ikon tetap menggantung di atas. */
.app-name { margin-top: auto; font-size: 22px; font-weight: 600; }
.app-desc { margin-top: 4px; color: rgba(255, 255, 255, .82); font-size: 15px; }

/* -------------------------------------------------------------- Alerts */
.alert-error {
    padding: 10px 12px;
    margin-bottom: 16px;
    background: #fee2e2;
    color: var(--danger);
    border-radius: 6px;
    font-size: 13px;
}

.alert-info {
    padding: 12px 14px;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 8px;
    font-size: 14px;
}

/* ------------------------------------------- Halaman pengaturan hak akses */
.brand-link { color: inherit; text-decoration: none; }

.app-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
    align-items: start;
}

.app-card-holder {
    display: flex;
    flex-direction: column;
    background: var(--card);
    /* Warna teks dikembalikan ke gelap SECARA EKSPLISIT. body.shell mewarnai seluruh
       shell putih untuk latar biru; tanpa baris ini, isi kartu putih ini jadi putih di
       atas putih dan halamannya tampak kosong. */
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 12px;
    padding: 16px 18px 14px;
    box-shadow: 0 10px 26px rgba(4, 26, 56, .22);
}

.holder-head {
    display: flex;
    align-items: center;
    gap: 9px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.holder-icon { font-size: 20px; line-height: 1; }
.holder-title { font-weight: 600; }
/* Jumlah anggota didorong ke kanan; badge "nonaktif" menempel sesudahnya. */
.holder-count { margin-left: auto; font-size: 12px; }

.badge-off {
    padding: 2px 8px;
    background: #f1f5f9;
    color: var(--muted);
    border-radius: 999px;
    font-size: 11px;
}

.holder-list {
    /* Dibatasi tingginya supaya kartu aplikasi berisi 200 orang tidak menenggelamkan
       kartu di sebelahnya — daftarnya menggulir sendiri. */
    max-height: 320px;
    overflow-y: auto;
    margin: 6px -6px 0;
    padding: 0 6px;
}

.holder-empty, .holder-note { font-size: 13px; margin: 10px 0; }

.member-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

.member-row:last-child { border-bottom: 0; }

.member-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.member-name { font-size: 14px; font-weight: 500; }

.member-meta {
    color: var(--muted);
    font-size: 12px;
    /* Nama departemen bisa panjang — dipotong, bukan membuat kartunya melebar. */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.badge-me {
    flex: none;
    padding: 2px 8px;
    background: #e0e7ff;
    color: var(--primary);
    border-radius: 999px;
    font-size: 11px;
}

.btn-minus {
    flex: none;
    width: 28px;
    height: 28px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--danger);
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
}

.btn-minus:hover { background: #fee2e2; border-color: #fca5a5; }
.btn-minus:disabled { opacity: .5; cursor: default; }

.holder-add { margin-top: 12px; }

.btn-add {
    width: 100%;
    padding: 8px;
    background: none;
    border: 1px dashed var(--border);
    border-radius: 8px;
    color: var(--primary);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.btn-add:hover { border-color: var(--primary); background: #f8faff; }
.btn-add .sign { font-size: 15px; font-weight: 700; }

.add-panel { margin-top: 8px; }

.suggest {
    margin-top: 6px;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    max-height: 260px;
    overflow-y: auto;
}

.suggest-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    padding: 8px 10px;
    text-align: left;
    background: none;
    border: 0;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    font: inherit;
}

.suggest-item:last-child { border-bottom: 0; }
.suggest-item:hover { background: #eef2ff; }
.s-name { font-size: 14px; font-weight: 500; }
.s-meta { color: var(--muted); font-size: 12px; }
.suggest-empty { padding: 10px; margin: 0; font-size: 13px; }

.input {
    width: 100%;
    padding: 8px 10px;
    background: #fff;
    /* `font: inherit` tidak membawa warna, dan warna bawaan input berbeda antar browser —
       disebut eksplisit supaya tidak ada peluang teks putih di kotak putih. */
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    font-size: 14px;
}

.alert-ok {
    padding: 10px 12px;
    margin-bottom: 16px;
    background: #dcfce7;
    color: #166534;
    border-radius: 6px;
    font-size: 13px;
}

/* -------------------------------------------- Panel wajib ganti password */
.must-change {
    max-width: 560px;
    padding: 28px 30px;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 14px;
}

.must-change-title { margin: 0 0 8px; font-size: 22px; font-weight: 600; }
.must-change-text { margin: 0 0 18px; color: rgba(255, 255, 255, .85); font-size: 15px; }

.btn-primary {
    padding: 10px 20px;
    background: #fff;
    color: #0f4c94;
    border: 0;
    border-radius: 9px;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary:hover:not(:disabled) { background: #eef4ff; }
.btn-primary:disabled { opacity: .6; cursor: default; }

/* Warna terang, bukan merah gelap: latarnya biru, dan #b91c1c nyaris tak terbaca di atasnya. */
.must-change-note { margin: 14px 0 0; color: #ffd0d0; font-size: 13px; }

/* ----------------------------------------------------- Pemilih role anggota */
.role-picker-wrap { margin-top: 10px; }

.role-picker {
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.role-picker-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.role-option { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 14px; }
.role-picker-note { margin: 8px 0 0; color: var(--danger); font-size: 12px; }

.picker-actions { display: flex; gap: 8px; margin-top: 10px; }

.btn-mini {
    padding: 6px 14px;
    background: var(--primary);
    color: #fff;
    border: 0;
    border-radius: 7px;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.btn-mini-ghost { background: none; color: var(--muted); border: 1px solid var(--border); }
.btn-mini-ghost:hover { background: #eef2f6; }

.btn-role {
    flex: none;
    padding: 4px 10px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--primary);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.btn-role:hover { background: #eef2ff; border-color: var(--primary); }
