* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* すべてのボタンのクリックを確実にする */
button {
    pointer-events: auto;
    cursor: pointer;
    position: relative;
    z-index: 10;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: #f5f5f5;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    position: relative;
}

.app-container {
    display: flex;
    min-height: 100vh;
    background: #f5f5f5;
}

/* サイドバー */
.sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    box-shadow: none;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.sidebar-header h2 {
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

/* マスターデータ管理セクション */
.master-data-manager {
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #fafafa;
}

.master-data-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.master-data-header h3 {
    color: #333;
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.master-data-edit-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.master-data-edit-btn:hover {
    background: #e0e0e0;
    color: #333;
}

.master-data-edit-btn svg {
    width: 16px;
    height: 16px;
}

.master-data-selector {
    margin-bottom: 12px;
}

.master-data-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    background: white;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
}

.master-data-select:hover {
    border-color: #4caf50;
}

.master-data-select:focus {
    outline: none;
    border-color: #4caf50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.master-data-info {
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
}

.master-data-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
}

.master-data-info-item:last-child {
    margin-bottom: 0;
}

.master-data-info-item .info-label {
    color: #666;
    font-weight: 500;
}

.master-data-info-item .info-value {
    color: #333;
    font-weight: 600;
}

/* マスターデータ編集モーダル */
.master-data-edit-modal {
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
}

.master-data-edit-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 6px;
}

.master-data-edit-info .info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.master-data-edit-info .info-label {
    color: #666;
    font-weight: 500;
}

.master-data-edit-info .info-value {
    color: #333;
    font-weight: 600;
}

.master-data-preview-table-container {
    max-height: 400px;
    overflow: auto;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.master-data-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.master-data-preview-table thead {
    background: #f5f5f5;
    position: sticky;
    top: 0;
    z-index: 10;
}

.master-data-preview-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #ddd;
    white-space: nowrap;
}

.master-data-preview-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #e0e0e0;
    color: #666;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.master-data-preview-table tbody tr:hover {
    background: #f9f9f9;
}

.master-data-edit-actions {
    display: flex;
    gap: 12px;
}

.master-data-edit-actions button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
}

.master-data-edit-actions button svg {
    width: 16px;
    height: 16px;
}

.menu {
    flex: 1;
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    border-left: 3px solid transparent;
    pointer-events: auto;
    position: relative;
    z-index: 10;
    -webkit-tap-highlight-color: transparent;
}

.menu-item:hover {
    background: #f5f5f5;
    color: #333;
}

.menu-item.active {
    background: #e8f5e9;
    color: #2e7d32;
    border-left-color: #4caf50;
    font-weight: 600;
}

.menu-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* メインコンテンツ */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #f5f5f5;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    width: calc(100% - 280px);
    max-width: calc(100% - 280px);
    position: relative;
    left: 0;
    right: 0;
}

.page {
    display: none !important;
    width: 100%;
    max-width: 100%;
    flex: 1;
    box-sizing: border-box;
}

.page.active {
    display: flex !important;
    flex-direction: column;
    animation: fadeIn 0.3s ease-in;
    opacity: 1 !important;
    flex: 1;
    width: 100%;
    max-width: 100%;
    min-height: 100%;
    position: relative;
    z-index: 1;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    box-sizing: border-box;
}

/* 明示的に非表示にする（念のため） */
.page:not(.active) {
    display: none !important;
}

.container {
    background: #f5f5f5;
    padding: 24px 32px;
    width: 100%;
    max-width: 100%;
    flex: 1;
    animation: fadeIn 0.3s ease-in;
    overflow-x: hidden;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    box-sizing: border-box;
    margin: 0;
    position: relative;
    left: 0;
    right: 0;
}

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

h1 {
    color: #333;
    font-size: 24px;
    margin-bottom: 24px;
    font-weight: 600;
}

.subtitle {
    color: #666;
    margin-bottom: 24px;
    font-size: 14px;
}

.drop-zone {
    border: 2px dashed #ccc;
    border-radius: 4px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    margin-bottom: 20px;
}

.drop-zone:hover {
    border-color: #4caf50;
    background: #f5f5f5;
}

.drop-zone.drag-over {
    border-color: #4caf50;
    background: #e8f5e9;
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.upload-icon {
    width: 64px;
    height: 64px;
    color: #999;
    margin-bottom: 10px;
}

.drop-zone-text {
    font-size: 18px;
    color: #333;
    font-weight: 600;
}

.drop-zone-hint {
    font-size: 14px;
    color: #999;
}

.file-info {
    background: #f8f9ff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    animation: slideDown 0.3s ease;
}

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

.file-info-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.file-icon {
    width: 40px;
    height: 40px;
    color: #667eea;
    flex-shrink: 0;
}

.file-details {
    flex: 1;
}

.file-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    word-break: break-all;
}

.file-size {
    font-size: 14px;
    color: #666;
}

