/* ================================================================
   CRG MLM Design System
   Presentation layer only. All theme values are controlled here.
   ================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --mlm-primary: #1e3a8a;
    --mlm-primary-hover: #172e70;
    --mlm-primary-soft: #dbeafe;
    --mlm-accent: #f59e0b;
    --mlm-accent-soft: #fef3c7;
    --mlm-success: #059669;
    --mlm-success-soft: #d1fae5;
    --mlm-danger: #dc2626;
    --mlm-danger-soft: #fee2e2;
    --mlm-warning: #d97706;
    --mlm-info: #0891b2;
    --mlm-indigo: #6d28d9;
    --mlm-bg: #f4f7fb;
    --mlm-surface: #ffffff;
    --mlm-surface-muted: #f8fafc;
    --mlm-text: #0f172a;
    --mlm-text-muted: #64748b;
    --mlm-border: #e2e8f0;
    --mlm-sidebar: #07163e;
    --mlm-sidebar-top: #10235f;
    --mlm-radius-sm: 8px;
    --mlm-radius: 12px;
    --mlm-radius-lg: 16px;
    --mlm-shadow-sm: 0 4px 14px rgba(15, 23, 42, .05);
    --mlm-shadow: 0 10px 30px rgba(15, 23, 42, .07);
    --mlm-shadow-lg: 0 18px 45px rgba(15, 23, 42, .12);
    --mlm-transition: 180ms ease;
    --mlm-space-1: 4px;
    --mlm-space-2: 8px;
    --mlm-space-3: 12px;
    --mlm-space-4: 16px;
    --mlm-space-5: 20px;
    --mlm-space-6: 24px;
    --mlm-focus-ring: 0 0 0 3px rgba(37, 99, 235, .14);
}

html {
    font-size: 16px;
}

body {
    background: var(--mlm-bg);
    color: var(--mlm-text);
    font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--mlm-primary);
    transition: color var(--mlm-transition);
}

a:hover {
    color: var(--mlm-primary-hover);
}

.content-wrapper {
    background: var(--mlm-bg);
}

.content-header {
    padding: 24px 8px 12px;
}

.content {
    padding: 0 8px 32px;
}

.content-header .container-fluid,
.content .container-fluid {
    max-width: 1680px;
}

.content-header h1,
.content-header h1[style] {
    color: var(--mlm-text);
    font-size: 1.5rem !important;
    font-weight: 750;
    line-height: 1.3;
    margin: 0;
}

.content-header h1:after {
    background: var(--mlm-accent);
    border-radius: 999px;
    content: "";
    display: block;
    height: 3px;
    margin-top: 8px;
    width: 32px;
}

/* App shell */
.main-header {
    background: rgba(255, 255, 255, .94) !important;
    border-bottom: 1px solid var(--mlm-border);
    box-shadow: var(--mlm-shadow-sm);
    min-height: 64px;
    padding-inline: 12px;
    backdrop-filter: blur(12px);
}

.main-header .nav-link {
    border-radius: 10px;
    color: var(--mlm-text-muted) !important;
    margin: 4px 2px;
    transition: background var(--mlm-transition), color var(--mlm-transition);
}

.main-header .nav-link:hover {
    background: var(--mlm-surface-muted);
    color: var(--mlm-primary) !important;
}

.navbar-search-block,
.navbar-search-block .form-control {
    background: var(--mlm-surface-muted) !important;
}

.main-sidebar {
    background: linear-gradient(180deg, var(--mlm-sidebar-top), var(--mlm-sidebar)) !important;
    box-shadow: 8px 0 28px rgba(7, 22, 62, .15) !important;
}

.brand-link {
    border-bottom: 1px solid rgba(255, 255, 255, .1) !important;
    min-height: 64px;
    padding: 17px 16px;
}

.brand-link .brand-text {
    color: #fff;
    font-weight: 750 !important;
    letter-spacing: .02em;
}

.brand-image {
    background: #fff;
    padding: 2px;
}

.sidebar {
    padding-top: 12px;
}

.nav-sidebar .nav-header {
    color: #93a4c7;
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: .12em;
    padding: 18px 18px 8px;
    text-transform: uppercase;
}

.nav-sidebar .nav-link {
    border-radius: 10px;
    color: #cbd5e1 !important;
    margin: 3px 8px;
    padding: 10px 12px;
    transition: background var(--mlm-transition), color var(--mlm-transition), transform var(--mlm-transition);
    width: calc(100% - 16px) !important;
}

.nav-sidebar .nav-link p {
    font-size: .84rem;
    font-weight: 600;
}

.nav-sidebar .nav-icon {
    color: #93a4c7;
    font-size: .92rem !important;
}

.nav-sidebar .nav-link:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff !important;
    transform: translateX(2px);
}

