.bg-gray-primary {
    background-color: #777;
    border: 2px solid #aaa9a9;
    border-left: none;
    border-right: none;
}
.bg-gray-primary ul {
    justify-content: center;
    align-items: center;
}
@font-face {
    font-family: "FontAwesome";
    src: url("../fonts/fontawesome-webfont.eot?v=4.7.0");
    src:
        url("../fonts/fontawesome-webfont.eot?#iefix&v=4.7.0")
            format("embedded-opentype"),
        url("../fonts/fontawesome-webfont.woff2?v=4.7.0") format("woff2"),
        url("../fonts/fontawesome-webfont.woff?v=4.7.0") format("woff"),
        url("../fonts/fontawesome-webfont.ttf?v=4.7.0") format("truetype"),
        url("../fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular")
            format("svg");
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: "FontKhJrungThom";
    src: url("../fonts/KhJrungThom.ttf");
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: "MoulLight";
    src: url("../fonts/KHMEROSMUOLLIGHT.TTF");
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: "Khmerbattambang";
    src: url("../fonts/Khmerbattambang.woff");
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: "Kuntumruy";
    src: url("../fonts/googleFont.woff2");
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: "Kantumruy Pro";
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url(../fonts/googleFont.woff2) format("woff2");
    unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC;
}
.h-khmer-battambang {
    font-family: Khmerbattambang;
}
.h-khmer-title {
    font-family: FontKhJrungThom;
}
a,
p,
span,
button,
label,
input,
th,
td,
div,
body {
    font-family: "Verdana";
    font-size: 13px;
}
.nav-chield-active {
    border-bottom: solid 4px #8fc74a !important;
}
.site-nav-chield-active {
    border-bottom: solid 2px;
    border-image: linear-gradient(90deg, #8dc63f, #f58220) 1;
    font-weight: bold;
    color: #8fc74a !important;
}
.active {
    background-color: #1b053f;
    color: #d1bdf4 !important;
    font-weight: bold;
}
.hover\:bg-green-600:hover {
    background-color: #8fc74a !important;
}

@media screen and (max-width: 992px) {
    .word_governace {
        display: none;
    }
}
.nav-ul-li {
    background-color: #fff;
    color: #000;
}
ul.absolute {
    z-index: 1000 !important;
}
li ul li .block:hover {
    background-color: #777;
    color: #fff !important;
}
.select2-container {
    z-index: 0 !important;
}

.select2-dropdown {
    z-index: 1 !important; /* Lower z-index so it stays under other elements */
}
a.header {
    font-weight: bold !important;
}
.outer-bg-gray-primary {
    padding: 1px 0px !important;
    border: solid 1.5px #777 !important;
}
.bg-gray-primary {
    border: none !important;
}
#tabButtons .p-2 {
    background-color: #f0f0f0 !important;
    color: #000 !important;
    padding: 4px 8px !important;
}
/* --- Tab Content Areas --- */
/* .tab-content-area {
    background-color: #fff;
} */
#tabButtons .show {
    background-color: #8fc74a;
    color: #fff !important;
    font-weight: bold;
    padding-left: 1rem;
    padding-right: 1rem;
}
.tab-content {
    display: none; /* Hidden by default */
}

.tab-content.active {
    display: block; /* Shown when active */
}

/* --- Order Information Detail Grid (inside tab) --- */
.order-info-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px 30px;
}

/* Responsive adjustment for detail grid */
@media (max-width: 900px) {
    .order-info-detail-grid {
        grid-template-columns: 1fr; /* Single column on medium/small screens */
    }
    .order-info-label {
        text-align: left;
        width: 140px;
    }
}

.order-info-item {
    display: flex;
}

.order-info-label {
    font-weight: bold;
    color: #666;
    width: 150px;
    text-align: right;
    margin-right: 15px;
    flex-shrink: 0;
}

.order-info-value {
    color: #333;
    flex-grow: 1;
}
.show {
    display: block !important;
}
#tabButtons button {
    margin: 0px 1px;
    border: solid 1px #777;
    border-bottom: none;
}
#tabButtons .show,
#tabButtons .show {
    background-color: #8fc74a !important;
}

.h-12 {
    height: 70px !important;
}
.container-button {
    border: solid 1px #000 !important;
}
.c-p-h {
    font-size: 16px;
    font-weight: bold;
}
.fieldset-lg {
    font-size: 14px;
    font-weight: bold;
}
.pc-2 {
    padding: 2px;
}
.pc-2-4 {
    padding: 2px 4px;
}
.pc-4 {
    padding: 4px;
}
.pc-4-8 {
    padding: 4px 8px;
}
.pc-8 {
    padding: 8px;
}
.rounded-c-4 {
    border-radius: 4px;
}
.rounded-c-2 {
    border-radius: 2px;
}
.font-c-10 {
    font-size: 10px;
}
.font-c-11 {
    font-size: 11px;
}
.font-c-12 {
    font-size: 12px;
}
.font-c-13 {
    font-size: 13px;
}
.message {
    font-style: italic !important;
}
.success {
    color: #8fc74a !important;
}
.failed {
    color: red !important;
}
.folder-toggle,
.file-item {
    cursor: pointer;
    -webkit-user-select: none; /* Safari/Chrome */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* IE10+ */
    user-select: none; /* standard */
}
.folder-toggle:hover,
.file-item:hover {
    background-color: #e7e7e7;
}
.button-option:hover {
    cursor: pointer !important;
}
.fc-button-group button,
.fc-toolbar-chunk button {
    background-color: #777 !important;
    color: #fff !important;
    font-weight: bold !important;
    font-size: 12px !important;
}
.fc-event {
    padding: 10px 8px !important;
}
#modal .select2 {
    width: 100% !important;
}
#modal .select2 .select2-selection--multiple {
    width: 100% !important;
    height: 100px !important;
    overflow-y: scroll !important;
}

