/* ==========================================================
   Kerja Pintar — Tabler customization
   ========================================================== */

/* Pulse badge — sidebar pending indicator */
@keyframes pulse-expand {
    0%   { transform: scale(1);   opacity: .8; }
    70%  { transform: scale(2.2); opacity: 0; }
    100% { transform: scale(2.2); opacity: 0; }
}
.pulse-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #f76707;
    animation: pulse-expand 1.4s ease-out infinite;
}
.pulse-dot {
    position: relative;
    z-index: 1;
    background: #f76707;
    color: #fff;
    border-radius: 50%;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

:root {
    --tblr-font-sans-serif: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

    /* Brand primary color: Tabler Blue */
    --tblr-primary: #4263eb;
    --tblr-primary-rgb: 66, 99, 235;
    --tblr-primary-fg: #ffffff;
    --tblr-primary-lt: #e8edfc;
    --tblr-link-color: #4263eb;
    --tblr-link-color-rgb: 66, 99, 235;
    --tblr-link-hover-color: #3957d8;
    --tblr-link-hover-color-rgb: 57, 87, 216;
}

/* Override Tabler primary button & related */
.btn-primary {
    --tblr-btn-bg: #4263eb;
    --tblr-btn-border-color: #4263eb;
    --tblr-btn-color: #ffffff;
    --tblr-btn-hover-bg: #3957d8;
    --tblr-btn-hover-border-color: #3957d8;
    --tblr-btn-active-bg: #2c47bc;
    --tblr-btn-active-border-color: #2c47bc;
    background-color: #4263eb !important;
    border-color: #4263eb !important;
    color: #fff !important;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #3957d8 !important;
    border-color: #3957d8 !important;
    color: #fff !important;
}

.btn-primary:active,
.btn-primary.active {
    background-color: #2c47bc !important;
    border-color: #2c47bc !important;
}

.btn-outline-primary {
    color: #4263eb !important;
    border-color: #4263eb !important;
}

.btn-outline-primary:hover {
    background-color: #4263eb !important;
    color: #fff !important;
}

/* Bootstrap pagination active (used by DataTables) */
.page-item.active .page-link,
.pagination .page-item.active .page-link {
    background-color: #4263eb !important;
    border-color: #4263eb !important;
    color: #fff !important;
}

.page-link {
    color: #4263eb;
}

.page-link:hover {
    color: #3957d8;
}

.page-link:focus {
    box-shadow: 0 0 0 0.15rem rgba(66, 99, 235, 0.18);
    color: #4263eb;
}

/* DataTables pagination active button (different selector) */
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: #4263eb !important;
    color: #fff !important;
    border-color: #4263eb !important;
}

/* Links */
a {
    color: #4263eb;
}

a:hover {
    color: #3957d8;
}

/* Text-primary utility */
.text-primary {
    color: #4263eb !important;
}

.bg-primary {
    background-color: #4263eb !important;
}

.border-primary {
    border-color: #4263eb !important;
}

