/*
 * Penyesuaian kustom di atas tema NobleUI.
 * File ini dimuat paling akhir (lihat AdminAsset) agar bisa meng-override tema.
 */

/* Induk menu yang sedang terbuka (expanded) jangan ikut berwarna aktif.
   Warna primary hanya untuk item halaman yang sedang aktif & saat hover.
   :not(:hover) dipakai agar warna hover tetap jalan. */
.sidebar .sidebar-body .nav .nav-item:not(:hover) > .nav-link[aria-expanded="true"] {
    color: var(--bs-sidebar-color);
}

.sidebar-dark .sidebar .sidebar-body .nav .nav-item:not(:hover) > .nav-link[aria-expanded="true"] {
    color: #7987a1;
}

/* Nama aplikasi ditampilkan pada dua baris agar tetap muat di area brand sidebar. */
.sidebar .sidebar-header .sidebar-brand {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.1;
}

.sidebar .sidebar-header .sidebar-brand span.sidebar-brand-title {
    color: #000;
    font-size: 22px;
    font-weight: 700;
}

.sidebar .sidebar-header .sidebar-brand span.sidebar-brand-subtitle {
    font-size: .975rem;
    font-weight: 400;
    white-space: nowrap;
}

/* Kolom terakhir (Aksi) "freeze" di kanan saat tabel discroll horizontal,
   supaya tombol aksi selalu terlihat. Tambahkan class .table-sticky-end pada <table>.
   Background opaque dipakai agar isi sel lain tidak tembus di baliknya; efek hover
   tetap ditangani box-shadow bawaan tabel Bootstrap. */
.table-sticky-end > thead > tr > th:last-child,
.table-sticky-end > tbody > tr > td:last-child {
    position: sticky;
    right: 0;
    z-index: 2;
    background-color: var(--bs-card-bg, var(--bs-body-bg));
    border-left: 1px solid var(--bs-border-color);
}

/* Tombol layanan WhatsApp untuk akses cepat ke helpdesk kementerian. */
.whatsapp-float {
    --whatsapp-green: #16a34a;
    --whatsapp-green-dark: #087e3d;
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 1080;
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    min-height: 4.5rem;
    padding: .5rem .8rem .5rem .55rem;
    color: #fff;
    background: linear-gradient(135deg, #25d366 0%, var(--whatsapp-green) 58%, var(--whatsapp-green-dark) 100%);
    border: 1px solid rgba(255, 255, 255, .46);
    border-radius: 999px;
    box-shadow: 0 14px 32px rgba(8, 126, 61, .28), 0 4px 10px rgba(15, 23, 42, .18);
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.whatsapp-float::before {
    position: absolute;
    inset: -5px;
    z-index: -1;
    border: 1px solid rgba(37, 211, 102, .35);
    border-radius: inherit;
    content: '';
    animation: whatsapp-float-pulse 2.4s ease-out infinite;
}

.whatsapp-float:hover {
    color: #fff;
    filter: saturate(1.08);
    box-shadow: 0 18px 38px rgba(8, 126, 61, .36), 0 6px 14px rgba(15, 23, 42, .18);
    transform: translateY(-3px);
}

.whatsapp-float:focus-visible {
    color: #fff;
    outline: 3px solid #fbbf24;
    outline-offset: 4px;
}

.whatsapp-float__icon {
    display: grid;
    flex: 0 0 auto;
    width: 3.35rem;
    height: 3.35rem;
    place-items: center;
    color: var(--whatsapp-green);
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 3px 9px rgba(6, 78, 59, .16);
}

.whatsapp-float__icon svg {
    width: 2.15rem;
    height: 2.15rem;
}

.whatsapp-float__copy {
    display: grid;
    gap: .05rem;
    padding-right: .15rem;
    line-height: 1.15;
}

.whatsapp-float__eyebrow {
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: .01em;
    opacity: 1;
}

.whatsapp-float__label {
    font-size: .98rem;
    font-weight: 800;
}

.whatsapp-float__arrow {
    display: grid;
    width: 1.75rem;
    height: 1.75rem;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .38);
    border-radius: 50%;
}

.whatsapp-float__arrow svg {
    display: block;
    width: 1rem;
    height: 1rem;
}

@keyframes whatsapp-float-pulse {
    0%, 35% { opacity: .8; transform: scale(1); }
    70%, 100% { opacity: 0; transform: scale(1.12); }
}

@media (max-width: 575.98px) {
    .whatsapp-float {
        right: 1rem;
        bottom: calc(1rem + env(safe-area-inset-bottom));
        min-height: 3.75rem;
        padding: .4rem .65rem .4rem .4rem;
    }

    .whatsapp-float__icon {
        width: 2.95rem;
        height: 2.95rem;
    }

    .whatsapp-float__icon svg { width: 1.9rem; height: 1.9rem; }
    .whatsapp-float__eyebrow { font-size: 1rem; }
    .whatsapp-float__label { font-size: .88rem; }
    .whatsapp-float__arrow { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .whatsapp-float, .whatsapp-float::before { animation: none; transition: none; }
}
