/* ==========================================================================
   OP BOOBLE — LAYOUT
   --------------------------------------------------------------------------
   Kerangka aplikasi di atas theme Datta Able (pcoded):
     1. Sidebar      nav.pcoded-navbar.app-sidebar   (application/views/admin/index.php)
     2. Header       header.pcoded-header
     3. Notifikasi   dropdown lonceng di header (markup di-render JS index.php)
     4. Loader AJAX  .modal2 + body.loading

   Override Datta Able dilakukan lewat spesifisitas scope (.app-sidebar,
   .pcoded-header), bukan !important. Datta tidak memakai !important pada
   rule sidebar/header, sehingga scope +1 class sudah cukup untuk menang.
   ========================================================================== */


/* ==========================================================================
   1. SIDEBAR
   ========================================================================== */

/* ---------- 1.1 Container ---------- */
.pcoded-navbar.app-sidebar {
    background: var(--app-sidebar-bg);
    box-shadow: var(--app-sidebar-shadow);
}

/* Garis aktif bawaan template (li::after) disembunyikan; penanda aktif
   dipindah ke a::before agar mengikuti bentuk item yang membulat. */
.pcoded-navbar.app-sidebar .pcoded-inner-navbar > li.active::after,
.pcoded-navbar.app-sidebar .pcoded-inner-navbar > li.pcoded-trigger::after {
    content: "";
    background-color: unset;
    z-index: 1027;
    position: absolute;
    left: 0;
    top: 3px;
    width: 3px;
    height: calc(100% - 5px);
}

/* ---------- 1.2 Brand ---------- */
.pcoded-navbar.app-sidebar .navbar-brand.header-logo {
    background: var(--app-sidebar-brand-bg);
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    box-shadow: none;
}

.pcoded-navbar.app-sidebar .navbar-brand.header-logo .b-brand {
    display: flex;
    align-items: center;
    min-width: 0;
}

.pcoded-navbar.app-sidebar .navbar-brand.header-logo .b-title {
    color: var(--app-sidebar-title);
    font-size: 18px;
    font-weight: var(--app-fw-bold);
    letter-spacing: .2px;
}

.pcoded-navbar.app-sidebar .navbar-brand.header-logo .b-bg {
    background: transparent;
    box-shadow: none;
}

.pcoded-navbar.app-sidebar .navbar-brand.header-logo .mobile-menu {
    color: var(--app-sidebar-toggle);
    border-radius: 7px;
}

.pcoded-navbar.app-sidebar .navbar-brand.header-logo .mobile-menu:hover {
    background: rgba(255, 255, 255, .06);
}

.app-sidebar__logo {
    width: 40px;
}

/* ---------- 1.3 Area scroll ---------- */
.pcoded-navbar.app-sidebar .navbar-content {
    padding-top: var(--app-space-2);
}

.pcoded-navbar.app-sidebar .navbar-content::-webkit-scrollbar,
.pcoded-navbar.app-sidebar .scroll-div::-webkit-scrollbar {
    width: 5px;
}

.pcoded-navbar.app-sidebar .navbar-content::-webkit-scrollbar-thumb,
.pcoded-navbar.app-sidebar .scroll-div::-webkit-scrollbar-thumb {
    border-radius: var(--app-radius-pill);
    background: var(--app-sidebar-scrollbar);
}

/* ---------- 1.4 Wrapper menu ---------- */
.pcoded-navbar.app-sidebar .pcoded-inner-navbar {
    padding: 0 11px 28px;
}

/* Reset posisi icon & teks: template pcoded membuat keduanya absolute.
   Dikembalikan ke flow flex agar icon tidak menimpa teks. */
.pcoded-navbar.app-sidebar .pcoded-inner-navbar li > a .pcoded-micon,
.pcoded-navbar.app-sidebar .pcoded-inner-navbar li > a .pcoded-mtext {
    position: static;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    float: none;
    transform: none;
}

.pcoded-navbar.app-sidebar .pcoded-inner-navbar li > a .pcoded-micon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.pcoded-navbar.app-sidebar .pcoded-inner-navbar li > a .pcoded-mtext {
    display: block;
    margin: 0;
    padding: 0;
}

/* ---------- 1.5 Item level 1 ---------- */
.pcoded-navbar.app-sidebar .pcoded-inner-navbar > li.nav-item {
    position: relative;
    margin: 2px 0;
}