/* ===========================================
        Organization Chart Style
==============================================*/
.toolbar-btn {
    padding: 6px 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.toolbar-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

/* ================= CHART CORE STYLES ================= */
#chart-viewport {
    cursor: grab;
    background-color: #f8fafc;
    background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
    background-size: 20px 20px;
    position: relative;
    /* Allow vertical scrolling on the viewport itself */
    overflow: auto;
}
#chart-viewport:active {
    cursor: grabbing;
}

#chart-container {
    transform-origin: top center;
    transition: transform 0.2s ease-out;
    padding: 40px;
    display: inline-block;
    min-width: 100%;
}

/* ================= TREE ARCHITECTURE ================= */
.tree ul {
    padding-top: 20px;
    position: relative;
    display: flex;
    justify-content: center;
}
.tree li {
    text-align: center;
    list-style-type: none;
    position: relative;
    padding: 20px 10px 0 10px;
    font-weight: normal !important;
}

/* Connecting lines */
.tree li::before,
.tree li::after {
    content: "";
    position: absolute;
    top: 0;
    right: 50%;
    border-top: 2px solid #cbd5e1;
    width: 50%;
    height: 20px;
}
.tree li::after {
    right: auto;
    left: 50%;
    border-left: 2px solid #cbd5e1;
}
.tree li:only-child::after,
.tree li:only-child::before {
    display: none;
}
.tree li:only-child {
    padding-top: 0;
}
.tree li:first-child::before,
.tree li:last-child::after {
    border: 0 none;
}
.tree li:last-child::before {
    border-right: 2px solid #cbd5e1;
    border-radius: 0 8px 0 0;
}
.tree li:first-child::after {
    border-radius: 8px 0 0 0;
}
.tree ul ul::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    border-left: 2px solid #cbd5e1;
    width: 0;
    height: 20px;
}

/* Node Cards */
.node-card {
    display: inline-block;
    width: 190px;
    padding: 16px 12px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    position: relative;
    z-index: 10;
}

.node-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin: 0 auto 10px;
    border: 2px solid #3b82f6;
    object-fit: cover;
    background: #f1f5f9;
}

/* ================= PRINT OPTIMIZATION ================= */
@media print {
    @page {
        size: A4 landscape;
        margin: 5mm;
    }
    body {
        background: white !important;
        overflow: visible !important;
        width: 100%;
    }
    #toolbar,
    #loading-spinner {
        display: none !important;
    }
    #chart-viewport {
        overflow: visible !important;
        height: auto !important;
        background: none !important;
        padding: 0 !important;
        width: 100% !important;
    }
    #chart-container {
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .node-card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        -webkit-print-color-adjust: exact;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

.dark ::-webkit-scrollbar-thumb {
    background: #334155;
}

.login-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

.dark ::-webkit-scrollbar-thumb {
    background: #334155;
}

/* Sidebar Transition Logic */
#sidebar {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 280px;
    min-width: 280px;
}

/* When closed, sidebar has 0 width and is translated */
.sidebar-closed #sidebar {
    width: 0;
    min-width: 0;
    transform: translateX(-100%);
    opacity: 0;
}

/* Dropdown transition */
.dropdown-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.dropdown-content.open {
    max-height: max-content;
    /* Adjust based on content */
}

.rotate-180 {
    transform: rotate(180deg);
}

/* Mobile specific overrides */
@media (max-width: 1023px) {
    #sidebar {
        position: fixed;
        z-index: 50;
        height: 100%;
    }

    .sidebar-closed #sidebar {
        transform: translateX(-100%);
    }
}

