
.schedule-page {
    max-width: 1180px;
    padding-bottom: 2rem;
}

.schedule-page-heading {
    margin: 1.25rem 0;
}

.schedule-page-heading h2 {
    color: var(--text);
    font-size: 1.55rem;
    font-weight: var(--fw-semibold);
    letter-spacing: 0.04em;
}

.schedule-card {
    overflow: visible;
}

.schedule-card-header {
    padding: 1rem 1.25rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.schedule-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.schedule-card-title {
    color: var(--text);
    font-size: 1rem;
    font-weight: var(--fw-semibold);
}

.schedule-card-subtitle {
    margin-top: 0.2rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: var(--fw-normal);
}

.schedule-card-icon {
    color: var(--brand-primary);
    font-size: 1.25rem;
}

.schedule-card-body {
    padding: 0;
}

.schedule-grid-header,
.schedule-row {
    display: grid;
    grid-template-columns:
        minmax(190px, 1.25fr)
        minmax(210px, 1.5fr)
        minmax(145px, 0.8fr)
        minmax(145px, 0.8fr);
    align-items: center;
    column-gap: 1rem;
}

.schedule-grid-header {
    padding: 0.75rem 1.25rem;
    color: var(--text-muted);
    background: var(--grid-header);
    border-bottom: 1px solid var(--border);
    font-size: 0.72rem;
    font-weight: var(--fw-semibold);
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.schedule-row {
    min-height: 74px;
    padding: 0.8rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.schedule-row:hover {
    background: var(--grid-stripe);
}

.schedule-service {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 0;
}

.schedule-color {
    width: 11px;
    height: 36px;
    flex: 0 0 11px;
    border-radius: 999px;
}

.schedule-service-name {
    color: var(--text);
    font-size: 0.94rem;
    font-weight: var(--fw-medium);
}

.schedule-service-key {
    margin-top: 0.12rem;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: var(--fw-normal);
    letter-spacing: 0.08em;
}

.schedule-name-input {
    height: 42px;
    border-color: var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-family: var(--font-base);
    font-weight: var(--fw-normal);
}

.schedule-name-input:focus {
    border-color: var(--brand-accent);
    box-shadow: var(--focus-ring-accent);
}

.schedule-time-select .Select-control {
    min-height: 42px;
    border-color: var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

.schedule-time-select .Select-value,
.schedule-time-select .Select-placeholder {
    line-height: 40px !important;
}

.schedule-time-select .Select-input {
    height: 40px;
}

.schedule-rule {
    display: flex;
    align-items: center;
    padding: 0.9rem 1.25rem;
    color: var(--text-muted);
    background: var(--grid-header);
    border-bottom: 1px solid var(--border);
    font-size: 0.8rem;
}

.schedule-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
}

.schedule-reset-button,
.schedule-save-button {
    min-height: 40px;
    border-radius: var(--radius-sm);
    font-family: var(--font-base);
    font-size: 0.86rem;
    font-weight: var(--fw-medium);
}

.schedule-reset-button {
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
}

.schedule-alert {
    font-size: 0.86rem;
}

.schedule-mobile-label {
    display: none;
}

@media (max-width: 767.98px) {
    .schedule-grid-header {
        display: none;
    }

    .schedule-row {
        grid-template-columns: 1fr 1fr;
        row-gap: 0.85rem;
        padding: 1rem;
    }

    .schedule-service {
        grid-column: 1 / -1;
    }

    .schedule-row > div:nth-child(2) {
        grid-column: 1 / -1;
    }

    .schedule-mobile-label {
        display: block;
        margin-bottom: 0.3rem;
        color: var(--text-muted);
        font-size: 0.7rem;
        font-weight: var(--fw-semibold);
        letter-spacing: 0.05em;
        text-transform: uppercase;
    }

    .schedule-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .schedule-actions .btn {
        width: 100%;
    }
}


/* Schedule — saisie libre des heures à la minute */
.schedule-time-input {
    width: 100%;
    height: 42px;
    padding: 0.45rem 0.75rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-base);
    font-size: 0.9rem;
    font-weight: var(--fw-normal);
}

.schedule-time-input:focus {
    color: var(--text);
    background: var(--surface);
    border-color: var(--brand-accent);
    box-shadow: var(--focus-ring-accent);
}


/* Fin calculée automatiquement depuis le début du service suivant */
.schedule-time-input-derived:disabled {
    color: var(--text-muted);
    background: var(--grid-header);
    border-color: var(--border);
    opacity: 1;
    cursor: not-allowed;
}


/* Schedule dynamique : période et actions supplémentaires */
.schedule-grid-header,
.schedule-row {
    grid-template-columns:
        minmax(180px, 1.2fr)
        minmax(210px, 1.35fr)
        minmax(135px, 0.72fr)
        minmax(135px, 0.72fr)
        92px;
}

.schedule-row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
}

.schedule-row-action {
    width: 36px;
    height: 36px;
    padding: 0;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
}

.schedule-row-action:hover {
    color: var(--brand-primary);
    background: var(--grid-header);
    border-color: var(--border);
}

.schedule-row-delete:hover {
    color: var(--danger, #b54747);
}

.schedule-row-action:disabled {
    opacity: 0.25;
}

.schedule-actions-dynamic {
    justify-content: space-between;
}

.schedule-primary-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.schedule-add-button {
    min-height: 40px;
    color: var(--brand-primary);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-base);
    font-size: 0.86rem;
    font-weight: var(--fw-medium);
}

@media (max-width: 767.98px) {
    .schedule-row-actions {
        grid-column: 1 / -1;
    }

    .schedule-actions-dynamic,
    .schedule-primary-actions {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .schedule-add-button,
    .schedule-primary-actions .btn {
        width: 100%;
    }
}


/* Schedule : un seul nom visible et couleur personnalisable */
.schedule-grid-header,
.schedule-row {
    grid-template-columns:
        110px
        minmax(260px, 1.7fr)
        minmax(150px, 0.8fr)
        minmax(150px, 0.8fr)
        92px;
}

.schedule-color-picker {
    display: flex;
    align-items: center;
}

.schedule-color-input {
    width: 54px;
    height: 42px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
}

.schedule-color-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.schedule-color-input::-webkit-color-swatch {
    border: none;
    border-radius: calc(var(--radius-sm) - 2px);
}

.schedule-color-input::-moz-color-swatch {
    border: none;
    border-radius: calc(var(--radius-sm) - 2px);
}

@media (max-width: 767.98px) {
    .schedule-color-picker {
        grid-column: auto;
    }

    .schedule-row > div:nth-child(2) {
        grid-column: 1 / -1;
    }
}


/* Schedule : carré de couleur + code hexadécimal copiable */
.schedule-grid-header,
.schedule-row {
    grid-template-columns:
        225px
        minmax(240px, 1.55fr)
        minmax(145px, 0.75fr)
        minmax(145px, 0.75fr)
        92px;
}

.schedule-color-picker {
    min-width: 0;
}

.schedule-color-controls {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.schedule-color-code {
    width: 112px;
    height: 42px;
    padding: 0.45rem 0.65rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-base);
    font-size: 0.82rem;
    font-weight: var(--fw-normal);
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.schedule-color-code:focus {
    border-color: var(--brand-accent);
    box-shadow: var(--focus-ring-accent);
}
