:root {
    --bg: #f4f6fb;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --danger-bg: #fee2e2;
    --danger-text: #b91c1c;
    --border: #e5e7eb;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

.container {
    max-width: 560px;
    margin: 0 auto;
    padding: 48px 24px;
}

h1 {
    margin: 0 0 8px;
    font-size: 28px;
}

.subtitle {
    margin: 0 0 24px;
    color: var(--muted);
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

label {
    font-weight: 600;
    font-size: 14px;
}

input[type="file"] {
    padding: 10px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    background: #fafafa;
    cursor: pointer;
    font-size: 14px;
}

input[type="file"]:hover {
    border-color: var(--accent);
}

button {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

button:hover {
    background: var(--accent-hover);
}

.alert {
    background: var(--danger-bg);
    color: var(--danger-text);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 14px;
}

.hint {
    color: var(--muted);
    font-size: 13px;
    margin-top: 16px;
}

.stats {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    color: var(--muted);
    font-size: 13px;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

.stats-table th,
.stats-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.stats-table th {
    color: var(--muted);
    font-weight: 600;
}

.groups {
    margin-top: 16px;
    font-size: 14px;
    color: var(--text);
}

.groups-title {
    font-weight: 600;
    margin-right: 6px;
}

.actions {
    margin-top: 20px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.button {
    display: inline-block;
    padding: 12px 20px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease;
}

.button:hover {
    background: var(--accent-hover);
}

.button-secondary {
    display: inline-block;
    padding: 12px 20px;
    border-radius: 8px;
    background: var(--card);
    color: var(--accent);
    border: 1px solid var(--accent);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease;
}

.button-secondary:hover {
    background: #eef2ff;
}

h2 {
    font-size: 18px;
    margin: 28px 0 12px;
}

.preview-wrap {
    overflow-x: auto;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.preview {
    border-collapse: collapse;
    width: 100%;
    min-width: 100%;
    font-size: 13px;
    white-space: nowrap;
}

.preview th,
.preview td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

.preview th:last-child,
.preview td:last-child {
    border-right: none;
}

.preview thead th {
    background: #eef2ff;
    color: var(--text);
    font-weight: 600;
    position: sticky;
    top: 0;
}

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