.nav-sidebar .nav-link.active {
    background: linear-gradient(135deg, #2563eb, #3b82f6) !important;
    box-shadow: 0 7px 18px rgba(37, 99, 235, .3);
    color: #fff !important;
}

.nav-sidebar .nav-link.active .nav-icon {
    color: #fff;
}

.nav-treeview {
    padding-left: 7px;
}

.main-footer {
    background: var(--mlm-surface);
    border-top: 1px solid var(--mlm-border);
    color: var(--mlm-text-muted);
    font-size: .78rem;
    padding: 16px 24px;
}

.main-footer strong {
    font-weight: 650;
}

.dropdown-menu {
    background: var(--mlm-surface);
    border: 1px solid var(--mlm-border);
    border-radius: var(--mlm-radius);
    box-shadow: var(--mlm-shadow-lg);
    padding: 8px;
}

.dropdown-item {
    border-radius: 8px;
    color: var(--mlm-text);
    font-size: .82rem;
    padding: 9px 12px;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--mlm-primary-soft);
    color: var(--mlm-primary);
}

/* Cards and panels */
.card {
    background: var(--mlm-surface);
    border: 1px solid var(--mlm-border);
    border-radius: var(--mlm-radius-lg);
    box-shadow: var(--mlm-shadow);
    margin-bottom: 24px;
    overflow: hidden;
    transition: transform var(--mlm-transition), box-shadow var(--mlm-transition), border-color var(--mlm-transition);
}

.card:hover {
    border-color: #d5deeb;
    box-shadow: var(--mlm-shadow-lg);
}

.card.card-outline {
    border-top: 3px solid var(--mlm-primary);
}

.card-header {
    background: var(--mlm-surface);
    border-bottom: 1px solid var(--mlm-border);
    padding: 16px 20px;
}

.card-header:first-child {
    border-radius: var(--mlm-radius-lg) var(--mlm-radius-lg) 0 0;
}

.card-title {
    color: var(--mlm-text);
    font-size: .95rem;
    font-weight: 750;
}

.card-body {
    padding: 20px;
}

.card-footer {
    background: var(--mlm-surface-muted);
    border-top: 1px solid var(--mlm-border);
    padding: 14px 20px;
}

.small-box,
.info-box {
    border: 1px solid var(--mlm-border);
    border-radius: var(--mlm-radius-lg);
    box-shadow: var(--mlm-shadow);
    overflow: hidden;
}

.info-box {
    background: var(--mlm-surface);
    color: var(--mlm-text);
}

/* Forms */
label,
.col-form-label {
    color: var(--mlm-text);
    font-size: .78rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.form-group {
    margin-bottom: 18px;
}

.form-control,
.custom-select,
select.form-control,
textarea.form-control,
.input-group-text {
    background-color: var(--mlm-surface);
    border: 1px solid var(--mlm-border);
    border-radius: var(--mlm-radius-sm);
    color: var(--mlm-text);
    font-size: .82rem;
    min-height: 40px;
    transition: border-color var(--mlm-transition), box-shadow var(--mlm-transition), background var(--mlm-transition);
}

.form-control:focus,
.custom-select:focus,
select.form-control:focus {
    background: var(--mlm-surface);
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .13);
    color: var(--mlm-text);
}

.form-control::placeholder {
    color: #94a3b8;
}

.form-control:disabled,
.form-control[readonly] {
    background: var(--mlm-surface-muted);
    color: var(--mlm-text-muted);
}

.input-group-text {
    background: var(--mlm-surface-muted);
    color: var(--mlm-text-muted);
}

.custom-control-label {
    font-weight: 500;
}

.custom-control-input:checked~.custom-control-label::before {
    background-color: var(--mlm-primary);
    border-color: var(--mlm-primary);
}

.invalid-feedback {
    font-size: .72rem;
}

.form-control.is-invalid {
    border-color: var(--mlm-danger);
}

.form-control.is-valid {
    border-color: var(--mlm-success);
}

.valid-feedback {
    color: var(--mlm-success);
    font-size: .72rem;
}

textarea.form-control {
    min-height: 104px;
    resize: vertical;
}

input[type="file"].form-control,
.custom-file-label {
    border: 1px dashed #b8c5d8;
    background: var(--mlm-surface-muted);
}

.custom-file-label {
    border-radius: var(--mlm-radius-sm);
    color: var(--mlm-text-muted);
    min-height: 40px;
    padding: 9px 12px;
}

.custom-file-label::after {
    background: var(--mlm-primary-soft);
    border: 0;
    color: var(--mlm-primary);
    font-weight: 700;
    min-height: 38px;
    padding-top: 9px;
}

.mlm-required-mark {
    color: var(--mlm-danger);
    margin-left: 3px;
}

.mlm-form-enhanced .row {
    row-gap: var(--mlm-space-2);
}

.mlm-form-enhanced .form-text,
.mlm-form-enhanced small.text-muted {
    color: var(--mlm-text-muted) !important;
    font-size: .7rem;
}

.mlm-password-wrap {
    position: relative;
}

.mlm-password-wrap .form-control {
    padding-right: 44px;
}

.mlm-password-toggle {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 7px;
    color: var(--mlm-text-muted);
    display: flex;
    height: 32px;
    justify-content: center;
    position: absolute;
    right: 5px;
    top: 4px;
    width: 34px;
    z-index: 4;
}

.mlm-password-toggle:hover {
    background: var(--mlm-primary-soft);
    color: var(--mlm-primary);
}

.form-check-input,
.custom-control-input {
    accent-color: var(--mlm-primary);
}

