:root { color-scheme: dark; }
* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top left, #243b55, #10151f 45%, #080b11);
    color: #eef4ff;
}
a { color: #8ec5ff; text-decoration: none; }
a:hover { text-decoration: underline; }
.shell, .wide-shell { width: min(960px, calc(100% - 32px)); margin: 7vh auto; }
.wide-shell { width: min(1180px, calc(100% - 32px)); margin-top: 32px; }
.card, .login-card {
    background: rgba(11, 18, 32, 0.88);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 24px;
    box-shadow: 0 24px 90px rgba(0,0,0,.36);
    padding: 28px;
    backdrop-filter: blur(10px);
}
.login-card { width: min(440px, 100%); margin: 0 auto; }
h1 { margin: 0 0 8px; letter-spacing: -0.03em; font-size: clamp(28px, 4vw, 42px); }
.muted { color: #a9b7cb; margin: 0 0 20px; }
.tiny { color: #8290a4; font-size: 13px; margin-top: 20px; }
.alert { padding: 12px 14px; border-radius: 12px; background: rgba(220, 38, 38, .14); border: 1px solid rgba(248, 113, 113, .35); color: #fecaca; margin-bottom: 16px; }
label { display: block; margin: 14px 0; color: #cbd5e1; font-size: 14px; }
input[type=text], input[type=password] {
    width: 100%; margin-top: 7px; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(148,163,184,.28);
    background: rgba(15, 23, 42, .9); color: #f8fafc; outline: none;
}
input:focus { border-color: #93c5fd; box-shadow: 0 0 0 4px rgba(59,130,246,.18); }
button, .button {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 0; border-radius: 12px; padding: 11px 16px; min-height: 42px;
    background: #dbeafe; color: #0f172a; font-weight: 700; cursor: pointer;
}
button:hover, .button:hover { filter: brightness(.96); text-decoration: none; }
.button.secondary { background: rgba(148, 163, 184, .14); color: #e2e8f0; border: 1px solid rgba(148,163,184,.22); }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.module { display: block; padding: 20px; border-radius: 18px; background: rgba(59, 130, 246, .12); border: 1px solid rgba(147,197,253,.2); min-height: 140px; }
.module:hover { text-decoration: none; background: rgba(59, 130, 246, .18); }
.module.disabled { opacity: .58; background: rgba(148, 163, 184, .08); }
.module-title { display: block; color: #eff6ff; font-size: 18px; font-weight: 800; margin-bottom: 8px; }
.module-text { color: #a9b7cb; line-height: 1.5; }
.folder-tools { display: flex; gap: 16px; align-items: stretch; justify-content: space-between; margin: 20px 0; flex-wrap: wrap; }
.inline-form { display: flex; gap: 8px; align-items: center; flex: 1 1 340px; }
.inline-form input { margin: 0; }
.drop-target { flex: 1 1 360px; min-height: 76px; display: flex; align-items: center; justify-content: center; border: 2px dashed rgba(148,163,184,.45); border-radius: 16px; color: #a9b7cb; cursor: pointer; }
.drop-target input { display: none; }
.drop-target.drag-over { border-color: #93c5fd; color: #dbeafe; background: rgba(147,197,253,.1); }
.no-write .folder-tools { display: none; }
#upload-progress { min-height: 8px; }
.progress-row { margin: 8px 0; padding: 9px 12px; border-radius: 10px; background: rgba(148,163,184,.1); color: #cbd5e1; }
.progress-row.error { background: rgba(220, 38, 38, .14); color: #fecaca; }
table { width: 100%; border-collapse: collapse; overflow: hidden; border-radius: 16px; }
th { text-align: left; color: #bfdbfe; font-size: 13px; background: rgba(30,41,59,.75); cursor: pointer; user-select: none; }
th, td { padding: 12px 10px; border-bottom: 1px solid rgba(148,163,184,.13); vertical-align: middle; }
td { color: #dbeafe; font-size: 14px; }
td.first { min-width: 300px; }
tr:hover td { background: rgba(148,163,184,.06); }
.empty { text-align: center; color: #94a3b8; padding: 44px 0; }
.name { padding-left: 28px; position: relative; color: #e0f2fe; font-weight: 650; }
.name::before { position: absolute; left: 0; top: -1px; }
.name.file::before { content: "📄"; }
.name.folder::before { content: "📁"; }
.download { margin-right: 14px; }
.link { background: none; color: #93c5fd; padding: 0; min-height: auto; border-radius: 0; font-weight: 600; }
.link.danger { color: #fca5a5; }
@media (max-width: 720px) {
    .topbar { flex-direction: column; }
    table { display: block; overflow-x: auto; white-space: nowrap; }
}


/* Migration module */
.migrate-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.pane { border: 1px solid rgba(148,163,184,.18); border-radius: 18px; overflow: hidden; background: rgba(15,23,42,.46); }
.pane-header { padding: 16px; border-bottom: 1px solid rgba(148,163,184,.14); display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.pane-header h2 { margin: 0 0 4px; font-size: 20px; letter-spacing: -.02em; }
.pane-header .muted { margin-bottom: 0; font-size: 13px; }
.pane-body { padding: 0; overflow-x: auto; }
.migrate-table { border-radius: 0; }
.migrate-table th, .migrate-table td { padding: 10px 9px; font-size: 13px; }
.migrate-table td.first { min-width: 220px; }
.pathline { word-break: break-all; }
.badge { display:inline-flex; align-items:center; border-radius:999px; padding:4px 8px; font-size:12px; font-weight:700; background:rgba(148,163,184,.14); color:#cbd5e1; }
.badge.good { background:rgba(34,197,94,.14); color:#bbf7d0; }
.badge.bad { background:rgba(220,38,38,.14); color:#fecaca; }
.migrate-actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin:16px 0; }
.migrate-log { margin-top:16px; max-height:260px; overflow:auto; white-space:pre-wrap; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size:12px; background:rgba(2,6,23,.65); border:1px solid rgba(148,163,184,.18); border-radius:14px; padding:12px; color:#cbd5e1; }
.checkbox-line { display:inline-flex; align-items:center; gap:8px; margin:0; color:#cbd5e1; }
.checkbox-line input { width:auto; margin:0; }
@media (max-width: 940px) { .migrate-layout { grid-template-columns: 1fr; } }
.job-panel { margin: 14px 0 18px; padding: 14px; border: 1px solid rgba(148,163,184,.18); border-radius: 16px; background: rgba(15,23,42,.36); }
.job-panel h2 { margin: 0 0 8px; font-size: 18px; }
.job-row { padding: 7px 0; border-bottom: 1px solid rgba(148,163,184,.10); }
.job-row:last-child { border-bottom: 0; }
.tiny-button { min-height: 28px; padding: 4px 8px; border-radius: 8px; font-size: 12px; margin-left: 8px; }
.migrate-log { max-height: 420px; }
.job-panel-head { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.job-panel-head h2 { margin:0; }
.remote-select, #select-all-remote { width:auto; margin:0; transform:scale(1.05); }
button:disabled, .button:disabled { opacity:.45; cursor:not-allowed; filter:none; }
#selected-count { margin-top:0; }
