.wpac-calendar {
    border: 1px solid #d7d7d7;
    padding: 16px;
    background: #fff;
    color: #1e1e1e;
    font-family: inherit;
}

.wpac-header {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
}

.wpac-header button {
    border: 1px solid #c0c0c0;
    background: #f5f5f5;
    padding: 8px 14px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    color: #1e1e1e;
    transition: background 0.15s;
}

.wpac-header button:hover {
    background: #e8e8e8;
}

.wpac-header button.active {
    background: #1e1e1e;
    color: #fff;
    border-color: #1e1e1e;
}

.wpac-header button.active:hover {
    background: #333;
}

.wpac-header .wpac-manage-schedule {
    background: #1e1e1e;
    color: #fff;
    border-color: #1e1e1e;
}

.wpac-header .wpac-manage-schedule:hover {
    background: #333;
    border-color: #333;
}

.wpac-title {
    font-weight: 600;
    margin-left: auto;
}

.wpac-logout {
    display: inline-block;
    border: 1px solid #c0c0c0;
    background: #f5f5f5;
    padding: 8px 14px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    color: #1e1e1e;
    margin-left: 8px;
    transition: background 0.15s;
}

.wpac-logout:hover {
    background: #e8e8e8;
    color: #1e1e1e;
}

.wpac-body--month {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

.wpac-timegrid {
    display: grid;
    grid-template-columns: 70px 1fr;
    grid-template-rows: auto 1fr;
    gap: 8px;
}

.wpac-timecol-header {
    grid-column: 1;
    grid-row: 1;
}

.wpac-day-header {
    grid-column: 2;
    grid-row: 1;
    display: grid;
    gap: 6px;
    align-items: center;
}

.wpac-day-header-cell {
    font-size: 12px;
    font-weight: 600;
    color: #2d2d2d;
    padding: 4px 6px;
    border-bottom: 1px solid #e3e3e3;
    text-align: center;
}

.wpac-day-header-cell.wpac-today {
    background: #fff4cc;
    border-radius: 6px;
}

.wpac-day-header-cell--inactive {
    opacity: 0.5;
}

.wpac-timecol {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex-direction: column;
}

.wpac-time-label {
    font-size: 12px;
    color: #4a4a4a;
    border-top: 1px solid #eee;
    padding-top: 4px;
}

.wpac-daygrid {
    grid-column: 2;
    grid-row: 2;
    display: grid;
    gap: 6px;
    position: relative;
}

.wpac-daycol {
    position: relative;
    border: 1px solid #e3e3e3;
    background:
        repeating-linear-gradient(
            to bottom,
            transparent,
            transparent calc(var(--hour-height) / 2 - 1px),
            #f0f0f0 calc(var(--hour-height) / 2 - 1px),
            #f0f0f0 calc(var(--hour-height) / 2),
            transparent calc(var(--hour-height) / 2),
            transparent calc(var(--hour-height) - 1px),
            #e3e3e3 calc(var(--hour-height) - 1px),
            #e3e3e3 var(--hour-height)
        );
    background-size: 100% var(--hour-height);
    overflow: hidden;
}

.wpac-daycol--today {
    border-color: #f2b400;
    box-shadow: inset 0 0 0 1px rgba(242, 180, 0, 0.35);
}

.wpac-day-background {
    position: absolute;
    inset: 0;
}

.wpac-slot-hover {
    position: absolute;
    left: 0;
    right: 0;
    background: rgba(74, 120, 194, 0.16);
    border-top: 1px solid rgba(74, 120, 194, 0.45);
    border-bottom: 1px solid rgba(74, 120, 194, 0.45);
    pointer-events: none;
    z-index: 1;
}

.wpac-events-layer {
    position: relative;
    height: 100%;
}

.wpac-cell {
    min-height: 90px;
    border: 1px solid #e3e3e3;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}

.wpac-cell:hover {
    background: #f5f5f5;
}

.wpac-cell.wpac-cell--inactive {
    opacity: 0.55;
    cursor: not-allowed;
    background: #f8f8f8;
}

.wpac-cell.wpac-cell--inactive:hover {
    background: #f8f8f8;
}

.wpac-cell.wpac-today {
    border-color: #f2b400;
    background: #fff9e0;
}

.wpac-cell.wpac-today:hover {
    background: #fff3c4;
}

.wpac-cell-label {
    font-size: 12px;
    color: #4a4a4a;
}

.wpac-event {
    font-size: 12px;
    background: #e9f2ff;
    border-left: 3px solid #4a78c2;
    padding: 3px 4px;
    cursor: pointer;
}

.wpac-event-phone {
    display: block;
    margin-top: 2px;
    color: #1f4f99;
    text-decoration: none;
}

.wpac-event-phone:hover {
    text-decoration: underline;
}

.wpac-event-header {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
}

.wpac-event-title {
    overflow: hidden;
    text-overflow: ellipsis;
}

.wpac-event-phone-inline {
    flex: 0 0 auto;
    color: #1f4f99;
    text-decoration: none;
    font-size: 11px;
}

.wpac-event-phone-inline:hover {
    text-decoration: underline;
}

.wpac-event-block {
    position: absolute;
    --col-count: 1;
    --col-index: 0;
    --col-gap: 6px;
    width: calc((100% - (var(--col-count) - 1) * var(--col-gap)) / var(--col-count));
    left: calc(var(--col-index) * ((100% - (var(--col-count) - 1) * var(--col-gap)) / var(--col-count) + var(--col-gap)));
    background: #e9f2ff;
    border-left: 3px solid #4a78c2;
    padding: 1px;
    min-height: 25px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 4px;
    box-sizing: border-box;
}

.wpac-event-header {
    font-weight: 600;
}

.wpac-event-meta {
    font-size: 11px;
    color: #3a3a3a;
    margin-top: 2px;
}

.wpac-status-chip {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 6px;
    font-size: 10px;
    border-radius: 999px;
    background: #e3e3e3;
    color: #2d2d2d;
}

.wpac-calendar .wpac-status-pending {
    border-left-color: #d9822b !important;
    background: #fff0dc !important;
}

.wpac-calendar .wpac-status-confirmed {
    border-left-color: #2f855a !important;
    background: #e6f7ed !important;
}

.wpac-calendar .wpac-status-paid {
    border-left-color: #2563eb !important;
    background: #e6efff !important;
}

.wpac-calendar .wpac-status-pending .wpac-status-chip {
    background: #f8c79a !important;
}

.wpac-calendar .wpac-status-confirmed .wpac-status-chip {
    background: #bcebd0 !important;
}

.wpac-calendar .wpac-status-paid .wpac-status-chip {
    background: #c7dcff !important;
}

.wpac-legend {
    display: flex;
    gap: 10px;
    align-items: center;
}

.wpac-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #2d2d2d;
}

.wpac-legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
    border-left: 3px solid #4a78c2;
    background: #e9f2ff;
}

