/* =================================================================
   Dashboard Styles
   ================================================================= */
.dashboard-launch-pad {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease-in-out;
}

.dashboard-launch-pad:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

.btn-launch {
    font-weight: 500;
    padding: 0.75rem 1.5rem;
}

/* FIX: Tighter card grid for dashboard */
.application-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 600px));
    gap: 1.5rem;
}

.application-card {
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.2s ease-in-out;
}

.application-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.application-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f9fa;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid #dee2e6;
}

.application-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0;
}

.application-card .card-body {
    padding: 1.25rem;
    flex-grow: 1;
}

.application-card .card-text {
    margin-bottom: 0.5rem;
    color: #495057;
}

.application-card .card-footer {
    background-color: #f8f9fa;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid #e9ecef;
}


/* =================================================================
   Original Styles (with modal improvements)
   ================================================================= */

/* Card Layout */
.location-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    min-height: 100px;
}

.empty-state-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px;
    background-color: #f8f9fa;
    border: 1px dashed #ced4da;
    border-radius: 6px;
    color: #6c757d;
}

.location-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background-color: #fff;
    padding: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease;
}

.location-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.location-card h5 {
    margin-bottom: 5px;
    color: #0056b3;
    font-size: 1.25rem;
    font-weight: 600;
}

.location-card .location-address {
    font-size: 0.9em;
    color: #6c757d;
    margin-bottom: 20px;
    font-style: italic;
}

.location-card .selected-services-list {
    flex-grow: 1;
}

.location-card .selected-services-list > strong {
    display: block;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e9ecef;
    color: #495057;
}

.location-card .manage-btn {
    align-self: flex-end;
    margin-top: 16px;
    padding: 6px 12px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.location-card .manage-btn:hover {
    background-color: #5a6268;
}

    .location-card .no-services {
        padding: 15px;
        background-color: #f8f9fa;
        border-radius: 4px;
        color: #4E545A !important;
        font-style: italic;
        text-align: center;
    }

.summaries-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* --- REVISED SUMMARY CARD STYLES --- */
.summary-item-card {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    width: 100%;
    margin: 0;
    padding: 0;
}

.summary-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: #e9ecef;
    border-bottom: 1px solid #dee2e6;
}

.summary-item-title {
    margin: 0;
    font-weight: 600;
    color: #495057;
    font-size: 1rem;
}

.summary-item-fee {
    font-weight: 600;
    font-size: 0.9rem;
    color: #198754; /* Green for fee */
}

.summary-item-body {
    padding: 1rem;
}

.summary-details-list {
    margin: 0;
}

.summary-detail-item {
    display: grid;
    grid-template-columns: 120px 1fr; /* Label column and value column */
    gap: 1rem;
    font-size: 0.9rem;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

.summary-detail-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.summary-detail-item dt {
    font-weight: 600;
    color: #6c757d;
}

.summary-detail-item dd {
    margin: 0;
    color: #212529;
    word-break: break-word;
}

/* --- NEW REPEATING GROUP STYLES --- */
.repeating-group-container {
    padding: 1rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

.repeating-group-body {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.repeating-group-row {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    padding: 1rem;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-left: 4px solid #0d6efd;
    border-radius: 4px;
}

.repeating-group-fields {
    flex-grow: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.repeating-group-fields > div {
    flex: 1;
    min-width: 200px;
}

.repeating-group-action {
    flex-shrink: 0;
}

.repeating-group-empty {
    text-align: center;
    padding: 1rem;
    color: #6c757d;
    font-style: italic;
}


/* Modal Styles */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1050;
    overflow-y: auto;
    padding: 20px 0;
}
.modal-backdrop.hidden {
    display: none;
}

/* FIX: Wider modal for better layout */
.modal-content {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 1440px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 40px);
    overflow: hidden;
}
.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f9fa;
}
.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    font-weight: bold;
    line-height: 1;
    color: #6c757d;
    cursor: pointer;
    padding: 0 5px;
}
.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex-grow: 1;
}
.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    background-color: #f8f9fa;
}
.component-group-header {
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
    padding-bottom: 5px;
    border-bottom: 2px solid #0d6efd;
    color: #212529;
    font-weight: 600;
    font-size: 1.2em;
}

/* Dynamic Form Styles */
.service-list-item {
    padding: 1rem;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    transition: box-shadow 0.2s ease;
}

.service-list-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.service-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 1.1em;
}
.service-label input[type="checkbox"] {
    width: 1.2rem;
    height: 1.2rem;
    margin-right: 0.75rem;
}
.service-details {
    margin-top: 12px;
    padding: 1rem;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    display: none;
}
.service-details.visible {
    display: block;
}
.service-list-item > .service-details {
    padding-left: 2rem;
    border-left: 3px solid #0d6efd;
    border-top: none;
    border-right: none;
    border-bottom: none;
}

/* FIX: More subtle border for nested repeating group */
.service-details .repeating-group-row {
    border-left-color: #adb5bd;
}

.form-group {
    margin-bottom: 1.25rem;
}
.form-group > label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #495057;
}
.required-indicator {
    color: #dc3545;
    font-weight: bold;
    margin-left: 4px;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.5rem 1rem;
    padding-left: 5px;
    margin-top: 0.5rem;
}

.checkbox-group .form-check {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.checkbox-group .form-check:hover {
    background-color: #e9ecef;
}

/* FIX: Nicer checkbox labels */
.form-check.form-check-styled {
    display: flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
}

.form-check-styled .form-check-input {
    margin-top: 0;
    margin-right: 0.5rem;
}


/* FIX: Custom styled checkboxes with primary color */
.form-check-input.custom-styled {
    appearance: none;
    -webkit-appearance: none;
    background-color: #fff;
    border: 1px solid #adb5bd;
    height: 1.25em;
    width: 1.25em;
    border-radius: 0.25em;
    display: inline-block;
    position: relative;
    cursor: pointer;
    vertical-align: middle;
}

.form-check-input.custom-styled:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.form-check-input.custom-styled:checked::before {
    content: '';
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0.35em;
    height: 0.7em;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -60%) rotate(45deg);
}

/* FIX: Improved weekly hours table styling */
.weekly-hours-group {
    border: 1px solid #dee2e6;
    border-radius: .375rem;
    padding: 1rem;
    background-color: #fdfdff;
}

.weekly-hours-table thead th {
    background-color: #f8f9fa;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
}
.weekly-hours-table th:first-child {
    text-align: left;
}
.weekly-hours-table input[type="time"] {
    min-width: 100px;
}


.repeating-group-container {
        padding: 1rem;
        background-color: #f8f9fa;
        border: 1px solid #dee2e6;
        border-radius: 6px;
    }

    .repeating-group-body {
        margin-top: 0.5rem;
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .repeating-group-row {
        display: flex;
        align-items: flex-end;
        gap: 0.5rem;
        padding: 1rem;
        background-color: #fff;
        border: 1px solid #ced4da;
        border-left: 4px solid #0d6efd;
        border-radius: 4px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    }

    .repeating-group-fields {
        flex-grow: 1;
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .repeating-group-fields .form-group {
        margin-bottom: 0; /* Remove default margin from DynamicFormGroup */
    }

    .repeating-group-fields > div {
        flex: 1;
        min-width: 200px;
    }

    .repeating-group-action {
        flex-shrink: 0;
    }
    .repeating-group-action .btn-danger {
        --bs-btn-padding-y: .25rem;
        --bs-btn-padding-x: .5rem;
        --bs-btn-font-size: .75rem;
    }

    .repeating-group-empty {
        text-align: center;
        padding: 1rem;
        color: #6c757d;
        font-style: italic;
    }
