:root {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --text: #1d2330;
    --muted: #6b7385;
    --border: #dfe3ea;
    --accent: #3f5bd8;
    --accent-hover: #2f48b8;
    --danger: #c23b3b;
    --ok: #2e8a4f;
    --radius: 8px;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; line-height: 1.5; background: var(--bg); }
a { color: var(--accent); }
h1 { font-size: 1.7rem; margin: 0 0 .5rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }

.topbar {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
    padding: .75rem 1.5rem; background: var(--surface); border-bottom: 1px solid var(--border);
}
.topbar nav { display: flex; align-items: center; gap: 1rem; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; }

main { max-width: 960px; margin: 2rem auto; padding: 0 1.5rem; }
main.narrow { max-width: 420px; }

.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.25rem; margin: 1.25rem 0;
}
.muted { color: var(--muted); }
.error { color: var(--danger); }
.notice { color: var(--ok); }
.right { text-align: right; }
.crumbs { margin: 0 0 1rem; }

input[type=text], input[type=password] {
    font: inherit; padding: .5rem .65rem; border: 1px solid var(--border); border-radius: 6px;
    width: 100%; background: #fff;
}
button, .button {
    font: inherit; display: inline-block; padding: .5rem 1rem; border-radius: 6px; cursor: pointer;
    border: 1px solid var(--accent); background: var(--accent); color: #fff; text-decoration: none;
}
button:hover, .button:hover { background: var(--accent-hover); }
button.secondary, .button.secondary { background: #fff; color: var(--accent); }
button.secondary:hover, .button.secondary:hover { background: #eef1fc; }
button.link {
    background: none; border: none; padding: 0; color: var(--accent); text-decoration: underline;
}
button.link.danger { color: var(--danger); }
.button.big { font-size: 1.05rem; padding: .7rem 1.4rem; font-weight: 600; }

form.inline { display: inline; }
form.stack { display: flex; flex-direction: column; gap: 1rem; }
form.stack label { display: flex; flex-direction: column; gap: .3rem; font-weight: 500; }
form.stack small, form.stack .error { font-weight: 400; font-size: .875rem; }
form.row { display: flex; gap: .5rem; }
form.row input { flex: 1; }
.actions { display: flex; gap: .75rem; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: .75rem; align-items: baseline; padding: .45rem 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: none; }

.project-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }

table.files { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.files th, table.files td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid var(--border); }
table.files th { color: var(--muted); font-weight: 500; }
table.files td:first-child { word-break: break-all; }

.dropzone {
    margin-top: 1rem; padding: 1.5rem; text-align: center; border: 2px dashed var(--border);
    border-radius: var(--radius); background: #fafbfc; transition: border-color .15s, background .15s;
}
.dropzone p { margin: .25rem 0; }
.dropzone.dragover { border-color: var(--accent); background: #eef1fc; }

.upload-results { list-style: none; margin: .75rem 0 0; padding: 0; font-size: .9rem; }
.upload-results li { display: grid; grid-template-columns: 1fr 140px auto; gap: .75rem; align-items: center; padding: .2rem 0; }
.upload-results .path { word-break: break-all; }
.upload-results progress { width: 100%; }
.upload-results .ok { color: var(--ok); }
.upload-results .fail { color: var(--danger); }

@media (max-width: 600px) {
    .topbar { padding: .75rem 1rem; }
    main { padding: 0 1rem; }
    .upload-results li { grid-template-columns: 1fr; gap: .1rem; }
}