.wpac-calendar .wpac-legend-swatch.wpac-status-pending {
    border-left-color: #d9822b;
    background: #fff0dc;
}

.wpac-calendar .wpac-legend-swatch.wpac-status-confirmed {
    border-left-color: #2f855a;
    background: #e6f7ed;
}

.wpac-calendar .wpac-legend-swatch.wpac-status-paid {
    border-left-color: #2563eb;
    background: #e6efff;
}

.wpac-offhours {
    position: absolute;
    left: 0;
    right: 0;
    background: repeating-linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.03),
        rgba(0, 0, 0, 0.03) 6px,
        rgba(0, 0, 0, 0.06) 6px,
        rgba(0, 0, 0, 0.06) 12px
    );
}

.wpac-break {
    position: absolute;
    left: 0;
    right: 0;
    background: rgba(255, 193, 7, 0.25);
}

.wpac-more {
    font-size: 11px;
    color: #4a4a4a;
}

.wpac-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wpac-list-item {
    padding: 8px;
    border: 1px solid #e3e3e3;
    cursor: pointer;
}

.wpac-list-time {
    font-size: 12px;
    color: #4a4a4a;
}

.wpac-error {
    color: #b3261e;
}

/* Login form styles */
.wpac-login {
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
}

.wpac-login__title {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 600;
}

.wpac-login__message {
    margin: 0 0 20px;
    color: #4a4a4a;
}

.wpac-login #wpac-login-form {
    text-align: left;
}

.wpac-login #wpac-login-form p {
    margin-bottom: 12px;
}

.wpac-login #wpac-login-form label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
}

.wpac-login #wpac-login-form input[type="text"],
.wpac-login #wpac-login-form input[type="password"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #c0c0c0;
    border-radius: 4px;
    font-size: 14px;
}

