﻿/* Working Set Components Styles */
.working-sets-page {
    background: #fff;
    height: calc(100vh - 50px);
}
    /* Header Component Styles */
    .working-sets-page .working-set-header {
        background: white;
        padding: 24px 32px;
        border-bottom: 1px solid #e5e7eb;
        margin-bottom: 24px;
    }

    .working-sets-page .header-content {
        display: flex;
        justify-content: space-between;
        align-items: center;
        /*    max-width: 1200px;
    margin: 0 auto;*/
    }

    .working-sets-page .header-text {
        flex: 1;
    }

    .working-sets-page .page-title {
        font-size: 24px;
        font-weight: 700;
        color: #1f2937;
        margin: 0 0 8px 0;
        line-height: 1.2;
    }

    .working-sets-page .page-description {
        font-size: 13px;
        color: #6b7280;
        margin: 0;
        line-height: 1.5;
    }

    .working-sets-page .header-actions {
        flex-shrink: 0;
        margin-left: 24px;
    }

    .working-sets-page .btn-add-working-set {
        background: #10b981;
        color: white;
        border: none;
        border-radius: 8px;
        padding: 12px 20px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 8px;
        transition: all 0.3s ease;
        box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
    }

        .working-sets-page .btn-add-working-set:hover {
            background: #059669;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
        }

        .working-sets-page .btn-add-working-set:active {
            transform: translateY(0);
            box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
        }

    .working-sets-page .btn-icon {
        font-size: 16px;
        font-weight: bold;
    }

/* Table Component Styles */
    .working-sets-page .working-set-table {
        background: white;
        border-radius: 12px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
        height: fit-content;
        max-height: calc(100vh - 210px);
        /*    max-width: 1200px;*/
        margin: 0 2rem;
    }

        .working-sets-page .working-set-table .table {
            width: 100%;
            border-collapse: collapse;
            margin: 0;
        }

            .working-sets-page .working-set-table .table thead {
                background: #f9fafb;
            }

            .working-sets-page .working-set-table .table th {
                padding: 16px 20px;
                text-align: start;
                font-weight: 500;
                font-size: var(--table-header-font-size);
                color: #374151;
                text-transform: uppercase;
                letter-spacing: 0.05em;
                border-bottom: 1px solid #e5e7eb;
            }

            .working-sets-page .working-set-table .table thead tr th {
                background-color: unset;
            }

        .working-sets-page .working-set-table .table-row {
            border-bottom: 1px solid #dcdcdc;
            transition: background-color 0.2s ease;
        }

            .working-sets-page .working-set-table .table-row:hover {
                background: #f9fafb;
            }

            .working-sets-page .working-set-table .table-row:last-child {
                border-bottom: none;
            }

        .working-sets-page .working-set-table .table td {
            padding: 16px 20px;
            vertical-align: middle;
            font-size: var(--table-row-font-size);
            font-weight: 500;
        }

            .working-sets-page .working-set-table .table td.actions {
                justify-content: start;
                display: flex;
            }

    .working-sets-page .working-set-name {
        font-weight: 600;
        color: #1f2937;
    }

    .working-sets-page .schedule-coverage {
        padding: 12px 20px;
    }

    .working-sets-page .coverage-button {
        background: none;
        border: none;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 12px;
        border-radius: 6px;
        transition: all 0.2s ease;
        width: 100%;
/*        justify-content: space-between;*/
    }

        .working-sets-page .coverage-button:hover {
            background: #f3f4f6;
        }

        .working-sets-page .coverage-button:focus {
            outline: unset;
        }

    .working-sets-page .coverage-text {
        color: rgb(161 98 7 / 1);
        font-weight: 500;
        font-size: 11px;
    }

    .working-sets-page .expand-icon {
        color: #6b7280;
        font-size: 12px;
        transition: transform 0.3s ease;
    }

        .working-sets-page .expand-icon.expanded {
            transform: rotate(180deg);
        }

    .working-sets-page .status-badge {
        padding: 4px 12px;
        border-radius: 16px;
        font-size: 12px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .working-sets-page .status-active {
        background: #d1fae5;
        color: #065f46;
        font-size: 10px;
    }

    .working-sets-page .status-inactive {
        background: #fee2e2;
        color: #991b1b;
        font-size: 10px;
    }

    .working-sets-page .status-pending {
        background: #fef3c7;
        color: #92400e;
        font-size: 10px;
    }

    .working-sets-page .status-default {
        background: #f3f4f6;
        color: #374151;
        font-size: 10px;
    }

    .working-sets-page .created-date {
        color: #6b7280;
        font-size: 11px;
    }

    .working-sets-page .actions {
        text-align: right;
    }

    .working-sets-page .btn-action {
        background: none;
        border: none;
        cursor: pointer;
        padding: 8px;
        border-radius: 6px;
        /*    margin-left: 4px;*/
        transition: all 0.2s ease;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

        .working-sets-page .btn-action:not(:first-child) {
            margin-inline-start: 8px;
        }

    .working-sets-page .btn-edit:hover {
        background: #dbeafe;
        transform: scale(1.1);
    }

    .working-sets-page .btn-delete:hover {
        background: #fee2e2;
        transform: scale(1.1);
    }

    .working-sets-page .action-icon {
        font-size: 16px;
    }

/* Expanded Row Styles */
    .working-sets-page .expanded-row {
        background: #fafafa;
        animation: slideDown 0.3s ease-out;
    }

    .working-sets-page .expanded-content {
        padding: 0 !important;
    }

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }

    to {
        opacity: 1;
        max-height: 500px;
    }
}