.convert-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.convert-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.convert-btn:active:not(:disabled) {
    transform: translateY(0);
}

.convert-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #ccc;
    box-shadow: none;
}

.btn-icon {
    width: 20px;
    height: 20px;
}

.status-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    font-size: 14px;
    display: none;
}

.status-message.success {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-message.info {
    display: block;
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ファイルリスト（結合機能用） */
.files-list {
    background: #f8f9ff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    animation: slideDown 0.3s ease;
}

.files-list h3 {
    color: #333;
    font-size: 18px;
    margin-bottom: 15px;
    font-weight: 600;
}

.files-list-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.file-item-icon {
    width: 32px;
    height: 32px;
    color: #667eea;
    flex-shrink: 0;
}

.file-item-details {
    flex: 1;
    min-width: 0;
}

.file-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    word-break: break-all;
}

.file-item-size {
    font-size: 12px;
    color: #666;
}

.remove-file-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.remove-file-btn:hover {
    background: #ff5252;
    transform: scale(1.1);
}

.remove-file-btn svg {
    width: 16px;
    height: 16px;
}

/* ==================== マスターデータ取込ウィザード ==================== */
.wizard-step {
    display: none;
}

.wizard-step.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

.wizard-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.wizard-header h2 {
    color: #333;
    font-size: 24px;
    margin-bottom: 20px;
}

.step-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
}

.step-number.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.step-number.completed {
    background: #4caf50;
    color: white;
}

.step-line {
    flex: 1;
    height: 2px;
    background: #e0e0e0;
}

/* フォーム要素 */
.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.form-label.required::after {
    content: ' *';
    color: #f44336;
}

.form-input,
.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input::placeholder {
    color: #999;
}

/* ラジオボタングループ */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-option {
    display: flex;
    align-items: flex-start;
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.radio-option:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.radio-option input[type="radio"] {
    margin-right: 12px;
    margin-top: 2px;
    cursor: pointer;
    width: 20px;
    height: 20px;
}

.radio-option input[type="radio"]:checked + .radio-label {
    color: #667eea;
}

.radio-label {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.radio-label strong {
    font-size: 16px;
    color: #333;
}

.radio-label small {
    font-size: 13px;
    color: #666;
}

.radio-option input[type="radio"]:checked ~ .radio-label strong,
.radio-option:has(input[type="radio"]:checked) .radio-label strong {
    color: #667eea;
}

/* チェックボックス */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 16px;
    color: #333;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"]:checked {
    accent-color: #667eea;
}

/* サーバー設定・アップロード設定 */
.server-settings,
.upload-settings {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9ff;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

.drop-zone-small {
    border: 2px dashed #667eea;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.drop-zone-small:hover {
    border-color: #764ba2;
    background: #f0f2ff;
}

.drop-zone-small.drag-over {
    border-color: #764ba2;
    background: #e8ebff;
    transform: scale(1.01);
}

.drop-zone-small .upload-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 10px;
}

.drop-zone-small .drop-zone-text {
    font-size: 16px;
}

.drop-zone-small .drop-zone-hint {
    font-size: 13px;
}

/* ウィザードアクション */
.wizard-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #eee;
}

.btn-primary,
.btn-secondary {
    padding: 14px 32px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
    position: relative;
    z-index: 10;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    margin-left: auto;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: white;
    color: #666;
    border: 2px solid #e0e0e0;
}

.btn-secondary:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

/* ==================== データフィード一覧 ==================== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e0e0e0;
}

.page-header h1 {
    color: #333;
    font-size: 24px;
    margin: 0;
    font-weight: 600;
}

.page-actions {
    display: flex;
    gap: 12px;
}

.page-actions .btn-primary,
.page-actions .btn-secondary {
    padding: 12px 24px;
    font-size: 14px;
}

.table-container {
    background: white;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: #f8f9ff;
}

.data-table th {
    padding: 16px;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #666;
}

.data-table tbody tr {
    transition: background 0.2s ease;
}

.data-table tbody tr:hover {
    background: #f8f9ff;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* フィード名セル */
.feed-name-cell {
    min-width: 250px;
}

.feed-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.feed-destination {
    font-size: 13px;
    color: #999;
}

/* 環境バッジ */
.env-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.env-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.env-badge.production {
    background: #e3f2fd;
    color: #1976d2;
}

.env-badge.test {
    background: #fff3e0;
    color: #f57c00;
}

/* スコア */
.score-cell {
    text-align: right;
    font-weight: 600;
    color: #333;
}

.score-value {
    font-size: 16px;
}

.score-total {
    font-size: 13px;
    color: #999;
    margin-left: 4px;
}

/* 変換ステータス */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.success {
    background: #d4edda;
    color: #155724;
}

.status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.status-badge.error {
    background: #f8d7da;
    color: #721c24;
}

/* 日時 */
.datetime-cell {
    color: #666;
    font-size: 13px;
}