.wpac-login #wpac-login-form input[type="submit"] {
    width: 100%;
    padding: 10px 20px;
    background: #1e1e1e;
    color: #fff;
    border: 1px solid #1e1e1e;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s;
}

.wpac-login #wpac-login-form input[type="submit"]:hover {
    background: #333;
    border-color: #333;
}

/* Edit form styles */
.wpac-edit {
    max-width: 500px;
    margin: 0 auto;
}

.wpac-edit__title {
    margin: 0 0 16px;
    font-size: 20px;
    font-weight: 600;
}

.wpac-edit__info {
    background: #f9f9f9;
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.wpac-edit__info p {
    margin: 0 0 4px;
    font-size: 14px;
}

.wpac-edit__info p:last-child {
    margin-bottom: 0;
}

.wpac-edit__form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wpac-edit__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wpac-edit__field label {
    font-weight: 500;
    font-size: 14px;
}

.wpac-edit__field input[type="text"],
.wpac-edit__field input[type="tel"],
.wpac-edit__field input[type="email"],
.wpac-edit__field textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #c0c0c0;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.wpac-edit__field textarea {
    resize: vertical;
    min-height: 80px;
}

.wpac-edit__actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.wpac-edit__actions button {
    min-width: 100px;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.2;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.wpac-edit__back {
    background: #f5f5f5;
    color: #1e1e1e;
    border: 1px solid #c0c0c0;
    transition: background 0.15s;
}

.wpac-edit__back:hover {
    background: #e8e8e8;
}

.wpac-edit__submit {
    background: #1e1e1e;
    color: #fff;
    border: 1px solid #1e1e1e;
    transition: background 0.15s;
}

.wpac-edit__submit:hover {
    background: #333;
    border-color: #333;
}

.wpac-edit__message {
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 14px;
}

.wpac-edit__message--success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.wpac-edit__message--error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.wpac-edit-error {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
    color: #b3261e;
}

/* Modal styles */
.wpac-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
}

.wpac-modal {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 560px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.wpac-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e3e3e3;
}

.wpac-modal__title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.wpac-modal__close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    line-height: 1;
}

.wpac-modal__close:hover {
    color: #1e1e1e;
}

.wpac-modal__date {
    padding: 12px 20px;
    background: #f9f9f9;
    font-size: 14px;
    color: #4a4a4a;
    border-bottom: 1px solid #e3e3e3;
}

.wpac-modal__form {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wpac-modal__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wpac-schedule-day {
    border: 1px solid #e3e3e3;
    border-radius: 8px;
    padding: 12px;
    gap: 8px;
}

.wpac-schedule-day__title {
    font-weight: 600;
}

.wpac-schedule-day__toggle {
    margin: 2px 0 8px;
}

.wpac-schedule-day__toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.wpac-schedule-day__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.wpac-schedule-list {
    border: 1px solid #e3e3e3;
    border-radius: 8px;
    padding: 12px;
    gap: 10px;
}

.wpac-schedule-list__items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wpac-schedule-list__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(92px, 108px) auto;
    gap: 8px;
    align-items: center;
}

.wpac-schedule-list__row--closed {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) auto;
}

.wpac-schedule-list__row--period {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(96px, 120px) minmax(98px, 120px);
    grid-template-areas:
        "start end interval remove"
        "breakStart breakEnd breakEnd remove";
    align-items: stretch;
}

.wpac-schedule-list__row--period > :nth-child(1) { grid-area: start; }
.wpac-schedule-list__row--period > :nth-child(2) { grid-area: end; }
.wpac-schedule-list__row--period > :nth-child(3) { grid-area: interval; }
.wpac-schedule-list__row--period > :nth-child(4) { grid-area: breakStart; }
.wpac-schedule-list__row--period > :nth-child(5) { grid-area: breakEnd; }
.wpac-schedule-list__row--period > :nth-child(6) {
    grid-area: remove;
    align-self: stretch;
    height: auto;
}

.wpac-schedule-list__row > * {
    min-width: 0;
}

.wpac-picker-field {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    gap: 6px;
    align-items: center;
}

.wpac-picker-btn {
    height: 40px;
    border: 1px solid #c0c0c0;
    border-radius: 4px;
    background: #f5f5f5;
    color: #1e1e1e;
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    line-height: 1;
}

.wpac-picker-btn:hover {
    background: #e8e8e8;
}