.pcoded-navbar.app-sidebar .pcoded-inner-navbar > li.nav-item > a.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 46px;
    margin: 0;
    padding: var(--app-space-2) var(--app-space-3);
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--app-sidebar-link);
    text-decoration: none;
    overflow: hidden;
    transition:
        background .16s ease,
        color .16s ease,
        border-color .16s ease;
}

.pcoded-navbar.app-sidebar .pcoded-inner-navbar > li.nav-item > a.nav-link > .pcoded-micon {
    flex: 0 0 24px;
    width: 24px;
    min-width: 24px;
    height: 24px;
    margin: 0 11px 0 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--app-sidebar-icon);
}

.pcoded-navbar.app-sidebar .pcoded-inner-navbar > li.nav-item > a.nav-link > .pcoded-micon i {
    display: block;
    width: auto;
    margin: 0;
    padding: 0;
    color: inherit;
    font-size: 16px;
    line-height: 1;
}

.pcoded-navbar.app-sidebar .pcoded-inner-navbar > li.nav-item > a.nav-link > .pcoded-mtext {
    flex: 1 1 auto;
    min-width: 0;
    color: inherit;
    font-size: 13.5px;
    font-weight: var(--app-fw-medium);
    line-height: 1.35;
    white-space: normal;
}

/* hover */
.pcoded-navbar.app-sidebar .pcoded-inner-navbar > li.nav-item > a.nav-link:hover {
    background: var(--app-sidebar-hover-bg);
    border-color: rgba(255, 255, 255, .035);
    color: var(--app-sidebar-link-hover);
}

.pcoded-navbar.app-sidebar .pcoded-inner-navbar > li.nav-item > a.nav-link:hover > .pcoded-micon {
    color: var(--app-sidebar-accent-hover);
}

/* aktif / terbuka */
.pcoded-navbar.app-sidebar .pcoded-inner-navbar > li.nav-item.active > a.nav-link,
.pcoded-navbar.app-sidebar .pcoded-inner-navbar > li.nav-item.pcoded-trigger > a.nav-link {
    background: var(--app-sidebar-active-bg);
    border-color: var(--app-sidebar-active-border);
    color: var(--app-sidebar-link-hover);
    box-shadow: none;
}

.pcoded-navbar.app-sidebar .pcoded-inner-navbar > li.nav-item.active > a.nav-link::before,
.pcoded-navbar.app-sidebar .pcoded-inner-navbar > li.nav-item.pcoded-trigger > a.nav-link::before {
    content: "";
    display: block;
    position: absolute;
    top: 9px;
    bottom: 9px;
    left: 0;
    width: 3px;
    border-radius: 0 var(--app-radius-pill) var(--app-radius-pill) 0;
    background: var(--app-sidebar-accent);
}

.pcoded-navbar.app-sidebar .pcoded-inner-navbar > li.nav-item.active > a.nav-link > .pcoded-micon,
.pcoded-navbar.app-sidebar .pcoded-inner-navbar > li.nav-item.pcoded-trigger > a.nav-link > .pcoded-micon {
    color: var(--app-sidebar-accent-icon);
}

.pcoded-navbar.app-sidebar .pcoded-inner-navbar > li.nav-item.active > a.nav-link > .pcoded-mtext,
.pcoded-navbar.app-sidebar .pcoded-inner-navbar > li.nav-item.pcoded-trigger > a.nav-link > .pcoded-mtext {
    font-weight: 650;
}

/* panah menu induk */
.pcoded-navbar.app-sidebar .pcoded-inner-navbar > li.pcoded-hasmenu > a::after {
    position: static;
    flex: 0 0 auto;
    margin-left: auto;
    color: var(--app-sidebar-caret);
}

/* ---------- 1.6 Submenu ---------- */
.pcoded-navbar.app-sidebar .pcoded-inner-navbar li.pcoded-hasmenu .pcoded-submenu {
    margin: 4px 0 7px 34px;
    padding: 5px 0 5px 10px;
    border-left: 1px solid var(--app-sidebar-divider);
    border-radius: 0;
    background: transparent;
}

.pcoded-navbar.app-sidebar .pcoded-inner-navbar li.pcoded-hasmenu .pcoded-submenu li {
    margin: 1px 0;
    padding: 0;
}