body {
    font-family: var(--tblr-font-sans-serif);
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

/* =====================================================
   Sidebar: Midnight Blue + Glass theme
   ===================================================== */

.navbar-vertical {
    background: linear-gradient(180deg, #0a0e27 0%, #0d1235 100%) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.06) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: relative;
}

.navbar-vertical::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 0% 0%, rgba(66, 99, 235, 0.08), transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(99, 102, 241, 0.06), transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.navbar-vertical > * {
    position: relative;
    z-index: 1;
}

.navbar-vertical .navbar-brand {
    padding: 1.5rem 1.25rem;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    margin: 0;
}

.navbar-vertical .navbar-brand a {
    text-decoration: none;
}

.sidebar-logo {
    max-height: 44px;
    max-width: 80%;
    object-fit: contain;
    filter: brightness(1.05);
}

.sidebar-logo-fallback {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.15rem;
    color: #fff;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #4263eb, #6366f1);
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(66, 99, 235, 0.35);
}

.navbar-vertical .navbar-nav .nav-category {
    text-transform: uppercase;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: rgba(148, 163, 184, 0.5);
    padding: 1.25rem 1.5rem 0.5rem;
}

.navbar-vertical .navbar-nav .nav-link {
    padding: 0.6rem 0.85rem;
    border-radius: 8px;
    margin: 2px 10px;
    color: #cbd5e1;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.18s ease;
    position: relative;
}

.navbar-vertical .navbar-nav .nav-link-icon {
    color: #cbd5e1;
    transition: color 0.18s ease;
}

.navbar-vertical .navbar-nav .nav-link:hover {
    background: rgba(66, 99, 235, 0.08);
    color: #fff;
}

.navbar-vertical .navbar-nav .nav-link:hover .nav-link-icon {
    color: #4263eb;
}

/* Active state: same look as hover (subtle cyan tint, no glow) */
.navbar-vertical .navbar-nav .nav-item.active > .nav-link {
    background: rgba(66, 99, 235, 0.08);
    color: #fff;
    font-weight: 600;
}

.navbar-vertical .navbar-nav .nav-item.active > .nav-link .nav-link-icon {
    color: #4263eb;
}

/* Submenu — match main menu width, indented right */
.navbar-vertical .nav-dropdown-menu {
    padding-left: 1.25rem;
    padding-top: 0.15rem;
    padding-bottom: 0.25rem;
    list-style: none;
    flex-direction: column;
    width: 100%;
    border-left: 0 !important;
}

/* Nuke borders inside the sidebar — covers regular elements + pseudo-elements.
   EXCEPT: chevron icons (use border to draw nothing) and brand divider. */
.navbar-vertical .navbar-nav,
.navbar-vertical .navbar-nav *,
.navbar-vertical .navbar-nav *::before,
.navbar-vertical .navbar-nav *::after,
.navbar-vertical .navbar-collapse,
.navbar-vertical .navbar-collapse *,
.navbar-vertical .navbar-collapse *::before,
.navbar-vertical .navbar-collapse *::after {
    border-left: 0 none !important;
    border-right: 0 none !important;
    border-inline-start: 0 none !important;
    border-inline-end: 0 none !important;
    border-left-width: 0 !important;
    border-right-width: 0 !important;
    border-inline-start-width: 0 !important;
    border-inline-end-width: 0 !important;
}

/* Exempt: dot indicator on submenu nav-link::before (we want that visible) */
.navbar-vertical .nav-dropdown-menu .nav-link::before {
    border: 0 !important;
}

/* Exempt: active indicator that Tabler may add as ::before on .nav-link.active — make it none */
.navbar-vertical .nav-link::before,
.navbar-vertical .nav-link.active::before,
.navbar-vertical .nav-item.active > .nav-link::before {
    background-image: none !important;
}

/* Use a clean chevron icon for dropdown caret instead of CSS triangle */
.navbar-vertical .dropdown-toggle::after {
    display: none !important;
}

.navbar-vertical .dropdown-toggle .nav-link-title {
    flex: 1;
}

.navbar-vertical .dropdown-toggle::before {
    display: none !important;
}

/* Inject chevron via Tabler icon font */
.navbar-vertical .nav-link.dropdown-toggle .nav-chevron {
    margin-left: auto;
    font-size: 0.95rem;
    transition: transform 0.2s ease;
    opacity: 0.7;
}

.navbar-vertical .nav-link.dropdown-toggle[aria-expanded="true"] .nav-chevron {
    transform: rotate(180deg);
}

.navbar-vertical .nav-dropdown-menu .nav-item {
    width: auto;
}

.navbar-vertical .nav-dropdown-menu .nav-link {
    display: flex;
    align-items: center;
    padding: 0.3rem 0.85rem;
    font-size: 0.86rem;
    font-weight: 400;
    color: #b6c2d1;
    margin: 0 10px 0 0;
    border-radius: 8px;
    transition: all 0.18s ease;
}

.navbar-vertical .nav-dropdown-menu .nav-link::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.4;
    margin-right: 0.7rem;
    flex-shrink: 0;
}

.navbar-vertical .nav-dropdown-menu .nav-link:hover {
    background: rgba(66, 99, 235, 0.08);
    color: #fff;
}

.navbar-vertical .nav-dropdown-menu .nav-link:hover::before {
    opacity: 1;
    color: #4263eb;
    background: #4263eb;
}

.navbar-vertical .nav-dropdown-menu .nav-item.active > .nav-link {
    background: rgba(66, 99, 235, 0.08);
    color: #fff;
    font-weight: 500;
}

.navbar-vertical .nav-dropdown-menu .nav-item.active > .nav-link::before {
    background: #4263eb;
    opacity: 1;
}

/* Search input in sidebar */
.navbar-vertical .input-icon .form-control {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #cbd5e1 !important;
    border-radius: 8px;
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.navbar-vertical .input-icon .form-control::placeholder {
    color: rgba(148, 163, 184, 0.6);
}

.navbar-vertical .input-icon .form-control:focus {
    background: rgba(66, 99, 235, 0.06) !important;
    border-color: rgba(66, 99, 235, 0.4) !important;
    box-shadow: 0 0 0 3px rgba(66, 99, 235, 0.12) !important;
    color: #fff !important;
}

.navbar-vertical .input-icon-addon {
    color: rgba(148, 163, 184, 0.6);
}

/* Sidebar scrollbar — hidden but still scrollable, and own scroll context */
.navbar-vertical {
    max-height: 100vh;
    overflow-y: auto;
    overscroll-behavior: contain;    /* don't bubble scroll to page */
}
.navbar-vertical .navbar-collapse {
    max-height: calc(100vh - 80px);  /* brand area ~80px */
    overflow-y: auto;
    overscroll-behavior: contain;
}
.navbar-vertical,
.navbar-vertical .navbar-collapse,
.navbar-vertical .collapse {
    scrollbar-width: none;          /* Firefox */
    -ms-overflow-style: none;        /* IE/Edge legacy */
}

.navbar-vertical::-webkit-scrollbar,
.navbar-vertical .navbar-collapse::-webkit-scrollbar,
.navbar-vertical .collapse::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;                   /* Chrome/Safari */
}

/* =====================================================
   Sidebar mini mode (icon-only) with hover-expand
   ===================================================== */

:root {
    --kp-sidebar-width: 250px;
    --kp-sidebar-mini-width: 72px;
}

.navbar-vertical {
    width: var(--kp-sidebar-width);
    transition: width 0.22s ease;
}

@media (min-width: 992px) {
    body.sidebar-collapsed .navbar-vertical {
        width: var(--kp-sidebar-mini-width);
        overflow: visible;
    }

    body.sidebar-collapsed .page-wrapper {
        margin-inline-start: var(--kp-sidebar-mini-width) !important;
        transition: margin-inline-start 0.22s ease;
    }

    /* Hide labels, chevrons, submenu — but transform category & search into icon variants */
    body.sidebar-collapsed .navbar-vertical .nav-link-title,
    body.sidebar-collapsed .navbar-vertical .nav-chevron,
    body.sidebar-collapsed .navbar-vertical [id^="submenu-"] {
        display: none !important;
    }

    /* Category header → bullet dot */
    body.sidebar-collapsed .navbar-vertical .nav-category {
        font-size: 0 !important;
        padding: 0.5rem 0 0.2rem !important;
        margin: 0 !important;
        text-align: center;
        color: rgba(148, 163, 184, 0.4);
    }

    body.sidebar-collapsed .navbar-vertical .nav-category::before {
        content: "•";
        font-size: 1.4rem;
        line-height: 0.5;
        display: inline-block;
    }

    /* Search input → icon button */
    body.sidebar-collapsed .navbar-vertical .px-2.mt-2.mb-3 {
        display: flex !important;
        justify-content: center;
        padding: 2px 0 !important;
        margin: 0 !important;
    }

    body.sidebar-collapsed .navbar-vertical .input-icon {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        background: rgba(255, 255, 255, 0.04);
        border-radius: 8px;
        cursor: pointer;
        transition: background 0.18s ease;
    }

    body.sidebar-collapsed .navbar-vertical .input-icon:hover {
        background: rgba(66, 99, 235, 0.12);
    }

    body.sidebar-collapsed .navbar-vertical .input-icon .form-control {
        display: none !important;
    }

    body.sidebar-collapsed .navbar-vertical .input-icon-addon {
        position: static !important;
        padding: 0 !important;
        font-size: 1.15rem;
        color: rgba(203, 213, 225, 0.85);
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
    }

    /* On hover-expand: revert search/category to normal */
    body.sidebar-collapsed .navbar-vertical:hover .nav-category {
        font-size: 0.68rem !important;
        padding: 1.25rem 1.5rem 0.5rem !important;
        text-align: left;
    }

    body.sidebar-collapsed .navbar-vertical:hover .nav-category::before {
        content: none;
    }

    body.sidebar-collapsed .navbar-vertical:hover .px-2.mt-2.mb-3 {
        padding: 0.5rem 0.5rem 0.75rem !important;
        margin: 0 !important;
    }

    body.sidebar-collapsed .navbar-vertical:hover .input-icon {
        width: auto;
        height: auto;
        background: transparent;
        display: block !important;
        cursor: text;
    }

    body.sidebar-collapsed .navbar-vertical:hover .input-icon .form-control {
        display: block !important;
    }

    body.sidebar-collapsed .navbar-vertical:hover .input-icon-addon {
        position: absolute !important;
        width: auto;
        height: auto;
    }

    body.sidebar-collapsed .navbar-vertical .navbar-nav .nav-link {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        margin: 2px auto;
        height: 44px;
        width: 44px;
    }

    body.sidebar-collapsed .navbar-vertical .navbar-nav .nav-link-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin: 0;
        padding: 0;
        line-height: 1;
        font-size: 1rem;
        width: 100%;
        height: 100%;
    }

    body.sidebar-collapsed .navbar-vertical .navbar-nav .nav-link-icon i {
        line-height: 1;
        vertical-align: middle;
    }

    /* Brand: smaller logo when collapsed */
    body.sidebar-collapsed .navbar-vertical .navbar-brand {
        padding: 1rem 0.5rem;
        min-height: 64px;
    }

    body.sidebar-collapsed .navbar-vertical .sidebar-logo,
    body.sidebar-collapsed .navbar-vertical .sidebar-logo-fallback {
        max-height: 36px;
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }

    /* Hover-expand: when collapsed and user hovers, expand back temporarily */
    body.sidebar-collapsed .navbar-vertical:hover {
        width: var(--kp-sidebar-width);
        box-shadow: 8px 0 30px rgba(0, 0, 0, 0.35);
        z-index: 1050;
    }

    body.sidebar-collapsed .navbar-vertical:hover .nav-link-title,
    body.sidebar-collapsed .navbar-vertical:hover .nav-chevron {
        display: inline !important;
    }

    /* Restore submenu visibility on hover (only the active/expanded one) */
    body.sidebar-collapsed .navbar-vertical:hover [id^="submenu-"].show {
        display: block !important;
    }

    body.sidebar-collapsed .navbar-vertical:hover .navbar-nav .nav-link {
        justify-content: flex-start;
        padding: 0.6rem 0.85rem;
        margin: 2px 10px;
        height: auto;
        width: auto;
    }

    body.sidebar-collapsed .navbar-vertical:hover .navbar-nav .nav-link-icon {
        font-size: 1rem;
        width: auto;
        height: auto;
        margin-right: 0.7rem;
    }

    body.sidebar-collapsed .navbar-vertical:hover .navbar-brand {
        padding: 1.5rem 1.25rem;
        min-height: 80px;
    }

    body.sidebar-collapsed .navbar-vertical:hover .sidebar-logo {
        max-height: 44px;
        width: auto;
        height: auto;
    }

    body.sidebar-collapsed .navbar-vertical:hover .sidebar-logo-fallback {
        width: 48px;
        height: 48px;
        font-size: 1.15rem;
    }
}

