/* ── 콘솔 코어 — 변수, 리셋, 공통 컴포넌트 ── */

:root {
    --sf-primary: #667eea;
    --sf-primary-dark: #5a6fd6;
    --sf-accent: #764ba2;
    --sf-primary-light: #eef2ff;
    --sf-primary-border: #c7d2fe;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #fafbff;
    min-height: 100vh;
}

/* Buttons */
.btn {
    display: block; width: 100%; padding: 15px; border: none; border-radius: 10px;
    font-size: 16px; font-weight: bold; cursor: pointer; margin-bottom: 10px;
    text-decoration: none; text-align: center;
}
.btn-primary { background: linear-gradient(135deg, var(--sf-primary) 0%, var(--sf-accent) 100%); color: white; }
.btn-secondary { background: #f0f0f0; color: #333; }
.btn-small { padding: 6px 14px; font-size: 13px; display: inline-block; width: auto; margin: 2px; border-radius: 6px; }
.btn:hover { opacity: 0.9; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.btn-source { font-size: 11px !important; padding: 5px 10px !important; opacity: 0.7; }
.btn-source:hover { opacity: 1; }

/* Spinner */
.spinner {
    display: inline-block; width: 20px; height: 20px;
    border: 3px solid rgba(102,126,234,0.2); border-top: 3px solid var(--sf-primary);
    border-radius: 50%; animation: spin 1s linear infinite; margin-right: 10px;
    vertical-align: middle;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Status messages */
.status { text-align: center; padding: 15px; border-radius: 10px; margin-top: 20px; display: none; }
.status.loading { display: block; background: var(--sf-primary-light); color: var(--sf-primary-dark); }
.status.success { display: block; background: #d4edda; color: #155724; }
.status.error { display: block; background: #f8d7da; color: #721c24; }

/* Status badge */
.status-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px; border-radius: 12px;
    font-size: 11px; font-weight: 500;
}
.status-badge .badge-spinner {
    display: inline-block; width: 10px; height: 10px;
    border: 1.5px solid currentColor; border-top-color: transparent;
    border-radius: 50%; animation: spin 0.8s linear infinite;
}
.status-badge.extracting { background: #fff3cd; color: #856404; }
.status-badge.parsing { background: #cce5ff; color: #004085; }
.status-badge.failed { background: #f8d7da; color: #721c24; }

/* Stats bar */
.stats-bar {
    display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 24px;
}
.stat-pill {
    font-size: 12px; color: #64748b; background: #f1f5f9;
    padding: 5px 14px; border-radius: 20px; font-weight: 500;
    letter-spacing: -0.01em;
}
.stat-pill strong { color: #334155; font-weight: 700; }

/* List header */
.list-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.list-header-left { display: flex; align-items: center; gap: 10px; }
.count-badge {
    font-size: 12px; font-weight: 700; color: var(--sf-primary);
    background: var(--sf-primary-light); padding: 2px 10px; border-radius: 12px;
    min-width: 24px; text-align: center;
}
.refresh-btn {
    background: none; border: 1px solid #e2e8f0; cursor: pointer;
    padding: 6px 8px; border-radius: 6px; display: flex; align-items: center;
    color: #94a3b8; transition: all 0.2s;
}
.refresh-btn:hover { background: #f8fafc; border-color: #cbd5e1; color: #64748b; }
.refresh-btn svg { width: 16px; height: 16px; }

/* Editable cell */
.editable-cell { position: relative; border-bottom: 1px dashed transparent; transition: all 0.15s; }
.editable-cell:hover {
    background: #eef2ff !important;
    border-bottom-color: #667eea;
}
.editable-cell .edit-icon {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    width: 14px; height: 14px; opacity: 0; transition: opacity 0.15s;
    color: #667eea; pointer-events: none;
}
.editable-cell:hover .edit-icon { opacity: 0.6; }
@keyframes cellSaved {
    0%, 100% { background: transparent; }
    50% { background: #d1fae5; }
}

/* Footer */
.footer-grid {
    display: flex; justify-content: space-between; align-items: flex-start;
    flex-wrap: wrap; gap: 32px;
}
.footer-links { display: flex; gap: 32px; font-size: 14px; color: #6b7280; }

/* Test banner */
.test-banner {
    background: #fff3cd; color: #856404; text-align: center;
    padding: 8px; font-size: 12px; font-weight: 600;
}