.pcoded-navbar.app-sidebar .pcoded-inner-navbar li.pcoded-hasmenu .pcoded-submenu li > a {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 37px;
    margin: 0;
    padding: 7px 9px;
    border-radius: 7px;
    background: transparent;
    color: var(--app-sidebar-sublink);
    text-align: left;
    text-decoration: none;
}

.pcoded-navbar.app-sidebar .pcoded-inner-navbar li.pcoded-hasmenu .pcoded-submenu li > a .pcoded-micon {
    flex: 0 0 20px;
    width: 20px;
    min-width: 20px;
    height: 20px;
    margin: 0 var(--app-space-2) 0 0;
    padding: 0;
    background: transparent;
    color: var(--app-sidebar-subicon);
}

.pcoded-navbar.app-sidebar .pcoded-inner-navbar li.pcoded-hasmenu .pcoded-submenu li > a .pcoded-micon i {
    margin: 0;
    padding: 0;
    color: inherit;
    font-size: var(--app-fs-xs);
    line-height: 1;
}

.pcoded-navbar.app-sidebar .pcoded-inner-navbar li.pcoded-hasmenu .pcoded-submenu li > a .pcoded-mtext {
    flex: 1 1 auto;
    min-width: 0;
    color: inherit;
    font-size: 12.5px;
    font-weight: var(--app-fw-medium);
    line-height: 1.35;
    white-space: normal;
}

.pcoded-navbar.app-sidebar .pcoded-inner-navbar li.pcoded-hasmenu .pcoded-submenu li > a:hover {
    background: var(--app-sidebar-sub-hover-bg);
    color: var(--app-sidebar-sublink-hover);
}

.pcoded-navbar.app-sidebar .pcoded-inner-navbar li.pcoded-hasmenu .pcoded-submenu li.active > a {
    background: var(--app-sidebar-sub-active-bg);
    color: var(--app-sidebar-link-hover);
}

.pcoded-navbar.app-sidebar .pcoded-inner-navbar li.pcoded-hasmenu .pcoded-submenu li.active > a .pcoded-micon {
    color: var(--app-sidebar-accent-hover);
}

/* Hilangkan bullet/garis dekoratif bawaan template di submenu.
   Selector sengaja sepanjang selector Datta Able (li.pcoded-hasmenu ...)
   agar menang tanpa !important. */
.pcoded-navbar.app-sidebar .pcoded-inner-navbar li.pcoded-hasmenu .pcoded-submenu li::before,
.pcoded-navbar.app-sidebar .pcoded-inner-navbar li.pcoded-hasmenu .pcoded-submenu li::after,
.pcoded-navbar.app-sidebar .pcoded-inner-navbar li.pcoded-hasmenu .pcoded-submenu li a::before,
.pcoded-navbar.app-sidebar .pcoded-inner-navbar li.pcoded-hasmenu .pcoded-submenu li a::after {
    display: none;
    content: none;
}

/* ---------- 1.7 Mode collapsed (tombol hamburger desktop) ---------- */
.pcoded-navbar.app-sidebar.navbar-collapsed .pcoded-inner-navbar {
    padding-left: var(--app-space-2);
    padding-right: var(--app-space-2);
}

.pcoded-navbar.app-sidebar.navbar-collapsed .pcoded-inner-navbar > li.nav-item > a.nav-link {
    justify-content: center;
}

.pcoded-navbar.app-sidebar.navbar-collapsed .pcoded-inner-navbar > li.nav-item > a.nav-link > .pcoded-micon {
    margin-right: 0;
}

/* ---------- 1.8 Tablet & mobile ---------- */
@media (max-width: 991px) {
    .pcoded-navbar.app-sidebar .pcoded-inner-navbar > li.nav-item > a.nav-link {
        min-height: 48px;
    }

    .pcoded-navbar.app-sidebar .pcoded-inner-navbar > li.nav-item > a.nav-link > .pcoded-mtext {
        font-size: var(--app-fs-md);
    }
}


/* ==========================================================================
   2. HEADER
   ========================================================================== */
.app-header__user-icon {
    font-size: 20px;
}


/* ==========================================================================
   3. NOTIFIKASI (lonceng header)
   Markup dirender oleh render_notif_cuti_list() di index.php.
   ========================================================================== */

