/* Menu */
.nav> .nav-item > a{
    color: white;
}

/* Headings */
h1, h2, h3, h4, h5, h6 { color: #506281; }

/* Global font size */
body, table, .form-control, .form-select, .btn, input, select, textarea, label, th, td {
    font-size: 14px !important;
}

/* Modal form spacing */
.modal-body .form-group { margin-bottom: 0.75rem; }
.modal-body .row.g-2 > [class*="col-"] { padding-top: 0.25rem; padding-bottom: 0.25rem; }

/* Validation feedback */
.was-validated .form-control:invalid,
.was-validated .form-select:invalid { border-color: #dc3545; }
.was-validated .form-control:valid,
.was-validated .form-select:valid   { border-color: #28a745; }

/* DataTable cell and header — condensed */
table.dataTable th, table.dataTable td {
    line-height: 20px !important;
    padding: 10px 18px !important;
}

/* Grid header — bold, no wrap, aligned with body */
table.dataTable thead th {
    font-weight: 600 !important;
    color: #3f4d67 !important;
    font-size: 12px !important;
    white-space: nowrap !important;
    padding: 10px 18px !important;
}

/* Grid body */
table.dataTable tbody td {
    color: #212529 !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    padding: 4px !important;
}

/* DataTables sizing elements — leave in DOM for column alignment */

/* Grid status pills */
table.dataTable .badge {
    display: inline-block;
    padding: 3px 12px !important;
    border-radius: 10px;
    font-size: 13px !important;
    font-weight: 600;
}

/* Search button — match Add button exactly */
button#searchWithTerms {
    border-radius: 0.25rem !important;
}

/* Store nav label */
a#store-nav-label {
    color: #ffffff !important;
    font-weight: 400 !important;
}

/* Dropdown menu */
.dropdown-menu li {
    font-size: 14px;
    padding: 0px;
}
.dropdown-menu {
    padding: 0;
}

/* Page headings */
h4 {
    font-size: 30px !important;
    font-weight: 600 !important;
}

/* DataTables sorting_disabled sizing rows — kept for column alignment */

/* Filter bar — size, alignment, font */
.tableFilter .form-control-sm,
.tableFilter .form-select-sm {
    font-size: 12px !important;
    height: 30px !important;
    vertical-align: middle !important;
    display: inline-flex !important;
    align-items: center !important;
}
.tableFilter .btn {
    font-size: 12px !important;
    height: 30px !important;
    vertical-align: middle !important;
    display: inline-flex !important;
    align-items: center !important;
}
.tableFilter label {
    font-size: 12px !important;
}

/* Reduce gap between filter row and action buttons */
.dataTables_wrapper .row:first-child {
    align-items: center !important;
    gap: 0 !important;
    margin-bottom: 4px !important;
}
.dataTables_wrapper .row:first-child > [class*="col-"] {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}
/* Shrink filter column, give more space to buttons */
.dataTables_wrapper .row:first-child .tableFilter {
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: none !important;
}
.dataTables_wrapper .row:first-child .float-right,
.dataTables_wrapper .row:first-child .dt-buttons {
    margin-left: auto !important;
}

/* Options column — keep buttons on one row */
table.dataTable td.text-nowrap,
table.dataTable td .btn-group-nowrap {
    white-space: nowrap;
}

/* Searchable customer dropdown — now uses .entity-search-wrap / .entity-dropdown / .entity-item */

/* Pagination hidden — show all rows */
.dataTables_paginate { display: none !important; }
.dataTables_info { display: none !important; }

/* ── Status badges ── */
.badge-active {
    display: inline-block; padding: 3px 12px !important; border-radius: 10px;
    font-size: 13px !important; font-weight: 600;
    background: linear-gradient(135deg, #1dc4e9, #1de9b6); color: #fff;
}
.badge-inactive {
    display: inline-block; padding: 3px 12px !important; border-radius: 10px;
    font-size: 13px !important; font-weight: 600;
    background: linear-gradient(135deg, #f6665d, #f89b95); color: #fff;
}
.badge-info-alt {
    display: inline-block; padding: 3px 12px !important; border-radius: 10px;
    font-size: 13px !important; font-weight: 600;
    background: linear-gradient(135deg, #8569ba, #d198e3); color: #fff;
}

/* ── Entity search dropdown (customers, creditors) ── */
.entity-search-wrap { position: relative; display: inline-block; width: 100%; }
.entity-search-wrap input { width: 100%; }
.entity-search-wrap .search-icon {
    position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: #aab2bd;
}
.entity-dropdown {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 1050;
    max-height: 250px; overflow-y: auto;
    background: #fff; border: 1px solid #ddd; border-top: none; border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); display: none;
}
.entity-dropdown .entity-item {
    padding: 8px 12px; cursor: pointer; font-size: 13px; border-bottom: 1px solid #f5f5f5;
}
.entity-dropdown .entity-item:hover { background: #e9f5ff; }
.entity-dropdown .entity-item .entity-acno { font-weight: 600; color: #3f4d67; margin-right: 8px; }
.entity-dropdown .entity-item .entity-name { color: #506281; }

/* ── GRV modal wide ── */
.modal-wide .modal-dialog { max-width: 900px; }

/* ── Legacy user grid overrides ── */
.user-grid-wrap .dataTables_wrapper { margin-right: 20px; padding-top: 0; }
.user-grid-wrap .dt-buttons { float: none; text-align: center; margin-bottom: 0; padding-top: 0; }
.user-grid-wrap .dt-buttons .dt-button {
    background: #1976d2; border-radius: 4px; color: #fff; margin-right: 3px; padding: 5px 15px;
}

/* Toggle switch styling */
.form-check.form-switch {
    padding-left: 3em;
    min-height: 2em;
    display: flex;
    align-items: center;
}
.form-check.form-switch .form-check-input {
    width: 2.5em;
    height: 1.3em;
    margin-left: -3em;
    margin-top: 0;
    cursor: pointer;
    background-color: #cfd5de;
    border: none;
    transition: background-color 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}
.form-check.form-switch .form-check-input:checked {
    background-color: #1de9b6;
    border-color: #1de9b6;
}
.form-check.form-switch .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(29, 233, 182, 0.25);
    border-color: #1de9b6;
}
.form-check.form-switch .form-check-label {
    cursor: pointer;
    margin-left: 0.5em;
}