/* Schedule Coverage Details Component Styles */
.working-sets-page .schedule-coverage-details {
    padding: 24px;
    background: #fafafa;
    border-top: 1px solid #e5e7eb;
}

.working-sets-page .coverage-section {
    display: flex;
    gap: 24px;
    /*    margin-bottom: 24px;*/
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.working-sets-page .days-coverage {
    /*    background: white;*/
/*    border-radius: 8px;*/
/*    border-bottom: 1px solid rgba(0, 0, 0, 0.1);*/
    padding: 20px;
    /*    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);*/
}

.working-sets-page .ws-manage-half-width {
    flex: 1;
}

.working-sets-page .full-width {
    width: 100%;
}

.working-sets-page .coverage-header {
    margin-bottom: 16px;
}

.working-sets-page .coverage-title {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.working-sets-page .days-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.working-sets-page .day-badge {
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

    .working-sets-page .day-badge.covered {
        background: #d1fae5;
        color: #065f46;
    }

    .working-sets-page .day-badge.missing {
        background: #fee2e2;
        color: #991b1b;
    }

.working-sets-page .drivers-section {
/*    background: white;*/
/*    border-radius: 8px;*/
    padding: 20px;
/*    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);*/
}

.working-sets-page .drivers-header {
    margin-bottom: 16px;
}

.working-sets-page .drivers-title {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.working-sets-page .drivers-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.working-sets-page .driver-card {
    background: #cffafe;
    border: 1px solid #a5f3fc;
    border-radius: 8px;
    padding: 12px 16px;
    transition: all 0.2s ease;
    cursor: pointer;
}

    .working-sets-page .driver-card:hover {
        background: #a5f3fc;
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(6, 182, 212, 0.2);
    }

.working-sets-page .driver-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.working-sets-page .driver-name {
    font-weight: 600;
    color: #0f172a;
    font-size: 14px;
}

.working-sets-page .driver-role {
    color: #64748b;
    font-size: 12px;
}

.working-sets-page .no-drivers {
    width: 100%;
    text-align: center;
    padding: 24px;
}

.working-sets-page .no-drivers-text {
    color: #9ca3af;
    font-style: italic;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .working-sets-page .header-content {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .working-sets-page .header-actions {
        margin-left: 0;
        width: 100%;
    }

    .working-sets-page .btn-add-working-set {
        width: 100%;
        justify-content: center;
    }

    .working-sets-page .table {
        font-size: 12px;
    }

        .working-sets-page .table th,
        .working-sets-page .table td {
            padding: 12px 16px;
            border-top: unset !important;
        }

    .working-sets-page .coverage-section {
        flex-direction: column;
        gap: 16px;
    }

    .working-sets-page .ws-manage-half-width {
        width: 100%;
    }

    .working-sets-page .drivers-list {
        gap: 8px;
    }

    .working-sets-page .driver-card {
        flex: 1;
        min-width: calc(50% - 4px);
    }
}

@media (max-width: 480px) {
    .working-sets-page .working-set-header {
        padding: 16px 20px;
    }

    .working-sets-page .page-title {
        font-size: 20px;
    }

    .working-sets-page .page-description {
        font-size: 12px;
    }

    .working-sets-page .schedule-coverage-details {
        padding: 16px;
    }

    .working-sets-page .driver-card {
        min-width: 100%;
    }
}

/* ============================================== */
/*  Working Sets page: reuse Customers/theme tokens */
/* ============================================== */

.working-sets-page-container {
    background: var(--page-bg);
}

.working-sets-page-container .page-main-card-container {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.working-sets-page-container .ws-list-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.working-sets-page-container .ws-table-wrapper {
    overflow: hidden;
    position: relative;
}

.working-sets-page-container .ws-orders-grid {
    width: 100%;
    background-color: transparent;
    border: unset;
}

.working-sets-page-container .ws-orders-grid,
.working-sets-page-container .ws-orders-grid .rz-data-grid {
    height: 100%;
}

.working-sets-page-container .ws-orders-grid .rz-data-grid-data {
    overflow-y: auto;
    max-height: 100%;
}

.working-sets-page-container .ws-orders-grid .rz-datatable-thead th,
.working-sets-page-container .ws-orders-grid .rz-grid-table thead th {
    background-color: var(--table-header-bg);
    color: var(--table-header-text-color);
    border-color: var(--table-row-border-color);
    height: 40px;
    min-height: 40px;
    max-height: 40px;
    padding-block: 0;
    padding-inline: 11px;
    font-size: var(--table-header-font-size);
    font-weight: 500;
    font-family: BrownStdRegular, sans-serif;
    text-align: start;
    position: relative;
    box-sizing: border-box;
    text-transform: none;
}

.working-sets-page-container .ws-orders-grid .rz-datatable-thead th span,
.working-sets-page-container .ws-orders-grid .rz-grid-table thead th span,
.working-sets-page-container .ws-orders-grid .rz-column-title-content {
    color: var(--table-header-text-color);
    font-size: var(--table-header-font-size);
    font-weight: 500;
}

.working-sets-page-container .ws-orders-grid .rz-grid-table tbody > tr:not(.rz-expanded-row-content) > td {
    background-color: var(--table-row-bg);
    border-bottom: 1px solid var(--table-row-border-color);
    color: var(--table-row-text-color);
    min-height: 48px;
    padding-block: 8px;
    padding-inline-start: 11px;
    padding-inline-end: 7px;
    font-size: var(--table-row-font-size);
    font-weight: 500;
    font-family: BrownStdRegular, sans-serif;
    line-height: 1.2;
    box-sizing: border-box;
    vertical-align: middle;
}

.working-sets-page-container .ws-orders-grid .rz-grid-table tbody > tr:not(.rz-expanded-row-content) > td,
.working-sets-page-container .ws-orders-grid .rz-grid-table tbody > tr:not(.rz-expanded-row-content) > td span,
.working-sets-page-container .ws-orders-grid .rz-grid-table tbody > tr:not(.rz-expanded-row-content) > td div,
.working-sets-page-container .ws-orders-grid .rz-cell-data {
    color: var(--table-row-text-color) !important;
}

.working-sets-page-container .ws-orders-grid .rz-grid-table tbody > tr:not(.rz-expanded-row-content) > td:not(.ws-complementary-cell) {
    height: 48px;
    max-height: 48px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.working-sets-page-container .ws-orders-grid .rz-selectable tbody tr.rz-data-row:hover:not(.rz-state-highlight) > td {
    background-color: var(--table-row-hover-bg);
}

.working-sets-page-container .ws-orders-grid .rz-datatable-empty-message {
    color: var(--table-row-text-color);
}

.working-sets-page-container .ws-complementary-cell {
    white-space: normal;
    overflow: visible;
    height: auto;
    max-height: none;
}

.working-sets-page-container .driver-availability-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.working-sets-page-container .driver-availability-header {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    color: var(--table-row-text-color);
}

.working-sets-page-container .driver-availability-header .schedule-count,
.working-sets-page-container .driver-availability-header .expand-icon {
    color: var(--sec-text-color);
}

.working-sets-page-container .expand-icon {
    width: 14px;
}

.working-sets-page-container .driver-availability-expanded {
    margin-top: 0;
    margin-inline-start: 22px;
    margin-left: 22px;
    padding: 8px;
    background: var(--modal-content-inner-card-bg);
    border: 1px solid var(--modal-content-inner-card-border);
    border-radius: 8px;
    width: auto;
    box-sizing: border-box;
}

.working-sets-page-container .availability-days-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
}

.working-sets-page-container .availability-day-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    background: var(--table-row-bg);
    border: 1px solid var(--modal-content-inner-card-border);
    border-radius: 6px;
    font-size: 12px;
    color: var(--table-row-text-color) !important;
}

.working-sets-page-container .availability-day-badge i {
    color: #25d466 !important;
    font-size: 13px;
}

.working-sets-page-container .no-availability-text {
    font-size: 12px;
    color: var(--sec-text-color);
    padding: 4px 0;
}

.ws-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 120000000000000000000;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ws-popup-container {
    max-width: 420px;
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
}

.ws-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
}

.ws-popup-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ws-popup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.ws-popup-error {
    color: #ff4d4d;
    font-size: 13px;
    padding: 8px 10px;
    background: rgba(255, 77, 77, 0.1);
    border-radius: 4px;
}

.ws-popup-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--modal-content-separetor);
}

.ws-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
}

.ws-editor-overlay .ws-editor-modal {
    background: var(--modal-content-bg);
    box-shadow: 0px 4px 4px 0px var(--modal-container-box-shadow);
}

.ws-editor-overlay .ws-editor-header,
.ws-editor-overlay .new-modal-header-container {
    background-color: var(--modal-header-bg);
}

.ws-editor-overlay .ws-editor-title {
    color: var(--modal-header-text-color);
    font-size: var(--modal-header-font-size);
}

.ws-editor-overlay .ws-editor-body,
.ws-editor-overlay .config-body,
.ws-editor-overlay .config-footer,
.ws-editor-overlay .ws-editor-footer,
.ws-editor-overlay .form-section {
    background-color: var(--modal-content-bg);
}

.ws-editor-overlay .ws-schedule-section,
.ws-editor-overlay .ws-week-grid,
.ws-editor-overlay .ws-week-grid-corner,
.ws-editor-overlay .ws-week-resource-header-row {
    background-color: var(--table-card-container-bg);
}


/*.ws-editor-overlay .ws-editor-footer {
    border-top: 1px solid var(--modal-content-separetor);
}*/
.ws-editor-overlay .form-section {
    border-color: var(--modal-content-separetor);
}

.ws-editor-overlay label,
.ws-editor-overlay .ws-section-title,
.ws-editor-overlay .ws-assigned-label,
.ws-editor-overlay .ws-schedule-title {
    color: var(--modal-content-text-color);
}