/* ---------- 3.1 Tombol lonceng ---------- */
.cuti-bell-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.pcoded-header .cuti-bell-wrap .cuti-bell-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: var(--app-radius-xs);
    color: var(--app-gray-600);
    background: transparent;
    transition: all .18s ease;
}

.pcoded-header .cuti-bell-wrap .cuti-bell-toggle:hover,
.pcoded-header .cuti-bell-wrap .cuti-bell-toggle:focus,
.pcoded-header .cuti-bell-wrap.show .cuti-bell-toggle {
    background: #f4f8fb;
    color: var(--app-info);
    text-decoration: none;
}

.cuti-bell {
    font-size: 20px;
    line-height: 1;
}

/* Angka jumlah & titik berkedip; tampil via jQuery .show() */
.cuti-badge {
    position: absolute;
    top: -3px;
    right: -2px;
    z-index: 2;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--app-radius-pill);
    background: var(--app-danger);
    color: #fff;
    border: 2px solid #fff;
    font-size: var(--app-fs-2xs);
    font-weight: var(--app-fw-bold);
    line-height: 14px;
    text-align: center;
    display: none;
    box-shadow: 0 4px 10px rgba(239, 68, 68, .25);
}

.cuti-dot {
    position: absolute;
    top: 7px;
    right: 7px;
    z-index: 1;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--app-danger);
    border: 2px solid #fff;
    display: none;
}

.cuti-dot.blink {
    animation: app-pulse-danger 1.2s infinite;
}

/* ---------- 3.2 Panel dropdown ---------- */
.pcoded-header .cuti-bell-wrap .cuti-notif-dropdown {
    width: 420px;
    max-width: calc(100vw - 30px);
    padding: 0;
    margin-top: -6px;           /* nilai efektif sebelumnya (dari Datta Able) */
    border: 0;
    border-radius: var(--app-radius-xs);
    background: var(--app-surface);
    overflow: hidden;
    box-shadow: var(--app-shadow-lg);
}

.pcoded-header .cuti-bell-wrap .cuti-notif-dropdown::before,
.pcoded-header .cuti-bell-wrap .cuti-notif-dropdown::after {
    display: none;
}

.cuti-notif-dropdown,
.cuti-notif-dropdown * {
    box-sizing: border-box;
}

.cuti-notif-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    padding: 20px 22px 18px;
    background: var(--app-surface);
    border-bottom: 1px solid #eef2f7;
}

.cuti-notif-title {
    margin: 0;
    color: var(--app-gray-800);
    font-size: var(--app-fs-lg);
    font-weight: var(--app-fw-bold);
    letter-spacing: .2px;
}

.cuti-notif-subtitle {
    margin-top: var(--app-space-2);
    color: var(--app-gray-500);
    font-size: var(--app-fs-base);
    line-height: var(--app-lh-base);
}

/* ---------- 3.3 Daftar ---------- */
.cuti-notif-body {
    max-height: 360px;
    overflow-y: auto;
    background: var(--app-surface);
}

.pcoded-header .cuti-notif-dropdown .cuti-notif-item {
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
    white-space: normal;
    color: var(--app-slate-700);
    background: var(--app-surface);
    border: 0;
    text-decoration: none;
    transition: background .18s ease;
}

.pcoded-header .cuti-notif-dropdown .cuti-notif-item:hover {
    background: var(--app-surface-hover);
}

.pcoded-header .cuti-notif-dropdown .cuti-notif-item.unread {
    background: #f2f9ff;
}

.pcoded-header .cuti-notif-dropdown .cuti-notif-item.unread:hover {
    background: #edf7ff;
}

.cuti-notif-row {
    display: grid;
    grid-template-columns: 8px 42px minmax(0, 1fr);
    align-items: flex-start;
    column-gap: 13px;
    padding: 16px 22px;
    border-bottom: 1px solid #eef2f7;
}

.cuti-unread-space {
    width: 8px;
    height: 8px;
    margin-top: 17px;
    border-radius: 50%;
}

.cuti-unread-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    min-width: 8px;
    min-height: 8px;
    margin: 8px 12px 0 0;
    padding: 0;
    flex: 0 0 8px;
    border-radius: 50%;
    background: var(--app-danger);
    line-height: 8px;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, .12);
    animation: app-pulse-danger-sm 1.2s infinite;
}

