:root {
    --bg: #f7f7f8;
    --surface: #ffffff;
    --border: #e0e0e3;
    --text: #1c1c1f;
    --text-muted: #6b6b70;
    --accent: #2d5bff;
    --danger: #d64545;
    --success: #1f9254;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
}

body.centered {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

main {
    max-width: 1600px;
    margin: 0 auto;
    padding: 24px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.topbar h1 { margin: 0; font-size: 1.2rem; }
.topbar nav a { margin-left: 16px; color: var(--text-muted); text-decoration: none; }
.topbar nav a.button { color: white; }

.login-box {
    background: var(--surface);
    padding: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    width: 320px;
}
.login-box h1 { margin-top: 0; text-align: center; }

label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 0.9rem; }
input, textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.field { margin-bottom: 16px; }
.hint { color: var(--text-muted); font-size: 0.85rem; margin-top: -8px; }

button, .button {
    display: inline-block;
    background: var(--accent);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
}
button:disabled { background: #b0b0b8; cursor: not-allowed; }
.button-danger { background: var(--danger); }

.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; }
.alert-error { background: #fde8e8; color: var(--danger); }
.alert-success { background: #e6f6ed; color: var(--success); }

table.transfers { width: 100%; border-collapse: collapse; background: var(--surface); }
table.transfers th, table.transfers td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 0.9rem;
    vertical-align: top;
}
.filename { font-size: 0.85rem; }

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    background: #e5e5ea;
    color: var(--text-muted);
}
.badge-pending { background: #fff3d6; color: #916300; }
.badge-downloaded { background: #e6f6ed; color: var(--success); }
.badge-expired { background: #f0e5e5; color: var(--danger); }
.badge-deleted { background: #e5e5ea; color: var(--text-muted); }
.badge-draft { background: #e5e9fb; color: var(--accent); }

.actions form { display: inline; margin-left: 6px; }
.actions a { margin-right: 6px; }

.empty-state { color: var(--text-muted); padding: 32px; text-align: center; }
.pagination { margin-top: 16px; display: flex; justify-content: space-between; }

.file-list { list-style: none; padding: 0; }
.file-row {
    display: grid;
    grid-template-columns: 1fr 2fr auto;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.progress-wrap {
    background: var(--border);
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}
.progress-bar {
    background: var(--accent);
    height: 100%;
    width: 0%;
    transition: width 0.2s ease;
}
.file-status { font-size: 0.85rem; color: var(--text-muted); }

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #16161a;
        --surface: #1e1e23;
        --border: #2c2c33;
        --text: #f0f0f2;
        --text-muted: #9a9aa2;
    }
    .badge { background: #2c2c33; }
}
