.ck-editor__editable,
textarea {
    min-height: 150px;
}

.datatable {
    width: 100% !important;
}

table.dataTable tbody td.select-checkbox::before,
table.dataTable tbody td.select-checkbox::after,
table.dataTable tbody th.select-checkbox::before,
table.dataTable tbody th.select-checkbox::after {
    top: 50%;
}

.dataTables_length,
.dataTables_filter,
.dt-buttons {
    margin-bottom: 0.333em;
    margin-top: .2rem;
}

.dataTables_filter {
    margin-right: .2rem;
}

.dt-buttons .btn {
    margin-left: 0.333em;
    border-radius: 0;
}

.table.datatable {
    box-sizing: border-box;
    border-collapse: collapse;
}

table.dataTable thead th {
    border-bottom: 2px solid #c8ced3;
    padding-right : 10px;
    padding-left: 10px;
}

.dataTables_wrapper.no-footer .dataTables_scrollBody {
    border-bottom: 1px solid #c8ced3;
}

.select2 {
    max-width: 100%;
    width: 100% !important;
}

.select2-selection__rendered {
    padding-bottom: 5px !important;
}

.has-error .invalid-feedback {
    display: block !important;
}

.btn-info,
.badge-info {
    color: white;
}

table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc {
    background-image: none;
}

.sidebar .nav-item {
    cursor: pointer;
}

.btn-default {
    color: #23282c;
    background-color: #f0f3f5;
    border-color: #f0f3f5;
}

.btn-default.focus,
.btn-default:focus {
    box-shadow: 0 0 0 .2rem rgba(209, 213, 215, .5);
}

.btn-default:hover {
    color: #23282c;
    background-color: #d9e1e6;
    border-color: #d1dbe1;
}

.btn-group-xs > .btn,
.btn-xs {
    padding: 1px 5px;
    font-size: 12px;
    line-height: 1.5;
    border-radius: 3px;
}

.searchable-title {
    font-weight: bold;
}
.searchable-fields {
    padding-left:5px;
}
.searchable-link {
    padding:0 5px 0 5px;
}
.searchable-link:hover   {
    cursor: pointer;
    background: #eaeaea;
}
.select2-results__option {
    padding-left: 0px;
    padding-right: 0px;
}

.form-group .required::after {
    content: " *";
    color: red;
}

.form-check.is-invalid ~ .invalid-feedback {
    display: block;
}

.c-sidebar-brand .c-sidebar-brand-full:hover {
    color: inherit;
}

.custom-select.form-control-sm {
    padding: 0.25rem 1.5rem;
}

/* ======================================================================
   Beautified admin cards, DataTables, buttons, badges & forms
   ====================================================================== */

.card {
    border: none;
    border-radius: 0.6rem;
    box-shadow: 0 2px 14px rgba(33, 40, 50, 0.08);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, #321fdb 0%, #4b3cf0 100%);
    color: #fff;
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: .02em;
    border-bottom: none;
    padding: 0.95rem 1.25rem;
}

/* EV Control charger cards define their own status-tinted header
   backgrounds (online/offline) — keep their text dark & readable
   instead of inheriting the gradient header's white text. */
.charger-card .card-header {
    color: #2c3e50;
    font-weight: 600;
    font-size: 0.95rem;
}

.card-body {
    padding: 1.35rem;
    background: #fff;
}

/* ---- DataTables ---- */
.table.datatable,
table.dataTable {
    border-radius: 0.4rem;
    overflow: hidden;
}

table.dataTable thead th {
    background-color: #f7f8fc;
    color: #4b5566;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: .05em;
    border-bottom: 2px solid #e6e9f0 !important;
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
    white-space: nowrap;
}

table.dataTable tbody td {
    vertical-align: middle;
    font-size: 0.86rem;
    color: #3c4858;
    border-color: #eef0f4;
}

table.dataTable.table-striped tbody tr:nth-of-type(odd) {
    background-color: #fafbfd;
}

table.dataTable.table-hover tbody tr:hover {
    background-color: #eef1ff !important;
    transition: background-color .12s ease-in-out;
}

/* ---- DataTables controls / pagination ---- */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border-radius: 0.35rem;
    border: 1px solid #d8dce6;
    padding: 0.25rem 0.6rem;
}

.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
    border-color: #321fdb;
    box-shadow: 0 0 0 .15rem rgba(50, 31, 219, .15);
    outline: none;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 0.3rem;
    margin-left: 3px;
    padding: 0.3rem 0.7rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: #321fdb !important;
    border-color: #321fdb !important;
    color: #fff !important;
}

.dataTables_wrapper .dataTables_info {
    color: #6b7280;
    font-size: 0.82rem;
}

/* ---- Buttons ---- */
.btn {
    border-radius: 0.4rem;
    font-weight: 500;
    transition: transform .12s ease-in-out, box-shadow .12s ease-in-out;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(33, 40, 50, 0.12);
}

.btn-success {
    background-color: #2eb85c;
    border-color: #2eb85c;
}

.btn-danger {
    background-color: #e55353;
    border-color: #e55353;
}

.btn-group-xs > .btn,
.btn-xs {
    padding: 3px 9px;
    font-size: 12px;
    border-radius: 0.3rem;
    font-weight: 600;
}

