/**
 * rental.css
 * Toss Design System Implementation for Rental Page
 */

/* ===============================================
   Page Layout
   =============================================== */
.center-max-width {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ===============================================
   Summary Cards (Stats)
   =============================================== */
.rental-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.summary-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.card-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--toss-text-tertiary);
}

.card-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--toss-text-primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.5px;
}

/* Highlight Card */
.summary-card.highlight {
    background-color: var(--toss-blue-light);
    border: 1px solid rgba(49, 130, 246, 0.1);
}

.summary-card.highlight .card-label {
    color: var(--toss-blue-secondary);
}

.summary-card.highlight .card-value {
    color: var(--toss-blue-primary);
}

/* ===============================================
   Action Bar (Search & Buttons)
   =============================================== */
.action-card {
    padding: 24px;
}

.action-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.search-box-wrapper {
    position: relative;
    flex: 1;
    min-width: 240px;
    max-width: 400px;
}

.search-box-wrapper .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--toss-text-placeholder);
    font-size: 16px;
    pointer-events: none;
}

.search-input {
    padding-left: 44px !important;
    width: 100%;
}

.action-buttons-wrapper {
    display: flex;
    gap: 8px;
}

/* ===============================================
   Rental Form Container
   =============================================== */
.rental-form-container {
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: none;
}

.rental-form-container.show {
    display: block;
    animation: tossFadeIn 0.3s ease-out;
}

@keyframes tossFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--toss-line-weak);
}

.form-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--toss-text-primary);
    margin: 0;
}

.form-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--toss-text-tertiary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.form-close-btn:hover {
    background-color: var(--toss-bg-grey-opacity);
    color: var(--toss-text-primary);
}

/* ===============================================
   Form Sections
   =============================================== */
.form-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--toss-line-weak);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.section-title h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--toss-text-primary);
    margin: 0;
}

.section-hint {
    font-size: 12px;
    color: var(--toss-text-tertiary);
    margin-left: 8px;
}

.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full-width {
    width: 100%;
}

.required {
    color: var(--toss-red-primary);
    margin-left: 2px;
}

.location-input-group {
    display: flex;
    gap: 8px;
}

.location-input-group .toss-input {
    flex: 1;
}

/* ===============================================
   Category & Status Buttons (Chips)
   =============================================== */
.category-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.category-btn {
    padding: 10px 16px;
    border-radius: 20px;
    border: 1px solid var(--toss-line-opacity);
    background: var(--toss-bg-white);
    color: var(--toss-text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.category-btn:hover {
    background: var(--toss-bg-grey-opacity);
}

.category-btn.selected {
    background: var(--toss-blue-primary);
    color: #fff;
    border-color: var(--toss-blue-primary);
}

/* ===============================================
   Image Upload Area
   =============================================== */
.multi-image-upload-area {
    position: relative;
    width: 100%;
    min-height: 180px;
    border: 2px dashed var(--toss-line-opacity);
    border-radius: 12px;
    background: var(--toss-bg-grey-opacity);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
}

.multi-image-upload-area:hover,
.multi-image-upload-area.drag-over {
    border-color: var(--toss-blue-primary);
    background: rgba(49, 130, 246, 0.05);
}

.upload-placeholder {
    text-align: center;
    padding: 20px;
    pointer-events: none;
    /* Let clicks pass to parent */
}

.upload-placeholder i,
.upload-placeholder svg {
    color: var(--toss-text-tertiary);
    margin-bottom: 12px;
}

.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    width: 100%;
    padding: 16px;
    box-sizing: border-box;
}

.image-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--toss-line-opacity);
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-image {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* ===============================================
   Tiptap Editor
   =============================================== */
.tiptap-wrapper {
    border: 1px solid var(--toss-line-opacity);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.tiptap-wrapper:focus-within {
    border-color: var(--toss-blue-primary);
    box-shadow: 0 0 0 2px rgba(49, 130, 246, 0.2);
}

.tiptap-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px;
    background: var(--toss-bg-grey-opacity);
    border-bottom: 1px solid var(--toss-line-opacity);
}

.tiptap-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    background: transparent;
    border: none;
    color: var(--toss-text-secondary);
}

.tiptap-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.tiptap-btn.active {
    background: var(--toss-blue-light);
    color: var(--toss-blue-primary);
}