/* 操作ボタン */
.action-buttons {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 6px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    color: #666;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    pointer-events: auto;
    position: relative;
    z-index: 10;
    -webkit-tap-highlight-color: transparent;
}

.action-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
    color: #333;
}

.action-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.action-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.action-btn.delete {
    background: white;
    color: #dc3545;
    border-color: #dc3545;
}

.action-btn.delete:hover {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

/* ==================== モーダル ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #666;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #333;
}

.modal-close svg {
    width: 24px;
    height: 24px;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 24px;
    border-top: 1px solid #eee;
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #999;
}

.checkbox-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.data-preview {
    background: #f8f9ff;
    border-radius: 8px;
    padding: 16px;
    margin-top: 8px;
}

.preview-info {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}

.preview-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 12px;
    color: #999;
}

.stat-value {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

/* ==================== 進捗バー ==================== */
.progress-container {
    margin-top: 12px;
}

.progress-bar {
    width: 100%;
    height: 24px;
    background: #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50 0%, #8bc34a 100%);
    transition: width 0.3s ease;
    border-radius: 12px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 14px;
    color: #666;
}

.progress-time {
    font-size: 12px;
    color: #999;
}

/* ==================== マッピングモーダル ==================== */
.mapping-modal-content {
    max-width: 95vw;
    width: 1400px;
    max-height: 95vh;
    height: 90vh;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.mapping-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
    background: white;
}

.mapping-header-left h2 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.mapping-header-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mapping-last-sent {
    font-size: 13px;
    color: #666;
}

.mapping-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mapping-env-selector {
    position: relative;
}

.env-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

.env-btn svg {
    width: 16px;
    height: 16px;
}

.mapping-preview-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    color: #666;
}

.mapping-preview-btn:hover {
    background: #f5f5f5;
}

.mapping-preview-btn svg {
    width: 18px;
    height: 18px;
}

.mapping-close-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    border-radius: 4px;
}

.mapping-close-btn:hover {
    background: #f5f5f5;
}

.mapping-close-btn svg {
    width: 20px;
    height: 20px;
}

.mapping-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
    padding: 0 24px;
}

.mapping-tab {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.2s ease;
}

.mapping-tab:hover {
    color: #333;
    background: #f0f0f0;
}

.mapping-tab.active {
    color: #4caf50;
    border-bottom-color: #4caf50;
    font-weight: 600;
}

.mapping-content-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.mapping-main-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.mapping-info-banner {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: #e3f2fd;
    border-radius: 4px;
    margin-bottom: 20px;
}

.info-icon {
    width: 20px;
    height: 20px;
    color: #2196f3;
    flex-shrink: 0;
    margin-top: 2px;
}

.info-content {
    flex: 1;
}

.info-content p {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #333;
    line-height: 1.6;
}

.info-content p:last-child {
    margin-bottom: 0;
}

.info-link {
    color: #2196f3;
    text-decoration: underline;
    font-size: 13px;
}

.mapping-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.mapping-actions .btn-secondary {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mapping-actions .btn-secondary svg {
    width: 16px;
    height: 16px;
}

.mapping-table-container {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: auto;
    width: 100%;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.mapping-table {
    width: 100%;
    border-collapse: collapse;
}

.mapping-table thead {
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
}

.mapping-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
    white-space: nowrap;
}

.mapping-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.mapping-table tbody tr:hover {
    background: #f8f9ff;
}

.mapping-feed-item {
    width: 100%;
    min-width: 200px;
}

.mapping-master-item {
    width: 100%;
    min-width: 250px;
}

.mapping-row-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.mapping-clear-btn,
.mapping-delete-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s ease;
}

.mapping-clear-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.mapping-delete-btn:hover {
    background: #fee;
    border-color: #dc3545;
    color: #dc3545;
}

.mapping-clear-btn svg,
.mapping-delete-btn svg {
    width: 16px;
    height: 16px;
}

/* プレビューサイドバー */
.mapping-preview-sidebar {
    width: 400px;
    border-left: 1px solid #e0e0e0;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.preview-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: white;
}

.preview-header h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-icon {
    width: 16px;
    height: 16px;
    color: #999;
    cursor: help;
}

.preview-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.preview-nav-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    color: #666;
}

.preview-nav-btn:hover {
    background: #f5f5f5;
}

.preview-nav-btn svg {
    width: 16px;
    height: 16px;
}

#previewItemNumber {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.preview-tabs {
    display: flex;
    background: white;
    border-bottom: 1px solid #e0e0e0;
}

.preview-tab {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 13px;
    color: #666;
}

.preview-tab.active {
    color: #4caf50;
    border-bottom-color: #4caf50;
    font-weight: 600;
}

.preview-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.preview-creative {
    margin-bottom: 24px;
}

.preview-image-placeholder {
    width: 100%;
    height: 200px;
    background: #f0f0f0;
    border: 2px dashed #ccc;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.preview-image-placeholder svg {
    width: 64px;
    height: 64px;
    color: #999;
}