/* Mobile: sidebar HIDDEN by default; toggle slides it in as off-canvas drawer */
@media (max-width: 991.98px) {
    .navbar-vertical {
        position: fixed !important;
        top: 0;
        bottom: 0;
        left: 0;
        width: 260px !important;
        max-width: 80vw;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 1050;
        overflow-y: auto;
    }

    /* Show sidebar when toggled (note: on mobile we INVERT the collapsed flag —
       default = hidden, toggling adds .sidebar-mobile-show) */
    body.sidebar-mobile-show .navbar-vertical {
        transform: translateX(0);
        box-shadow: 8px 0 30px rgba(0, 0, 0, 0.35);
    }

    /* Backdrop when sidebar is open on mobile */
    body.sidebar-mobile-show::after {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1049;
    }

    body.sidebar-mobile-show {
        overflow: hidden;
    }

    /* Page wrapper takes full width on mobile (no sidebar offset) */
    .page-wrapper {
        margin-left: 0 !important;
        width: 100%;
    }

    /* Force-show the menu content inside sidebar on mobile
       (Bootstrap's .collapse:not(.show) hides it on < lg viewports) */
    .navbar-vertical .collapse.navbar-collapse,
    .navbar-vertical .collapse.navbar-collapse:not(.show) {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        flex-grow: 1;
        align-items: stretch !important;
        visibility: visible !important;
    }
    .navbar-vertical .collapse.navbar-collapse > * {
        width: 100%;
    }

    /* Force vertical stacking so brand + menu are adjacent (no flex grow gap) */
    .navbar-vertical .container-fluid {
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 0 !important;
    }

    /* Hide the internal navbar-toggler (used by Bootstrap to expand inner collapse — not needed since we force-show) */
    .navbar-vertical > .container-fluid > .navbar-toggler {
        display: none !important;
    }

    /* Hide brand area on mobile — menu starts from top */
    .navbar-vertical .navbar-brand {
        display: none !important;
    }
}

