* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", sans-serif; background: #f4f7fb; color: #0f172a; }
a { color: inherit; text-decoration: none; }
.shell { display: flex; min-height: 100vh; }
.side {
    width: 268px;
    background: #0f172a;
    color: #e2e8f0;
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    flex-shrink: 0;
}
.brand-row { display: flex; gap: 12px; align-items: center; padding: 4px 8px 18px; }
.logo {
    width: 40px; height: 40px; border-radius: 12px;
    background: #4f46e5; color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 700;
}
.brand { font-size: 16px; font-weight: 700; }
.brand-sub { color: #94a3b8; font-size: 12px; margin-top: 2px; }
.nav-label {
    margin: 16px 8px 8px;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 700;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 12px;
    color: #cbd5e1;
    margin-bottom: 4px;
}
.nav-link:hover { background: #1e293b; color: #fff; }
.nav-link.active { background: #4f46e5; color: #fff; }
.mark { width: 8px; height: 8px; border-radius: 99px; background: currentColor; opacity: 0.8; }
.nav-empty {
    margin: 0 8px;
    padding: 12px;
    border: 1px dashed #334155;
    border-radius: 12px;
    color: #94a3b8;
    font-size: 13px;
}
.side-foot { margin-top: auto; background: #1e293b; border-radius: 14px; padding: 14px; }
.side-foot span { color: #94a3b8; font-size: 12px; }
.side-foot strong { display: block; margin-top: 4px; }
.main { flex: 1; padding: 28px 32px 48px; min-width: 0; }
.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; }
.top h1 { margin: 0; font-size: 28px; letter-spacing: -0.03em; }
.top p { margin: 6px 0 0; color: #64748b; }
.alert { border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; }
.ok { background: #ecfdf5; color: #065f46; }
.bad { background: #fef2f2; color: #991b1b; }
.grid-2 { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 16px; }
.card { background: #fff; border: 1px solid #e2e8f0; border-radius: 18px; padding: 20px; box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04); margin-bottom: 16px; }
.card h2 { margin: 0 0 14px; font-size: 16px; }
.fields { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 12px; }
.submit-line { display: flex; gap: 12px; align-items: flex-end; margin-top: 14px; }
.submit-line .file-box { flex: 1; }
label { display: block; font-size: 12px; font-weight: 650; color: #475569; margin-bottom: 6px; }
input[type=text], input[type=password], select { width: 100%; border: 1px solid #dbe3ee; background: #f8fafc; border-radius: 10px; padding: 10px 12px; font: inherit; }
input:focus, select:focus { outline: 2px solid #c7d2fe; border-color: #6366f1; background: #fff; }
.row-gap { margin-top: 12px; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn { border: 0; border-radius: 10px; padding: 10px 14px; font: inherit; font-weight: 650; cursor: pointer; }
.btn-primary { background: #4f46e5; color: #fff; }
.btn-dark { background: #0f172a; color: #fff; }
.btn-soft { background: #eef2ff; color: #3730a3; }
.btn-ghost { background: #f1f5f9; color: #334155; }
.hint { color: #64748b; font-size: 12px; margin-top: 8px; }
.upload-box { border: 1.5px dashed #cbd5e1; border-radius: 14px; padding: 16px; background: #f8fafc; }
.pill { display: inline-flex; align-items: center; gap: 8px; background: #eef2ff; color: #3730a3; border-radius: 999px; padding: 8px 12px; font-weight: 700; font-size: 13px; }
.map-table { margin-top: 14px; border: 1px solid #e2e8f0; border-radius: 14px; overflow: hidden; background: #fff; }
.map-head, .map-row { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: center; }
.map-head { margin: 0; padding: 12px 16px; background: #f8fafc; border-bottom: 1px solid #e2e8f0; font-size: 12px; color: #64748b; font-weight: 700; }
.map-scroll { max-height: 540px; overflow: auto; }
.map-row { margin: 0; padding: 10px 16px; border-bottom: 1px solid #eef2f7; min-height: 58px; }
.map-row:last-child { border-bottom: 0; }
.map-row:nth-child(even) { background: #f8fafc; }
.sql-cell { display: flex; align-items: center; gap: 8px; min-height: 40px; }
.sql-name { font-weight: 700; color: #0f172a; font-size: 14px; }
.need { font-size: 11px; font-weight: 700; color: #9a3412; background: #ffedd5; border-radius: 999px; padding: 3px 8px; }
.map-row select { background: #fff; }
.split { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
.split .card { margin-bottom: 0; }
.format-link { display: block; padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 12px; margin-bottom: 8px; background: #f8fafc; }
.format-link strong { display: block; font-size: 14px; }
.format-link span { display: block; margin-top: 4px; color: #64748b; font-size: 12px; }
.format-link:hover { border-color: #c7d2fe; background: #fff; }
.format-link.active { border-color: #4f46e5; background: #eef2ff; }
.excel-val { font-weight: 700; color: #0f172a; }
.excel-empty { font-weight: 650; color: #94a3b8; }
.auto-val { font-weight: 700; color: #3730a3; }
.preview { overflow: auto; max-height: 320px; border: 1px solid #e2e8f0; border-radius: 12px; }
.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
.grid th, .grid td { padding: 8px 10px; border-bottom: 1px solid #e2e8f0; text-align: left; white-space: nowrap; }
.preview .grid td:last-child { white-space: normal; }
.grid th { background: #f8fafc; color: #475569; }
.modal-back { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.55); display: flex; align-items: center; justify-content: center; z-index: 20; padding: 20px; }
.modal-card { width: 460px; max-width: 100%; background: #fff; border-radius: 18px; padding: 22px; }
.modal-card h3 { margin: 0 0 8px; }
.xfer { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.55); display: flex; align-items: center; justify-content: center; z-index: 30; padding: 20px; }
.xfer[hidden] { display: none; }
.xfer-card { width: 440px; max-width: 100%; background: #fff; border-radius: 18px; padding: 22px; }
.xfer-card h3 { margin: 0 0 14px; }
.xfer-track { height: 18px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.xfer-bar { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #4f46e5, #818cf8); transition: width .35s ease; position: relative; overflow: hidden; }
.xfer-bar::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent); transform: translateX(-100%); animation: xferShine 1.1s linear infinite; }
.xfer-bar.wait { width: 35%; animation: xferSlide 1.15s ease-in-out infinite; }
.xfer-pct { margin-top: 12px; font-size: 28px; font-weight: 750; letter-spacing: -0.03em; }
.xfer-text { margin-top: 4px; color: #64748b; font-size: 14px; }
@keyframes xferShine { to { transform: translateX(100%); } }
@keyframes xferSlide { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }
@media (max-width: 900px) {
    .shell { display: block; }
    .side { width: auto; height: auto; position: static; }
    .grid-2, .fields, .split { grid-template-columns: 1fr; }
    .map-head, .map-row { grid-template-columns: 1fr; }
    .submit-line { display: block; }
}
