html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
    position: relative;
    min-height: 100%;
}

.container {
    height: calc(100vh - var(--header-height) - 1rem);
}

:root {
    --header-height: 64px;
    --nav-width: 256px;
    --first-color: #005baf;
    --first-color-hover: #004689;
    --first-color-light: #64748b;
    --white-color: #ffffff;
    --body-font: 'Manrope', 'Nunito', sans-serif;
    --normal-font-size: 14px;
    --z-fixed: 100;
    --sub-child-color: #f8fafc;
    --sidebar-bg: #ffffff;
    --sidebar-border: #e2e8f0;
    --sidebar-text: #475569;
    --sidebar-text-strong: #0f172a;
    --sidebar-text-muted: #94a3b8;
    --sidebar-active-bg: #eff6ff;
    --sidebar-active-text: #1d4ed8;
    --sidebar-section-text: #94a3b8;
    --header-bg: rgba(255, 255, 255, 0.92);
    --header-border: #e2e8f0;
}

*,
::before,
::after {
    box-sizing: border-box
}

body {
    position: relative;
    margin: var(--header-height) 0 0 0;
    font-family: var(--body-font);
    font-size: var(--normal-font-size);
    color: #0f172a;
    background-color: #f6f8fc;
    transition: .3s
}

a {
    text-decoration: none
}

/* ---------- Top Header ---------- */
.header {
    width: 100%;
    height: var(--header-height);
    padding: 0 24px 0 calc(var(--nav-width) + 24px);
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background-color: var(--header-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--header-border);
    z-index: var(--z-fixed);
    transition: padding .25s ease;
}

.header-burger {
    border: 1px solid var(--header-border);
    background: #fff;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    color: #475569;
    font-size: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.header-burger:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.header-greeting {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    overflow: hidden;
}

.header-greeting-eyebrow {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
}

.header-greeting-name {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    max-width: 60vw;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.header-icon-btn {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: transparent;
    border: 1px solid transparent;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.header-icon-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.header-icon-btn .header-badge {
    position: absolute;
    top: 8px;
    right: 9px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 9999px;
    box-shadow: 0 0 0 2px #fff;
}

.header-divider {
    width: 1px;
    height: 24px;
    background: #e2e8f0;
    margin: 0 4px;
}

.header-profile {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 4px 4px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.header-profile:hover {
    border-color: #cbd5e1;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.header-profile::after {
    display: none;
}

.header-profile-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.1;
    text-align: left;
}

.header-profile-name {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    max-width: 140px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.header-profile-role {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
}

.header-profile-caret {
    font-size: 10px;
    color: #94a3b8;
    margin-right: 6px;
}

.header_img {
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 9999px;
    overflow: hidden;
    background: #e0e7ff;
    color: #1d4ed8;
    border: 1px solid #c7d2fe;
}

.header_img img {
    width: 32px;
    height: 32px;
    object-fit: cover;
}

/* ---------- Sidebar ---------- */
.l-navbar {
    position: fixed;
    top: 0;
    left: 0;
    padding: 0;
    width: var(--nav-width);
    height: 100vh;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    transition: transform .3s ease;
    z-index: calc(var(--z-fixed) + 5);
    overflow-y: auto;
    overflow-x: hidden;
}

.l-navbar::-webkit-scrollbar {
    width: 6px;
}

.l-navbar::-webkit-scrollbar-track {
    background: transparent;
}

.l-navbar::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 9999px;
}

.l-navbar .nav {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    padding-bottom: 12px;
}

.nav_logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    margin: 0;
    background: #fff;
    border-bottom: 1px solid var(--sidebar-border);
    width: 100%;
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 2;
    text-decoration: none;
}

.nav_logo-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0074db 0%, #1d4ed8 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 6px 16px -8px rgba(29, 78, 216, 0.6);
    flex-shrink: 0;
}

.nav_logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
    overflow: hidden;
}

.nav_logo-name {
    color: #0f172a;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -0.01em;
}

.nav_logo-tag {
    font-size: 10px;
    color: var(--sidebar-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav_list {
    flex: 1 0 auto;
    padding: 12px 12px 8px 12px;
}

.nav_section-label {
    display: block;
    margin: 14px 12px 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--sidebar-section-text);
}

.nav_section-label:first-child {
    margin-top: 4px;
}

.nav_link {
    display: flex !important;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 9px 12px;
    margin: 2px 0;
    border-radius: 8px;
    color: var(--sidebar-text);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    background: transparent;
    border: none;
    transition: background .15s ease, color .15s ease;
    position: relative;
}

.nav_link:hover {
    color: var(--sidebar-text-strong);
    background: #f1f5f9;
}

.nav_link.active {
    color: var(--sidebar-active-text);
    background: var(--sidebar-active-bg);
    font-weight: 600;
}

.nav_link.active::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: var(--sidebar-active-text);
    border-radius: 9999px;
}