.sidebar-toggle-btn {
    background: transparent;
    border: 0;
    color: var(--tblr-body-color);
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 0.5rem;
    transition: background 0.15s ease;
}

.sidebar-toggle-btn:hover {
    background: var(--tblr-bg-surface-secondary, #f1f5f9);
}

.sidebar-toggle-btn i {
    font-size: 1.25rem;
    vertical-align: middle;
}

/* Toggle icon swap: menu (☰) when sidebar hidden/expanded, X when collapsed/showing-on-mobile */
.sidebar-toggle-btn .toggle-icon-close { display: none; }
body.sidebar-collapsed .sidebar-toggle-btn .toggle-icon-open { display: none; }
body.sidebar-collapsed .sidebar-toggle-btn .toggle-icon-close { display: inline-block; }

/* Mobile: when sidebar is shown via off-canvas, toggle becomes X */
@media (max-width: 991.98px) {
    body.sidebar-mobile-show .sidebar-toggle-btn .toggle-icon-open { display: none; }
    body.sidebar-mobile-show .sidebar-toggle-btn .toggle-icon-close { display: inline-block; }
    body:not(.sidebar-mobile-show) .sidebar-toggle-btn .toggle-icon-open { display: inline-block; }
    body:not(.sidebar-mobile-show) .sidebar-toggle-btn .toggle-icon-close { display: none; }
}

/* Sticky navbar — stays at top when scrolling */
.page-wrapper > .navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: #fff;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

/* Profile dropdown must appear ABOVE sticky navbar, below the toggle */
.navbar .nav-item.dropdown { position: relative; }
.navbar .dropdown-menu {
    z-index: 1040 !important;
    min-width: 12rem;
}
.navbar .dropdown-menu.show {
    display: block !important;
    position: absolute !important;
    top: calc(100% + 0.5rem) !important;
    right: 0 !important;
    left: auto !important;
    bottom: auto !important;
    margin: 0 !important;
}

/* Navbar container padding — minimal but keep content readable */
.page-wrapper > .navbar > .container-xl,
.page-wrapper > .navbar > .container-fluid {
    padding-left: 0.75rem;
    padding-right: 1rem;
    max-width: 100%;
}

/* Sidebar shouldn't have border-right (causes apparent gap) */
.navbar-vertical {
    border-right: 0 !important;
}

.navbar-vertical.navbar-expand-lg .navbar-collapse .navbar-nav {
    margin-bottom: 40px !important;
}

/* =====================================================
   Page header block (title + breadcrumb)
   ===================================================== */

.page-header-block {
    margin: 0 0 1rem !important;
}

.page-body {
    padding-top: 1rem !important;
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
    margin-top: 0 !important;
}

.page-body > .container-xl,
.page-body > .container-fluid {
    padding-top: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-top: 0 !important;
}

.page-body .page-header-block:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.page-title-kp {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--tblr-body-color);
    margin: 0 0 0.4rem;
    line-height: 1.2;
}