.cuti-notif-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--app-radius-lg);
    background: var(--app-info-soft);
    color: var(--app-info);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--app-fs-lg);
}

.cuti-notif-icon.reset-data {
    background: #fff4e8;
    color: #ea580c;
}

.cuti-notif-content {
    min-width: 0;
}

.cuti-notif-heading {
    margin: 0 0 5px;
    color: var(--app-gray-800);
    font-size: var(--app-fs-md);
    font-weight: var(--app-fw-bold);
    line-height: 1.35;
}

.cuti-notif-text {
    margin: 0;
    color: #526070;
    font-size: var(--app-fs-base);
    line-height: var(--app-lh-base);
}

.cuti-notif-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    color: var(--app-slate-500);
    font-size: var(--app-fs-sm);
    line-height: var(--app-lh-tight);
}

.cuti-notif-separator {
    color: var(--app-slate-300);
}

/* Badge status pengajuan — dipakai oleh cutiStatusBadge() di index.php */
.cuti-notif-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 22px;
    padding: 0 9px;
    border-radius: var(--app-radius-pill);
    font-size: var(--app-fs-xs);
    font-weight: var(--app-fw-bold);
    line-height: 22px;
    white-space: nowrap;
    letter-spacing: .2px;
}

.cuti-badge-primary   { background: #e0f2fe;                 color: #0284c7; }
.cuti-badge-info      { background: #dbeafe;                 color: #2563eb; }
.cuti-badge-warning   { background: var(--app-warning-soft); color: var(--app-warning-text); }
.cuti-badge-success   { background: #dcfce7;                 color: #15803d; }
.cuti-badge-danger    { background: var(--app-danger-soft);  color: var(--app-danger-text); }
.cuti-badge-secondary { background: var(--app-neutral-soft); color: var(--app-neutral-text); }

/* ---------- 3.4 Kosong & footer ---------- */
.cuti-notif-empty {
    padding: 34px 22px;
    text-align: center;
    color: var(--app-gray-500);
    background: var(--app-surface);
}

.cuti-notif-empty i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: #f3f7fb;
    color: var(--app-slate-400);
    font-size: 20px;
}

.cuti-notif-footer {
    display: flex;
    background: var(--app-surface);
    border-top: 1px solid #eef2f7;
    line-height: 1.5;
}

.pcoded-header .cuti-notif-footer a {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--app-space-2);
    min-height: 58px;
    padding: 14px 10px;
    color: var(--app-slate-700);
    font-size: var(--app-fs-base);
    font-weight: var(--app-fw-semibold);
    text-align: center;
    text-decoration: none;
}

.pcoded-header .cuti-notif-footer a:hover {
    background: var(--app-surface-hover);
    color: var(--app-info);
}

.cuti-notif-footer a + a {
    border-left: 1px solid #eef2f7;
}

/* ---------- 3.5 Mobile ---------- */
@media (max-width: 575px) {
    /* Datta Able mengatur lebar 95% + left/right 0 di breakpoint ini;
       panel digeser agar tidak terpotong tepi kanan layar. */
    .pcoded-header .cuti-bell-wrap .cuti-notif-dropdown {
        right: -72px;
    }

    .cuti-notif-header {
        padding: 17px 18px 15px;
    }

    .cuti-notif-row {
        grid-template-columns: 7px 38px minmax(0, 1fr);
        padding: 14px 18px;
        column-gap: 11px;
    }

    .cuti-notif-icon {
        width: 38px;
        height: 38px;
    }
}


/* ==========================================================================
   4. LOADER AJAX
   body.loading ditambahkan otomatis saat ada request AJAX (ajaxStart).
   ========================================================================== */
.modal2 {
    display: none;
    position: fixed;
    z-index: var(--app-z-loader);
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: rgba(255, 255, 255, .8) url("../../images/loading blue.gif") 50% 50% no-repeat;
}

body.loading {
    overflow: hidden;
}

body.loading .modal2 {
    display: block;
}


/* ==========================================================================
   5. KEYFRAMES
   ========================================================================== */
@keyframes app-pulse-danger {
    0%   { box-shadow: 0 0 0 0 rgba(239, 68, 68, .45); }
    70%  { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@keyframes app-pulse-danger-sm {
    0%   { box-shadow: 0 0 0 0 rgba(239, 68, 68, .35); }
    70%  { box-shadow: 0 0 0 7px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
