﻿body {
    font-family: "Segoe UI", sans-serif;
    background-color: #f4f6f9;
    overflow-x: hidden;
    font-size: 12px;
}

html,
body {
    height: 100%;
    margin: 0;
}

body {
    display: flex;
    padding-right: 0px !important;
    overflow:auto !important;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 250px;
    background: linear-gradient(180deg, #0b2554 0%, #123875 100%);
    color: #fff;
    transition: all 0.35s ease;
    z-index: 1040;
    overflow-y: auto;
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

    .sidebar.collapsed {
        width: 80px;
    }

@media (max-width: 991.98px) {
    .sidebar {
        left: -250px;
    }

        .sidebar.show {
            left: 0;
        }

    .main-content {
        margin-left: 0 !important;
    }
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.sidebar-header {
    position: sticky;
    top: 0;
    background: #0b2554;
    display: flex;
    align-items: center;
    padding: 0.34rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1050;
}

    .sidebar-header img {
        height: 35px;
        margin-right: 10px;
        transition: all 0.3s ease;
    }

    .sidebar-header span {
        font-weight: 600;
        font-size: 1rem;
        white-space: nowrap;
        transition: opacity 0.3s ease;
    }

.sidebar.collapsed .sidebar-header img {
    margin: auto;
}

.sidebar.collapsed .sidebar-header span {
    opacity: 0;
}

.nav-link {
    color: #cfd8dc;
    padding: 0.6rem .5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

    .nav-link:hover,
    .nav-link.active {
        background-color: rgba(255, 255, 255, 0.35);
        color: #fff;
    }

    .nav-link i {
        margin-right: 8px;
        width: 10px;
        text-align: center;
    }

.sidebar.collapsed .nav-link span {
    display: none;
}

.sidebar.collapsed .nav-link i {
    margin: 0;
}

.collapse .nav-link {
    padding-left: .5rem;
}

.sidebar.collapsed .nav-item .bi-chevron-down {
    display: none !important;
}

button#toggleSidebar {
    color: white;
    font-weight: bold;
    min-width: 0 !important;
    padding: 0;
}

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    background-color: #0b2554;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1020;
}

    .navbar .navbar-brand {
        color: #fff;
        font-weight: 600;
        font-size: .7rem;
        letter-spacing: 0.3px;
    }

    .navbar .user-info {
        color: #fff;
        display: block;
        align-items: center;
        gap: 10px;
        position: relative;
        cursor: pointer;
    }

        .navbar .user-info i {
            font-size: 0.9rem;
            cursor: pointer;
            transition: color 0.2s, transform 0.2s;
        }

            .navbar .user-info i:hover {
                color: #ffc107;
                transform: scale(1.15);
            }

    .navbar > .container-fluid {
        justify-content: start;
    }
/* Dropdown menu styling */
.dropdown-menu {
    font-size: 14px;
    border-radius: 8px;
    padding: .3rem 0;
}

.dropdown-item i {
    margin-right: 6px;
}

/* Main Content */
.main-content {
    margin-left: 250px;
    width: -webkit-fill-available;
    transition: all 0.35s ease;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

    /* Konten utama agar mendorong footer ke bawah */
    .main-content > .container-fluid {
        flex: 1 0 auto;
    }

    .main-content.collapsed {
        margin-left: 80px;
    }

h4.section-title,
h5.section-title,
h6.section-title {
    border-left: 4px solid #0b2554;
    padding-left: 10px;
    font-weight: 600;
}

/* Card */
.card {
    border: none;
    border-radius: 0.4rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    /*    transition: transform 0.25s ease, box-shadow 0.25s ease;*/
    transition: none !important;
}

    .card:hover {
        /*        transform: translateY(-4px);*/
        transform: none !important;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
    }

.card-fixed-hover {
    border-top: 4px solid #102C57;
    transform: none !important;
    overflow: hidden;
}

/* Fullscreen Card */
.fullscreen-card {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1055;
    background: #fff !important;
    overflow-y: auto !important;
    border-radius: 0 !important;
}

    .fullscreen-card .card-body {
        min-height: calc(100vh - 60px) !important;
    }

.text-primary {
    color: #102C57 !important;
}

.card.border-primary {
    border-color: #102C57 !important;
    border-top: 2px solid #102C57;
}

/* Footer selalu di bawah */
.footer {
    background-color: #ffffff;
    color: #575757;
    font-size: 0.8rem;
    text-align: center;
    margin-top: auto;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.1);
}

/* Responsif di mobile */
@media (max-width: 991.98px) {
    .main-content {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    #img-illustration {
        display: none !important;
    }
}

/* button */
.btn-primary {
    color: #fff;
    background-color: #102C57 !important;
    border-color: #102C57 !important;
}

button.btn.btn-sm.btn-outline-primary {
    border: 1px solid #102C57;
    color: #102C57;
}

    button.btn.btn-sm.btn-outline-primary:hover {
        background-color: #102C57;
        color: #FFF;
    }

.table-responsive {
    border: 1px solid rgba(0, 0, 0, .2) !important;
    height: calc(63vh - 44px) !important;
    margin-bottom: 10px;
    overflow-y: auto !important;
}

body table thead tr th {
    background-color: #102C57 !important;
    color: #fff !important;
}

.table td,
.table th {
    padding: .25rem !important;
    vertical-align: middle !important;
}

/* 🔒 Fixed Table Header Style */
.sticky-header th {
    position: sticky;
    top: 0;
    background-color: #f8f9fa;
    /* Bootstrap .table-light color */
    z-index: 10;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Optional: hover highlight */
.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

.btn {
    padding: 2.4px 6px;
}

button.btn.btn-sm {
    font-size: 12px;
}

.form-select-sm {
    padding-left: .5rem;
    font-size: .8rem;
}

.form-select.form-select-sm.form-select-show-entries {
    width: 70px;
    padding-top: 0.08rem !important;
    padding-bottom: 0.08rem !important;
}

/* Modal */
.modal-header {
    padding: 0.4rem 0.8rem;
}

/* Form */
.form-control-sm {
    font-size: .8rem;
}

.page-link {
    font-size: 10px !important;
}

.page-item.active a.page-link {
    background-color: #102C57 !important;
    border-color: #102C57 !important;
}

.input-group-sm > .btn, .input-group-sm > .form-control, .input-group-sm > .form-select, .input-group-sm > .input-group-text {
    font-size: .8rem;
}

/* Execution */
.nav-tab-execution.nav-tabs .nav-item {
    flex: 1 1 0;
    text-align: center;
}

/* Smooth transition & highlight effect */
.nav-tab-execution.nav-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    color: #495057;
    font-weight: 500;
    transition: all 0.25s ease;
    padding: 0.45rem 1rem;
    background-color: rgba(13, 110, 253, 0.25);
    height: -webkit-fill-available;
}

    .nav-tab-execution.nav-tabs .nav-link:hover {
        border-bottom: 3px solid #102C57;
        background-color: rgba(13, 110, 253, 0.3);
        color: #102C57;
    }

    .nav-tab-execution.nav-tabs .nav-link.active {
        border-bottom: 3px solid #102C57;
        background-color: #fff;
        color: #102C57;
        font-weight: 600;
    }

button.nav-link.rounded-0.border-bottom-0.active {
    font-weight: bold;
}


/*Sweet Alert*/
div:where(.swal2-icon) {
    margin: 2em auto .5em !important;
    font-size: .5em !important;
    font-weight: 700 !important;
}

div:where(.swal2-container) h2:where(.swal2-title) {
    margin: 0 !important;
    padding: 0 1em 0 !important;
}

[type=button]:not(:disabled), [type=reset]:not(:disabled), [type=submit]:not(:disabled), button:not(:disabled), .btn {
    min-width: 3.4rem !important;
}

div:where(.swal2-container) .swal2-html-container {
    margin: 0 0.6em !important;
    font-size: 0.9rem !important;
}

    div:where(.swal2-container) .swal2-html-container table tbody tr td {
        font-size: 0.7rem !important;
    }

div:where(.swal2-container) div:where(.swal2-actions) {
    margin: 0.4em auto 0 !important;
}

button.swal2-confirm.btn.btn-sm.swal2-styled.swal2-default-outline, button.swal2-cancel.btn.btn-sm.swal2-styled.swal2-default-outline {
    color: #FFFFFF;
}
/*Select2*/
span.select2.select2-container.select2-container--default {
    width: 100% !important;
}

button.btn-close {
    clip-path: border-box !important;
}

.select2-container--default .select2-selection--single {
    border: 1px solid rgba(0, 0, 0, .1) !important;
}

/*Checkbox Select*/
.custom-check {
    position: relative;
    display: inline-block;
}

    /* Sembunyikan input asli */
    .custom-check input[type="checkbox"] {
        position: absolute;
        opacity: 0;
        cursor: pointer;
    }

    /* Kotak */
    .custom-check label {
        width: 20px;
        height: 20px;
        border: 2px solid darkgrey; /* warna primary bootstrap */
        border-radius: 4px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease-in-out;
        cursor: pointer;
    }

        /* Saat hover */
        .custom-check label:hover {
            background-color: rgba(13, 110, 253, 0.1);
        }

    /* Saat dicentang */
    .custom-check input[type="checkbox"]:checked + label {
        background-color: #0d6efd;
        border-color: #0d6efd;
    }

        /* Centang di tengah */
        .custom-check input[type="checkbox"]:checked + label::after {
            content: "✓";
            color: white;
            font-weight: bold;
            font-size: 13px;
        }

    /* Fokus keyboard */
    .custom-check input[type="checkbox"]:focus + label {
        box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);
    }

    /* Saat disabled */
    .custom-check input[type="checkbox"]:disabled + label {
        opacity: 0.5;
        cursor: not-allowed;
        filter: grayscale(60%);
    }


/* Radio Select*/
.color-radio {
    display: flex;
    align-items: center;
    gap: 12px;
}

    .color-radio input[type="radio"] {
        display: none;
    }

    .color-radio label {
        display: flex;
        align-items: center;
        cursor: pointer;
        font-weight: 500;
        user-select: none;
    }

    /* Lingkaran */
    .color-radio .checkmark {
        width: 22px;
        height: 22px;
        border-radius: 50%;
        border: 2px solid #ccc;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-right: 6px;
        font-size: 14px;
        transition: all 0.2s ease;
    }

    /* Warna hijau untuk TRUE */
    .color-radio input[type="radio"]:checked + label.success .checkmark {
        background-color: #28a745;
        border-color: #28a745;
    }

    /* Warna merah untuk FALSE */
    .color-radio input[type="radio"]:checked + label.danger .checkmark {
        background-color: #dc3545;
        border-color: #dc3545;
    }

    /* Warna primary untuk TRUE */
    .color-radio input[type="radio"]:checked + label.primary .checkmark {
        background-color: #0b2554;
        border-color: #0b2554;
    }

    /* Warna warning untuk TRUE */
    .color-radio input[type="radio"]:checked + label.warning .checkmark {
        background-color: #ffc107;
        border-color: #ffc107;
    }

    /* Belum dipilih */
    .color-radio label.success .checkmark {
        border-color: #28a745;
    }

    .color-radio label.danger .checkmark {
        border-color: #dc3545;
    }

    .color-radio label.primary .checkmark {
        border-color: #0b2554;
    }

    .color-radio label.warning .checkmark {
        border-color: #ffc107;
    }

    /* Tanda centang (✓) di tengah */
    .color-radio input[type="radio"]:checked + label .checkmark::before {
        content: "✓";
        color: #fff;
        font-weight: bold;
    }

    /* Saat disabled */
    .color-radio input[type="radio"]:disabled + label {
        opacity: 0.5;
        cursor: not-allowed;
        filter: grayscale(70%);
    }

button.btn.btn-sm.btn-light.card-toggle-expand, button.btn.btn-sm.card-toggle-collapse {
    min-width: 0.4rem !important;
}

.form-check-input {
    width: 1.4em !important;
    height: 1.4em !important;
}

/*Camera Scanner*/
button#html5-qrcode-button-camera-start, button#html5-qrcode-button-camera-stop {
    color: #fff !important;
    border: none !important;
    border-radius: 2.8px !important;
    padding: 3.4px 8px !important;
    margin-top: 4px !important;
}

button#html5-qrcode-button-camera-start {
    background-color: #0b2554 !important;
}

button#html5-qrcode-button-camera-stop {
    background-color: #dc3545 !important;
}

select#html5-qrcode-select-camera {
    padding: 3.4px !important;
    border: 1px solid #0b2554 !important;
    border-radius: 2.4px !important;
    margin-top: 4px !important;
}
/*end*/

tr.text-danger td {
    color: var(--bs-danger) !important;
}
/* Membuat teks jadi abu-abu ketika ada class disabled */
tr.bg-warning.disabled td,
td.bg-warning.disabled {
    color: var(--bs-secondary-color) !important;
    opacity: 0.6; /* opsional, biar terlihat 'mati' */
    pointer-events: none; /* opsional, nonaktifkan klik */
}

/* Animasi ketik */
@keyframes typingtext {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}
