/**
 * Washing Automation — AdminLTE overrides & report table styles
 */
:root {
    --wash-primary: #008B74;
    --wash-primary-dark: #006b5a;
}

.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active,
.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active:hover {
    background-color: var(--wash-primary);
    color: #fff;
}

[class*="sidebar-dark-"] .brand-link,
[class*="sidebar-dark-"] .brand-link:hover {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.wash-brand-link {
    display: flex;
    align-items: center;
    min-height: 3.5rem;
}

.wash-brand-logo {
    max-height: 32px;
    width: auto;
    object-fit: contain;
}

.wash-brand-text {
    white-space: normal;
    line-height: 1.2;
}

.btn-primary {
    background-color: var(--wash-primary);
    border-color: var(--wash-primary-dark);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:not(:disabled):not(.disabled):active {
    background-color: var(--wash-primary-dark);
    border-color: #005a4c;
}

.btn-outline-primary {
    color: var(--wash-primary);
    border-color: var(--wash-primary);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--wash-primary);
    border-color: var(--wash-primary-dark);
    color: #fff;
}

a {
    color: var(--wash-primary);
}

a:hover {
    color: var(--wash-primary-dark);
}

.content-wrapper .card table.dataTable {
    width: 100% !important;
}

.content-wrapper .card table.dataTable th,
.content-wrapper .card table.dataTable td {
    vertical-align: middle;
    white-space: normal;
}

.content-wrapper .card table.dataTable td:last-child,
.content-wrapper .card table.dataTable th:last-child,
.wash-actions-cell {
    white-space: nowrap;
}

/* KPI boxes */
.wash-kpi-row {
    margin-bottom: 1rem;
}

.wash-kpi-box {
    border-radius: 0.25rem;
    padding: 1rem 1.15rem;
    color: #fff;
    min-height: 88px;
}

.wash-kpi-box .wash-kpi-value {
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.2;
}

.wash-kpi-box .wash-kpi-label {
    font-size: 0.85rem;
    opacity: 0.92;
    margin-top: 0.25rem;
}

.wash-kpi-primary {
    background: linear-gradient(135deg, var(--wash-primary) 0%, var(--wash-primary-dark) 100%);
}

.wash-kpi-secondary {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
}

.wash-kpi-info {
    background: linear-gradient(135deg, #17a2b8 0%, #117a8b 100%);
}

.wash-kpi-warning {
    background: linear-gradient(135deg, #fd7e14 0%, #e8590c 100%);
}

/* Report filters */
.wash-report-filters .date-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.75rem;
}

.wash-report-filters .btn-preset {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    border-radius: 0.2rem;
    border: 1px solid #ced4da;
    background: #fff;
    color: #495057;
    cursor: pointer;
}

.wash-report-filters .btn-preset:hover {
    border-color: var(--wash-primary);
    color: var(--wash-primary);
}

.wash-report-filters .btn-preset.active {
    background: var(--wash-primary);
    border-color: var(--wash-primary);
    color: #fff;
}

/* DataTables report */
.wash-dt-report thead tr.wash-col-filters th {
    padding: 4px 6px;
    vertical-align: top;
}

.wash-dt-report table.dataTable th,
.wash-dt-report table.dataTable td {
    white-space: nowrap;
}

.wash-dt-report thead tr.wash-col-filters input.form-control-sm {
    height: calc(1.5em + 0.5rem + 2px);
    padding: 0.15rem 0.35rem;
    min-width: 90px;
}

.wash-dt-report tfoot tr.wash-subtotal-row td {
    background: #eef5ff !important;
    border-top: 2px solid #6c8ebf !important;
    font-weight: 700;
}

.wash-dt-report table.dataTable thead > tr:not(.wash-col-filters) > th.sorting_asc,
.wash-dt-report table.dataTable thead > tr:not(.wash-col-filters) > th.sorting_desc {
    background-color: #d9ecff !important;
    color: #0b2e59;
}

.wash-dt-report table.dataTable thead > tr:not(.wash-col-filters) > th.sorting {
    cursor: move;
}

.wash-dt-tools .dt-buttons {
    margin-bottom: 0.5rem;
}

.wash-dt-tools .dataTables_length,
.wash-dt-tools .dataTables_filter {
    margin-bottom: 0.5rem;
}

.dataTables_wrapper {
    width: 100%;
}

.dataTables_wrapper .dt-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.dataTables_wrapper .dt-buttons .btn {
    min-width: 2.1rem;
}

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0;
}

.dataTables_wrapper .dataTables_filter label {
    justify-content: flex-end;
}

.dataTables_wrapper .dataTables_filter input {
    max-width: 220px;
}

.dataTables_wrapper .dataTables_length select {
    width: auto;
    min-width: 4.5rem;
}

.dataTables_wrapper .dataTables_scroll {
    width: 100%;
}

.output-chip {
    display: inline-block;
    background: #f1f3f5;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.15rem 0.45rem;
    margin: 0.1rem 0.2rem 0.1rem 0;
    font-size: 0.8rem;
    white-space: normal;
}

/* Card lookup form fixes */
.wash-card-lookup .form-control-sm {
    min-height: 34px;
    height: auto;
    padding: 0.35rem 0.55rem;
    line-height: 1.35;
}

.wash-card-lookup select.form-control-sm {
    height: 34px;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

/* Legacy layout helpers still used on some pages */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    margin-bottom: 0;
    color: #212529;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.3rem;
    vertical-align: middle;
    border-top: 1px solid #dee2e6;
}

.data-table thead th {
    vertical-align: bottom;
    border-bottom: 2px solid #dee2e6;
}

.form-error {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 1rem;
}

@media (max-width: 767.98px) {
    .card-header.d-flex,
    form.d-flex,
    .card-body > .d-flex {
        row-gap: 0.5rem;
    }

    .table-wrap {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .dataTables_wrapper .dataTables_filter label {
        justify-content: flex-start;
    }

    .dataTables_wrapper .dataTables_filter input {
        max-width: 100%;
        width: 100%;
    }

    .dataTables_wrapper .dt-buttons {
        margin-bottom: 0.5rem;
    }
}

/* RTL (FuelAutomation parity) */
html[dir="rtl"] body {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] .main-sidebar {
    left: auto;
    right: 0;
}

html[dir="rtl"] .content-wrapper,
html[dir="rtl"] .main-footer,
html[dir="rtl"] .main-header {
    margin-left: 0;
    margin-right: 250px;
}

@media (max-width: 991.98px) {
    html[dir="rtl"] .content-wrapper,
    html[dir="rtl"] .main-footer,
    html[dir="rtl"] .main-header {
        margin-right: 0;
    }
}