.page-header-block .breadcrumb {
    font-size: 0.82rem;
    background: transparent;
    padding: 0;
    margin: 0;
}

.page-header-block .breadcrumb-item,
.page-header-block .breadcrumb-item a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.15s;
}

.page-header-block .breadcrumb-item + .breadcrumb-item::before {
    color: #cbd5e1;
}

.page-header-block .breadcrumb-item a:hover {
    color: #4263eb;
}

.page-header-block .breadcrumb-item.active {
    color: #64748b;
    font-weight: 500;
}

.page-header-block .breadcrumb-item i.ti {
    font-size: 0.95rem;
    vertical-align: -2px;
}

/* Slightly darker page body bg so white cards stand out */
.page-body,
body {
    background-color: #eef1f6;
}

.page-wrapper {
    background-color: #eef1f6;
}

/* =====================================================
   Input focus — clean cyan border, no chunky shadow ring
   ===================================================== */

.form-control:focus,
.form-select:focus,
.input-group-flat:focus-within {
    border-color: #4263eb !important;
    box-shadow: 0 0 0 1px #4263eb !important;
    outline: none !important;
}

/* Inside input-group-flat, the input shouldn't have its own focus border/shadow
   — the wrapper handles the focus state to keep input + addon visually merged */
.input-group-flat .form-control:focus,
.input-group .form-control:focus {
    border-color: transparent !important;
    box-shadow: none !important;
}

.input-group-flat:focus-within .input-group-text {
    border-color: #4263eb !important;
}

/* Subtle tint inside input on focus so the change reads */
.form-control:focus,
.form-select:focus {
    background-color: #f6fcfd;
}

/* Input-group flat: highlight the whole wrapper on focus */
.input-group-flat:focus-within {
    border-color: #4263eb !important;
}

.input-group-flat:focus-within .form-control,
.input-group-flat:focus-within .input-group-text {
    background-color: #f6fcfd;
}

/* Select2 focus parity */
.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection {
    border-color: #4263eb !important;
    box-shadow: none !important;
}

/* Checkbox / radio focus */
.form-check-input:focus {
    border-color: #4263eb !important;
    box-shadow: none !important;
}

/* Catch-all for any other focusable element that still has the chunky Bootstrap ring
   (datatables search, raw inputs, etc.) */
input:focus,
textarea:focus,
select:focus,
button:focus,
.btn:focus,
.btn:focus-visible {
    box-shadow: none !important;
    outline: none !important;
}

input:focus:not([type=checkbox]):not([type=radio]),
textarea:focus,
select:focus {
    border-color: #4263eb !important;
}

/* DataTables length & filter inputs */
.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
    border-color: #4263eb !important;
    box-shadow: none !important;
}

/* Pagination buttons hover/active — cyan tint */
.pagination .page-item.active .page-link {
    background-color: #4263eb !important;
    border-color: #4263eb !important;
}

.pagination .page-link:focus {
    box-shadow: none !important;
    color: #4263eb !important;
}