.nav_icon {
    width: 18px;
    text-align: center;
    font-size: 14px;
    flex-shrink: 0;
    color: inherit;
}

.nav_link>i {
    width: 18px;
}

.nav_name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav_link.accordion-button {
    box-shadow: none;
    color: var(--sidebar-text);
    background: transparent;
    text-align: left;
}

.nav_link.accordion-button:not(.collapsed) {
    background: #f1f5f9;
    color: var(--sidebar-text-strong);
}

.nav_link.accordion-button:hover {
    color: var(--sidebar-text-strong);
    background: #f1f5f9;
}

.nav_link.accordion-button:after {
    display: none;
}

.nav_link.accordion-button .accordion-arrow-indicators {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.nav_link.accordion-button .accordion-arrow-indicators .nav_name {
    flex: 1;
}

.nav_link.accordion-button .accordion-arrow-indicators i {
    font-size: 11px;
    color: var(--sidebar-text-muted);
}

.nav_link.accordion-button .accordion-arrow-indicators i.fa-chevron-down {
    display: none;
}

.nav_link.accordion-button.collapsed .accordion-arrow-indicators i.fa-chevron-up {
    display: none;
}

.nav_link.accordion-button.collapsed .accordion-arrow-indicators i.fa-chevron-down {
    display: inline-block;
}

/* Guard Bootstrap collapse against any stray utility CSS that may set
   visibility: collapse (e.g. Tailwind's `.collapse` utility class). */
.l-navbar .collapse {
    visibility: visible;
}

.nav_submenu {
    margin: 2px 0 6px 12px;
    padding-left: 10px;
    border-left: 1px dashed #cbd5e1;
}

.nav_submenu .nav_link {
    padding: 7px 10px;
    font-size: 13px;
    color: #64748b;
}

.nav_submenu .nav_link:hover {
    color: #0f172a;
    background: #f8fafc;
}

.nav_submenu .nav_link.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
}

.nav_submenu .nav_link.active::before {
    left: -11px;
    top: 6px;
    bottom: 6px;
    width: 2px;
}

.nav_footer {
    padding: 10px 12px 4px;
    border-top: 1px solid var(--sidebar-border);
    margin-top: 8px;
}

.nav_logout {
    color: #b91c1c !important;
}

.nav_logout:hover {
    background: #fee2e2 !important;
    color: #991b1b !important;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: calc(var(--z-fixed) + 1);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}

.sidebar-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.height-100 {
    height: 100vh
}

.dropdown-toggle::after {
    display: none;
}


.client-container {
    padding-left: calc(var(--nav-width) + 24px);
    padding-right: 24px;
}

@media (max-width: 991.98px) {
    .header {
        padding-left: 16px;
        padding-right: 16px;
    }

    .l-navbar {
        transform: translateX(-100%);
        box-shadow: 0 12px 40px -10px rgba(15, 23, 42, 0.25);
    }

    .l-navbar.is-open {
        transform: translateX(0);
    }

    .client-container {
        padding-left: 16px;
        padding-right: 16px;
    }
}

.page-header {
    height: var(--header-height);
    padding: 0 4px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
}

.page-header .page-header-title {
    font-size: 18px;
    color: #0f172a;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.page-header .page-header-title i {
    color: #1d4ed8;
}

/*heaer and sidebar changes end*/



/*loader start*/
.loader-container {
    position: fixed;
    z-index: 9999999999;
    height: 100%;
    width: 100%;
    text-align: center;
    top: 0;
}

.wrapper-loader {
    height: 100%;
    width: 100%;
    background: #000000;
    z-index: 9;
    opacity: 0.1;
}

.loader {
    width: 60px;
    height: 60px;
    background: url('/images/building-logo-icon.png') no-repeat;
    background-size: cover;
    display: inline-block;
    position: relative;
    box-sizing: border-box;
    top: calc(50% - 25px);
    left: calc(50% - 25px);
    z-index: 99;
    position: fixed;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(10px);
    }

    100% {
        transform: translateY(0px);
    }
}

.loader-caption {
    box-sizing: border-box;
    top: calc(50% + 28px);
    left: 0;
    z-index: 99;
    position: fixed;
    margin: auto;
    width: 100%;
    color: var(--bs-primary);
    font-weight: 600;
    margin-top: 10px;
}

