.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;
}

.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;
}

/* Modern Professional Table Styling */

.card {
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, #40739e 0%, #40739e 100%);
    color: white;
    border-bottom: none;
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}

.card-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: rgba(255, 255, 255, 0.3);
}

.card-body {
    padding: 1.5rem;
}

/* Enhanced DataTables Styling */
.datatable {
    width: 100% !important;
    border-radius: 8px;
    overflow: hidden;
}

.datatable thead th {
    background: #f8f9fa;
    color: #495057;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    padding: 1rem 0.75rem;
    border-bottom: 2px solid #e9ecef;
    white-space: nowrap;
}

.datatable tbody td {
    padding: 1rem 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f3f5;
}

.datatable tbody tr {
    transition: all 0.2s ease;
}

.datatable tbody tr:hover {
    background-color: #f8f9fa;
    transform: scale(1.002);
}

.datatable tbody tr:nth-child(even) {
    background-color: #fafbfc;
}

.datatable tbody tr:nth-child(even):hover {
    background-color: #f1f3f5;
}

/* Image thumbnails in tables */
.datatable tbody td img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.datatable tbody td img:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Action buttons styling */
.btn-xs {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    border-radius: 6px;
    margin: 0 2px;
    transition: all 0.2s ease;
    border: none;
}

.btn-xs.btn-primary {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 2px 4px rgba(79, 172, 254, 0.3);
}

.btn-xs.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(79, 172, 254, 0.4);
}

.btn-xs.btn-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.btn-xs.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

.btn-xs.btn-danger {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 2px 4px rgba(245, 87, 108, 0.3);
}

.btn-xs.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(245, 87, 108, 0.4);
}