/* Hide page (browser) scrollbar but keep scrollable */
html {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

body {
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* Avatar fully round (override Tabler default 4px radius) */
.avatar.avatar-rounded {
    border-radius: 50% !important;
}

/* Page header utility */
.page-header {
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.page-pretitle {
    text-transform: uppercase;
    color: var(--tblr-secondary);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
}

/* =====================================================
   Card header auto-injected by JS (kp-card-title class)
   ===================================================== */

.kp-card-title-bar {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--tblr-border-color);
    margin: -1rem -1rem 1rem;
    background: #fcfcfd;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.section-body > .card.p-3 > .kp-card-title-bar {
    margin: -1rem -1rem 1rem;
}

.kp-card-title-bar h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: var(--tblr-body-color);
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
}

/* Accent bar before card title */
.kp-card-title-bar h3::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: linear-gradient(180deg, #4263eb, #6366f1);
    border-radius: 2px;
    flex-shrink: 0;
}

.kp-card-title-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.kp-card-title-actions:empty {
    display: none;
}

/* DataTables — tighter rows + no zebra + outer border */
.dataTables_wrapper .table-responsive {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

table.dataTable {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    min-width: 600px;
}

/* If the table is NOT inside a .table-responsive wrapper (fallback) */
.dataTables_wrapper > table.dataTable {
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px;
}

/* Custom scrollbar inside table-responsive */
.dataTables_wrapper .table-responsive::-webkit-scrollbar {
    height: 8px;
}

.dataTables_wrapper .table-responsive::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.dataTables_wrapper .table-responsive::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.dataTables_wrapper .table-responsive::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Round corners on first/last header & last row cells */
table.dataTable thead th:first-child {
    border-top-left-radius: 8px;
}

table.dataTable thead th:last-child {
    border-top-right-radius: 8px;
}

table.dataTable tbody tr:last-child td:first-child {
    border-bottom-left-radius: 8px;
}

table.dataTable tbody tr:last-child td:last-child {
    border-bottom-right-radius: 8px;
}



/* Row padding */
table.dataTable tbody td {
    padding: 0.6rem 0.75rem !important;
    font-size: 0.88rem;
    line-height: 1.4;
}

table.dataTable thead th {
    padding: 1rem 0.75rem !important;
}

/* Vertical column borders */
table.dataTable thead th:not(:last-child),
table.dataTable tbody td:not(:last-child) {
    border-right: 1px solid #e9ecef !important;
}

/* Column divider in header */
table.dataTable thead th:not(:last-child) {
    border-right: 1px solid #dee2e6 !important;
}

/* Action buttons inside rows */
table.dataTable tbody td .btn {
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
    line-height: 1.2;
    min-height: 0;
}

/* Tabler square icon button — override DataTable's td .btn padding too */
.btn.btn-icon,
table.dataTable tbody td .btn.btn-icon,
.btn-list .btn.btn-icon {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 2rem !important;
    height: 2rem !important;
    min-width: 2rem !important;
    min-height: 2rem !important;
    padding: 0 !important;
    line-height: 1 !important;
    font-size: 1rem !important;
    aspect-ratio: 1 / 1;
    flex: 0 0 auto;
}

.btn-icon > i,
.btn-icon > .ti,
.btn-icon > svg {
    margin: 0 !important;
    font-size: 1rem;
}

/* .btn-list helper — flex row of action buttons with small gap */
.btn-list {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.btn-list.flex-nowrap {
    flex-wrap: nowrap;
}

table.dataTable tbody td {
    vertical-align: middle;
}

/* Tombol aksi icon-only — persegi, ukuran konsisten */
.btn-icon-sq {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0 !important;
    flex-shrink: 0;
}

/* Remove alternating row colors */
table.dataTable.table-striped > tbody > tr:nth-of-type(odd) > *,
table.dataTable.table-striped tbody tr.odd > * {
    background: transparent !important;
    --tblr-table-accent-bg: transparent !important;
    --tblr-table-striped-bg: transparent !important;
    box-shadow: none !important;
}

/* Subtle row divider only */
table.dataTable tbody td {
    border-bottom: 1px solid #f1f3f6;
    border-top: 0;
}

table.dataTable thead th,
.table-responsive > table.table thead th,
.card > .table-responsive > table.table thead th,
.table-outer > table.table thead th,
.table-outer .table-sticky-wrap > table.table thead th {
    background: #ededed !important;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #000000 !important;
    font-weight: 600;
    border-bottom: 0 !important;
    text-align: center;
}

/* Sort feature hidden — arrows + cursor disabled */
table.dataTable thead .sorting::before,
table.dataTable thead .sorting::after,
table.dataTable thead .sorting_asc::before,
table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::before,
table.dataTable thead .sorting_desc::after,
table.dataTable thead .sorting_asc_disabled::before,
table.dataTable thead .sorting_asc_disabled::after,
table.dataTable thead .sorting_desc_disabled::before,
table.dataTable thead .sorting_desc_disabled::after {
    display: none !important;
}

table.dataTable thead th.sorting,
table.dataTable thead th.sorting_asc,
table.dataTable thead th.sorting_desc {
    cursor: default !important;
    padding-right: 0.75rem !important;
}

table.dataTable tbody td {
    vertical-align: middle;
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border-radius: 6px;
    padding: 4px 10px;
    border: 1px solid var(--tblr-border-color);
}

.dataTables_wrapper .dataTables_length select {
    min-width: 70px;
    padding: 4px 28px 4px 12px !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 4px !important;
    margin: 0 2px;
}

/* =====================================================
   DataTables loading — modern spinner + backdrop blur
   ===================================================== */

.dataTables_wrapper {
    position: relative;
}

/* Spacing for the length + filter controls row + info + paginate row */
.dataTables_wrapper > .row:first-child {
    padding: 0.25rem 0.25rem 1rem;
    align-items: center;
}

.dataTables_wrapper > .row:last-child {
    padding: 0.85rem 0.25rem 0.25rem;
    align-items: center;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    padding: 0 0.25rem;
}

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    color: #475569;
    font-weight: 500;
    font-size: 0.88rem;
}

.dataTables_wrapper .dataTables_filter input {
    margin-left: 0 !important;
}

.dataTables_wrapper .dataTables_processing {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    box-shadow: none !important;
    color: transparent !important;
    font-size: 0 !important;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    transform: none !important;
    border-radius: 8px;
}

/* Hide DataTables' default content (3 bouncing dots etc.) */
.dataTables_wrapper .dataTables_processing > * {
    display: none !important;
}

.dataTables_wrapper .dataTables_processing::before {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #4263eb;
    border-right-color: #6366f1;
    border-radius: 50%;
    animation: kp-spin 0.75s linear infinite;
}

.dataTables_wrapper .dataTables_processing::after {
    content: 'Memuat data...';
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    animation: kp-pulse 1.4s ease-in-out infinite;
}

@keyframes kp-spin {
    to { transform: rotate(360deg); }
}

@keyframes kp-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Level bar in pekerjaan edit modal — thin solid line */
.kp-level-bar {
    height: 4px;
    border-radius: 2px;
    margin-bottom: 0.75rem;
}

/* Select2 + BS5 sizing fix */
.select2-container--bootstrap-5 .select2-selection {
    min-height: calc(2.25rem + 2px);
    font-size: 0.88rem;
}

.select2-container--bootstrap-5 .select2-selection__choice,
.select2-container--bootstrap-5 .select2-selection__choice__display,
.select2-container--bootstrap-5 .select2-selection__rendered,
.select2-container--bootstrap-5 .select2-selection__placeholder,
.select2-container--bootstrap-5 .select2-search__field,
.select2-container--bootstrap-5 .select2-results__option {
    font-size: 0.88rem !important;
}

/* Cards — softer shadow */
.card {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Buttons rounded */
.btn {
    font-weight: 500;
}

/* Auto-spacing between icon and text inside any button (when both present, icon first) */
.btn > i + *,
.btn > svg + *,
.btn > .ti + * {
    margin-inline-start: 0.4rem;
}

/* Also when icon has explicit no-margin class but text follows */
.btn i:first-child:not(:only-child):not([class*="me-"]):not([class*="ms-"]):not([class*="mx-"]) {
    margin-right: 0.4rem;
}

/* Avatar fallback (initial) */
.avatar.bg-primary,
.avatar.bg-secondary,
.avatar.bg-success,
.avatar.bg-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Quill editor border align */
.ql-toolbar.ql-snow,
.ql-container.ql-snow {
    border-color: var(--tblr-border-color);
}

.ql-container.ql-snow {
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}

/* Toastr position adjustments */
#toast-container > div {
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Print friendly */
@media print {
    .navbar-vertical, .navbar, .footer, .d-print-none {
        display: none !important;
    }
}

/* =====================================================
   Stisla legacy class compatibility shim
   Maps old Stisla structure to Tabler-like look
   ===================================================== */

.main-content {
    padding: 0;
}

.section {
    margin: 0 0 1.5rem;
}

.section-header {
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.section-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--tblr-body-color);
    margin: 0;
    flex: 1;
}

.section-header .breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 0.85rem;
    color: var(--tblr-secondary);
}

.section-body {
    /* Tabler-style card spacing */
}

/* Old card.p-3 → Tabler card with body padding */
.section-body > .card {
    border: 1px solid var(--tblr-border-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    border-radius: 8px;
}

/* Card header from Stisla */
.section-body .card .card-header {
    background: #fff;
    border-bottom: 1px solid var(--tblr-border-color);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

/* Stisla's "alert-icon" pattern */
.alert .fas, .alert .far, .alert i {
    margin-right: 0.4rem;
}

/* Improve text inputs across the board */
.form-control, .form-select {
    font-size: 0.88rem;
}

/* Gap between label and input — match input font-size so they look consistent */
.form-label,
.mb-3 > label,
.modal-body label,
.form-group > label {
    display: inline-block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    color: #475569;
    font-size: 0.88rem;
}

.modal-content {
    border-radius: 8px;
    border: 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid var(--tblr-border-color);
    padding: 1rem 1.25rem;
}

.modal-body { padding: 1.25rem; }

.modal-footer {
    border-top: 1px solid var(--tblr-border-color);
    padding: 0.75rem 1.25rem;
    background: #fafbfc;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Buttons in tables — make them small + tight */
table .btn {
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
}

/* DataTables: improve looks */
table.dataTable.no-footer {
    border-bottom: 1px solid var(--tblr-border-color);
}

.dataTables_info {
    color: var(--tblr-secondary);
    font-size: 0.85rem;
    padding-top: 0.75rem;
}

/* Inputs in input-group flat */
.input-group-flat {
    border: 1px solid var(--tblr-border-color);
    border-radius: 6px;
}

.input-group-flat .form-control {
    border: 0;
    box-shadow: none;
}

.input-group-flat .input-group-text {
    border: 0;
    background: transparent;
}

/* Auth pages background */
.page-center {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
}

/* Spinner sizing fix in alerts */
.alert .spinner-border-sm {
    width: 1rem;
    height: 1rem;
    vertical-align: text-bottom;
    margin-right: 0.5rem;
}

/* ===== Toastr — Tabler-styled override ===== */
#toast-container > div {
    opacity: 1;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.18), 0 4px 10px -2px rgba(15, 23, 42, 0.08);
    border-radius: 8px;
    padding: 0.85rem 1rem 0.85rem 3rem;
    background-image: none !important;
    color: #fff;
    font-size: 0.875rem;
    line-height: 1.45;
    min-width: 280px;
    max-width: 360px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
}
#toast-container > div:hover {
    box-shadow: 0 14px 30px -6px rgba(15, 23, 42, 0.25);
    opacity: 1;
}
#toast-container > div::before {
    font-family: "tabler-icons";
    font-size: 1.25rem;
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    line-height: 1;
}
#toast-container > .toast-success,
#toast-container > .toast-error,
#toast-container > .toast-info,
#toast-container > .toast-warning { background-image: none !important; }
#toast-container > .toast-success     { background-color: #2fb344; }
#toast-container > .toast-success::before { content: "\ea5e"; } /* ti-check */
#toast-container > .toast-error       { background-color: #d63939; }
#toast-container > .toast-error::before   { content: "\eb55"; } /* ti-x */
#toast-container > .toast-info        { background-color: #4263eb; }
#toast-container > .toast-info::before    { content: "\eac5"; } /* ti-info-circle */
#toast-container > .toast-warning     { background-color: #f76707; }
#toast-container > .toast-warning::before { content: "\ea06"; } /* ti-alert-triangle */