.btn-xs i {
    margin-right: 3px;
}

/* Action button group on listing rows */
.datatable-actions {
    display: inline-flex;
    gap: 4px;
    flex-wrap: wrap;
}

/* ---- Badges / role labels ---- */
.label-many,
.label-info {
    display: inline-block;
    margin: 1px 2px;
    padding: 0.32em 0.65em;
    border-radius: 0.35rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: .02em;
}

/* ---- Forms ---- */
.form-group label {
    font-weight: 600;
    color: #3c4858;
    font-size: 0.88rem;
    margin-bottom: 0.4rem;
}

.form-control,
.custom-select,
.select2-container--default .select2-selection--single {
    border-radius: 0.4rem !important;
    border: 1px solid #d8dce6;
    transition: border-color .12s ease-in-out, box-shadow .12s ease-in-out;
}

.form-control:focus,
.custom-select:focus {
    border-color: #321fdb;
    box-shadow: 0 0 0 .18rem rgba(50, 31, 219, .14);
}

.form-control.is-invalid,
.custom-select.is-invalid {
    border-color: #e55353;
}

.help-block {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.78rem;
    color: #8a93a2;
}

.form-group {
    margin-bottom: 1.35rem;
}

/* ---- Two-column form layout (auto, no markup changes needed) ---- */
@media (min-width: 768px) {
    .card-body > form {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0 2.5rem;
        align-items: start;
    }

    /* Fields that need the full width: textareas, rich-text editors,
       file/image uploads, checkboxes/radios, and the submit button row */
    .card-body > form > .form-group:has(textarea),
    .card-body > form > .form-group:has(.ckeditor),
    .card-body > form > .form-group:has(input[type="file"]),
    .card-body > form > .form-group:has(input[type="checkbox"]),
    .card-body > form > .form-group:has(.dropzone),
    .card-body > form > .form-group:last-child {
        grid-column: 1 / -1;
    }
}

/* ======================================================================
   Dashboard KPI cards
   ====================================================================== */
.kpi-card {
    border: none;
    color: #fff;
    position: relative;
    overflow: hidden;
    transition: transform .15s ease-in-out, box-shadow .15s ease-in-out;
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(33, 40, 50, 0.18);
}

.kpi-card .card-body {
    position: relative;
    padding: 1.5rem 1.6rem;
}

.kpi-card h2 {
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.kpi-card p {
    margin-bottom: 0;
    opacity: .9;
    font-size: 0.85rem;
    letter-spacing: .02em;
}

.kpi-icon {
    position: absolute;
    top: 1.1rem;
    right: 1.3rem;
    font-size: 2.1rem;
    opacity: .28;
}

.kpi-primary { background: linear-gradient(135deg, #321fdb 0%, #5e72e4 100%); }
.kpi-success { background: linear-gradient(135deg, #2eb85c 0%, #4ecf80 100%); }
.kpi-warning { background: linear-gradient(135deg, #f9b115 0%, #fcd462 100%); }
.kpi-danger  { background: linear-gradient(135deg, #e55353 0%, #ff8a8a 100%); }

#map {
    border-radius: 0.4rem;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px #eef0f4;
}

/* ======================================================================
   Sidebar (side panel) background
   ====================================================================== */
.c-sidebar {
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 55%, #0f3460 100%);
}

.c-sidebar .c-sidebar-brand {
    background: rgba(0, 0, 0, 0.18);
}

.c-sidebar .c-sidebar-nav-link {
    color: rgba(255, 255, 255, 0.78);
    border-radius: 0.4rem;
    margin: 2px 10px;
    transition: background-color .12s ease-in-out, color .12s ease-in-out;
}

.c-sidebar .c-sidebar-nav-link .c-sidebar-nav-icon {
    color: rgba(255, 255, 255, 0.55);
}

.c-sidebar .c-sidebar-nav-link:hover,
.c-sidebar .c-sidebar-nav-dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.c-sidebar .c-sidebar-nav-link:hover .c-sidebar-nav-icon,
.c-sidebar .c-sidebar-nav-dropdown-toggle:hover .c-sidebar-nav-icon {
    color: #fff;
}

.c-sidebar .c-sidebar-nav-link.c-active,
.c-sidebar .c-sidebar-nav-link.c-active .c-sidebar-nav-icon {
    background: linear-gradient(135deg, #321fdb 0%, #5e72e4 100%);
    color: #fff;
    box-shadow: 0 2px 10px rgba(50, 31, 219, .35);
}

.c-sidebar .c-sidebar-nav-dropdown-toggle {
    color: rgba(255, 255, 255, 0.78);
    border-radius: 0.4rem;
    margin: 2px 10px;
}

.c-sidebar .c-sidebar-nav-dropdown-toggle .c-sidebar-nav-icon {
    color: rgba(255, 255, 255, 0.55);
}

.c-sidebar .c-sidebar-nav-dropdown.c-show > .c-sidebar-nav-dropdown-toggle {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.c-sidebar .c-sidebar-nav-dropdown-items .c-sidebar-nav-link {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.88rem;
}

.c-sidebar .c-sidebar-nav-dropdown-items .c-sidebar-nav-link:hover {
    color: #fff;
}