/* ===========================================
        Dark Mode — DataTables
==============================================*/
.dark table.dataTable thead th,
.dark table.dataTable thead td {
    background-color: #1f2937;
    color: #e5e7eb;
    border-bottom: 1px solid #374151;
}
.dark table.dataTable tbody tr {
    background-color: #161b22;
    color: #e5e7eb;
}
.dark table.dataTable tbody tr.odd {
    background-color: #1a2130;
}
.dark table.dataTable tbody tr:hover,
.dark table.dataTable tbody tr.odd:hover {
    background-color: #253047 !important;
}
.dark table.dataTable tbody td {
    border-top: 1px solid #2d3748;
    /* color: #e5e7eb; */
}
.dark .dataTables_wrapper {
    color: #e5e7eb;
}
.dark .dataTables_wrapper .dataTables_length label,
.dark .dataTables_wrapper .dataTables_filter label,
.dark .dataTables_wrapper .dataTables_info {
    color: #9ca3af;
}
.dark .dataTables_wrapper .dataTables_length select,
.dark .dataTables_wrapper .dataTables_filter input {
    background-color: #1f2937;
    border: 1px solid #374151;
    color: #e5e7eb;
    border-radius: 4px;
    padding: 2px 6px;
}
.dark .dataTables_wrapper .dataTables_paginate .paginate_button {
    color: #9ca3af !important;
    background: transparent !important;
    border: 1px solid transparent !important;
}
.dark .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #374151 !important;
    color: #e5e7eb !important;
    border-color: #4b5563 !important;
}
.dark .dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dark .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: #3b82f6 !important;
    color: #fff !important;
    border-color: #3b82f6 !important;
}
/* .dark .dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dark .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    color: #4b5563 !important;
} */

/* ===========================================
        Dark Mode — Select2
==============================================*/
.dark .select2-container--default .select2-selection--single {
    background-color: #1f2937;
    border: 1px solid #374151;
    color: #e5e7eb;
}
.dark
    .select2-container--default
    .select2-selection--single
    .select2-selection__rendered {
    color: #e5e7eb;
}
.dark
    .select2-container--default
    .select2-selection--single
    .select2-selection__arrow
    b {
    border-color: #9ca3af transparent transparent transparent;
}
.dark .select2-dropdown {
    background-color: #1f2937;
    border: 1px solid #374151;
    color: #e5e7eb;
}
.dark .select2-container--default .select2-results__option {
    color: #e5e7eb;
    background-color: #1f2937;
}
.dark
    .select2-container--default
    .select2-results__option--highlighted[aria-selected] {
    background-color: #3b82f6;
    color: #fff;
}
.dark
    .select2-container--default
    .select2-results__option[aria-selected="true"] {
    background-color: #374151;
}
.dark .select2-search--dropdown .select2-search__field {
    background-color: #161b22;
    border: 1px solid #374151;
    color: #e5e7eb;
}
.dark .select2-container--default .select2-selection--multiple {
    background-color: #1f2937;
    border: 1px solid #374151;
}
.dark
    .select2-container--default
    .select2-selection--multiple
    .select2-selection__choice {
    background-color: #374151;
    border-color: #4b5563;
    color: #e5e7eb;
}

/* ===========================================
        Dark Mode — Org Chart
==============================================*/
.dark #chart-viewport {
    background-color: #0d1117;
    background-image: radial-gradient(#1e2a3a 1px, transparent 1px);
}
.dark .node-card {
    background: #1f2937;
    border-color: #374151;
    color: #e5e7eb;
}
.dark .toolbar-btn {
    background: #1f2937;
    border-color: #374151;
    color: #e5e7eb;
}
.dark .toolbar-btn:hover {
    background: #374151;
    border-color: #4b5563;
}
.dark .tree li::before,
.dark .tree li::after,
.dark .tree li:last-child::before,
.dark .tree ul ul::before {
    border-color: #374151;
}

/* ===========================================
        Dark Mode — Form inputs (native)
==============================================*/
.dark input[type="text"],
.dark input[type="email"],
.dark input[type="password"],
.dark input[type="number"],
.dark input[type="file"],
.dark input[type="datetime-local"],
.dark textarea,
.dark select {
    background-color: #1f2937;
    border-color: #374151;
    color: #e5e7eb;
}
.dark input::placeholder,
.dark textarea::placeholder {
    color: #6b7280;
}

/* ===========================================
        Dark Mode — Status badge / nav active
==============================================*/
.dark .active {
    background-color: #312e81;
    color: #c4b5fd !important;
}
.dark .status-badge {
    background-color: transparent;
}
/* .dark * {
    color: white !important;
} */
.nav-link-pill {
    position: relative;
    transition: all 0.2s ease-in-out;
}
.nav-link-pill::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0%;
    height: 2.5px;
    background: linear-gradient(90deg, #8dc63f, #f58220);
    border-radius: 99px;
    transition: all 0.25s ease-in-out;
    transform: translateX(-50%);
}
.nav-link-pill:hover::after,
.nav-link-pill.active::after {
    width: 100%;
}
.select2-container--open {
    z-index: 9999 !important;
}

/* Modern standard (Firefox, Chrome 121+) */
* {
    scrollbar-color: #8dc63f transparent; /* thumb color | track color */
    scrollbar-width: thin; /* auto, thin, or none */
}

/* WebKit-based browsers (Chrome, Edge, Safari) for custom sizing & rounded corners */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1f2937; /* Track background */
}

::-webkit-scrollbar-thumb {
    background: #4f46e5; /* Scrollbar handle */
    border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6366f1; /* Hover state */
}
input[type="date"]:hover,
input[type="time"]:hover,
input[type="datetime-local"]:hover{
    cursor: pointer !important;
}