/*loader end*/

.input-validation-error {
    border-color: red;
}

.input-validation-error:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 .25rem red;
}

.document-upload-title {
    min-width: 300px;
}

label,
h4 {
    color: #495057;
}

form label {
    margin-bottom: 5px;
}

.info {
    color: #495057;
}

#bookingDeleted_master_table_info {
    color: #495057;
}

#booking_master_table_info {
    color: #495057;
}

/* Booking grid summary: force readable text (main area can inherit light colors; only colored amounts were visible). */
#booking_master_table_summary {
    color: #212529 !important;
}

#booking_master_table_summary .text-success {
    color: #198754 !important;
}

#booking_master_table_summary .text-danger {
    color: #dc3545 !important;
}

#booking_master_table_summary .booking-summary-sep {
    color: #6c757d;
    user-select: none;
}

.table>thead>tr>th {
    font-weight: 600;
    border-color: #ccc !important;
}

.dataTables_wrapper>div:nth-child(1),
.dataTables_wrapper>div:nth-child(2) {
    margin-bottom: 15px;
}

tbody tr:last-child td {
    border: none;
}

table.dataTable>thead>tr {
    background-color: var(--white-color);
    font-size: 15px;
}

table.dataTable>tbody>tr>td {
    font-size: 15px;
    vertical-align: middle;
}

table.dataTable {
    box-shadow: 0px 0px 5px -3px;
    border-radius: 5px;
    margin-bottom: 0 !important;
    margin-top: 0 !important;
}

table.dataTable {
    margin-bottom: 0 !important;
    margin-top: 0 !important;
}

.field-validation-error {
    font-size: 13px;
}

.p-2rem {
    padding: 2rem;
}

.boottarcl {
    background-color: #fff;
    border-radius: 14px;
    padding: 18px;
    text-align: center;
    box-shadow: 0 4px 16px -10px rgba(15, 23, 42, 0.18);
    border: 1px solid #e2e8f0;
    transition: 0.25s ease-in-out;
}

.boottarcl:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px -14px rgba(15, 23, 42, 0.25);
    border-color: #cbd5e1;
}

#dashboardPieChart {
    max-width: 600px !important;
    max-height: 600px !important;
    margin: 0 auto;
}

.client-containers {
    max-width: 360px;
    width: 100%;
}


table th {
    background-color: #0d6efd !important;
    color: #ffffff;
}

table th:first-child {
    border-top-left-radius: 5px;
}

table th:last-child {
    border-top-right-radius: 5px;
}

/* Hide number input spinners - Global */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

#masters,
#inventories {
    background-color: transparent;
}

#masters a,
#inventories a {
    color: #475569;
    text-decoration: none;
}

#masters a:hover,
#inventories a:hover {
    color: #0f172a;
}

.dataTables_info {
    margin: 5px;
}

/* ---------- Dashboard helpers ---------- */
.dashboard-shell {
    padding: 18px 0 32px;
}

.dashboard-page-title {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.01em;
    margin: 0 0 4px;
}

.dashboard-page-sub {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 22px;
}

.stat-card {
    display: block;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px;
    text-decoration: none;
    color: inherit;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px -18px rgba(15, 23, 42, 0.25);
    border-color: #cbd5e1;
}

.stat-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.stat-card-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    background: #eff6ff;
    color: #1d4ed8;
    flex-shrink: 0;
}

.stat-card-icon.is-emerald {
    background: #ecfdf5;
    color: #059669;
}

.stat-card-icon.is-purple {
    background: #f5f3ff;
    color: #7c3aed;
}

.stat-card-icon.is-orange {
    background: #fff7ed;
    color: #ea580c;
}

.stat-card-icon.is-amber {
    background: #fffbeb;
    color: #b45309;
}

.stat-card-icon.is-pink {
    background: #fdf2f8;
    color: #db2777;
}

.stat-card-icon.is-cyan {
    background: #ecfeff;
    color: #0891b2;
}

.stat-card-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
}

.stat-card-value {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.01em;
    line-height: 1.1;
}

.surface-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
}

.surface-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.surface-card-header h6,
.surface-card-header h5,
.surface-card-header h3 {
    margin: 0;
    font-weight: 700;
    color: #0f172a;
    font-size: 15px;
}

