@import url('https://fonts.googleapis.com/css2?family=Pretendard:wght@400;600&display=swap');

body {
    font-family: 'Pretendard', sans-serif;
    margin: 0 auto;
    padding: 10px;
    background-color: #f0f7ff;
    color: #334155;
    max-width: 800px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

header {
    background: #ffffff;
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 123, 255, 0.1);
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.header-row { display: flex; flex-wrap: wrap; width: 100%; }

.top-row .left-group {
    display: flex;
    width: 100%;
    gap: 8px;
    align-items: center;
}

#travelSelect { width: auto; min-width: 80px; max-width: 200px; flex: 0 1 auto; }
.add-travel-btn { width: auto; padding: 0 15px; }

.middle-row { justify-content: center; border-top: 1px solid #f1f5f9; padding-top: 10px; }
.bottom-row { justify-content: flex-start; border-top: 1px solid #f1f5f9; padding-top: 8px; }

.action-group { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-start; }

button {
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    padding: 8px 12px;
    font-size: 0.85rem;
    white-space: nowrap;
}

.full-width-btn {
    width: 100%;
    display: block;
    padding: 12px;
    font-size: 0.95rem;
    margin-top: 10px;
}

.btn-main { background-color: #e0edff; color: #007bff; }
.btn-sub { background-color: #f1f5f9; color: #64748b; }
.btn-load { background-color: #007bff; color: white; }
.btn-save { background-color: #10b981; color: white; }
.btn-reset { background-color: #fee2e2; color: #ef4444; border: 1px solid #fecaca; }

.btn-lock { background-color: #f8fafc; color: #64748b; border: 1px solid #e2e8f0; }
.btn-lock.unlocked { background-color: #fff7ed; color: #ea580c; border: 1px solid #fdba74; }

/* 다운로드 버튼 스타일 */
.btn-download { background-color: #ecfdf5; color: #059669; border: 1px solid #d1fae5; }

#travelSelect, select, input, textarea {
    padding: 10px;
    border-radius: 8px;
    border: 2px solid #eef2f7;
    font-weight: 600;
    background-color: white;
    box-sizing: border-box;
    font-size: 0.9rem;
}

.full-width-input { width: 100% !important; }

.user-tabs { display: flex; background: #f1f5f9; padding: 3px; border-radius: 8px; gap: 3px; }
.tab-btn { padding: 6px 16px; background: transparent; color: #64748b; border-radius: 5px; }
.tab-btn.active { background: white; color: #007bff; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }

main { width: 100%; background: white; border-radius: 12px; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05); overflow: hidden; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th { background: #f8fbff; color: #475569; font-size: 0.85rem; padding: 12px 2px; border-bottom: 2px solid #eef2f7; }
td { padding: 10px 5px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }

tr.dragging { opacity: 0.4; background-color: #e0edff !important; }
.status-col { width: 60px; text-align: center; }
.name-cell { display: flex; align-items: center; justify-content: flex-start; gap: 8px; }
.name-text { font-size: 0.95rem; font-weight: 600; word-break: break-all; }
.row-num { color: #94a3b8; font-size: 0.85rem; min-width: 25px; }

.category-row td { background-color: #f0f7ff; color: #007bff; }

.fold-btn {
    background: transparent;
    border: none;
    color: #007bff;
    padding: 0;
    margin-right: 4px;
    font-size: 1.1rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    -webkit-appearance: none;
}

tr.hidden-item { display: none; }

body.is-unlocked .category-row .name-text::before { content: '≡'; margin-right: 8px; color: #007bff; cursor: grab; font-weight: bold; }

.status-btn { width: 38px; height: 38px; font-size: 16px; border-radius: 8px; border: 2px solid #e2e8f0; background: white; }
.status-O { color: white; background: #10b981; border-color: #10b981; }
.status-X { color: #cbd5e1; }

.mini-del-btn { background: #fee2e2; color: #ef4444; border: none; width: 22px; height: 22px; border-radius: 4px; font-size: 10px; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.mini-edit-btn { background: #e0f2fe; color: #0284c7; border: none; width: 22px; height: 22px; border-radius: 4px; font-size: 10px; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; margin-left: 4px; }

.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; backdrop-filter: blur(2px); }
.modal-content { background: white; padding: 20px; border-radius: 15px; width: 90%; max-width: 450px; }

.modal-large { max-height: 85vh; display: flex; flex-direction: column; width: 95%; }
.scrollable-modal { overflow-y: auto; }

.load-stack { display: flex; flex-direction: column; gap: 20px; margin-top: 15px; }
.grid-col { background: #f8fbff; padding: 12px; border-radius: 10px; border: 1px solid #eef2f7; }
.grid-col h4 { margin: 0 0 8px 0; font-size: 0.95rem; color: #334155; }

.data-list { list-style: none; padding: 0; max-height: 180px; overflow-y: auto; border: 1px solid #eee; border-radius: 5px; background: white; }
.data-list li { padding: 12px; border-bottom: 1px solid #f9f9f9; cursor: pointer; font-size: 0.9rem; display: flex; justify-content: space-between; align-items: center; }
.data-list li.selected { background: #e0edff; color: #007bff; font-weight: bold; }

.cat-preview-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cat-tag { background: #e0edff; color: #007bff; padding: 4px 10px; border-radius: 20px; font-size: 0.8rem; font-weight: bold; }

.vertical-buttons { margin-top: 20px; }

@media (max-width: 768px) {
    .modal-content { padding: 15px; }
    .status-btn { width: 44px; height: 44px; }
}