.tiptap-editor {
    min-height: 300px;
    padding: 16px;
    outline: none;
    line-height: 1.6;
}

/* ===============================================
   Color Picker Palette (형광펜 색상 선택)
   =============================================== */
.color-picker-palette {
    position: absolute;
    display: flex;
    gap: 6px;
    padding: 8px;
    background: var(--toss-bg-white, #fff);
    border: 1px solid var(--toss-line-normal, #E5E8EB);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    margin-top: 4px;
}

.color-option {
    width: 24px;
    height: 24px;
    border: 1px solid var(--toss-line-weak, #F2F4F6);
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.color-option:hover {
    transform: scale(1.1);
    border-color: var(--toss-line-normal, #E5E8EB);
}

.color-option.color-remove {
    background: var(--toss-bg-white, #fff);
    color: var(--toss-text-tertiary, #8B95A1);
}

.color-option.color-remove:hover {
    color: var(--toss-status-error, #F04452);
}

/* ===============================================
   Font Size Palette (폰트 크기 선택)
   =============================================== */
.font-size-palette {
    position: absolute;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    padding: 8px;
    background: var(--toss-bg-white, #fff);
    border: 1px solid var(--toss-line-normal, #E5E8EB);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    margin-top: 4px;
}

.font-size-option {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--toss-line-weak, #F2F4F6);
    border-radius: 4px;
    background: var(--toss-bg-white, #fff);
    color: var(--toss-text-secondary, #6B7684);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.font-size-option:hover {
    background: var(--toss-bg-grouped-base, #F2F4F6);
    border-color: var(--toss-line-normal, #E5E8EB);
    color: var(--toss-text-primary, #191F28);
}

/* ===============================================
   Skeleton Loading
   =============================================== */
.skeleton-row td {
    border-bottom: 1px solid var(--toss-line-weak);
}

.skeleton-bone {
    background: linear-gradient(90deg,
        var(--toss-bg-grouped-base, #F2F4F6) 25%,
        #E8EBED 37%,
        var(--toss-bg-grouped-base, #F2F4F6) 63%
    );
    background-size: 400% 100%;
    animation: skeleton-shimmer 1.4s ease infinite;
}

.skeleton-thumbnail {
    width: 56px;
    height: 56px;
    border-radius: 8px;
}

.skeleton-text {
    height: 14px;
    border-radius: 6px;
}

.skeleton-text-sm {
    height: 12px;
    border-radius: 4px;
}

.skeleton-badge {
    height: 24px;
    width: 64px;
    border-radius: 12px;
}

.skeleton-circle {
    border-radius: 8px;
}

@keyframes skeleton-shimmer {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* ===============================================
   Table Section
   =============================================== */
.table-card {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.toss-table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

.toss-table th {
    background-color: var(--toss-bg-grouped-base);
    padding: 12px 24px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--toss-text-secondary);
    border-bottom: 1px solid var(--toss-line-normal);
}

.toss-table td {
    padding: 16px 24px;
    font-size: 14px;
    color: var(--toss-text-primary);
    border-bottom: 1px solid var(--toss-line-weak);
    vertical-align: middle;
}

.toss-table tr:hover td {
    background-color: #FAFAFA;
}

/* Alignments */
.text-center {
    text-align: center !important;
}

.text-right {
    text-align: right !important;
}

.text-secondary {
    color: var(--toss-text-secondary) !important;
}

/* pages.css의 .data-table .text-center 이탤릭/색상 오버라이드 */
.toss-table th.text-center,
.toss-table td.text-center,
.toss-table th.text-right,
.toss-table td.text-right {
    font-style: normal;
    color: inherit;
}

/* 모바일 메타 정보 + 더보기 버튼 (데스크톱에서 숨김) */
.rental-mobile-meta {
    display: none;
}

.td-mobile-more {
    display: none;
}

/* Table Actions */
.table-actions {
    display: flex;
    gap: 6px;
    justify-content: center;
}

/* ===== 기본 아이콘 버튼 (토스 스타일) ===== */
/* pages.css 오버라이드 - 토스 미니멀 디자인: 배경 없이 아이콘만 */
.btn-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: none !important;
    background: transparent !important;
    color: var(--toss-text-tertiary, #8B95A1);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    box-shadow: none !important;
    transform: none !important;
}

.btn-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor !important;
}

/* ===== 끌어올리기 버튼 - 초록색 (긍정적 액션) ===== */
.btn-icon.btn-boost {
    background: transparent !important;
    border: none !important;
    color: var(--toss-status-success, #00C471) !important;
}

.btn-icon.btn-boost:hover:not(:disabled):not(.disabled) {
    background-color: rgba(0, 196, 113, 0.1) !important;
    color: #00A35E !important;
}

/* ===== 복사 버튼 - 파란색 (정보성 액션) ===== */
.btn-icon.btn-copy {
    background: transparent !important;
    border: none !important;
    color: var(--toss-blue-primary, #3182F6) !important;
}

.btn-icon.btn-copy:hover:not(:disabled):not(.disabled) {
    background-color: rgba(49, 130, 246, 0.1) !important;
    color: #1B6AE8 !important;
}

/* ===== QR 버튼 - 보라색 (디지털/기술적 액션) ===== */
.btn-icon.btn-qr {
    background: transparent !important;
    border: none !important;
    color: #8B5CF6 !important;
}

.btn-icon.btn-qr:hover:not(:disabled):not(.disabled) {
    background-color: rgba(139, 92, 246, 0.1) !important;
    color: #7C3AED !important;
}

/* ===== 수정 버튼 - 회색 (중립적 액션) ===== */
.btn-icon.btn-edit {
    background: transparent !important;
    border: none !important;
    color: var(--toss-text-secondary, #6B7684) !important;
}

.btn-icon.btn-edit:hover:not(:disabled):not(.disabled) {
    background-color: rgba(0, 0, 0, 0.05) !important;
    color: var(--toss-text-primary, #191F28) !important;
}

/* ===== 삭제 버튼 - 빨간색 (위험 액션) ===== */
.btn-icon.btn-delete {
    background: transparent !important;
    border: none !important;
    color: var(--toss-status-error, #F04452) !important;
}

.btn-icon.btn-delete:hover:not(:disabled):not(.disabled) {
    background-color: rgba(240, 68, 82, 0.1) !important;
    color: #D63341 !important;
}

/* ===== 비활성화 상태 (토스 스타일) ===== */
.btn-icon:disabled,
.btn-icon.disabled {
    background: transparent !important;
    border: none !important;
    color: var(--toss-text-placeholder, #B0B8C1) !important;
    cursor: not-allowed;
    opacity: 0.5;
    pointer-events: none;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.available {
    background-color: #E3FDF1;
    color: #0C8A5D;
}

.status-badge.occupied {
    background-color: var(--toss-bg-grey-opacity);
    color: var(--toss-text-tertiary);
}

.status-badge.maintenance {
    background-color: #FFF3E0;
    color: #F57F17;
}

/* ===============================================
   Map Container
   =============================================== */
#rentalMapContainer {
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--toss-line-opacity);
}

/* ===============================================
   Responsive - Mobile Optimized (Toss Style)
   =============================================== */
@media (max-width: 768px) {
    /* 페이지 콘텐츠 여백 및 간격 (모바일 16px 표준) */
    .center-max-width,
    .page-content {
        padding: 16px !important;
        gap: 16px !important;
    }

    /* ========== 요약 카드: 모바일에서 숨김 ========== */
    .rental-summary-grid {
        display: none;
    }

    /* ========== 액션 바: 한 줄 배치 ========== */
    .action-card {
        padding: 12px 16px;
    }

    .action-bar-inner {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        flex-wrap: nowrap;
    }

    .search-box-wrapper {
        flex: 1;
        min-width: 0;
        max-width: none;
    }

    .search-input {
        padding: 10px 12px 10px 36px !important;
        font-size: 14px;
    }

    .search-box-wrapper .search-icon {
        left: 12px;
        font-size: 14px;
    }

    .action-buttons-wrapper {
        display: flex;
        flex-shrink: 0;
        gap: 6px;
    }

    /* Excel 버튼 숨김 (모바일에서 불필요) */
    .action-buttons-wrapper .toss-btn--secondary {
        display: none;
    }

    /* 상품 등록 버튼 - 모바일에서도 표시 */
    .action-buttons-wrapper .toss-btn--primary {
        display: inline-flex;
        padding: 10px 14px;
        font-size: 14px;
    }

    /* ========== 폼 영역: 모바일 최적화 ========== */
    .form-row {
        flex-direction: column;
    }

    .rental-form-container {
        padding: 16px;
        background: transparent;
        box-shadow: none;
        border: none;
    }

    .rental-form-container .form-section {
        background: var(--toss-bg-white);
        border-radius: var(--toss-radius-lg);
        padding: 16px;
        margin-bottom: 12px;
    }

    /* ========== Mobile Table → Card Layout ========== */
    /* .toss-card 클래스의 기본 스타일 오버라이드 */
    .toss-card.table-card,
    .table-card {
        background: transparent !important;
        box-shadow: none !important;
        padding: 0 !important;
        border: none !important;
        border-radius: 0 !important;
    }

    /* 검색창 영역 컨테이너 흰색 배경 + 동일한 좌우 여백 (테두리/섀도우 없음) */
    .toss-card.action-card,
    .action-card {
        background: #ffffff !important;
        box-shadow: none !important;
        border: none !important;
        border-radius: 12px !important;
        width: calc(100vw - 32px) !important;
        max-width: calc(100vw - 32px) !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
    }

    /* 핵심 수정: 뷰포트 기반 강제 너비 제약 - 모든 테이블 요소에 직접 적용 */
    .table-card {
        width: calc(100vw - 32px) !important;
        max-width: calc(100vw - 32px) !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    .table-responsive {
        overflow: hidden !important;
        width: calc(100vw - 32px) !important;
        max-width: calc(100vw - 32px) !important;
        background: transparent !important;
        box-sizing: border-box !important;
    }

    .toss-table,
    .toss-table.data-table {
        display: block !important;
        width: calc(100vw - 32px) !important;
        max-width: calc(100vw - 32px) !important;
        min-width: 0 !important;
        white-space: normal !important;
        table-layout: fixed !important;
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
        box-sizing: border-box !important;
    }

    .toss-table thead {
        display: none;
    }

    .toss-table tbody {
        display: flex !important;
        flex-direction: column;
        gap: 12px;
        width: calc(100vw - 32px) !important;
        max-width: calc(100vw - 32px) !important;
        box-sizing: border-box !important;
    }

    .toss-table tr {
        display: flex !important;
        flex-direction: column;
        background: var(--toss-bg-white);
        border: 1px solid var(--toss-line-opacity);
        border-radius: 16px;
        padding: 0;
        overflow: hidden;
        box-shadow: var(--toss-shadow-xs);
        width: calc(100vw - 32px) !important;
        max-width: calc(100vw - 32px) !important;
        box-sizing: border-box !important;
    }

    .toss-table td {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 10px 16px !important;
        text-align: right;
        border-bottom: 1px solid var(--toss-line-weak);
        font-size: 14px;
        width: calc(100vw - 32px) !important;
        max-width: calc(100vw - 32px) !important;
        box-sizing: border-box !important;
        white-space: normal !important;
    }

    /* 768px 카드 뷰에서 모바일 전용 요소 숨김 (488px에서만 표시) */
    .toss-table td.td-mobile-more {
        display: none !important;
    }

    .rental-mobile-meta {
        display: none !important;
    }

    /* 모바일 카드 레이아웃 순서 최적화 */
    .toss-table td.td-thumbnail { order: 1; }
    .toss-table td[data-label="상품명"] { order: 2; }
    .toss-table td[data-label="카테고리"] { order: 3; }
    .toss-table td[data-label="월 임대료"] { order: 4; }
    .toss-table td[data-label="면적"] { order: 5; }
    .toss-table td[data-label="수용인원"] { order: 6; }
    .toss-table td[data-label="할인가"] { order: 7; }
    .toss-table td[data-label="상태"] { order: 8; }
    .toss-table td.td-actions { order: 9; }

    /* 마지막 행 (관리 버튼) border 제거 - order 기반 */
    .toss-table td.td-actions {
        border-bottom: none;
    }

    .toss-table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 13px;
        color: var(--toss-text-secondary);
        text-align: left;
        flex-shrink: 0;
        min-width: 70px;
    }

    /* 셀 값 스타일 - 우측 정렬 */
    .toss-table td .cell-value {
        text-align: right;
        color: var(--toss-text-primary);
        font-size: 14px;
    }

    /* 썸네일 셀 - 좌우상단 여백 맞춤 */
    .toss-table td.td-thumbnail {
        padding: 16px 16px 0 16px !important;
        justify-content: center;
        border-bottom: none;
    }

    .toss-table td.td-thumbnail::before {
        display: none;
    }

    .toss-table td.td-thumbnail .thumbnail-container {
        width: 100%;
        height: 160px;
        border-radius: 12px;
        overflow: hidden;
    }

    .toss-table td.td-thumbnail .table-thumbnail {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 12px;
    }

    .toss-table td.td-thumbnail .no-image {
        width: 100%;
        height: 160px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--toss-bg-grouped-base);
    }

    /* 상품명 강조 */
    .toss-table td[data-label="상품명"] {
        padding: 14px 16px 10px;
        border-bottom: none;
    }

    .toss-table td[data-label="상품명"]::before {
        display: none;
    }

    .toss-table td[data-label="상품명"] .product-name {
        width: 100%;
    }

    .toss-table td[data-label="상품명"] .product-link {
        font-size: 16px;
        font-weight: 600;
        color: var(--toss-text-primary);
        text-decoration: none;
        display: block;
        text-align: left;
    }

    /* 카테고리 배지 - 상품명 아래 */
    .toss-table td[data-label="카테고리"] {
        padding: 0 16px 12px;
        border-bottom: 1px solid var(--toss-line-weak);
        justify-content: flex-start;
    }

    .toss-table td[data-label="카테고리"]::before {
        display: none;
    }

    /* 가격 강조 */
    .toss-table td[data-label="월 임대료"] {
        font-weight: 600;
        color: var(--toss-blue-primary);
    }

    /* 관리 버튼 영역 */
    .toss-table td.td-actions {
        padding: 12px 16px;
        justify-content: center;
        background: var(--toss-bg-grouped-base);
    }

    .toss-table td.td-actions::before {
        display: none;
    }

    .toss-table td.td-actions .table-actions {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap;
        width: 100%;
        justify-content: center;
        align-items: center;
        gap: 8px;
    }

    .toss-table td.td-actions .btn-icon {
        width: 36px;
        height: 36px;
        flex-shrink: 0;
    }

    /* ========== 스켈레톤 카드 레이아웃 (768px) ========== */
    .toss-table tr.skeleton-row {
        display: flex !important;
        flex-direction: column;
        background: var(--toss-bg-white);
        border: 1px solid var(--toss-line-opacity);
        border-radius: 16px;
        padding: 0;
        overflow: hidden;
        box-shadow: var(--toss-shadow-xs);
        width: calc(100vw - 32px) !important;
        max-width: calc(100vw - 32px) !important;
        box-sizing: border-box !important;
    }

    .toss-table tr.skeleton-row td {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 10px 16px !important;
        border-bottom: 1px solid var(--toss-line-weak);
        width: calc(100vw - 32px) !important;
        max-width: calc(100vw - 32px) !important;
        box-sizing: border-box !important;
    }

    .toss-table tr.skeleton-row td::before {
        display: none;
    }

    .toss-table tr.skeleton-row td.td-thumbnail {
        padding: 16px 16px 0 16px !important;
        justify-content: center;
        border-bottom: none;
    }

    .toss-table tr.skeleton-row td.td-thumbnail .skeleton-thumbnail {
        width: 100%;
        height: 160px;
        border-radius: 12px;
    }

    .toss-table tr.skeleton-row td:last-child {
        border-bottom: none;
    }

    /* ========== FAB (플로팅 버튼) ========== */
    .fab-add-product {
        display: flex;
    }

    /* ========== 페이지네이션 ========== */
    .pagination-container {
        padding: 16px;
        background: var(--toss-bg-white);
        border-radius: 12px;
        margin-top: 4px;
    }
}

/* ===============================================
   체크인 모드 선택 UI (Toss Style)
   =============================================== */
.checkin-mode-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 8px;
}

.checkin-mode-btn {
    padding: 16px;
    background: var(--toss-bg-white);
    border: 2px solid var(--toss-line-opacity);
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.checkin-mode-btn:hover {
    border-color: var(--toss-blue-primary);
    background: var(--toss-bg-grey-opacity);
}

.checkin-mode-btn.selected {
    border-color: var(--toss-blue-primary);
    background: var(--toss-blue-light);
}

.checkin-mode-btn .checkin-mode-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--toss-text-primary);
}

.checkin-mode-btn .checkin-mode-desc {
    font-size: 12px;
    color: var(--toss-text-tertiary);
    line-height: 1.4;
}

/* 위치 확인 설정 섹션 */
.location-verification-section {
    margin-top: 16px;
    padding: 16px;
    background: var(--toss-bg-grey-opacity);
    border-radius: 12px;
    border: 1px solid var(--toss-line-opacity);
}

.location-verification-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--toss-text-primary);
}

.location-verification-header i {
    color: var(--toss-blue-primary);
}

.location-verification-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.location-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.location-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--toss-blue-primary);
}

.checkbox-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.checkbox-text strong {
    font-size: 14px;
    color: var(--toss-text-primary);
}

.checkbox-text small {
    font-size: 12px;
    color: var(--toss-text-tertiary);
}

.location-radius-input {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 28px;
}

.location-radius-input label {
    font-size: 14px;
    color: var(--toss-text-secondary);
    white-space: nowrap;
}

.radius-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.radius-input-wrapper input {
    width: 100px;
    padding: 8px 12px;
    border: 1px solid var(--toss-line-opacity);
    border-radius: 8px;
    font-size: 14px;
    text-align: right;
}

.radius-input-wrapper input:focus {
    outline: none;
    border-color: var(--toss-blue-primary);
}

.radius-unit {
    font-size: 14px;
    color: var(--toss-text-tertiary);
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .checkin-mode-selector {
        grid-template-columns: 1fr;
    }

    .checkin-mode-btn {
        flex-direction: row;
        text-align: left;
        padding: 14px 16px;
    }

    .checkin-mode-btn .checkin-mode-title,
    .checkin-mode-btn .checkin-mode-desc {
        text-align: left;
    }

    .location-radius-input {
        flex-direction: column;
        align-items: flex-start;
        padding-left: 28px;
        gap: 8px;
    }
}

/* ===============================================
   Pagination
   =============================================== */
.pagination-container {
    padding: 16px 24px;
    display: flex;
    justify-content: center !important;
    gap: 4px;
    border-top: 1px solid var(--toss-line-weak);
}

.pagination-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--toss-text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
}

.pagination-btn:hover:not(:disabled) {
    background-color: var(--toss-bg-grouped-base);
    color: var(--toss-text-primary);
}

.pagination-btn.active {
    background-color: var(--toss-blue-primary);
    color: white;
    font-weight: 600;
}

.pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* 페이지네이션 모바일 반응형 - 상단 @media 블록으로 통합됨 */

/* ===============================================
   FAB (Floating Action Button) - 모바일 상품 등록
   =============================================== */
.fab-add-product {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--toss-blue-primary);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(49, 130, 246, 0.4);
    cursor: pointer;
    z-index: 100;
    display: none; /* 데스크톱에서는 숨김 */
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.fab-add-product:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(49, 130, 246, 0.5);
}

.fab-add-product:active {
    transform: scale(0.95);
}

.fab-add-product svg {
    width: 24px;
    height: 24px;
}

/* FAB 모바일 표시는 상단 @media 블록에서 처리 */

/* ===============================================
   모바일 컴팩트 리스트 (488px 이하)
   테이블 → 토스 스타일 리스트 + ⋯ 관리 메뉴
   =============================================== */
@media (max-width: 488px) {
    .center-max-width,
    .page-content {
        padding: 16px !important;
        gap: 16px !important;
    }

    /* 카드 배경 투명화 */
    .toss-card.table-card,
    .table-card {
        background: var(--toss-bg-white) !important;
        box-shadow: none !important;
        border: none !important;
        border-radius: 12px !important;
        padding: 0 !important;
    }

    /* 테이블 헤더 숨김 */
    .toss-table thead {
        display: none;
    }

    /* 테이블 오버플로 해제 */
    .table-responsive {
        overflow-x: visible !important;
    }

    /* 테이블 블록 전환 */
    .toss-table,
    .toss-table.data-table,
    .toss-table tbody {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
    }

    /* 데이터 행 → 수평 리스트 아이템 */
    .toss-table tr.rental-item {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        padding: 14px 16px !important;
        gap: 12px !important;
        border: none !important;
        border-bottom: 1px solid var(--toss-line-weak) !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
        overflow: visible !important;
        width: 100% !important;
    }

    .toss-table tr.rental-item:last-child {
        border-bottom: none !important;
    }

    /* 모든 td 기본 초기화 */
    .toss-table tr.rental-item td {
        display: none !important;
        border: none !important;
        padding: 0 !important;
        width: auto !important;
        max-width: none !important;
    }

    /* data-label 라벨 비활성 */
    .toss-table tr.rental-item td::before {
        display: none !important;
    }

    /* === 보이는 셀 1: 썸네일 === */
    .toss-table tr.rental-item td.td-thumbnail {
        display: block !important;
        flex-shrink: 0;
        order: 1;
    }

    .toss-table tr.rental-item td.td-thumbnail .thumbnail-container {
        width: 64px;
        height: 64px;
        border-radius: 10px;
        overflow: hidden;
    }

    .toss-table tr.rental-item td.td-thumbnail .table-thumbnail {
        width: 64px;
        height: 64px;
        object-fit: cover;
        border-radius: 10px;
    }

    .toss-table tr.rental-item td.td-thumbnail .no-image {
        width: 64px;
        height: 64px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--toss-bg-grouped-base);
        border-radius: 10px;
        font-size: 20px;
        color: var(--toss-text-placeholder);
    }

    /* === 보이는 셀 2: 상품명 + 모바일 메타 === */
    .toss-table tr.rental-item td.td-product-name {
        display: block !important;
        flex: 1;
        min-width: 0;
        order: 2;
        text-align: left !important;
    }

    .toss-table tr.rental-item .product-name {
        width: 100%;
    }

    .toss-table tr.rental-item .product-link {
        font-size: 15px;
        font-weight: 600;
        color: var(--toss-text-primary);
        text-decoration: none;
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* 모바일 메타 표시 */
    .toss-table tr.rental-item .rental-mobile-meta {
        display: flex !important;
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        margin-top: 4px;
    }

    .mobile-meta-sub {
        font-size: 13px;
        color: var(--toss-text-tertiary);
    }

    .mobile-meta-price {
        font-size: 14px;
        font-weight: 600;
        color: var(--toss-blue-primary);
    }

    .mobile-meta-status {
        font-size: 12px;
        color: var(--toss-text-tertiary);
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .status-dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        display: inline-block;
        flex-shrink: 0;
    }

    .status-dot.active {
        background: #22c55e;
    }

    .status-dot.occupied {
        background: #f59e0b;
    }

    .status-dot.maintenance {
        background: #ef4444;
    }

    /* === 보이는 셀 3: ⋯ 더보기 버튼 === */
    .toss-table tr.rental-item td.td-mobile-more {
        display: flex !important;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        order: 3;
    }

    .btn-mobile-more {
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        border-radius: 8px;
        color: var(--toss-text-tertiary);
        cursor: pointer;
        transition: background-color 0.15s;
        position: relative;
        z-index: 2;
    }

    .btn-mobile-more:active {
        background-color: var(--toss-bg-grouped-base);
    }

    /* 로딩/빈 상태 유지 */
    .toss-table tr:not(.rental-item):not(.skeleton-row) {
        display: block !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
    }

    .toss-table tr:not(.rental-item):not(.skeleton-row) td {
        display: block !important;
        width: 100% !important;
        padding: 32px 16px !important;
        text-align: center;
    }

    /* 스켈레톤 행 모바일 (리스트 아이템 형태) */
    .toss-table tr.skeleton-row {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        padding: 14px 16px !important;
        gap: 12px !important;
        border: none !important;
        border-bottom: 1px solid var(--toss-line-weak) !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
        overflow: visible !important;
        width: 100% !important;
    }

    .toss-table tr.skeleton-row td {
        display: none !important;
        border: none !important;
        padding: 0 !important;
        width: auto !important;
        max-width: none !important;
    }

    .toss-table tr.skeleton-row td::before {
        display: none !important;
    }

    .toss-table tr.skeleton-row td.td-thumbnail {
        display: block !important;
        flex-shrink: 0;
    }

    .toss-table tr.skeleton-row td.td-thumbnail .skeleton-thumbnail {
        width: 64px;
        height: 64px;
        border-radius: 10px;
    }

    .toss-table tr.skeleton-row td.td-product-name {
        display: block !important;
        flex: 1;
        min-width: 0;
    }
}

/* ===============================================
   모바일 관리 액션 바텀시트
   =============================================== */
.rental-action-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: rentalOverlayFadeIn 0.2s ease;
}

@keyframes rentalOverlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.rental-action-sheet {
    background: var(--toss-bg-base, #fff);
    border-radius: 20px 20px 0 0;
    padding: 20px 0 calc(env(safe-area-inset-bottom, 0px) + 12px);
    width: 100%;
    max-width: 480px;
    animation: rentalSheetSlideUp 0.3s ease;
}

@keyframes rentalSheetSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.action-sheet-header {
    padding: 0 24px 16px;
    border-bottom: 1px solid var(--toss-line-weak);
}

.action-sheet-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--toss-text-primary);
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.action-sheet-list {
    list-style: none;
    margin: 0;
    padding: 8px 0;
}

.action-sheet-divider {
    height: 1px;
    background: var(--toss-line-weak);
    margin: 4px 24px;
}

.action-sheet-item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 24px;
    background: none;
    border: none;
    font-size: 16px;
    color: var(--toss-text-primary);
    cursor: pointer;
    transition: background-color 0.15s;
    text-align: left;
}

.action-sheet-item:active {
    background-color: var(--toss-bg-grouped-base);
}

.action-sheet-item svg {
    flex-shrink: 0;
    color: var(--toss-text-tertiary);
}

.action-sheet-item.danger {
    color: #ef4444;
}

.action-sheet-item.danger svg {
    color: #ef4444;
}

.action-sheet-cancel {
    display: block;
    width: calc(100% - 48px);
    margin: 8px 24px 0;
    padding: 14px;
    background: var(--toss-bg-grouped-base);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--toss-text-secondary);
    cursor: pointer;
    transition: background-color 0.15s;
}

.action-sheet-cancel:active {
    background-color: var(--toss-line-weak);
}

/* ==================== 가격 숨기기 토글 ==================== */

.plan-badge-max {
    background: #000;
    color: #7089ff;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    letter-spacing: 0.5px;
    border: none;
}

/* 토글 카드 */
.toggle-card {
    background: var(--toss-bg-elevated);
    border: 1px solid var(--toss-border-light);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s ease;
}

.toggle-card:hover {
    border-color: var(--toss-border-dark);
}

.toggle-card.active {
    border-color: var(--toss-primary);
    background: rgba(0, 102, 255, 0.02);
}

.toggle-card.disabled {
    opacity: 0.6;
    pointer-events: none;
}

.toggle-card-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.toggle-info {
    flex: 1;
}

.toggle-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--toss-text-primary);
    margin-bottom: 6px;
}

.toggle-title svg {
    color: var(--toss-text-secondary);
    flex-shrink: 0;
}

.toggle-description {
    font-size: 13px;
    color: var(--toss-text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* 토글 스위치 */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 28px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e5e7eb;
    transition: 0.3s;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.toggle-switch input:checked + .toggle-slider {
    background: #191F28;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle-switch input:disabled + .toggle-slider {
    background-color: #d1d5db;
    cursor: not-allowed;
}

/* 플랜 업그레이드 안내 */
.plan-upgrade-notice {
    margin-top: 12px;
    padding: 12px;
    background: #fef3c7;
    border-radius: 8px;
    border: 1px solid rgba(217, 119, 6, 0.2);
}

.plan-upgrade-notice p {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #92400e;
}

.plan-upgrade-notice .upgrade-link {
    font-size: 13px;
    font-weight: 600;
    color: #d97706;
    text-decoration: none;
}

.plan-upgrade-notice .upgrade-link:hover {
    text-decoration: underline;
}

/* 가격 숨기기 옵션 */
.hide-price-options {
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 안내 박스 */
.auto-apply-notice {
    background: var(--toss-bg-base);
    border: 1px solid var(--toss-border-light);
    border-radius: 12px;
    padding: 16px;
}

.auto-apply-notice .notice-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--toss-text-secondary);
    margin-bottom: 12px;
}

.auto-apply-notice .notice-header svg {
    color: var(--toss-text-tertiary);
    flex-shrink: 0;
}

.auto-apply-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auto-apply-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: var(--toss-text-secondary);
    line-height: 1.4;
}

.auto-apply-list li svg {
    color: #7089ff;
    flex-shrink: 0;
    margin-top: 2px;
}

.auto-apply-list li strong {
    color: var(--toss-text-primary);
}

/* 모바일 반응형 - 토글 카드 */
@media (max-width: 768px) {
    .toggle-card-content {
        gap: 12px;
    }

    .toggle-switch {
        margin-top: 2px;
    }
}