.custom-switch .custom-control-label::before {
    border-color: var(--mlm-border);
    box-shadow: none;
}

.custom-switch .custom-control-input:checked~.custom-control-label::before {
    background: var(--mlm-primary);
    border-color: var(--mlm-primary);
}

/* Form cards: reusable component and safe legacy-form coverage. */
.form-card,
.content form:not(#logout-form) {
    background: var(--mlm-surface);
    border: 1px solid var(--mlm-border);
    border-radius: var(--mlm-radius-lg);
    box-shadow: var(--mlm-shadow);
    margin-bottom: var(--mlm-space-6);
    overflow: hidden;
}

.content .card form:not(#logout-form),
.content .modal form:not(#logout-form),
.form-card form {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0;
    overflow: visible;
}

.form-card__header {
    align-items: center;
    background: linear-gradient(180deg, var(--mlm-surface), var(--mlm-surface-muted));
    border-bottom: 1px solid var(--mlm-border);
    display: flex;
    justify-content: space-between;
    gap: var(--mlm-space-4);
    padding: var(--mlm-space-4) var(--mlm-space-5);
}

.form-card__heading {
    align-items: center;
    display: flex;
    gap: var(--mlm-space-3);
    min-width: 0;
}

.form-card__icon {
    align-items: center;
    background: var(--mlm-primary-soft);
    border-radius: 10px;
    color: var(--mlm-primary);
    display: inline-flex;
    flex: 0 0 40px;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.form-card__heading h2 {
    color: var(--mlm-text);
    font-size: 1rem;
    font-weight: 800;
    margin: 0;
}

.form-card__heading p {
    color: var(--mlm-text-muted);
    font-size: .72rem;
    margin: 3px 0 0;
}

.form-card__header-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--mlm-space-2);
}

.form-card__body {
    padding: var(--mlm-space-5);
}

.form-card__footer {
    align-items: center;
    background: var(--mlm-surface-muted);
    border-top: 1px solid var(--mlm-border);
    display: flex;
    flex-wrap: wrap;
    gap: var(--mlm-space-2);
    justify-content: flex-end;
    padding: var(--mlm-space-3) var(--mlm-space-5);
}

.form-card__errors {
    align-items: flex-start;
    background: var(--mlm-danger-soft);
    border: 1px solid #fecaca;
    border-radius: var(--mlm-radius);
    color: #991b1b;
    display: flex;
    gap: var(--mlm-space-3);
    margin-bottom: var(--mlm-space-5);
    padding: var(--mlm-space-3) var(--mlm-space-4);
}

.form-card__errors>i {
    margin-top: 3px;
}

.form-card__errors strong {
    font-size: .78rem;
}

.form-card__errors ul {
    font-size: .72rem;
    margin: 5px 0 0;
    padding-left: 18px;
}

.form-card--compact .form-card__header {
    padding: 12px 16px;
}

.form-card--compact .form-card__body {
    padding: 16px;
}

.form-card--compact .form-group {
    margin-bottom: 10px;
}

.report-combined-card>.card-body {
    padding: 0;
}

.report-combined-card>.card-body>form {
    padding: var(--mlm-space-5) !important;
}

.report-results-section {
    border-top: 1px solid var(--mlm-border);
    padding: var(--mlm-space-5);
}

.report-results-section::before {
    color: var(--mlm-text);
    content: "Results";
    display: block;
    font-size: .9rem;
    font-weight: 800;
    margin-bottom: var(--mlm-space-4);
}

.report-results-section .row {
    margin: 0;
}

.report-results-section .col-12 {
    padding: 0;
}

.content form:not(#logout-form) {
    padding: var(--mlm-space-5);
}

.content .card form:not(#logout-form),
.content .modal form:not(#logout-form),
.form-card form {
    padding: 0;
}

.content form[method="get"],
.content form[method="GET"] {
    padding: var(--mlm-space-4);
}

.content .card form[method="get"],
.content .card form[method="GET"] {
    padding: 0;
}

.form-card .form-control,
.form-card .custom-select,
.content form .form-control,
.content form .custom-select {
    min-height: 44px;
    width: 100%;
}

.form-card textarea.form-control,
.content form textarea.form-control {
    min-height: 112px;
}

.form-card .select2-container .select2-selection--single,
.content form .select2-container .select2-selection--single {
    min-height: 44px;
}

.form-card .select2-container--default .select2-selection--single .select2-selection__rendered,
.content form .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 0px;
}

.form-card .select2-container--default .select2-selection--single .select2-selection__arrow,
.content form .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 42px;
}

.btn.is-loading,
.btn[aria-busy="true"] {
    color: transparent !important;
    pointer-events: none;
    position: relative;
}

.btn.is-loading::after,
.btn[aria-busy="true"]::after {
    animation: mlm-spin .7s linear infinite;
    border: 2px solid rgba(255, 255, 255, .45);
    border-radius: 50%;
    border-top-color: #fff;
    content: "";
    height: 16px;
    left: calc(50% - 8px);
    position: absolute;
    top: calc(50% - 8px);
    width: 16px;
}

@keyframes mlm-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Buttons */
.btn {
    border-radius: var(--mlm-radius-sm);
    font-size: .78rem;
    font-weight: 700;
    min-height: 38px;
    padding: 8px 16px;
    transition: transform var(--mlm-transition), box-shadow var(--mlm-transition), background var(--mlm-transition);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15) !important;
}