.preview-image-select {
    display: flex;
    gap: 8px;
}

.preview-image-select .form-select {
    flex: 1;
}

.preview-details {
    background: white;
    border-radius: 4px;
    padding: 16px;
    border: 1px solid #e0e0e0;
}

.preview-details h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.preview-details-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.preview-details-table th {
    padding: 8px 12px;
    text-align: left;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    font-weight: 600;
    color: #666;
}

.preview-details-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

.preview-details-table tbody tr:last-child td {
    border-bottom: none;
}

/* ==================== マスターデータ一覧 ==================== */
.master-data-list-section {
    margin-top: 32px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
}

.master-data-table-container {
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.file-name-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-icon-small {
    width: 18px;
    height: 18px;
    color: #666;
    flex-shrink: 0;
}

.action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-danger {
    background: #f44336;
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #d32f2f;
}

.btn-danger:active {
    background: #b71c1c;
}

/* ==================== 画像変換ページ ==================== */
/* 画像変換タブUI */
.image-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid #e0e0e0;
}

.image-tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #666;
    transition: all 0.2s ease;
    position: relative;
    bottom: -2px;
}

.image-tab:hover {
    color: #4CAF50;
    background: rgba(76, 175, 80, 0.05);
}

.image-tab.active {
    color: #4CAF50;
    border-bottom-color: #4CAF50;
    font-weight: 600;
}

.image-tab-content {
    margin-bottom: 24px;
}

.tab-description {
    color: #666;
    font-size: 14px;
    margin: 0 0 16px 0;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 6px;
    border-left: 3px solid #4CAF50;
}

.image-progress-section {
    margin-top: 24px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
}

.converted-images-section {
    margin-top: 32px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
}

.section-actions {
    display: flex;
    gap: 12px;
}

.converted-images-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 20px;
}

.image-group {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    background: #fafafa;
}

.image-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.image-group-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

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

.image-group-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.converted-image-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
}

.converted-image-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.image-preview {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 6px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.2s ease;
    display: block;
}

.image-preview img:hover {
    transform: scale(1.05);
}

.image-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #999;
    font-size: 12px;
}

.image-info {
    flex: 1;
    margin-bottom: 12px;
}

.image-name-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    margin: 0 0 4px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.image-name-input {
    width: 100%;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin: 0 0 4px 0;
    padding: 6px 10px;
    border: 2px solid #4CAF50;
    border-radius: 4px;
    background: white;
    box-sizing: border-box;
    cursor: text;
}

.image-name-input:hover {
    border-color: #45a049;
    background: #f9fff9;
}

.image-name-input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.15);
    background: white;
}

/* ==================== コード効果早見表ページ ==================== */
.code-reference-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid #e0e0e0;
}

.code-reference-tabs .code-reference-tab {
    padding: 10px 20px;
    background: none !important;
    border: none !important;
    color: #666 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0;
    outline: none;
}

.code-reference-tabs .code-reference-tab:hover {
    color: #4caf50 !important;
}

.code-reference-tabs .code-reference-tab.active {
    color: #4caf50 !important;
    border-bottom: 2px solid #4caf50 !important;
}

.code-reference-tab-content {
    margin-bottom: 24px;
}

.code-reference-table {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    min-height: 400px;
}

.code-reference-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.code-reference-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    background: #fafafa;
    transition: all 0.2s ease;
}

.code-reference-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #4caf50;
}

.code-reference-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.code-reference-property {
    font-size: 18px;
    font-weight: 700;
    color: #4caf50;
    margin: 0;
    font-family: 'Courier New', monospace;
}