/* Modal backdrop blur */
.modal-backdrop {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    background-color: rgba(0, 0, 0, 0.35) !important;
}
.modal-backdrop.show { opacity: 1 !important; }

.toast-title { font-weight: 600; margin-bottom: 0.15rem; }
.toast-message { color: rgba(255, 255, 255, 0.95); word-wrap: break-word; }
.toast-close-button {
    color: #fff;
    opacity: 0.85;
    text-shadow: none;
    font-weight: 400;
    font-size: 1.1rem;
    right: 0.4rem;
    top: 0.2rem;
}
.toast-close-button:hover, .toast-close-button:focus { opacity: 1; color: #fff; }
.toast-progress { background-color: rgba(255, 255, 255, 0.45); opacity: 0.6; height: 3px; }

/* =====================================================
   table-bordered border color — override Bootstrap/Tabler default yang terlalu gelap
   ===================================================== */

.table-bordered > :not(caption) > * > * {
    border-color: #e9ecef !important;
}
.table-bordered > :not(caption) > * {
    border-color: #e9ecef !important;
}
.dataTables_wrapper .table-bordered {
    border-color: #e9ecef !important;
}

/* =====================================================
   table-sm row height & cell padding override
   Bootstrap's default table-sm is too tight (0.25rem).
   This makes it consistent across all pages.
   ===================================================== */

.table-sm > :not(caption) > * > * {
    padding: 0.6rem 0.75rem !important;
}

.table-sm > thead > * > * {
    padding: 0.55rem 0.75rem !important;
}

/* ===== Push footer to bottom of viewport ===== */
html, body { height: 100%; }
body { display: flex; flex-direction: column; min-height: 100vh; }
.page { min-height: 100vh; display: flex; flex: 1 1 auto; }
.page-wrapper { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 100vh; }
.page-wrapper > .page-body { flex: 1 0 auto; padding-bottom: 1.5rem; }
.page-wrapper > .footer { margin-top: auto; padding: 1rem 0; }