.btn-primary {
    background: var(--mlm-primary);
    border-color: var(--mlm-primary);
    box-shadow: 0 5px 12px rgba(30, 58, 138, .18);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--mlm-primary-hover);
    border-color: var(--mlm-primary-hover);
}

.btn-success {
    background: var(--mlm-success);
    border-color: var(--mlm-success);
}

.btn-danger {
    background: var(--mlm-danger);
    border-color: var(--mlm-danger);
}

.btn-warning {
    background: var(--mlm-accent);
    border-color: var(--mlm-accent);
    color: #422006;
}

.btn-secondary {
    background: #475569;
    border-color: #475569;
}

.btn-outline-primary {
    border-color: var(--mlm-primary);
    color: var(--mlm-primary);
}

.btn-outline-primary:hover {
    background: var(--mlm-primary);
}

.btn-sm {
    min-height: 32px;
    padding: 5px 10px;
}

.icon-edit,
.icon-print {
    color: #0d6efd;
}

.icon-delete,
.icon-cancel {
    color: #dc3545;
}

.btn-icon {
    align-items: center;
    background: transparent !important;
    border: 0 !important;
    border-radius: 6px;
    box-shadow: none !important;
    display: inline-flex;
    font-size: 1.1rem;
    justify-content: center;
    line-height: 1;
    min-height: 30px;
    min-width: 30px;
    padding: 4px 8px;
}

.btn-icon:hover,
.btn-icon:focus {
    background: rgba(0, 0, 0, .06) !important;
    transform: none;
}

.btn-icon:focus-visible {
    box-shadow: var(--mlm-focus-ring) !important;
    outline: 0;
}

.table td .btn-icon,
table.dataTable td .btn-icon {
    margin: 0 2px;
    vertical-align: middle;
}

/* Tables and DataTables */
.table-responsive {
    background: var(--mlm-surface);
    border: 1px solid var(--mlm-border);
    border-radius: var(--mlm-radius-lg);
    box-shadow: var(--mlm-shadow);
    margin-bottom: var(--mlm-space-6);
    overflow-x: auto;
    overflow-y: hidden;
}

.card .table-responsive,
.modal .table-responsive,
.table-card .table-responsive,
.report-combined-card .table-responsive {
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0;
}

.modal .table-responsive {
    border-radius: var(--mlm-radius-sm);
}

.table-card {
    overflow: hidden;
}

.table-card>.card-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.table-card__actions {
    align-items: center;
    flex-wrap: wrap;
}

.table-card>.card-body {
    padding: 0;
}

.table-card>.card-footer {
    align-items: center;
    display: flex;
    justify-content: flex-end;
}

.table {
    color: var(--mlm-text);
    margin-bottom: 0;
}

.table thead th,
table.dataTable thead th {
    background: var(--mlm-surface-muted);
    border-bottom: 1px solid var(--mlm-border) !important;
    border-top: 0;
    color: var(--mlm-text-muted);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: 0px;
    padding: 12px 14px;
    text-transform: uppercase;
    vertical-align: middle;
}

.table td,
table.dataTable tbody td {
    border-color: var(--mlm-border);
    font-size: .76rem;
    padding: 14px 12px;
    vertical-align: middle;
}

table td,
table th {
    color: black !important;
}

.table th:first-child,
.table td:first-child,
table.dataTable th:first-child,
table.dataTable td:first-child {
    padding-left: 20px;
}

.table th:last-child,
.table td:last-child,
table.dataTable th:last-child,
table.dataTable td:last-child {
    padding-right: 20px;
}

.table tbody tr:last-child td,
table.dataTable tbody tr:last-child td {
    border-bottom: 0;
}

.table-striped tbody tr:nth-of-type(odd),
table.dataTable.stripe tbody tr.odd {
    background: transparent;
}

.table-striped tbody tr:nth-of-type(even),
table.dataTable.stripe tbody tr.even {
    background: var(--mlm-surface-muted);
}

.table-hover tbody tr:hover,
table.dataTable tbody tr:hover {
    background: #eff6ff !important;
}

.table-bordered,
.table-bordered td,
.table-bordered th {
    border-color: var(--mlm-border);
}

