* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #0f0f23;
    color: #e0e0e0;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 16px;
}

/* Header */
.header {
    text-align: center;
    padding: 20px 0;
    border-bottom: 1px solid #2a2a4a;
    margin-bottom: 20px;
}
.header h1 { font-size: 1.8em; color: #00d4ff; margin-bottom: 4px; }
.subtitle { color: #8888aa; font-size: 0.9em; }

/* Main Layout */
.main-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 20px;
    align-items: start;
}

/* Cards */
.card {
    background: #1a1a3e;
    border: 1px solid #2a2a5a;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
.card h3 {
    color: #00d4ff;
    font-size: 0.95em;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #2a2a5a;
}
.card h4 { color: #ffaa00; font-size: 0.9em; margin-bottom: 10px; }

/* Upload */
.upload-area {
    border: 2px dashed #3a3a6a;
    border-radius: 8px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #12123a;
}
.upload-area:hover { border-color: #00d4ff; background: #18184a; }
.upload-area p { font-size: 0.9em; color: #aaaacc; }
.upload-area a { color: #00d4ff; text-decoration: none; font-weight: 600; }
.upload-area.highlight { border-color: #00ff88; background: #0a2a1a; }
.upload-area.small { padding: 12px; }
.hint { font-size: 0.78em !important; color: #666688 !important; margin-top: 6px; }

/* File Info */
.file-info {
    margin-top: 8px;
    padding: 6px 10px;
    background: #0d2d1d;
    border-radius: 5px;
    font-size: 0.82em;
    display: flex;
    justify-content: space-between;
    color: #88dd88;
}
.file-info.hidden, .hidden { display: none !important; }

/* Import Options */
.import-options {
    margin-top: 10px;
    padding: 10px;
    background: #12123a;
    border-radius: 6px;
}
.import-options.hidden { display: none; }

/* Buttons */
.btn-group { display: flex; flex-wrap: wrap; gap: 6px; }
.btn-group.inline { display: inline-flex; }
.btn-group.small { margin-top: 8px; }

.btn {
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.82em;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.15); }
.btn:active { transform: translateY(0); }
.btn-primary { background: #0066cc; color: #fff; }
.btn-secondary { background: #663399; color: #fff; }
.btn-accent { background: #cc6600; color: #fff; }
.btn-info { background: #008866; color: #fff; }
.btn-danger { background: #cc3333; color: #fff; }
.btn-small { padding: 5px 10px; font-size: 0.76em; }

/* Column Checkbox Group */
.col-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-height: 100px;
    overflow-y: auto;
    padding: 4px;
    background: #0a0a20;
    border-radius: 4px;
}
.col-checkbox-group label {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.76em;
    color: #aaaacc;
    cursor: pointer;
    padding: 2px 6px;
    background: #12123a;
    border-radius: 3px;
    white-space: nowrap;
}
.col-checkbox-group label:hover {
    background: #1a2a4a;
}
.col-checkbox-group input[type="checkbox"] {
    accent-color: #00d4ff;
}
.col-checkbox-all {
    font-weight: 600;
    color: #00d4ff !important;
    border: 1px solid #0a3a5a !important;
}

/* Form */
.form-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.form-row label { font-size: 0.84em; color: #aaaacc; white-space: nowrap; }
.form-row input, .form-row select {
    background: #12123a;
    border: 1px solid #3a3a6a;
    color: #e0e0e0;
    padding: 6px 10px;
    border-radius: 5px;
    font-size: 0.85em;
    flex: 1;
    min-width: 0;
}
.form-row select { cursor: pointer; }
.form-row input:focus, .form-row select:focus { outline: none; border-color: #00d4ff; }

.col-select {
    background: #12123a;
    border: 1px solid #3a3a6a;
    color: #e0e0e0;
    padding: 6px 10px;
    border-radius: 5px;
    font-size: 0.85em;
}

/* Columns */
.column-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.column-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #0a1a3a;
    border: 1px solid #2a4a7a;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 0.78em;
    color: #88bbff;
}
.column-tag .col-idx { color: #666; }
.column-tag .col-sample { color: #aaccff; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.badge {
    display: inline-block;
    background: #006688;
    color: #fff;
    font-size: 0.7em;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 6px;
    vertical-align: middle;
}

/* Stats */
.stats-section #stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.stat-item {
    display: flex; justify-content: space-between;
    padding: 5px 8px;
    background: #12123a;
    border-radius: 5px;
    font-size: 0.82em;
}
.stat-label { color: #8888aa; }
.stat-value { color: #00d4ff; font-weight: 700; }

/* Table */
.table-section { 
    min-height: 200px; 
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #2a2a5a;
    z-index: 10;
    background: #1a1a3e;
    position: relative;
}
.table-wrapper {
    overflow: auto;
    max-height: 55vh;
    border: 1px solid #2a2a4a;
    border-radius: 6px;
    flex: 1;
    min-height: 0;
}
.table-container {
    display: inline-block;
    min-width: 100%;
}
.table-container table {
    border-collapse: collapse;
    font-size: 0.78em;
    width: 100%;
}
.table-container th {
    background: #0a1a3a;
    color: #00d4ff;
    padding: 6px 10px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #2a4a7a;
    position: sticky;
    top: 0;
    z-index: 2;
    white-space: nowrap;
}
.table-container td {
    padding: 4px 10px;
    border-bottom: 1px solid #1a2a3a;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.table-container tr:hover td { background: #1a2a4a; }
.table-container tr:nth-child(even) td { background: #12122e; }
.table-container tr:nth-child(even):hover td { background: #1a2a4a; }

/* Log */
.log-section { min-height: 120px; }
.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #2a2a5a;
}
.log-content { overflow: auto; max-height: 180px; }
.log-text {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.78em;
    color: #aabbcc;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.5;
}

/* Progress */
.progress-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center; justify-content: center;
    z-index: 9999;
}
.progress-box {
    background: #1a1a3e;
    border: 1px solid #2a2a5a;
    border-radius: 14px;
    padding: 30px;
    text-align: center;
    min-width: 300px;
}
.progress-box h4 { color: #00d4ff; margin-bottom: 16px; }
.progress-bar {
    width: 100%; height: 10px;
    background: #0a0a20;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d4ff, #00ff88);
    border-radius: 5px;
    width: 0%;
    transition: width 0.3s;
}
.progress-box p { color: #8888aa; font-size: 0.85em; }

/* Responsive */
@media (max-width: 1000px) {
    .main-layout { grid-template-columns: 1fr; }
    .table-wrapper { max-height: 40vh; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #0a0a20; }
::-webkit-scrollbar-thumb { background: #3a3a6a; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #5a5a8a; }