.hours-status-preview {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 12px;
}

.hours-status-preview-title {
    color: var(--form-text-muted);
    flex-basis: 100%;
    white-space: nowrap;
}

.hours-status-controls {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 7px;
}

.hours-status-date {
    width: 168px;
    flex: 0 0 168px;
}

.hours-status-date-field {
    width: 168px;
    flex: 0 0 168px;
}

.hours-status-date .mud-input-control,
.hours-status-time .mud-input-control {
    margin-top: 0;
}

.hours-status-date .mud-input-outlined,
.hours-status-time .mud-input-outlined {
    min-height: 40px;
}

.hours-status-date .mud-input-slot,
.hours-status-time .mud-input-slot {
    padding: 8px 8px 8px 10px !important;
}

.hours-status-time {
    width: 154px;
    flex-basis: 154px;
}

.hours-status-time-field {
    width: 154px;
}

.hours-status-error {
    display: block;
    margin-top: 4px;
    color: #ff3b30 !important;
    font-size: 0.82rem !important;
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: 0;
}

.hours-status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    margin-top: 6px;
    border-radius: 999px;
    padding: 0 10px;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1;
}

.hours-status-pill-open {
    background: #dcfce7;
    color: #166534;
}

.hours-status-pill-closed {
    background: #fee2e2;
    color: #991b1b;
}

.hours-status-transfer {
    color: var(--form-text-muted);
    flex-basis: 100%;
    font-size: 0.9rem;
    white-space: nowrap;
}

.hours-holiday-section {
    border: 1px solid var(--form-input-border);
    border-radius: 12px;
    background: var(--form-input-bg);
    padding: 0.9rem 0.95rem;
}

.hours-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.hours-list-header {
    display: grid;
    grid-template-columns: 90px 84px minmax(0, 1fr) 40px;
    align-items: center;
    gap: 10px;
    padding: 0 2px 6px;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 500;
    min-width: 604px;
}

.hours-weekly-list .hours-list-header {
    grid-template-columns: 90px 84px minmax(0, 1fr);
}

.hours-special-list .hours-list-header {
    grid-template-columns: 124px 84px minmax(0, 1fr) 40px;
    min-width: 680px;
}

.hours-hours-heading {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    white-space: nowrap;
}

.hours-transfer-heading {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
}

.hours-transfer-heading .mud-icon-button {
    width: 28px;
    height: 28px;
    padding: 2px;
}

.hours-entry-row {
    display: grid;
    grid-template-columns: 90px 84px minmax(0, 1fr);
    gap: 10px;
    align-items: flex-start;
    min-height: 44px;
    min-width: 604px;
    padding: 4px 2px;
}

.hours-special-entry-row {
    grid-template-columns: 124px 84px minmax(0, 1fr) 40px;
    min-width: 680px;
}

.hours-entry-label {
    color: var(--form-text-main);
    font-size: 0.95rem;
    line-height: 1.35;
    padding-top: 9px;
    min-width: 0;
}

.hours-holiday-name {
    display: block;
    color: var(--form-text-muted);
    line-height: 1.2;
    margin-top: 2px;
}

.hours-closed-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
}

.hours-closed-text {
    color: #64748b;
    white-space: nowrap;
}

.hours-segments-cell {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.hours-mobile-segments-heading {
    display: none;
}

.hours-segment-row {
    display: grid;
    grid-template-columns: 156px 14px 156px 180px repeat(2, 32px);
    align-items: flex-start;
    gap: 7px;
    min-height: 40px;
    width: max-content;
    max-width: 100%;
}

.hours-segment-row-no-phone {
    grid-template-columns: 156px 14px 156px repeat(2, 32px);
}

.hours-segment-arrow {
    color: #64748b;
    line-height: 40px !important;
    min-width: 14px;
    text-align: center;
}

.hours-time-input {
    width: 156px;
    flex: 0 0 156px;
}

.hours-time-open {
    grid-column: 1;
    grid-row: 1;
}

.hours-segment-arrow {
    grid-column: 2;
    grid-row: 1;
}

.hours-time-close {
    grid-column: 3;
    grid-row: 1;
}

.hours-time-input .mud-input-control {
    margin-top: 0;
}

.hours-time-input .mud-input-outlined {
    min-height: 40px;
}

.hours-time-input .mud-input-slot {
    padding: 8px 6px 8px 10px !important;
}

.hours-time-input-error .mud-input-outlined .mud-input-outlined-border {
    border-color: #ff3b30 !important;
}

.hours-time-input .mud-input-helper-text,
.hours-status-date-field .mud-input-helper-text,
.hours-status-time-field .mud-input-helper-text {
    display: none !important;
}

.hours-phone-field {
    width: 180px;
    flex: 0 0 180px;
    min-width: 0;
    grid-column: 4;
    grid-row: 1;
}

.hours-time-errors {
    display: block;
    grid-column: 1 / 4;
    grid-row: 2;
    max-width: 333px;
    min-width: 0;
}

.hours-time-errors:empty {
    display: none;
}

.hours-phone-native {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--form-input-border);
    border-radius: 12px;
    background: var(--form-input-bg);
    color: #334155;
    padding: 8px 10px;
    font: inherit;
    font-size: 0.9rem;
    outline: none;
}

