:root {
    font-family: Pretendard, "Noto Sans KR", Arial, sans-serif;
    color: #282828;
    background: #f7f5f2;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f7f5f2;
}

button,
input,
textarea,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.reservation-page {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 48px 0 80px;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 24px;
    margin-bottom: 28px;
}

.page-heading h1 {
    margin: 4px 0 8px;
    font-size: clamp(30px, 4vw, 44px);
}

.page-heading p {
    margin: 0;
    color: #6b675f;
}

.eyebrow {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.14em;
    color: #8e6f54 !important;
}

.reservation-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.panel,
.submit-panel {
    background: #ffffff;
    border: 1px solid #e8e2db;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 8px 28px rgba(47, 38, 30, 0.05);
}

.panel h2 {
    margin: 0 0 20px;
    font-size: 20px;
}

.panel h3 {
    margin: 20px 0 12px;
}

.menu-list {
    display: grid;
    gap: 10px;
}

.menu-card {
    display: block;
    cursor: pointer;
}

.menu-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.menu-content {
    display: grid;
    gap: 5px;
    border: 1px solid #ded7cf;
    border-radius: 14px;
    padding: 15px 16px;
    transition: 0.18s ease;
}

.menu-radio:checked + .menu-content {
    border-color: #8e6f54;
    background: #fbf6f1;
    box-shadow: inset 0 0 0 1px #8e6f54;
}

.menu-category {
    color: #8e6f54;
    font-size: 11px;
    font-weight: 800;
}

.field {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.field > span {
    font-size: 13px;
    font-weight: 700;
    color: #56514b;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid #d9d2ca;
    border-radius: 12px;
    background: #fff;
    padding: 12px 13px;
    outline: none;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #8e6f54;
    box-shadow: 0 0 0 3px rgba(142, 111, 84, 0.11);
}

.field-help {
    color: #817a72;
    font-size: 12px;
}

.time-slots {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.time-button {
    border: 1px solid #d9d2ca;
    border-radius: 10px;
    padding: 10px 6px;
    background: #fff;
    cursor: pointer;
}

.time-button.selected {
    background: #39332d;
    color: #fff;
    border-color: #39332d;
}

.member-notice,
.empty-box,
.loading-box {
    padding: 18px;
    background: #faf8f5;
    border: 1px dashed #d8d0c7;
    border-radius: 12px;
    color: #6e675f;
}

.guest-title {
    margin-top: 0;
    font-weight: 800;
}

.file-drop {
    display: grid;
    gap: 6px;
    text-align: center;
    padding: 28px;
    border: 1px dashed #c9b9aa;
    border-radius: 14px;
    cursor: pointer;
    background: #fcfaf8;
}

.file-drop input {
    display: none;
}

.image-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 14px;
}

.preview-item {
    overflow: hidden;
    border-radius: 12px;
    aspect-ratio: 1 / 1;
    background: #eee8e1;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.submit-panel {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.reservation-summary {
    color: #655f58;
}

.primary-button,
.secondary-button,
.primary-link {
    border: 0;
    border-radius: 12px;
    padding: 12px 18px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-weight: 800;
}

.primary-button,
.primary-link {
    background: #39332d;
    color: #fff;
}

.primary-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.secondary-button {
    background: #eee9e3;
    color: #403a34;
}

.message-box {
    position: fixed;
    right: 24px;
    bottom: 24px;
    max-width: 420px;
    padding: 15px 18px;
    border-radius: 12px;
    background: #32302d;
    color: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,.18);
    z-index: 100;
}

.message-box.error {
    background: #9c3939;
}

.hidden {
    display: none !important;
}

.reservation-list {
    display: grid;
    gap: 12px;
}

.reservation-item {
    border: 1px solid #e3ddd6;
    border-radius: 14px;
    padding: 18px;
    display: grid;
    gap: 10px;
}

.reservation-item-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.status-badge {
    display: inline-flex;
    width: fit-content;
    padding: 5px 9px;
    border-radius: 999px;
    background: #eee9e3;
    font-size: 12px;
    font-weight: 800;
}

