* { box-sizing: border-box; }

body {
    font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 2em 1em;
    background: #fafafa;
    color: #222;
    line-height: 1.45;
}

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

h1 {
    text-align: center;
    margin: 0 0 1em;
    font-weight: 600;
}

.instructions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5em;
    margin-bottom: 1.5em;
}
.col {
    background: #fff;
    padding: 1em 1.5em;
    border-radius: 6px;
    border: 1px solid #ddd;
}
.col h2 {
    margin-top: 0;
    font-size: 1.1em;
}
.col ol {
    padding-left: 1.2em;
    line-height: 1.55;
}
.col code {
    background: #f0f0f0;
    padding: 0.1em 0.3em;
    border-radius: 3px;
    font-size: 0.9em;
}
@media (max-width: 700px) {
    .instructions { grid-template-columns: 1fr; }
}

#uploader, .card {
    background: #fff;
    padding: 1.5em;
    border-radius: 6px;
    border: 1px solid #ddd;
    text-align: center;
}
.card { text-align: left; }
.card label { display: block; margin-bottom: 0.8em; }
.card input[type=text], .card input[type=password] {
    width: 100%;
    padding: 0.5em;
    font-size: 1em;
    border: 1px solid #bbb;
    border-radius: 4px;
}

#dropzone {
    border: 2px dashed #aaa;
    border-radius: 6px;
    padding: 2em 1em;
    margin-bottom: 1em;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
#dropzone.over    { background: #eef6ff; border-color: #4a90e2; }
#dropzone.has-file { background: #f0f7ed; border-color: #76a55a; }
.dz-prompt { margin: 0; color: #555; }
.dz-prompt small { display: block; margin-top: 0.5em; color: #888; }

button, .btn {
    padding: 0.55em 1.4em;
    font-size: 1em;
    border: 0;
    border-radius: 4px;
    background: #4a90e2;
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}
button:disabled { background: #999; cursor: not-allowed; }
button.danger { background: #c0392b; }
form.inline { display: inline; }

#progress { margin-top: 1em; }
#bar { background: #ddd; height: 8px; border-radius: 4px; overflow: hidden; }
#fill { background: #4a90e2; height: 100%; width: 0; transition: width 0.2s; }
#pct { display: block; margin-top: 0.3em; color: #666; font-size: 0.9em; }

#result, #error {
    background: #fff;
    padding: 1.5em;
    border-radius: 6px;
    border: 1px solid #ddd;
    text-align: center;
    margin-top: 1em;
}
#result code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; word-break: break-all; }
#error .err { color: #c33; }

/* Admin */
body.admin { padding-top: 1em; }
body.admin header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1em;
    margin-bottom: 1.5em;
}
body.admin header h1 { text-align: left; margin: 0; font-size: 1.4em; }
body.admin nav { display: flex; gap: 0.8em; align-items: center; }
body.admin nav a {
    color: #4a90e2;
    text-decoration: none;
    padding: 0.3em 0.6em;
}
body.admin nav a:hover { text-decoration: underline; }

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1em;
    margin-bottom: 1.5em;
}
.stat {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 1em;
    display: flex;
    flex-direction: column;
}
.stat .lbl { color: #666; font-size: 0.85em; }
.stat .val { font-size: 1.4em; font-weight: 600; }

table.uploads, table.blocked {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    font-size: 0.92em;
}
table.uploads th, table.uploads td,
table.blocked th, table.blocked td {
    padding: 0.55em 0.7em;
    text-align: left;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}
table.uploads th, table.blocked th {
    background: #f2f4f7;
    font-weight: 600;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #555;
}
table.uploads tbody tr:hover, table.blocked tbody tr:hover { background: #fafbfc; }
table.uploads code.hash {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.85em;
}
td.actions { white-space: nowrap; }
td.actions form, td.actions a { margin-right: 0.3em; }
td.actions button, td.actions .btn { padding: 0.3em 0.7em; font-size: 0.85em; }

.pager {
    display: flex;
    gap: 1em;
    justify-content: center;
    margin-top: 1.5em;
    align-items: center;
}
.pager a {
    color: #4a90e2;
    text-decoration: none;
    padding: 0.3em 0.8em;
    border: 1px solid #4a90e2;
    border-radius: 3px;
}
.pager span { color: #666; }

p.empty { text-align: center; color: #888; padding: 2em; }
p.err { color: #c33; background: #fde7e7; padding: 0.6em 1em; border-radius: 4px; }