.hours-phone-native:focus {
    background: #ffffff;
    border-color: rgba(79, 70, 229, 0.65);
    box-shadow: 0 0 0 2px var(--form-primary-soft);
}

.hours-phone-native::placeholder {
    color: #94a3b8;
}

.hours-phone-native:disabled {
    background: #f1f5f9;
    color: rgba(0, 0, 0, 0.38);
    cursor: not-allowed;
}

.hours-phone-native-error {
    border-color: #ff3b30;
}

.hours-segment-icon {
    width: 32px !important;
    height: 32px !important;
    padding: 4px !important;
    margin-top: 4px !important;
    flex: 0 0 32px;
    grid-row: 1;
}

.hours-remove-segment-icon {
    grid-column: 5;
}

.hours-add-segment-icon {
    grid-column: 5;
}

.hours-segment-row-no-phone .hours-remove-segment-icon,
.hours-segment-row-no-phone .hours-add-segment-icon {
    grid-column: 4;
}

.hours-remove-segment-icon + .hours-add-segment-icon {
    grid-column: 6;
}

.hours-segment-row-no-phone .hours-remove-segment-icon + .hours-add-segment-icon {
    grid-column: 5;
}

.hours-segment-error {
    display: block;
    margin: 4px 0 6px 0;
    color: #ff3b30 !important;
    font-size: 0.82rem !important;
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: 0;
}

.hours-phone-error {
    margin-top: 6px;
    margin-bottom: 8px;
}

.hours-special-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
}

.holiday-action-row {
    align-items: flex-end;
}

.special-date-row {
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
}

.special-date-add-button {
    margin-left: 0 !important;
    align-self: center;
}

@media (max-width: 900px) {
    .hours-status-preview {
        align-items: flex-start;
    }

    .hours-status-date {
        width: 168px;
        flex-basis: 168px;
    }

    .special-date-row {
        flex-wrap: wrap;
    }

    .hours-list {
        overflow-x: visible;
        gap: 6px;
    }

    .hours-list-header {
        display: none;
    }

    .hours-list-header > span:nth-child(2) {
        display: none;
    }

    .hours-list-header > span:nth-child(3) {
        display: none;
    }

    .hours-list-header > span:nth-child(4) {
        display: none;
    }

    .hours-weekly-list .hours-list-header,
    .hours-special-list .hours-list-header {
        grid-template-columns: minmax(0, 1fr);
        min-width: 0;
    }

    .hours-entry-row,
    .hours-special-entry-row {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "label toggle"
            "hours-heading hours-heading"
            "segments segments"
            "actions actions";
        gap: 2px 10px;
        min-width: 0;
        padding: 8px 0;
        border-bottom: 1px solid rgba(148, 163, 184, 0.24);
    }

    .hours-entry-label {
        grid-area: label;
        padding-top: 5px;
        font-weight: 600;
    }

    .hours-closed-toggle {
        grid-area: toggle;
        display: inline-flex;
        justify-self: end;
        min-height: 40px;
    }

    .hours-closed-toggle::before {
        content: attr(data-closed-label);
        align-self: center;
        margin-right: 8px;
        color: #64748b;
        font-size: 0.8rem;
        font-weight: 500;
        white-space: nowrap;
    }

    .hours-segments-cell {
        grid-area: segments;
        padding-top: 2px;
    }

    .hours-mobile-segments-heading {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        min-height: 24px;
        margin-bottom: 4px;
        color: #64748b;
        font-size: 0.8rem;
        font-weight: 500;
    }

    .hours-mobile-segments-heading .mud-icon-button {
        width: 28px;
        height: 28px;
        padding: 2px;
    }

    .hours-segment-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 14px minmax(0, 1fr);
        align-items: flex-start;
        gap: 6px;
        width: 100%;
    }

    .hours-time-input {
        width: 100%;
        flex: initial;
        min-width: 0;
    }

    .hours-time-input .mud-input-slot {
        padding: 8px 2px 8px 8px !important;
        font-size: 0.92rem;
    }

    .hours-time-input .mud-input-adornment {
        margin-left: 0;
    }

    .hours-time-input .mud-input-adornment .mud-icon-button {
        width: 28px;
        height: 28px;
        padding: 3px;
    }

    .hours-phone-field {
        grid-column: 1 / -1;
        grid-row: 3;
        width: 100%;
        flex: initial;
    }

    .hours-time-errors {
        grid-column: 1 / -1;
        grid-row: 2;
        max-width: 100%;
        width: 100%;
        order: initial;
    }

    .hours-segment-icon {
        grid-column: 1;
        grid-row: 4;
        margin-top: 0 !important;
        justify-self: start;
    }

    .hours-phone-native {
        min-height: 38px;
    }

    .hours-special-actions {
        grid-area: actions;
        padding-top: 0;
        justify-self: end;
        min-height: 32px;
    }
}

@media (max-width: 430px) {
    .hours-status-date,
    .hours-status-date-field,
    .hours-status-time,
    .hours-status-time-field {
        width: 100%;
        flex-basis: 100%;
    }

    .hours-segment-arrow {
        line-height: 38px !important;
    }

    .hours-segment-icon {
        margin-top: 2px !important;
    }
}