.status-REQUESTED { background: #fff1c7; }
.status-CONFIRMED { background: #d8ecff; }
.status-COMPLETED { background: #dcefdc; }
.status-CANCELED { background: #eee; }
.status-NO_SHOW { background: #f4d8d8; }

.toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 14px;
}

.search-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

.search-grid .field {
    margin-bottom: 0;
}

.search-actions {
    display: flex;
    gap: 8px;
}

.table-wrap {
    overflow-x: auto;
}

.reservation-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 850px;
}

.reservation-table th,
.reservation-table td {
    padding: 13px 10px;
    border-bottom: 1px solid #eee8e1;
    text-align: left;
    vertical-align: middle;
}

.action-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.action-button {
    border: 1px solid #d8d0c7;
    background: #fff;
    padding: 7px 9px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
}

.pagination {
    margin-top: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
}

@media (max-width: 820px) {
    .reservation-grid {
        grid-template-columns: 1fr;
    }

    .search-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .submit-panel,
    .page-heading {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 520px) {
    .reservation-page {
        width: min(100% - 20px, 1180px);
        padding-top: 24px;
    }

    .panel,
    .submit-panel {
        padding: 18px;
        border-radius: 16px;
    }

    .time-slots {
        grid-template-columns: repeat(3, 1fr);
    }

    .search-grid {
        grid-template-columns: 1fr;
    }
}


/* ===== Phase 4.1 ===== */
.section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.section-title-row h2,
.section-title-row h3 {
    margin: 0;
}

.hair-style-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.hair-style-card {
    display: block;
    cursor: pointer;
}

.hair-style-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.hair-style-content {
    display: grid;
    gap: 8px;
    border: 1px solid #ded7cf;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

.hair-style-radio:checked + .hair-style-content {
    border-color: #8e6f54;
    box-shadow: inset 0 0 0 1px #8e6f54;
}

.hair-style-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #eee8e1;
}

.hair-style-text {
    display: grid;
    gap: 4px;
    padding: 0 12px 12px;
}

.counter {
    text-align: right;
    font-size: 12px;
    color: #817a72;
}

.guest-lookup-form {
    max-width: 560px;
}

.detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.42);
    display: grid;
    place-items: center;
    padding: 20px;
    z-index: 200;
}

.detail-modal {
    width: min(760px, 100%);
    max-height: 88vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 18px;
    padding: 24px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.detail-block {
    padding: 14px;
    border-radius: 12px;
    background: #faf8f5;
}

.detail-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.detail-images img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 10px;
}

@media (max-width: 720px) {
    .hair-style-list,
    .detail-images {
        grid-template-columns: repeat(2, 1fr);
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   Phase 8 - 예약/관리 UI 보완
   ========================================================= */

.section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.reservation-actions,
.admin-tool-buttons,
.modal-actions,
.action-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.detail-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(29, 26, 23, 0.56);
    overflow-y: auto;
}

.detail-modal {
    width: min(860px, 100%);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    border-radius: 20px;
    padding: 24px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
}

.admin-tool-modal {
    width: min(980px, 100%);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.detail-block {
    padding: 14px;
    border: 1px solid #ebe5de;
    border-radius: 12px;
    background: #fcfaf8;
    line-height: 1.55;
}

.detail-images {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.detail-images img,
.hair-style-image {
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid #e8e2db;
}

.detail-style-image-wrap {
    margin-top: 10px;
}

.protected-image-link {
    display: block;
    text-decoration: none;
}

.form-two-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.admin-tool-panel .section-title-row {
    align-items: flex-start;
}

.admin-setting-list,
.admin-record-list {
    display: grid;
    gap: 10px;
}

.admin-setting-row {
    display: grid;
    grid-template-columns: 90px 90px 1fr auto 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid #e8e2db;
    border-radius: 12px;
}

.inline-check {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.inline-check input {
    width: auto;
    margin: 0;
}

.editor-check {
    margin: 4px 0 16px;
}

.admin-editor-form {
    padding-bottom: 20px;
    border-bottom: 1px solid #eee8e1;
    margin-bottom: 20px;
}

.admin-record-card {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    border: 1px solid #e8e2db;
    border-radius: 12px;
    background: #fcfaf8;
}

.action-button {
    border: 1px solid #ddd4ca;
    border-radius: 9px;
    background: #fff;
    padding: 7px 10px;
    cursor: pointer;
}

@media (max-width: 760px) {
    .reservation-grid,
    .detail-grid,
    .form-two-columns {
        grid-template-columns: 1fr;
    }

    .page-heading,
    .section-title-row,
    .admin-record-card {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-setting-row {
        grid-template-columns: 1fr 1fr;
    }

    .detail-images {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* =========================================================
   Phase 8.1 - 예약 불가 사유 안내
   ========================================================= */

.availability-notice {
    display: grid;
    gap: 8px;
    margin: 10px 0 14px;
}

.availability-notice-item {
    padding: 11px 13px;
    border: 1px solid #e5ddd4;
    border-radius: 10px;
    background: #faf7f3;
    line-height: 1.5;
}

.availability-holiday {
    font-weight: 700;
}

.availability-personal {
    font-weight: 600;
}

.availability-closed {
    font-weight: 700;
}

/* =========================================================
   관리자 예약 화면 - 공통 사이드바 배치
   ========================================================= */

.admin-layout {
    min-height: 100vh;
}

/* 고정 사이드바 250px만큼 예약 화면을 오른쪽으로 이동 */
.admin-layout .reservation-page {
    width: calc(100% - 250px);
    max-width: none;

    min-height: 100vh;

    margin-left: 250px;
    margin-right: 0;

    padding: 48px 40px 80px;
}

/* 예약 화면 내부 내용은 너무 넓어지지 않도록 제한 */
.admin-layout .reservation-page > section,
.admin-layout .reservation-page > .page-heading {
    width: 100%;
    max-width: 1180px;
    margin-left: auto;
    margin-right: auto;
}