.dataTables_wrapper {
    color: var(--mlm-text-muted);
    font-size: .76rem;
    margin-bottom: var(--mlm-space-6);
    overflow-x: auto;
    overflow-y: hidden;
    padding: var(--mlm-space-4);
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

.card .dataTables_wrapper,
.modal .dataTables_wrapper,
.table-card .dataTables_wrapper,
.report-combined-card .dataTables_wrapper {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0;
    overflow: visible;
    padding: 0;
}

.card .dataTables_wrapper,
.table-card .dataTables_wrapper,
.report-combined-card .dataTables_wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.dataTables_wrapper table.dataTable {
    width: 100% !important;
}

.dataTables_wrapper table.dataTable.nowrap {
    white-space: nowrap;
}

.dataTables_wrapper .dataTables_scroll {
    width: 100%;
}

.dataTables_wrapper .dataTables_scrollBody {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 14px;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    background: var(--mlm-surface);
    border: 1px solid var(--mlm-border);
    border-radius: 8px;
    color: var(--mlm-text);
    min-height: 36px;
    padding: 6px 10px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button,
.page-link {
    background: var(--mlm-surface) !important;
    border: 1px solid var(--mlm-border) !important;
    border-radius: 7px !important;
    color: var(--mlm-text-muted) !important;
    margin: 0 2px;
    min-width: 34px;
    text-align: center;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.page-item.active .page-link {
    background: var(--mlm-primary) !important;
    border-color: var(--mlm-primary) !important;
    color: #fff !important;
}

.table .badge,
table.dataTable .badge {
    border-radius: 999px;
    font-size: .65rem;
    font-weight: 750;
    padding: 6px 10px;
}

.table .badge-success,
.table .bg-success,
table.dataTable .badge-success,
table.dataTable .bg-success {
    background: var(--mlm-success-soft) !important;
    color: #047857 !important;
}

.table .badge-warning,
.table .bg-warning,
table.dataTable .badge-warning,
table.dataTable .bg-warning {
    background: var(--mlm-accent-soft) !important;
    color: #b45309 !important;
}

.table .badge-danger,
.table .bg-danger,
table.dataTable .badge-danger,
table.dataTable .bg-danger {
    background: var(--mlm-danger-soft) !important;
    color: #b91c1c !important;
}

.table .badge-secondary,
.table .bg-secondary,
table .badge-dark,
table.dataTable .badge-secondary,
table.dataTable .bg-secondary {
    background: #e2e8f0 !important;
    color: #475569 !important;
}

.table td .btn-group,
table.dataTable td .btn-group {
    display: inline-flex;
    gap: 5px;
}

.table td .btn-sm,
table.dataTable td .btn-sm {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    min-height: 30px;
    min-width: 30px;
    padding: 5px 8px;
}

.table td.text-right,
.table th.text-right,
table.dataTable td.text-right,
table.dataTable th.text-right,
.table td[align="right"] {
    font-variant-numeric: tabular-nums;
    text-align: right !important;
}

.table .empty-state,
.table .dataTables_empty,
table.dataTable .dataTables_empty {
    color: var(--mlm-text-muted);
    padding: 44px 20px !important;
    text-align: center;
}

.mlm-table-shell {
    background: var(--mlm-surface);
    border: 1px solid var(--mlm-border);
    border-radius: var(--mlm-radius-lg);
    box-shadow: var(--mlm-shadow);
    margin-bottom: var(--mlm-space-6);
    padding: var(--mlm-space-5);
}

.mlm-table-shell>.table-responsive {
    border: 0;
}

.dataTables_wrapper .row {
    align-items: center;
    row-gap: var(--mlm-space-3);
}

.dataTables_wrapper .dataTables_info {
    color: var(--mlm-text-muted);
    padding-top: 14px;
}

.dataTables_wrapper .dataTables_paginate {
    padding-top: 10px;
}

.dataTables_wrapper .dataTables_filter label,
.dataTables_wrapper .dataTables_length label {
    color: var(--mlm-text-muted);
    font-weight: 650;
}

.dataTables_wrapper .dataTables_filter input {
    min-width: 220px;
}

.dataTables_wrapper .dt-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.dataTables_wrapper .dt-button,
.dt-buttons .btn {
    background: var(--mlm-surface) !important;
    border: 1px solid var(--mlm-border) !important;
    border-radius: 8px !important;
    color: var(--mlm-text) !important;
    font-size: .72rem !important;
    font-weight: 700 !important;
    padding: 7px 11px !important;
}

.dataTables_wrapper .dt-button:hover,
.dt-buttons .btn:hover {
    background: red !important;
    border-color: red !important;
    color: white !important;
}

.dataTables_scrollHead {
    border-radius: var(--mlm-radius) var(--mlm-radius) 0 0;
    position: sticky;
    top: 0;
    z-index: 2;
}

table.dataTable.dtr-inline.collapsed>tbody>tr>td.dtr-control:before {
    background: var(--mlm-primary);
    border: 0;
    box-shadow: none;
}

table.dataTable tbody tr.child ul.dtr-details {
    width: 100%;
}

.mlm-empty-row td {
    color: var(--mlm-text-muted);
    padding: 42px 16px !important;
    text-align: center;
}

/* Select2, dates, modals, alerts and badges */
.select2-container {
    max-width: 100%;
    width: 100% !important;
}

.select2-container .select2-selection--single,
.select2-container .select2-selection--multiple {
    background: var(--mlm-surface);
    border: 1px solid var(--mlm-border) !important;
    border-radius: 8px !important;
    min-height: 40px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--mlm-text);
    line-height: 38px;
    padding-left: 12px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 38px;
}

.select2-dropdown,
.datepicker {
    background: var(--mlm-surface);
    border: 1px solid var(--mlm-border);
    border-radius: 10px;
    box-shadow: var(--mlm-shadow-lg);
    color: var(--mlm-text);
    overflow: hidden;
}

.select2-results__option--highlighted,
.datepicker table tr td.active {
    background: var(--mlm-primary) !important;
}

.modal-content {
    background: var(--mlm-surface);
    border: 0;
    border-radius: var(--mlm-radius-lg);
    box-shadow: var(--mlm-shadow-lg);
    overflow: hidden;
}

.modal-header,
.modal-footer {
    border-color: var(--mlm-border);
    padding: 16px 20px;
}

.modal-body {
    color: var(--mlm-text);
    padding: 20px;
}

.modal-title {
    font-size: 1rem;
    font-weight: 750;
}

.alert {
    border: 0;
    border-radius: var(--mlm-radius);
    box-shadow: var(--mlm-shadow-sm);
    font-size: .8rem;
}

.alert-success {
    background: var(--mlm-success-soft);
    color: #065f46;
}

.alert-danger {
    background: var(--mlm-danger-soft);
    color: #991b1b;
}

.alert-warning {
    background: var(--mlm-accent-soft);
    color: #92400e;
}

.badge {
    border-radius: 999px;
    font-size: .65rem;
    font-weight: 750;
    padding: 6px 9px;
}

.badge-success {
    background: var(--mlm-success);
}

.badge-danger {
    background: var(--mlm-danger);
}

.badge-warning {
    background: var(--mlm-accent);
    color: #422006;
}

.badge-primary {
    background: var(--mlm-primary);
}

/* Auth screens */
.login-page,
.register-page {
    align-items: center;
    background: radial-gradient(circle at 15% 10%, rgba(37, 99, 235, .18), transparent 30%), radial-gradient(circle at 90% 90%, rgba(245, 158, 11, .13), transparent 28%), var(--mlm-bg);
    min-height: 100vh;
    padding: 24px;
}

.login-box,
.register-box {
    width: min(440px, 100%);
}

.login-logo a,
.register-logo a {
    color: var(--mlm-primary);
    font-size: 1.65rem;
    font-weight: 800;
}

.login-box .card,
.register-box .card {
    border: 1px solid var(--mlm-border);
    box-shadow: var(--mlm-shadow-lg);
}

.login-box .card-header,
.register-box .card-header {
    padding: 24px 24px 8px;
    border: 0;
}

.login-box .card-title,
.register-box .card-title {
    font-size: 1.25rem;
}

.login-card-body,
.register-card-body {
    background: var(--mlm-surface);
    padding: 24px;
}

/* Reusable application components */
.ui-card {
    background: var(--mlm-surface);
    border: 1px solid var(--mlm-border);
    border-radius: var(--mlm-radius-lg);
    box-shadow: var(--mlm-shadow);
    overflow: hidden;
}

.ui-card {
    transition: transform var(--mlm-transition), box-shadow var(--mlm-transition);
}

.ui-card:hover {
    box-shadow: var(--mlm-shadow-lg);
    transform: translateY(-2px);
}

.ui-card__header {
    align-items: center;
    border-bottom: 1px solid var(--mlm-border);
    display: flex;
    justify-content: space-between;
    padding: 16px 20px;
}

.ui-card__title {
    align-items: center;
    color: var(--mlm-text);
    display: flex;
    font-size: .95rem;
    font-weight: 750;
    gap: 10px;
    margin: 0;
}

.ui-card__body {
    padding: 20px;
}

.ui-card__icon,
.ui-page-header__icon {
    align-items: center;
    background: var(--mlm-primary-soft);
    border-radius: 10px;
    color: var(--mlm-primary);
    display: inline-flex;
    height: 36px;
    justify-content: center;
    width: 36px;
}

.ui-card__actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ui-card__footer {
    background: var(--mlm-surface-muted);
    border-top: 1px solid var(--mlm-border);
    padding: 14px 20px;
}

.ui-stat {
    align-items: center;
    background: var(--mlm-surface);
    border: 1px solid var(--mlm-border);
    border-radius: var(--mlm-radius-lg);
    box-shadow: var(--mlm-shadow);
    display: flex;
    gap: 14px;
    padding: 18px;
}

.ui-stat {
    overflow: hidden;
    position: relative;
    transition: transform var(--mlm-transition), box-shadow var(--mlm-transition);
}

.ui-stat:hover {
    box-shadow: var(--mlm-shadow-lg);
    transform: translateY(-3px)
}

.ui-stat__icon {
    align-items: center;
    background: var(--mlm-primary-soft);
    border-radius: 50%;
    color: var(--mlm-primary);
    display: flex;
    flex: 0 0 48px;
    height: 48px;
    justify-content: center;
    width: 48px;
}

.ui-stat__label {
    color: var(--mlm-text-muted);
    display: block;
    font-size: .72rem;
    font-weight: 700;
}

.ui-stat__value {
    color: var(--mlm-text);
    display: block;
    font-size: 1.35rem;
    font-weight: 800;
}

.ui-stat__trend {
    color: var(--mlm-success);
    font-size: .68rem;
    font-weight: 700
}

.ui-stat--success .ui-stat__icon {
    background: var(--mlm-success-soft);
    color: var(--mlm-success)
}

.ui-stat--warning .ui-stat__icon {
    background: var(--mlm-accent-soft);
    color: var(--mlm-warning)
}

.ui-stat--danger .ui-stat__icon {
    background: var(--mlm-danger-soft);
    color: var(--mlm-danger)
}

.ui-empty {
    align-items: center;
    color: var(--mlm-text-muted);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 160px;
    padding: 24px;
    text-align: center;
}

.ui-empty i {
    color: #94a3b8;
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.ui-empty strong {
    color: var(--mlm-text);
}

.ui-page-header {
    align-items: center;
    background: var(--mlm-surface);
    border: 1px solid var(--mlm-border);
    border-radius: var(--mlm-radius-lg);
    box-shadow: var(--mlm-shadow-sm);
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--mlm-space-6);
    padding: 18px 20px
}

.ui-page-header__main {
    align-items: center;
    display: flex;
    gap: 12px
}

.ui-page-header h1 {
    color: var(--mlm-text);
    font-size: 1.2rem;
    font-weight: 800;
    margin: 0
}

.ui-page-header p {
    color: var(--mlm-text-muted);
    font-size: .76rem;
    margin: 3px 0 0
}

.ui-page-header__actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px
}

/* Dark mode: class toggle and operating-system preference */
html.mlm-dark {
    --mlm-bg: #081120;
    --mlm-surface: #101b2d;
    --mlm-surface-muted: #162337;
    --mlm-text: #e7eef9;
    --mlm-text-muted: #94a3b8;
    --mlm-border: #26364d;
    --mlm-shadow: 0 12px 30px rgba(0, 0, 0, .2);
    --mlm-shadow-lg: 0 20px 50px rgba(0, 0, 0, .35);
}

html.mlm-dark .main-header {
    background: rgba(16, 27, 45, .94) !important;
}

html.mlm-dark .table-hover tbody tr:hover,
html.mlm-dark table.dataTable tbody tr:hover {
    background: #172c4c !important;
}

html.mlm-dark .alert-success {
    background: #103b35;
    color: #6ee7b7;
}

html.mlm-dark .alert-danger {
    background: #482426;
    color: #fca5a5;
}

html.mlm-dark .table .badge-success,
html.mlm-dark table.dataTable .badge-success {
    background: #103b35 !important;
    color: #6ee7b7 !important;
}

html.mlm-dark .table .badge-warning,
html.mlm-dark table.dataTable .badge-warning {
    background: #44331b !important;
    color: #fcd34d !important;
}

html.mlm-dark .table .badge-danger,
html.mlm-dark table.dataTable .badge-danger {
    background: #482426 !important;
    color: #fca5a5 !important;
}

.user-menu-toggle {
    align-items: center;
    display: flex !important;
    gap: 9px;
}

.user-avatar {
    align-items: center;
    background: var(--mlm-primary-soft);
    border-radius: 10px;
    color: var(--mlm-primary);
    display: inline-flex;
    height: 32px;
    justify-content: center;
    width: 32px;
}

.user-display-name {
    color: var(--mlm-text);
    font-size: .78rem;
    font-weight: 750;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-summary {
    align-items: center;
    border-bottom: 1px solid var(--mlm-border);
    display: flex;
    gap: 12px;
    padding: 14px;
}

.user-avatar-lg {
    flex: 0 0 42px;
    height: 42px;
    width: 42px;
}

.user-menu-summary strong,
.user-menu-summary small {
    display: block;
}

.user-menu-summary strong {
    color: var(--mlm-text);
    font-size: .82rem;
}

.user-menu-summary small {
    color: var(--mlm-text-muted);
    font-size: .68rem;
    margin-top: 2px;
}

/* Landing page retains its route/auth controls and receives the same brand. */
.mlm-welcome {
    background: var(--mlm-bg) !important;
    color: var(--mlm-text);
}

.mlm-welcome>div {
    background-color: var(--mlm-bg) !important;
}

.mlm-welcome .bg-white,
.mlm-welcome [class*="dark:bg-gray-800"] {
    background: var(--mlm-surface) !important;
    border: 1px solid var(--mlm-border);
    border-radius: var(--mlm-radius-lg);
    box-shadow: var(--mlm-shadow) !important;
}

.mlm-welcome .text-gray-900,
.mlm-welcome .text-gray-600 {
    color: var(--mlm-text) !important;
}

.mlm-welcome .text-gray-500,
.mlm-welcome .text-gray-400 {
    color: var(--mlm-text-muted) !important;
}

.mlm-welcome .stroke-red-500 {
    stroke: var(--mlm-primary) !important;
}

.mlm-welcome .bg-red-50 {
    background: var(--mlm-primary-soft) !important;
}

.mlm-welcome [class*="focus:outline-red"]:focus {
    outline-color: var(--mlm-primary) !important;
}

/* Breadcrumbs, tabs and legacy Bootstrap 5 helpers. */
.breadcrumb {
    background: transparent;
    border-radius: 0;
    font-size: .75rem;
    margin-bottom: 0;
    padding: 0;
}

.breadcrumb-item a {
    color: var(--mlm-text-muted);
}

.breadcrumb-item.active {
    color: var(--mlm-primary);
    font-weight: 700;
}

.nav-tabs {
    border-bottom-color: var(--mlm-border);
}

.nav-tabs .nav-link {
    border-radius: 8px 8px 0 0;
    color: var(--mlm-text-muted);
    font-size: .78rem;
    font-weight: 700;
}

.nav-tabs .nav-link.active {
    background: var(--mlm-surface);
    border-color: var(--mlm-border) var(--mlm-border) var(--mlm-surface);
    color: var(--mlm-primary);
}

.pagination {
    gap: 4px;
}

.pagination .page-link {
    line-height: 1.35;
}

.btn-primary-light,
.btn-info-light {
    background: var(--mlm-primary-soft);
    color: var(--mlm-primary);
    border-color: transparent;
}

.btn-danger-light {
    background: var(--mlm-danger-soft);
    color: var(--mlm-danger);
    border-color: transparent;
}

.bg-danger-subtle {
    background: var(--mlm-danger-soft) !important;
    color: #991b1b;
}

.text-nowrap {
    white-space: nowrap;
}

.page-header-breadcrumb {
    background: var(--mlm-surface);
    border: 1px solid var(--mlm-border);
    border-radius: var(--mlm-radius);
    box-shadow: var(--mlm-shadow-sm);
    padding: 14px 18px;
}

.page-header-breadcrumb .page-title {
    color: var(--mlm-text);
    font-size: 1.1rem;
    font-weight: 750;
}

/* Keep dense legacy forms usable on narrow screens. */
img {
    max-width: 100%;
}

.card-body .row {
    row-gap: 4px;
}

fieldset {
    border-color: var(--mlm-border) !important;
    border-radius: var(--mlm-radius) !important;
}

legend {
    color: var(--mlm-primary);
    font-size: .82rem;
    font-weight: 750;
    padding-inline: 8px;
    width: auto;
}

/* DataTables export buttons. */
.buttons-pdf i,
.btn-export-pdf i {
    color: #dc3545;
}

.buttons-excel i,
.btn-export-excel i {
    color: #198754;
}

.bi.bi-file-earmark-pdf,
.bi.bi-file-earmark-excel {
    font-size: large;
}

.dt-buttons .btn-export {
    background: transparent;
    border: 1px solid var(--bs-border-color, #dee2e6);
    padding: 6px 10px;
    font-size: 1.1rem;
    line-height: 1;
}

.dt-buttons .btn-export:hover {
    background: rgba(0, 0, 0, .06);
}

@media (max-width: 991.98px) {
    .content-header {
        padding-top: 18px;
    }

    .card-body {
        padding: 16px;
    }

    .main-header {
        min-height: 58px;
    }

    .table-responsive>.table {
        min-width: 720px;
    }
}

@media (max-width: 575.98px) {
    .content {
        padding-inline: 0;
    }

    .content-header {
        padding-inline: 0;
    }

    .content-header h1,
    .content-header h1[style] {
        font-size: 1.25rem !important;
    }

    .card {
        border-radius: 12px;
        margin-bottom: 16px;
    }

    .card-header,
    .card-body,
    .card-footer {
        padding-left: 14px;
        padding-right: 14px;
    }

    .btn {
        padding-left: 12px;
        padding-right: 12px;
    }

    .main-footer {
        padding: 14px 16px;
        text-align: center;
    }

    .form-group [class*="col-"] {
        text-align: left !important;
    }

    .page-header-breadcrumb {
        align-items: flex-start !important;
        gap: 10px;
        padding: 12px;
    }

    .modal-dialog {
        margin: 12px;
    }

    .table-card>.card-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .table-card__actions {
        width: 100%;
    }

    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_length {
        float: none;
        text-align: left;
        width: 100%;
    }

    .dataTables_wrapper .dataTables_filter input {
        margin-left: 0;
        margin-top: 6px;
        min-width: 0;
        width: 100%;
    }

    .dataTables_wrapper .dataTables_paginate {
        display: flex;
        justify-content: flex-start;
        overflow-x: auto;
        width: 100%;
    }

    .dataTables_wrapper table.dataTable:not(.collapsed) {
        min-width: 720px;
    }

    .dataTables_wrapper table.dataTable.collapsed {
        min-width: 100%;
    }

    table.dataTable.dtr-inline.collapsed>tbody>tr>td.dtr-control,
    table.dataTable.dtr-inline.collapsed>tbody>tr>th.dtr-control {
        padding-left: 42px;
        position: relative;
    }
}

@media print {

    .main-header,
    .main-sidebar,
    .main-footer,
    .btn,
    .dataTables_filter,
    .dataTables_length,
    .dataTables_paginate {
        display: none !important;
    }

    .content-wrapper {
        margin: 0 !important;
        background: #fff !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #d1d5db;
    }
}

.form-card .form-control,
.form-card .custom-select,
.content form .form-control,
.content form .custom-select {
    min-height: 40px !important;
}

label,
.col-form-label {
    font-weight: 600 !important;
}

#Effect_From input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    /* Prevents iOS auto-zoom on focus */
    color: #1f2937;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Accessible focus state */
#Effect_From input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
}

/* Placeholder styling */
#Effect_From input::placeholder {
    color: #9ca3af;
}

.user-menu a img {
    display: none !important;
}