:root {
    --bg: #0f172a;
    --panel: #ffffff;
    --ink: #1e293b;
    --muted: #64748b;
    --line: #e2e8f0;
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --danger: #dc2626;
    --ok-bg: #dcfce7;
    --ok-ink: #166534;
    --err-bg: #fee2e2;
    --err-ink: #991b1b;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: #f1f5f9;
    color: var(--ink);
}

.topbar {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--bg); color: #fff; padding: 12px 24px;
}
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.25rem; letter-spacing: .5px; }
.brand span { color: #60a5fa; font-weight: 400; }
.topbar nav { display: flex; align-items: center; gap: 14px; }
.topbar .user { color: #cbd5e1; font-size: .9rem; }

.container { max-width: 1100px; margin: 24px auto; padding: 0 20px; }
.footer { text-align: center; color: var(--muted); padding: 24px; font-size: .85rem; }

.grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 800px) { .grid { grid-template-columns: 1fr; } }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.panel h2 { margin-top: 0; font-size: 1.05rem; }

.crumbs { margin-bottom: 16px; color: var(--muted); }
.crumbs a { color: var(--brand); text-decoration: none; }
.crumbs span { margin: 0 4px; color: var(--muted); }

table.files { width: 100%; border-collapse: collapse; }
table.files th, table.files td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: .9rem; vertical-align: middle; }
table.files th { color: var(--muted); font-weight: 600; }
table.files a { color: var(--brand); text-decoration: none; }
.thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.muted { color: var(--muted); }
.actions { white-space: nowrap; }

label { display: block; margin: 12px 0 4px; font-size: .85rem; color: var(--muted); font-weight: 600; }
input[type=text], input[type=password], input[type=file], select {
    width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: .95rem; background:#fff;
}

.btn { display: inline-block; border: none; border-radius: 8px; padding: 9px 16px; font-size: .9rem; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--brand); color: #fff; margin-top: 16px; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.ghost { background: transparent; color: #fff; border: 1px solid #475569; }
.btn.tiny { padding: 4px 8px; font-size: .78rem; background: #eef2ff; color: var(--brand); }
.btn.danger { background: #fef2f2; color: var(--danger); }

.hint { color: var(--muted); font-size: .8rem; margin-top: 14px; }

.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: .9rem; }
.alert.ok { background: var(--ok-bg); color: var(--ok-ink); }
.alert.err { background: var(--err-bg); color: var(--err-ink); }

.login-card { max-width: 360px; margin: 60px auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 28px; }
.login-card h1 { margin-top: 0; font-size: 1.3rem; }
.login-card .btn.primary { width: 100%; }