/* Success/Add button styling */
.btn-success {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    border: none;
    border-radius: 8px;
    padding: 0.625rem 1.5rem;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(67, 233, 123, 0.3);
    transition: all 0.3s ease;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(67, 233, 123, 0.4);
    background: linear-gradient(135deg, #38f9d7 0%, #43e97b 100%);
}

/* Badges and status indicators */
.badge {
    padding: 0.35rem 0.65rem;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.85rem;
}

.badge-success {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.badge-danger {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* DataTables controls styling */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 6px;
    margin: 0 2px;
    transition: all 0.2s ease;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
}

/* DataTables export buttons */
.dt-buttons .btn {
    border-radius: 6px;
    margin: 0 2px;
    border: none;
    transition: all 0.2s ease;
}

.dt-buttons .btn:hover {
    transform: translateY(-2px);
}

/* DataTables RTL Support */
[dir="rtl"] .dataTables_wrapper .dataTables_filter {
    float: left !important;
    text-align: left !important;
}

[dir="rtl"] .dataTables_wrapper .dataTables_length {
    float: right !important;
}

[dir="rtl"] .dataTables_wrapper .dataTables_info {
    float: right !important;
}

[dir="rtl"] .dataTables_wrapper .dataTables_paginate {
    float: left !important;
}

[dir="rtl"] .dataTables_wrapper .dataTables_paginate .paginate_button.previous {
    margin-right: 0 !important;
    margin-left: 5px !important;
}

[dir="rtl"] .dataTables_wrapper .dataTables_paginate .paginate_button.next {
    margin-left: 0 !important;
    margin-right: 5px !important;
}

[dir="rtl"] .dataTables_wrapper .dt-buttons {
    float: right !important;
}

[dir="rtl"] table.dataTable thead th, [dir="rtl"] table.dataTable thead td {
    text-align: right !important;
}

[dir="rtl"] table.dataTable tbody th, [dir="rtl"] table.dataTable tbody td {
    text-align: right !important;
}

/* RTL General Support */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .ml-auto {
    margin-left: 0 !important;
    margin-right: auto !important;
}

[dir="rtl"] .mr-auto {
    margin-right: 0 !important;
    margin-left: auto !important;
}

[dir="rtl"] .text-left {
    text-align: right !important;
}

[dir="rtl"] .text-right {
    text-align: left !important;
}

/* RTL Sidebar Support */
[dir="rtl"] .c-sidebar {
    right: 0;
    left: auto;
    border-right: none;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

[dir="rtl"] .c-sidebar-brand {
    text-align: right;
}

[dir="rtl"] .c-sidebar-nav-link::before {
    right: auto;
    left: 0;
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.3) 0%, transparent 100%);
}

[dir="rtl"] .c-sidebar-nav-link:hover {
    padding-right: 1.5rem;
    padding-left: 1.75rem;
}

[dir="rtl"] .c-sidebar-nav-link.c-active {
    border-right: none;
    border-left: 3px solid #667eea;
    background: linear-gradient(90deg, transparent 0%, rgba(102, 126, 234, 0.2) 100%);
}

[dir="rtl"] .c-sidebar-nav-icon {
    margin-left: 0;
    margin-right: 0.75rem;
}

[dir="rtl"] .c-sidebar-nav-dropdown-toggle::after {
    left: auto;
    right: 1.5rem;
}

[dir="rtl"] .c-sidebar-nav-dropdown-items {
    border-right: none;
    border-left: 3px solid rgba(102, 126, 234, 0.3);
}

[dir="rtl"] .c-sidebar-nav-dropdown-items .c-sidebar-nav-link {
    padding-right: 1.5rem;
    padding-left: 2.5rem;
}

/* RTL Header Support */
[dir="rtl"] .c-header {
    right: 0;
    left: 0;
}

[dir="rtl"] .c-header-nav {
    margin-left: 0;
    margin-right: auto;
}

[dir="rtl"] .c-header-nav.ml-auto {
    margin-left: 0;
    margin-right: auto;
}

[dir="rtl"] .dropdown-menu-right {
    left: 0;
    right: auto;
}

[dir="rtl"] .dropdown-menu-left {
    right: 0;
    left: auto;
}

/* RTL Form Support */
[dir="rtl"] .form-group label {
    text-align: right;
}

[dir="rtl"] .form-control {
    text-align: right;
}

[dir="rtl"] .input-group-prepend {
    margin-left: -1px;
    margin-right: 0;
}

[dir="rtl"] .input-group-append {
    margin-right: -1px;
    margin-left: 0;
}

[dir="rtl"] .input-group > .form-control:not(:last-child) {
    border-top-right-radius: 0.25rem;
    border-bottom-right-radius: 0.25rem;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* RTL Table Support */
[dir="rtl"] .table {
    text-align: right;
}

[dir="rtl"] .table thead th {
    text-align: right;
}

[dir="rtl"] .table tbody td {
    text-align: right;
}

/* RTL Card Support */
[dir="rtl"] .card-header {
    text-align: right;
}

[dir="rtl"] .card-header::before {
    left: auto;
    right: 0;
}

/* RTL Button Group */
[dir="rtl"] .btn-group > .btn:not(:first-child) {
    margin-right: -1px;
    margin-left: 0;
}

[dir="rtl"] .btn-group > .btn:not(:last-child):not(.dropdown-toggle) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-top-left-radius: 0.25rem;
    border-bottom-left-radius: 0.25rem;
}

/* RTL Alert */
[dir="rtl"] .alert {
    text-align: right;
}

/* RTL List */
[dir="rtl"] .list-unstyled {
    padding-right: 0;
    padding-left: 0;
}

[dir="rtl"] ul {
    padding-right: 1.5rem;
    padding-left: 0;
}

/* RTL Nav Tabs */
[dir="rtl"] .nav-tabs {
    padding-right: 0;
    padding-left: 0;
}

[dir="rtl"] .nav-tabs .nav-link {
    text-align: right;
}

/* RTL Badge */
[dir="rtl"] .badge {
    direction: rtl;
}

/* RTL Select2 */
[dir="rtl"] .select2-container--default .select2-selection--single .select2-selection__arrow {
    left: 1px;
    right: auto;
}

[dir="rtl"] .select2-dropdown {
    text-align: right;
}

/* RTL Dropdown */
[dir="rtl"] .dropdown-toggle::after {
    margin-left: 0;
    margin-right: 0.255em;
}

/* RTL Pagination */
[dir="rtl"] .pagination {
    padding-right: 0;
    padding-left: 0;
}

[dir="rtl"] .page-link {
    text-align: right;
}

/* RTL Modal */
[dir="rtl"] .modal-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .modal-footer {
    flex-direction: row-reverse;
}

/* RTL Breadcrumb */
[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before {
    padding-right: 0.5rem;
    padding-left: 0;
    content: "←";
}

/* RTL Close button */
[dir="rtl"] .close {
    float: left;
}

/* RTL Float */
[dir="rtl"] .float-left {
    float: right !important;
}

[dir="rtl"] .float-right {
    float: left !important;
}

/* RTL Margin and Padding utilities */
[dir="rtl"] .ml-0 { margin-left: 0 !important; margin-right: 0 !important; }
[dir="rtl"] .ml-1 { margin-left: 0 !important; margin-right: 0.25rem !important; }
[dir="rtl"] .ml-2 { margin-left: 0 !important; margin-right: 0.5rem !important; }
[dir="rtl"] .ml-3 { margin-left: 0 !important; margin-right: 1rem !important; }
[dir="rtl"] .ml-4 { margin-left: 0 !important; margin-right: 1.5rem !important; }
[dir="rtl"] .ml-5 { margin-left: 0 !important; margin-right: 3rem !important; }

[dir="rtl"] .mr-0 { margin-right: 0 !important; margin-left: 0 !important; }
[dir="rtl"] .mr-1 { margin-right: 0 !important; margin-left: 0.25rem !important; }
[dir="rtl"] .mr-2 { margin-right: 0 !important; margin-left: 0.5rem !important; }
[dir="rtl"] .mr-3 { margin-right: 0 !important; margin-left: 1rem !important; }
[dir="rtl"] .mr-4 { margin-right: 0 !important; margin-left: 1.5rem !important; }
[dir="rtl"] .mr-5 { margin-right: 0 !important; margin-left: 3rem !important; }

[dir="rtl"] .pl-0 { padding-left: 0 !important; padding-right: 0 !important; }
[dir="rtl"] .pl-1 { padding-left: 0 !important; padding-right: 0.25rem !important; }
[dir="rtl"] .pl-2 { padding-left: 0 !important; padding-right: 0.5rem !important; }
[dir="rtl"] .pl-3 { padding-left: 0 !important; padding-right: 1rem !important; }
[dir="rtl"] .pl-4 { padding-left: 0 !important; padding-right: 1.5rem !important; }
[dir="rtl"] .pl-5 { padding-left: 0 !important; padding-right: 3rem !important; }

[dir="rtl"] .pr-0 { padding-right: 0 !important; padding-left: 0 !important; }
[dir="rtl"] .pr-1 { padding-right: 0 !important; padding-left: 0.25rem !important; }
[dir="rtl"] .pr-2 { padding-right: 0 !important; padding-left: 0.5rem !important; }
[dir="rtl"] .pr-3 { padding-right: 0 !important; padding-left: 1rem !important; }
[dir="rtl"] .pr-4 { padding-right: 0 !important; padding-left: 1.5rem !important; }
[dir="rtl"] .pr-5 { padding-right: 0 !important; padding-left: 3rem !important; }

/* Status badges in tables */
.datatable .badge-active,
.datatable .badge-inactive {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-active {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-inactive {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Responsive table improvements */
@media (max-width: 768px) {
    .datatable tbody td,
    .datatable thead th {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }
    
    .btn-xs {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* Checkbox styling */
.datatable tbody td input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    border-radius: 4px;
    border: 2px solid #dee2e6;
}

.datatable tbody td input[type="checkbox"]:checked {
    background-color: #667eea;
    border-color: #667eea;
}

/* Loading overlay */
.dataTables_processing {
    border-radius: 8px;
    padding: 1rem;
}

/* Modern Sidebar Styling */
.c-sidebar {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-right: none;
}

.c-sidebar-brand {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
}

.c-sidebar-brand .brand-link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.c-sidebar-brand .brand-link:hover {
    transform: scale(1.05);
}

.c-sidebar-brand .brand-image {
    border: 3px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.c-sidebar-brand .brand-link:hover .brand-image {
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

.c-sidebar-brand .brand-text {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.c-sidebar-nav {
    padding: 1rem 0;
}

.c-sidebar-nav-item {
    margin-bottom: 0.25rem;
}

.c-sidebar-nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 1rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 0;
    position: relative;
    display: flex;
    align-items: center;
}

.c-sidebar-nav-link::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(102, 126, 234, 0.3) 100%);
    transition: width 0.3s ease;
}

.c-sidebar-nav-link:hover {
    background: rgba(102, 126, 234, 0.1);
    color: white;
    padding-right: 1.75rem;
}

.c-sidebar-nav-link:hover::before {
    width: 4px;
}

.c-sidebar-nav-link.c-active {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.2) 0%, transparent 100%);
    color: white;
    border-right: 3px solid #667eea;
}

.c-sidebar-nav-link.c-active::before {
    width: 0;
}

.c-sidebar-nav-icon {
    margin-left: 0.75rem;
    width: 20px;
    text-align: center;
    font-size: 1.2rem;
    color: rgba(102, 126, 234, 1);
    transition: all 0.3s ease;
}

.c-sidebar-nav-link:hover .c-sidebar-nav-icon,
.c-sidebar-nav-link.c-active .c-sidebar-nav-icon {
    color: #667eea;
    transform: scale(1.1);
}

/* Dropdown menu styling */
.c-sidebar-nav-dropdown {
    background: rgba(15, 23, 42, 0.3);
}

.c-sidebar-nav-dropdown-toggle {
    color: rgba(255, 255, 255, 0.8);
    padding: 1rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
}

.c-sidebar-nav-dropdown-toggle::after {
    position: absolute;
    left: 1.5rem;
    transition: transform 0.3s ease;
}

.c-sidebar-nav-dropdown-toggle:hover {
    background: rgba(102, 126, 234, 0.1);
    color: white;
}

.c-sidebar-nav-dropdown.c-show > .c-sidebar-nav-dropdown-toggle {
    background: rgba(102, 126, 234, 0.2);
    color: white;
}

.c-sidebar-nav-dropdown.c-show > .c-sidebar-nav-dropdown-toggle::after {
    transform: rotate(180deg);
}

.c-sidebar-nav-dropdown-items {
    background: rgba(0, 0, 0, 0.2);
    padding: 0.5rem 0;
    border-right: 3px solid rgba(102, 126, 234, 0.3);
}

.c-sidebar-nav-dropdown-items .c-sidebar-nav-link {
    padding-right: 2.5rem;
    font-size: 0.9rem;
}

.c-sidebar-nav-dropdown-items .c-sidebar-nav-link::before {
    display: none;
}

/* Search field in sidebar */
.c-sidebar-nav .searchable-field {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    color: white;
    padding: 0.75rem;
    margin: 1rem;
    width: calc(100% - 2rem);
}

.c-sidebar-nav .searchable-field:focus {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.5);
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.c-sidebar-nav .searchable-field option {
    background: #1e293b;
    color: white;
}

/* Logout button special styling */
.c-sidebar-nav-item:last-child {
    margin-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.c-sidebar-nav-item:last-child .c-sidebar-nav-link {
    color: rgba(245, 87, 108, 0.9);
}

.c-sidebar-nav-item:last-child .c-sidebar-nav-link:hover {
    background: rgba(245, 87, 108, 0.1);
    color: #f5576c;
}

.c-sidebar-nav-item:last-child .c-sidebar-nav-link:hover::before {
    background: linear-gradient(90deg, transparent 0%, rgba(245, 87, 108, 0.3) 100%);
}

.c-sidebar-nav-item:last-child .c-sidebar-nav-icon {
    color: #f5576c;
}

/* Responsive sidebar */
@media (max-width: 991px) {
    .c-sidebar-brand {
        padding: 1rem;
    }
    
    .c-sidebar-brand .brand-image {
        width: 60px !important;
        height: 60px !important;
    }
    
    .c-sidebar-nav-link {
        padding: 0.75rem 1rem;
    }
}