.wpac-native-picker {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    border: 0;
    padding: 0;
    margin: 0;
}

.wpac-schedule-list__add,
.wpac-schedule-list__remove {
    padding: 8px 10px;
    border: 1px solid #c0c0c0;
    border-radius: 4px;
    background: #f5f5f5;
    color: #1e1e1e;
    cursor: pointer;
    font-size: 13px;
}

.wpac-schedule-list__add:hover,
.wpac-schedule-list__remove:hover {
    background: #e8e8e8;
}

.wpac-modal__field label {
    font-size: 14px;
    font-weight: 500;
}

.wpac-modal__required {
    color: #b3261e;
}

.wpac-modal__field input,
.wpac-modal__field select,
.wpac-modal__field textarea {
    padding: 6px 10px;
    border: 1px solid #c0c0c0;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.2;
    font-family: inherit;
}

.wpac-modal__field input,
.wpac-modal__field select,
.wpac-schedule-list__add,
.wpac-schedule-list__remove,
.wpac-modal__cancel,
.wpac-modal__submit {
    height: 40px;
    box-sizing: border-box;
}

.wpac-schedule-list .wpac-schedule-list__row input,
.wpac-schedule-list .wpac-schedule-list__row select,
.wpac-schedule-list .wpac-schedule-list__row button {
    width: 100%;
}

.wpac-schedule-list .wpac-schedule-list__row .wpac-picker-btn {
    width: 34px;
}

@media (max-width: 860px) {
    .wpac-schedule-list__row--period {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas:
            "start end"
            "interval remove"
            "breakStart breakEnd";
    }

    .wpac-schedule-list__row--period > :nth-child(6) {
        align-self: center;
        height: 40px;
    }
}

.wpac-modal__field input:focus,
.wpac-modal__field select:focus,
.wpac-modal__field textarea:focus {
    outline: none;
    border-color: #1e1e1e;
}

.wpac-modal__field textarea {
    resize: vertical;
    min-height: 70px;
}

.wpac-schedule-list .wpac-schedule-list__row input,
.wpac-schedule-list .wpac-schedule-list__row select {
    min-width: 0;
}

.wpac-modal__actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.wpac-modal__cancel {
    padding: 10px 20px;
    background: #f5f5f5;
    color: #1e1e1e;
    border: 1px solid #c0c0c0;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s;
}

.wpac-modal__cancel:hover {
    background: #e8e8e8;
}

.wpac-modal__submit {
    flex: 1;
    padding: 10px 20px;
    background: #1e1e1e;
    color: #fff;
    border: 1px solid #1e1e1e;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s;
}

.wpac-modal__submit:hover {
    background: #333;
    border-color: #333;
}

.wpac-modal__submit:disabled {
    background: #888;
    cursor: not-allowed;
}

.wpac-modal__message {
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 14px;
}

.wpac-modal__message--success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.wpac-modal__message--error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Make day columns clickable */
.wpac-daycol {
    cursor: pointer;
}

.wpac-daycol.wpac-daycol--inactive {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Context menu */
.wpac-context-menu {
    position: absolute;
    z-index: 100001;
    background: #fff;
    border: 1px solid #d7d7d7;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 4px 0;
    min-width: 120px;
}

.wpac-context-menu__item {
    display: block;
    width: 100%;
    padding: 8px 16px;
    border: none;
    background: none;
    text-align: left;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
}

.wpac-context-menu__item:hover {
    background: #f5f5f5;
}

.wpac-context-menu__item--delete {
    color: #b3261e;
}

.wpac-context-menu__item--delete:hover {
    background: #fef0ef;
}

@media (max-width: 640px) {
    .wpac-modal {
        width: 94%;
    }

    .wpac-schedule-list__row,
    .wpac-schedule-list__row--closed {
        grid-template-columns: 1fr 1fr 110px 1fr 1fr auto;
    }

    .wpac-schedule-list .wpac-schedule-list__row .wpac-schedule-list__date-input,
    .wpac-schedule-list .wpac-schedule-list__row input[type="date"],
    .wpac-schedule-list .wpac-schedule-list__row input[type="time"],
    .wpac-schedule-list .wpac-schedule-list__row input[type="text"],
    .wpac-schedule-list .wpac-schedule-list__row select,
    .wpac-schedule-list .wpac-schedule-list__row .wpac-schedule-list__remove {
        width: 100%;
    }
}