.surface-card-sub {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

.surface-card-body {
    padding: 18px 20px;
}

.chart-frame {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px;
    height: 100%;
}

.dashboard-table thead th {
    background: #0d6efd !important;
    color: #ffffff !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 12px 16px;
    border: none !important;
}

.dashboard-table tbody td {
    padding: 12px 16px;
    font-size: 13px;
    vertical-align: middle;
    color: #334155;
    border-color: #f1f5f9;
}

.dashboard-table tbody tr:hover {
    background-color: #f8fafc;
}

.dashboard-table .text-emerald {
    color: #059669 !important;
    font-weight: 700;
}

.dashboard-table .text-rose {
    color: #dc2626 !important;
    font-weight: 700;
}

.dashboard-table .text-strong {
    color: #0f172a;
    font-weight: 600;
}

.dashboard-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #1d4ed8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.dashboard-action-btn:hover {
    background: #eff6ff;
    border-color: #c7d2fe;
    color: #1e40af;
}

/* ==========================================================================
   Data grid (DataTables) cards
   Wraps `<section class="surface-card grid-card">` around any DataTables
   instance to give it the same look as the dashboard tables.
   ========================================================================== */
.grid-shell {
    padding: 18px 22px 28px;
}

.grid-card {
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.grid-card-title-icon {
    color: #1d4ed8;
}

.grid-card-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.grid-card-body {
    padding: 0;
}

.grid-card-filters {
    padding: 14px 20px 4px;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
}

.grid-card-filters .form-control,
.grid-card-filters .form-select {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 7px 12px;
    font-size: 13px;
    color: #0f172a;
    background: #ffffff;
    box-shadow: 0 1px 1px rgba(15, 23, 42, 0.02);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.grid-card-filters .form-control:focus,
.grid-card-filters .form-select:focus {
    outline: none;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

.grid-card-form {
    padding: 18px 20px;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
}

.grid-card-form .form-label {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.grid-card-form .form-control,
.grid-card-form .form-select {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13px;
    color: #0f172a;
    background: #ffffff;
    box-shadow: 0 1px 1px rgba(15, 23, 42, 0.02);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.grid-card-form .form-control:focus,
.grid-card-form .form-select:focus {
    outline: none;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

/* Tabs strip (used at top of grid-card for multi-tab grids) */
.grid-card-tabs {
    background: #ffffff;
    padding: 6px 14px 0;
    border-bottom: 1px solid #f1f5f9;
    margin: 0;
    gap: 4px;
    flex-wrap: wrap;
}

.grid-card-tabs .nav-link {
    border: 1px solid transparent;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 10px 16px;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    background: transparent;
    transition: color .15s ease, border-color .15s ease, background .15s ease;
}

.grid-card-tabs .nav-link:hover {
    color: #1d4ed8;
    background: #f8fafc;
}

.grid-card-tabs .nav-link.active {
    color: #1d4ed8;
    background: transparent;
    border-bottom-color: #1d4ed8;
}

/* Inside modals, DataTables should also get a clean polished look */
.modal-body table.dataTable.dashboard-table thead th {
    background: #0d6efd !important;
    color: #ffffff !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 10px 12px !important;
    border: none !important;
}

.modal-body table.dataTable.dashboard-table tbody td {
    padding: 10px 12px !important;
    font-size: 13px;
    color: #334155;
    vertical-align: middle;
    border-top: 1px solid #f1f5f9 !important;
}

.modal-body .dataTables_wrapper .dataTables_filter input,
.modal-body .dataTables_wrapper .dataTables_length select {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 12px;
}

.modal-body .dataTables_wrapper .paginate_button,
.modal-body .dataTables_wrapper .page-item .page-link {
    border-radius: 6px !important;
    font-size: 12px !important;
    padding: 4px 10px !important;
}

/* Toolbar: length menu, search box, export buttons row */
.grid-card .dataTables_wrapper {
    padding: 16px 20px 8px;
    font-size: 13px;
    color: #475569;
}

.grid-card .dataTables_wrapper>.row {
    margin-left: -8px;
    margin-right: -8px;
}

.grid-card .dataTables_wrapper>.row>[class*="col-"] {
    padding-left: 8px;
    padding-right: 8px;
}

.grid-card .dataTables_length,
.grid-card .dataTables_filter {
    margin-bottom: 14px;
}

.grid-card .dataTables_length label,
.grid-card .dataTables_filter label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #475569;
    margin-bottom: 0;
}

.grid-card .dataTables_filter {
    text-align: right;
}

.grid-card .dataTables_length select,
.grid-card .dataTables_filter input,
.grid-card .dt-buttons+.dataTables_filter input {
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #0f172a;
    border-radius: 10px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 1px 1px rgba(15, 23, 42, 0.02);
    transition: border-color .15s ease, box-shadow .15s ease;
    min-width: 64px;
}

.grid-card .dataTables_filter input {
    min-width: 220px;
}

.grid-card .dataTables_length select:focus,
.grid-card .dataTables_filter input:focus {
    outline: none;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

/* Export / action button group rendered by DataTables Buttons */
.grid-card .dt-buttons {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.grid-card .dt-buttons .dt-button,
.grid-card .dt-buttons .btn {
    border: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
    color: #0f172a !important;
    border-radius: 10px !important;
    padding: 6px 14px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em;
    box-shadow: 0 1px 1px rgba(15, 23, 42, 0.02) !important;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.grid-card .dt-buttons .dt-button:hover,
.grid-card .dt-buttons .btn:hover {
    background: #f1f5f9 !important;
    border-color: #cbd5f5 !important;
    color: #1d4ed8 !important;
}

.grid-card .dt-buttons .dt-button i,
.grid-card .dt-buttons .btn i {
    margin-right: 6px;
    color: #1d4ed8;
}

/* Table layout */
.grid-card table.dataTable {
    margin: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0;
    width: 100% !important;
}

.grid-card table.dataTable thead th {
    background: #0d6efd !important;
    color: #ffffff !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 16px !important;
    border: none !important;
    white-space: nowrap;
}

.grid-card table.dataTable thead th:first-child {
    border-top-left-radius: 0;
}

.grid-card table.dataTable thead .sorting,
.grid-card table.dataTable thead .sorting_asc,
.grid-card table.dataTable thead .sorting_desc {
    background-image: none !important;
    cursor: pointer;
    position: relative;
    padding-right: 28px !important;
}

.grid-card table.dataTable thead .sorting::after,
.grid-card table.dataTable thead .sorting_asc::after,
.grid-card table.dataTable thead .sorting_desc::after {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", FontAwesome;
    font-weight: 900;
    font-size: 10px;
    opacity: 0.65;
}

.grid-card table.dataTable thead .sorting::after {
    content: "\f0dc";
    opacity: 0.45;
}

.grid-card table.dataTable thead .sorting_asc::after {
    content: "\f0de";
    opacity: 1;
}

.grid-card table.dataTable thead .sorting_desc::after {
    content: "\f0dd";
    opacity: 1;
}

.grid-card table.dataTable tbody td {
    padding: 12px 16px !important;
    font-size: 13px;
    color: #334155;
    vertical-align: middle;
    border-top: 1px solid #f1f5f9 !important;
    background: #ffffff;
}

.grid-card table.dataTable tbody tr:hover td {
    background-color: #f8fafc !important;
}

.grid-card table.dataTable.no-footer {
    border-bottom: 1px solid #f1f5f9 !important;
}

.grid-card table.dataTable tbody tr.odd td,
.grid-card table.dataTable tbody tr.even td {
    background-color: #ffffff;
}

.grid-card table.dataTable tbody tr.odd:hover td,
.grid-card table.dataTable tbody tr.even:hover td {
    background-color: #f8fafc !important;
}

/* Action column buttons inside grids - keep BS spacing readable */
.grid-card table.dataTable tbody td .btn {
    border-radius: 8px;
    padding: 5px 9px;
    font-size: 12px;
    line-height: 1;
}

.grid-card table.dataTable tbody td .btn+.btn {
    margin-left: 4px;
}

/* Footer: info + pagination */
.grid-card .dataTables_info {
    font-size: 12px;
    color: #64748b;
    padding: 14px 4px 4px;
}

.grid-card .dataTables_paginate {
    padding: 10px 4px 6px;
}

.grid-card .dataTables_paginate .pagination {
    margin: 0;
    gap: 4px;
}

.grid-card .dataTables_paginate .page-item .page-link,
.grid-card .dataTables_paginate .paginate_button {
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
    border-radius: 8px !important;
    padding: 6px 11px;
    font-size: 12px;
    font-weight: 600;
    margin: 0;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.grid-card .dataTables_paginate .page-item.active .page-link,
.grid-card .dataTables_paginate .paginate_button.current,
.grid-card .dataTables_paginate .paginate_button.current:hover {
    background: #1d4ed8 !important;
    border-color: #1d4ed8 !important;
    color: #ffffff !important;
}

.grid-card .dataTables_paginate .page-item:not(.active) .page-link:hover,
.grid-card .dataTables_paginate .paginate_button:hover {
    background: #f1f5f9 !important;
    border-color: #cbd5f5 !important;
    color: #1d4ed8 !important;
}

.grid-card .dataTables_paginate .page-item.disabled .page-link,
.grid-card .dataTables_paginate .paginate_button.disabled,
.grid-card .dataTables_paginate .paginate_button.disabled:hover {
    background: #f8fafc !important;
    color: #94a3b8 !important;
    border-color: #e2e8f0 !important;
    cursor: not-allowed;
}

/* Processing indicator */
.grid-card .dataTables_processing {
    border: none;
    background: rgba(255, 255, 255, 0.85);
    color: #1d4ed8;
    font-weight: 600;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

/* ==========================================================================
   Grid responsiveness
   ----------------------------------------------------------------------------
   The DataTables Responsive plugin is NOT bundled in this app, and every
   grid is initialised with `dom: 'lBfrtip'`. With that DOM string,
   DataTables produces a *flat* structure where the <table>, .dt-buttons,
   .dataTables_length, .dataTables_filter, .dataTables_info and
   .dataTables_paginate are all DIRECT children of .dataTables_wrapper —
   there are no Bootstrap row/col wrappers.

   So the only reliable way to make wide tables fit on every screen size
   is to allow horizontal scrolling on the wrapper itself, and to make
   sure the <table> is permitted to actually grow beyond 100% width
   (otherwise it just squashes its columns and never overflows).
   ========================================================================== */

/* 1) Allow the table to grow as wide as its content requires.
      Override the earlier `.grid-card table.dataTable { width: 100% !important }`
      rule by switching to `width: auto` plus a 100% minimum width. */
.grid-card table.dataTable,
.grid-card table.dashboard-table {
    width: auto !important;
    min-width: 100%;
    max-width: none;
}

/* 2) Make the table region horizontally scrollable inside the card.
      Both `.surface-card-body` (parent of the wrapper) and
      `.dataTables_wrapper` itself get the scroll context — whichever ends
      up being the immediate overflow ancestor will handle the scroll. */
.grid-card .surface-card-body,
.surface-card-body.grid-card-body,
.grid-card .grid-card-body {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

/* The wrapper itself must scroll too, because on tab-pane content the
   wrapper sits inside the tab pane, not directly under .surface-card-body. */
.grid-card .dataTables_wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

/* Make sure tab content does not clip the scrollable wrapper. */
.grid-card .tab-content,
.grid-card .tab-pane {
    overflow: visible;
    max-width: 100%;
}

/* Subtle horizontal scrollbar styling. */
.grid-card .surface-card-body::-webkit-scrollbar,
.grid-card .dataTables_wrapper::-webkit-scrollbar {
    height: 8px;
}

.grid-card .surface-card-body::-webkit-scrollbar-track,
.grid-card .dataTables_wrapper::-webkit-scrollbar-track {
    background: #f8fafc;
}

.grid-card .surface-card-body::-webkit-scrollbar-thumb,
.grid-card .dataTables_wrapper::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
}

.grid-card .surface-card-body::-webkit-scrollbar-thumb:hover,
.grid-card .dataTables_wrapper::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 3) Toolbar layout (length + buttons + filter) is a flat stack of divs.
      Use float to put length on the left and filter on the right by
      default (matches DataTables' bootstrap defaults), then collapse to
      a vertical stack on phones. */
.grid-card .dataTables_length {
    float: left;
}

.grid-card .dataTables_filter {
    float: right;
    text-align: right;
}

.grid-card .dt-buttons {
    float: left;
    margin-left: 8px;
}

/* Clear floats so the table area starts on a new line below the toolbar. */
.grid-card .dataTables_wrapper > table.dataTable,
.grid-card .dataTables_wrapper > .dataTables_processing,
.grid-card .dataTables_wrapper > .dataTables_info,
.grid-card .dataTables_wrapper > .dataTables_paginate {
    clear: both;
}

/* Search input gets a sensible max-width on wide screens, full-width on phones. */
.grid-card .dataTables_filter input {
    width: auto;
    min-width: 220px;
    max-width: 320px;
}

/* 4) Surface card header: title block flexes, action button stays put on
      desktop and stacks under the title on tablets/phones. */
.grid-card .surface-card-header {
    row-gap: 10px;
}

.grid-card .surface-card-header > div:first-child {
    min-width: 0;
    flex: 1 1 240px;
}

.grid-card .surface-card-header h6 {
    word-break: break-word;
}

.grid-card .grid-card-action {
    flex-shrink: 0;
}

/* 5) Tabs strip can scroll horizontally on phones if too many tabs. */
.grid-card-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.grid-card-tabs .nav-item {
    flex: 0 0 auto;
}

.grid-card-tabs .nav-link {
    white-space: nowrap;
}

.grid-card-tabs::-webkit-scrollbar {
    height: 4px;
}

.grid-card-tabs::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 9999px;
}

/* 6) Tablets and below — tighter shell, smaller padding, action button
      stretches under the title. */
@media (max-width: 991.98px) {
    .grid-shell {
        padding: 14px 16px 24px;
    }

    .grid-card-filters {
        padding: 12px 16px 4px;
    }

    .grid-card .dataTables_wrapper {
        padding: 12px 16px 4px;
    }

    .grid-card .surface-card-header {
        align-items: flex-start;
    }

    .grid-card .grid-card-action {
        align-self: stretch;
        justify-content: center;
    }

    .grid-card table.dataTable thead th,
    .grid-card table.dataTable tbody td {
        padding: 10px 12px !important;
    }
}

/* 7) Phones — collapse toolbar floats to vertical stack, full-width
      search, smaller cells/pagination. */
@media (max-width: 575.98px) {
    .grid-shell {
        padding: 10px 10px 18px;
    }

    .grid-card-filters,
    .grid-card .dataTables_wrapper {
        padding-left: 12px;
        padding-right: 12px;
    }

    .grid-card .dataTables_length,
    .grid-card .dataTables_filter,
    .grid-card .dt-buttons {
        float: none;
        text-align: left;
        width: 100%;
        margin-left: 0;
        margin-bottom: 10px;
    }

    .grid-card .dataTables_filter input {
        min-width: 0;
        max-width: none;
        width: 100%;
    }

    .grid-card .dataTables_filter label,
    .grid-card .dataTables_length label {
        width: 100%;
        display: flex;
    }

    .grid-card .dt-buttons .dt-button,
    .grid-card .dt-buttons .btn {
        flex: 1 1 auto;
        justify-content: center;
    }

    .grid-card table.dataTable thead th {
        padding: 10px 12px !important;
        font-size: 11px !important;
    }

    .grid-card table.dataTable tbody td {
        padding: 10px 12px !important;
        font-size: 12.5px;
    }

    .grid-card .dataTables_paginate .page-item .page-link,
    .grid-card .dataTables_paginate .paginate_button {
        padding: 5px 9px;
        font-size: 11px;
    }

    .grid-card .dataTables_info {
        text-align: center;
        padding: 10px 4px 4px;
    }

    .grid-card .dataTables_paginate {
        text-align: center;
        width: 100%;
        float: none;
    }

    .grid-card .dataTables_paginate .pagination {
        justify-content: center;
        flex-wrap: wrap;
    }

    .grid-card .surface-card-header {
        padding: 14px 16px;
    }

    .grid-card-filters .row > [class*="col-"] {
        margin-bottom: 8px;
    }
}

/* 8) Modal-hosted DataTables get the same treatment. */
.modal-body .dataTables_wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

.modal-body table.dataTable {
    width: auto !important;
    min-width: 100%;
    max-width: none;
}

/* 9) Dashboard `.surface-card` tables (which already use
      Bootstrap's .table-responsive) — make sure the rounded surface-card
      doesn't visually clip the scrollbar. */
.surface-card .table-responsive {
    -webkit-overflow-scrolling: touch;
    border-radius: 0;
    max-width: 100%;
}

.surface-card-header > div:first-child {
    min-width: 0;
    flex: 1 1 220px;
}

/* =====================================================================
   Global form controls — match grid filter UI for consistent look across
   forms (AddUpdate views, modals, dialogs, etc.) without changing markup.
   Scoped under .app-shell (admin + client roles) and inside .modal so it
   does not affect login pages and other unstyled bootstrap surfaces.
   ===================================================================== */
.app-shell .form-label,
.modal .form-label,
.app-shell form>label,
.app-shell form .row>[class*="col-"]>label,
.app-shell .p-2rem label:not(.form-check-label):not(.btn):not(.document-upload-title),
.modal form>label,
.modal form .row>[class*="col-"]>label {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
    letter-spacing: 0.02em;
    text-transform: none;
    display: inline-block;
}

.app-shell super,
.modal super {
    color: #dc2626;
    font-size: 12px;
    margin-left: 2px;
    vertical-align: super;
    line-height: 1;
}

.app-shell .form-control,
.app-shell .form-select,
.modal .form-control,
.modal .form-select {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13px;
    color: #0f172a;
    background: #ffffff;
    box-shadow: 0 1px 1px rgba(15, 23, 42, 0.02);
    transition: border-color .15s ease, box-shadow .15s ease;
    min-height: 38px;
}

.app-shell .form-control::placeholder,
.modal .form-control::placeholder {
    color: #94a3b8;
}

.app-shell .form-control:hover,
.app-shell .form-select:hover,
.modal .form-control:hover,
.modal .form-select:hover {
    border-color: #cbd5e1;
}

.app-shell .form-control:focus,
.app-shell .form-select:focus,
.modal .form-control:focus,
.modal .form-select:focus {
    outline: none;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
    background: #ffffff;
}

.app-shell .form-control:disabled,
.app-shell .form-control[readonly],
.app-shell .form-select:disabled,
.modal .form-control:disabled,
.modal .form-control[readonly],
.modal .form-select:disabled {
    background-color: #f8fafc;
    color: #64748b;
    cursor: not-allowed;
}

.app-shell .form-control[type="file"],
.modal .form-control[type="file"] {
    padding: 6px 12px;
}

.app-shell textarea.form-control,
.modal textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

.app-shell .form-check-input,
.modal .form-check-input {
    border: 1px solid #cbd5e1;
    box-shadow: none;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.app-shell .form-check-input:focus,
.modal .form-check-input:focus {
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

.app-shell .form-check-input:checked,
.modal .form-check-input:checked {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
}

.app-shell .form-check-label,
.modal .form-check-label {
    font-size: 13px;
    color: #334155;
}

.app-shell .input-group-text,
.modal .input-group-text {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    color: #475569;
    font-size: 13px;
    padding: 7px 12px;
}

.app-shell .input-group>.form-control,
.app-shell .input-group>.form-select,
.modal .input-group>.form-control,
.modal .input-group>.form-select {
    border-radius: 10px;
}

.app-shell .input-group> :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback),
.modal .input-group> :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
    margin-left: -1px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.app-shell .input-group> :not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating),
.modal .input-group> :not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.app-shell .form-select,
.modal .form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px 12px;
    padding-right: 36px;
}

/* Select2 — many AddUpdate pages enhance selects with select2 */
.app-shell .select2-container--default .select2-selection--single,
.modal .select2-container--default .select2-selection--single {
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    height: 38px !important;
    padding: 4px 8px !important;
    box-shadow: 0 1px 1px rgba(15, 23, 42, 0.02) !important;
}

.app-shell .select2-container--default .select2-selection--single .select2-selection__rendered,
.modal .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 28px !important;
    color: #0f172a !important;
    font-size: 13px !important;
    padding-left: 4px !important;
}

.app-shell .select2-container--default .select2-selection--single .select2-selection__arrow,
.modal .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px !important;
}

.app-shell .select2-container--default.select2-container--focus .select2-selection--single,
.app-shell .select2-container--default.select2-container--open .select2-selection--single,
.modal .select2-container--default.select2-container--focus .select2-selection--single,
.modal .select2-container--default.select2-container--open .select2-selection--single {
    border-color: #1d4ed8 !important;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12) !important;
}

/* Make the page-header panel consistent with surface-card-header on AddUpdate pages */
.app-shell .page-header {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px 18px;
    height: auto;
    margin-bottom: 14px;
    box-shadow: 0 1px 1px rgba(15, 23, 42, 0.02);
}

.app-shell .page-header .page-header-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

.app-shell .page-header .page-header-title i {
    color: #1d4ed8;
}

/* Wrap the top-level AddUpdate page form section to look like a surface card.
   We target only top-level .p-2rem panels that contain a <form>, and not
   panels nested inside grid-card / surface-card / nav-tab strips, etc. */
.app-shell>.p-2rem,
.app-shell>div>.p-2rem,
.app-shell>.tab-content>.tab-pane>.p-2rem {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 22px 22px !important;
    box-shadow: 0 1px 1px rgba(15, 23, 42, 0.02);
    margin-bottom: 14px;
}

/* Tab strip variant — keep it tight and seamless */
.app-shell .p-2rem.pb-0.border-bottom {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0 !important;
    border-radius: 14px 14px 0 0;
    padding: 14px 22px 0 !important;
    margin-bottom: 0;
}

/* The form body that follows the tab strip should connect seamlessly */
.app-shell .p-2rem.pb-0.border-bottom+.tab-content,
.app-shell .p-2rem.pb-0.border-bottom+.p-2rem,
.app-shell .tab-content.p-2rem,
.app-shell .p-2rem.pb-0.border-bottom+.container.p-2rem {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 14px 14px;
    padding: 22px 22px !important;
    box-shadow: 0 1px 1px rgba(15, 23, 42, 0.02);
    margin-bottom: 14px;
}

/* Don't force the card chrome onto p-2rem panels inside grid/surface cards */
.app-shell .grid-card .p-2rem,
.app-shell .surface-card .p-2rem {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0 !important;
    margin-bottom: 0;
    border-radius: 0;
}