.code-reference-values {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.code-reference-value {
    padding: 3px 10px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.code-reference-description {
    margin-bottom: 12px;
    color: #666;
    font-size: 13px;
    line-height: 1.5;
}

.code-reference-examples {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
}

.code-reference-code-example,
.code-reference-visual-example {
    flex: 1;
}

.code-reference-code-example strong,
.code-reference-visual-example strong {
    display: block;
    margin-bottom: 6px;
    color: #333;
    font-size: 12px;
    font-weight: 600;
}

.code-reference-code-example pre {
    margin: 0;
    padding: 10px;
    background: #2d2d2d;
    color: #f8f8f2;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 12px;
    line-height: 1.4;
    font-family: 'Courier New', monospace;
}

.code-reference-code-example code {
    color: #f8f8f2;
    font-family: 'Courier New', monospace;
}

.code-reference-visual-content {
    padding: 12px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    min-height: 60px;
}

@media (max-width: 768px) {
    .code-reference-examples {
        grid-template-columns: 1fr;
    }
}

.image-original {
    font-size: 11px;
    color: #666;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-actions {
    display: flex;
    gap: 8px;
}

.image-actions button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.image-actions button svg {
    width: 16px;
    height: 16px;
}

.progress-count {
    margin-left: 12px;
    color: #666;
    font-size: 13px;
}

/* ==================== 予約管理ページ ==================== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.page-header h1 {
    margin: 0;
}

.btn-icon-only {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #4caf50;
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon-only:hover {
    background: #45a049;
    transform: scale(1.05);
}

.btn-icon-only svg {
    width: 20px;
    height: 20px;
}

.reservation-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid #e0e0e0;
}

.reservation-tab {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: -2px;
}

.reservation-tab:hover {
    color: #333;
    background: #f5f5f5;
}

.reservation-tab.active {
    color: #4caf50;
    border-bottom-color: #4caf50;
    font-weight: 600;
}

.reservation-tab-content {
    display: none;
}

.reservation-tab-content.active {
    display: block;
}

.reservation-group-selector {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.reservation-group-selector .form-group {
    margin: 0;
}

.store-selection-section {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.store-selection-section h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.master-stores-selection {
    margin-top: 16px;
}

.master-stores-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

.store-checkbox-item {
    padding: 12px;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.store-checkbox-item .checkbox-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}

.store-checkbox-item .checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin-right: 8px;
}

.store-checkbox-item .checkbox-label span:first-of-type {
    font-weight: 500;
    color: #333;
}

.store-url-hint {
    font-size: 12px;
    color: #666;
    margin-left: 26px;
    word-break: break-all;
}

.stores-section {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
}

.stores-table-container {
    overflow-x: auto;
    margin-top: 16px;
    width: 100%;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.stores-table {
    width: 100%;
    border-collapse: collapse;
}

.stores-table thead {
    background: #f5f5f5;
}

.stores-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    font-size: 14px;
    border-bottom: 2px solid #e0e0e0;
}

.stores-table td {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
}

.stores-table tbody tr:hover {
    background: #f9f9f9;
}

.stores-table tbody tr.completed-row {
    background: #e8f5e9;
}

.stores-table tbody tr.completed-row:hover {
    background: #c8e6c9;
}

.store-url-link {
    color: #4caf50;
    text-decoration: none;
    word-break: break-all;
}

.store-url-link:hover {
    text-decoration: underline;
}

.stores-table .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.stores-table .checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.stores-table .checkbox-label span {
    font-size: 12px;
    color: #666;
}

/* 店舗情報を追加タブ */
.store-master-section {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
}

.store-master-section h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.section-description {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 14px;
}

.store-form-section {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

/* モバイルでの店舗情報追加フォームの最適化 */
@media screen and (max-width: 768px) {
    .store-form-section {
        padding: 16px;
        margin-bottom: 20px;
    }

    .store-form-section .form-group:last-child {
        margin-top: 0;
    }

    .store-form-section .form-group:last-child .form-label {
        display: none; /* 空のラベルを非表示 */
    }

    .store-form-section #addMasterStoreBtn {
        width: 100%;
        margin-top: 4px;
    }
}

.store-form-section h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.form-row {
    display: grid;
    grid-template-columns: 2fr 3fr auto;
    gap: 12px;
    align-items: end;
}

/* モバイルではフォーム行を縦並びに */
@media screen and (max-width: 768px) {
    .form-row {
        display: flex;
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
}

.master-stores-list-section {
    margin-top: 24px;
}

.master-stores-table-container {
    overflow-x: auto;
    margin-top: 16px;
    width: 100%;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.master-stores-table {
    width: 100%;
    border-collapse: collapse;
}

.master-stores-table thead {
    background: #f5f5f5;
}

.master-stores-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    font-size: 14px;
    border-bottom: 2px solid #e0e0e0;
}

.master-stores-table td {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
}

.master-stores-table tbody tr:hover {
    background: #f9f9f9;
}

.table-actions {
    display: flex;
    gap: 8px;
}

.table-actions button {
    padding: 6px 12px;
}

/* ==================== アップロード済みファイル一覧 ==================== */
.uploaded-files-section {
    margin-top: 32px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.section-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-sm svg {
    width: 14px;
    height: 14px;
}

.files-list-container {
    min-height: 100px;
}

.empty-message {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-size: 14px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 8px;
    background: #f8f9fa;
    transition: all 0.2s ease;
}

.file-item:hover {
    background: #f0f0f0;
    border-color: #ccc;
}

.file-item-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.file-item-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    color: #4caf50;
}

.file-item-details {
    flex: 1;
    min-width: 0;
}

.file-item-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin: 0 0 4px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-item-meta {
    font-size: 12px;
    color: #666;
    display: flex;
    gap: 12px;
}

.file-item-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.file-action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s ease;
}

.file-action-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.file-action-btn.download:hover {
    background: #e3f2fd;
    border-color: #2196f3;
    color: #2196f3;
}

.file-action-btn.delete:hover {
    background: #fee;
    border-color: #dc3545;
    color: #dc3545;
}

.file-action-btn svg {
    width: 16px;
    height: 16px;
}

/* ==================== データ加工ページ ==================== */
.result-section {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.result-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.copy-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 14px;
}

.copy-btn svg {
    width: 16px;
    height: 16px;
}

.result-content {
    margin-top: 12px;
}

.result-textarea {
    width: 100%;
    min-height: 200px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    background: #f8f9fa;
}

.result-textarea:focus {
    outline: none;
    border-color: #4caf50;
    background: white;
}

.duplicate-table-container {
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.duplicate-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.duplicate-table thead {
    background: #f8f9fa;
}

.duplicate-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
}

.duplicate-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    color: #666;
}

.duplicate-table tbody tr:hover {
    background: #f8f9ff;
}

.duplicate-table tbody tr:last-child td {
    border-bottom: none;
}

/* 予約管理ページのヘッダー（固定） */
.reservation-page-header {
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
    padding: 16px 0;
    margin-bottom: 24px;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.page-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.current-date-display {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    padding: 4px 12px;
    background: #f5f5f5;
    border-radius: 4px;
}

/* 予約管理サマリー */
.reservation-summary {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.summary-header {
    margin-bottom: 16px;
}

.summary-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.summary-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.summary-item-wide {
    grid-column: span 2;
}

.summary-label {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.summary-value {
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

.summary-value-primary {
    color: #2196f3;
}

.summary-value-success {
    color: #4caf50;
}

.summary-value-danger {
    color: #f44336;
}

.summary-value-muted {
    color: #999;
}

/* 店舗カード形式（モバイル用） */
.stores-cards-container {
    display: none;
}

.stores-cards-mobile {
    display: none;
}

.store-card {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
}

.store-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.store-card.completed {
    border-left: 4px solid #4caf50;
}

.store-card.status-won {
    border-left: 4px solid #4caf50;
}

.store-card.status-lost {
    border-left: 4px solid #f44336;
}

.store-card-header {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.store-card-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.store-card-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.store-card-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.store-card-label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.store-card-url {
    color: #2196f3;
    text-decoration: none;
    font-size: 14px;
    word-break: break-all;
    padding: 8px 12px;
    background: #f5f5f5;
    border-radius: 4px;
    display: inline-block;
}

.store-card-url:hover {
    text-decoration: underline;
}

.store-card-dates {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.store-card-dates input[type="date"] {
    flex: 1;
    min-width: 140px;
    font-size: 14px;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.date-separator {
    color: #666;
    font-weight: 500;
}

.store-card-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.store-card-checkbox-label:hover {
    background: #e9ecef;
}

.store-card-checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.store-card-completed-time {
    color: #666;
    font-size: 12px;
    margin-left: 4px;
}

.store-card-status {
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.store-card-status-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.store-card-status-option {
    flex: 1;
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    color: #666;
}

.store-card-status-option:hover {
    background: #e9ecef;
    border-color: #ccc;
}

.store-card-status-option.active {
    background: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
    font-weight: 600;
}

.store-card-status-option.active.lost {
    background: #ffebee;
    border-color: #f44336;
    color: #c62828;
}

.store-card-status-option input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.store-card-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    background: white;
    border-radius: 8px;
    border: 1px dashed #e0e0e0;
}

.store-card-empty p {
    margin: 0;
    font-size: 14px;
}

.store-card-status-none {
    color: #999;
    font-size: 14px;
    font-style: italic;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
}

/* ==================== モバイル対応 ==================== */

/* モバイル用ヘッダー */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    z-index: 1000;
    align-items: center;
    padding: 0 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mobile-menu-toggle {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.mobile-menu-toggle svg {
    width: 24px;
    height: 24px;
}

.mobile-header-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

/* モバイル用メニューオーバーレイ */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.mobile-menu-overlay.active .mobile-menu {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.mobile-menu-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.mobile-menu-close {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-close svg {
    width: 24px;
    height: 24px;
}

.mobile-menu-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    width: 100%;
    border-left: 3px solid transparent;
}

.mobile-menu-item:hover {
    background: #f5f5f5;
    color: #333;
}

.mobile-menu-item.active {
    background: #e8f5e9;
    color: #2e7d32;
    border-left-color: #4caf50;
    font-weight: 600;
}

/* タブレット対応: 1024px以下（レイアウト調整のみ、サイドバーは表示） */
@media screen and (max-width: 1024px) {
    .main-content {
        margin-left: 280px;
        width: calc(100% - 280px);
        max-width: calc(100% - 280px);
        position: relative;
        left: 0;
        right: 0;
    }
    
    .container {
        padding: 20px;
        width: 100%;
        max-width: 100%;
        margin: 0;
        position: relative;
        left: 0;
        right: 0;
    }
    
    /* 古物商取引記録ページのフォーム調整 */
    .antique-tab-content {
        overflow-x: auto;
        width: 100%;
        max-width: 100%;
    }
    
    /* スプレッドシートテーブルの調整 */
    #antiqueSpreadsheetTable {
        width: 100%;
        table-layout: fixed;
    }
    
    /* 古物商取引記録ページのテーブルセル */
    #antiqueSpreadsheetTable th,
    #antiqueSpreadsheetTable td {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    /* ダッシュボードのグリッド調整 */
    .container > div[style*="grid-template-columns"] {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
    }
    
    /* フォーム要素の幅調整 */
    input[type="text"],
    input[type="number"],
    input[type="date"],
    select,
    textarea {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* テーブルコンテナの調整 */
    .table-container,
    .master-stores-table-container,
    .mapping-table-container,
    .duplicate-table-container,
    .stores-table-container,
    .master-data-table-container {
        width: 100%;
        max-width: 100%;
    }
    
    /* ボタンのクリックを確実にする */
    button,
    .btn-primary,
    .btn-secondary,
    .btn-danger,
    .action-btn,
    .menu-item {
        pointer-events: auto;
        cursor: pointer;
        position: relative;
        z-index: 10;
    }
}

/* モバイル対応: 768px以下 */
@media screen and (max-width: 768px) {
    /* サイドバーを非表示 */
    .sidebar {
        display: none;
    }

    /* モバイルヘッダーを表示 */
    .mobile-header {
        display: flex;
    }

    /* メインコンテンツのマージンを削除 */
    .main-content {
        margin-left: 0;
        margin-top: 56px;
        min-height: calc(100vh - 56px);
        height: auto;
        max-height: none;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
        position: relative;
    }
    
    .page.active {
        min-height: calc(100vh - 56px);
        height: auto;
        max-height: none;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
        position: relative;
    }
    
    /* コンテナのパディングを調整 */
    .container {
        padding: 16px;
        min-height: calc(100vh - 56px);
        padding-bottom: 40px;
        overflow-x: hidden;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
        position: relative;
    }
    
    /* bodyのスクロールを確実に有効化 */
    body {
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
        height: auto;
        min-height: 100vh;
    }
    
    html {
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
        height: auto;
    }

    /* 予約管理ページのヘッダー調整 */
    .reservation-page-header {
        position: sticky;
        top: 56px;
        padding: 12px 0;
        margin-bottom: 16px;
    }

    .page-header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .page-header-left h1 {
        font-size: 20px;
        margin: 0;
    }

    .current-date-display {
        font-size: 12px;
        padding: 4px 8px;
    }

    /* 予約管理タブを調整 */
    .reservation-tabs {
        flex-wrap: wrap;
        gap: 8px;
    }

    .reservation-tab {
        flex: 1;
        min-width: 120px;
        padding: 10px 12px;
        font-size: 13px;
    }

    /* フォーム要素を調整 */
    .form-group {
        margin-bottom: 16px;
    }

    .form-label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .form-input,
    .form-select {
        font-size: 14px;
        padding: 10px 12px;
    }

    /* ボタンを調整 */
    .btn-primary,
    .btn-secondary,
    .btn-danger {
        padding: 10px 16px;
        font-size: 14px;
    }

    /* デスクトップ用テーブルを非表示 */
    .stores-table-desktop {
        display: none;
    }

    /* モバイル用カード形式を表示 */
    .stores-cards-mobile {
        display: block;
    }

    /* テーブルを横スクロール対応（マスター店舗テーブル用） */
    .master-stores-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .master-stores-table {
        min-width: 500px;
        font-size: 13px;
    }

    .master-stores-table th,
    .master-stores-table td {
        padding: 8px 12px;
    }

    /* 日付入力フィールドを調整 */
    .stores-table input[type="date"] {
        font-size: 13px;
        padding: 6px 8px;
        width: 100%;
        min-width: 140px;
    }

    /* 予約管理グループ選択を調整 */
    .reservation-group-selector {
        margin-bottom: 16px;
    }

    .reservation-group-selector .form-group > div {
        flex-direction: column;
        gap: 8px;
    }

    .reservation-group-selector .form-select {
        width: 100%;
    }

    .btn-sm {
        width: 100%;
        justify-content: center;
    }

    /* セクションヘッダーを調整 */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .section-header h3 {
        font-size: 16px;
    }

    /* 店舗情報追加フォームを調整 */
    .store-master-section {
        padding: 16px;
    }

    .store-master-section h3 {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .section-description {
        font-size: 13px;
        margin-bottom: 16px;
    }

    .store-form-section {
        padding: 16px;
        margin-bottom: 20px;
    }

    .store-form-section .form-row {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .store-form-section .form-group {
        width: 100%;
        margin-bottom: 0;
    }

    .store-form-section .form-group:last-child {
        margin-top: 4px;
    }

    .store-form-section .form-label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .store-form-section .form-input {
        width: 100%;
        font-size: 14px;
        padding: 10px 12px;
    }

    .store-form-section #addMasterStoreBtn {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
        font-size: 14px;
    }

    /* モーダルを調整 */
    .modal {
        width: 95%;
        max-width: 95%;
        margin: 20px auto;
        max-height: 90vh;
    }

    .modal-header h2 {
        font-size: 18px;
    }

    /* ステータスメッセージを調整 */
    .status-message {
        font-size: 13px;
        padding: 10px 12px;
    }

    /* サマリーを調整 */
    .reservation-summary {
        padding: 16px;
        margin-bottom: 16px;
    }

    .summary-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .summary-item {
        padding: 10px;
    }

    .summary-item-wide {
        grid-column: span 2;
    }

    .summary-value {
        font-size: 20px;
    }

    .summary-label {
        font-size: 12px;
    }

    /* 店舗カードの調整 */
    .store-card {
        padding: 14px;
        margin-bottom: 12px;
    }

    .store-card-name {
        font-size: 15px;
    }

    .store-card-dates {
        gap: 6px;
    }

    .store-card-dates input[type="date"] {
        min-width: 130px;
        font-size: 13px;
        padding: 9px 11px;
    }

    .store-card-status-options {
        gap: 6px;
    }

    .store-card-status-option {
        min-width: 90px;
        padding: 9px 14px;
        font-size: 13px;
    }

    /* 日付は横並びのまま */
    .store-card-dates {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
    }

    .store-card-dates input[type="date"] {
        flex: 1;
        min-width: 120px;
        font-size: 13px;
        padding: 8px 10px;
    }

    .date-separator {
        display: inline;
        font-size: 12px;
    }

    /* ステータスオプションも横並びのまま */
    .store-card-status-options {
        flex-direction: row;
        gap: 6px;
    }

    .store-card-status-option {
        flex: 1;
        min-width: 80px;
        padding: 8px 12px;
        font-size: 13px;
    }

    .store-card-status-option input[type="radio"] {
        width: 16px;
        height: 16px;
    }
}

/* MacBook Retinaディスプレイ対応 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Retinaディスプレイ用のスタイル */
    .app-container {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    /* テキストのレンダリングを最適化 */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-rendering: optimizeLegibility;
    }
    
    /* ボタンとリンクのタップハイライトを最適化 */
    button,
    a {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
}

/* モバイル対応: 480px以下（小さいスマホ） */
@media screen and (max-width: 480px) {
    .container {
        padding: 12px;
    }

    .page-header-left h1 {
        font-size: 18px;
    }

    .reservation-tab {
        font-size: 12px;
        padding: 8px 10px;
    }

    .master-stores-table {
        min-width: 400px;
        font-size: 12px;
    }

    .master-stores-table th,
    .master-stores-table td {
        padding: 6px 8px;
    }

    .btn-primary,
    .btn-secondary,
    .btn-danger {
        padding: 8px 12px;
        font-size: 13px;
    }

    .summary-content {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .summary-item-wide {
        grid-column: span 1;
    }

    .summary-value {
        font-size: 18px;
    }

    .store-card {
        padding: 12px;
    }

    .store-card-name {
        font-size: 14px;
    }

    .store-card-dates {
        gap: 6px;
    }

    .store-card-dates input[type="date"] {
        min-width: 100px;
        font-size: 12px;
        padding: 7px 8px;
    }

    .date-separator {
        font-size: 11px;
    }

    .store-card-status-options {
        gap: 4px;
    }

    .store-card-status-option {
        min-width: 70px;
        padding: 7px 10px;
        font-size: 12px;
    }

    .store-card-label {
        font-size: 11px;
    }

    .store-card-url {
        font-size: 12px;
        padding: 6px 10px;
    }

    .store-card-checkbox-label {
        font-size: 13px;
        padding: 6px 10px;
    }

    .store-card-status-none {
        font-size: 12px;
        padding: 6px 10px;
    }

    /* 店舗情報追加フォームをさらに調整 */
    .store-master-section {
        padding: 12px;
    }

    .store-master-section h3 {
        font-size: 15px;
    }

    .section-description {
        font-size: 12px;
        margin-bottom: 12px;
    }

    .store-form-section {
        padding: 12px;
        margin-bottom: 16px;
    }

    .store-form-section .form-row {
        gap: 10px;
    }

    .store-form-section .form-label {
        font-size: 12px;
        margin-bottom: 5px;
    }

    .store-form-section .form-input {
        font-size: 13px;
        padding: 9px 11px;
    }

    .store-form-section #addMasterStoreBtn {
        padding: 10px 14px;
        font-size: 13px;
    }

    .master-stores-list-section {
        margin-top: 16px;
    }

    .master-stores-table th,
    .master-stores-table td {
        padding: 8px 10px;
        font-size: 12px;
    }

    .table-actions {
        gap: 6px;
    }

    .table-actions button {
        padding: 5px 10px;
        font-size: 12px;
    }
}

