* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f8fafc;
    color: #0f172a;
    line-height: 1.5;
}
.topbar {
    background: linear-gradient(90deg, #1a56db 0%, #6366f1 100%);
    color: #fff;
    box-shadow: 0 2px 6px rgba(15,23,42,.08);
}
.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand-title { font-size: 20px; font-weight: 700; letter-spacing: 0.2px; }
.brand-sub   { font-size: 12px; opacity: 0.85; margin-top: 2px; }
.topbar nav a {
    color: #fff;
    text-decoration: none;
    margin-left: 18px;
    opacity: 0.9;
    font-size: 14px;
}
.topbar nav a:hover { opacity: 1; text-decoration: underline; }

.container {
    max-width: 1100px;
    margin: 24px auto;
    padding: 0 24px;
}

.card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 24px 28px;
    margin-bottom: 20px;
    box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.card.narrow { max-width: 420px; margin: 60px auto; }
.card h1 { margin-top: 0; color: #1a56db; font-size: 22px; }
.card h2 { color: #1a56db; font-size: 16px; margin-top: 24px; }
.card h3 { color: #334155; font-size: 14px; margin-top: 18px; margin-bottom: 6px; }
.muted { color: #64748b; font-size: 14px; }
.small { font-size: 12px; }
.req   { color: #dc2626; }
.mono  { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 14px; }

.stack { display: flex; flex-direction: column; gap: 14px; }
.stack label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 500; }
.stack label.row { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.stack input[type=text], .stack input[type=password], .stack input[type=file] {
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
}
.stack input:focus { outline: 2px solid #6366f1; outline-offset: 1px; border-color: #6366f1; }
.stack small { font-weight: 400; }

.btn {
    display: inline-block;
    padding: 10px 18px;
    border: 1px solid #1a56db;
    background: #fff;
    color: #1a56db;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
}
.btn:hover { background: #eff3ff; }
.btn-primary {
    background: #1a56db;
    color: #fff;
}
.btn-primary:hover { background: #1e40af; }
.btn-primary:disabled { background: #94a3b8; border-color: #94a3b8; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }

pre.code {
    background: #0f172a;
    color: #e2e8f0;
    padding: 14px 16px;
    border-radius: 6px;
    font-size: 12px;
    overflow-x: auto;
    font-family: ui-monospace, Menlo, Consolas, monospace;
}

.progress-bar {
    background: #e2e8f0;
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 10px;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1a56db, #6366f1);
    width: 0;
    transition: width 0.3s ease;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 10px;
}
.cell {
    background: #f0f4ff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px 12px;
}
.cell-k { font-size: 12px; color: #64748b; }
.cell-v { font-size: 18px; font-weight: 700; color: #1a56db; margin-top: 2px; }

.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 10px 14px;
    margin-top: 10px;
    font-size: 14px;
}
.flash {
    background: #eff6ff;
    color: #1e3a8a;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 16px;
}
.hidden { display: none; }

.footbar {
    text-align: center;
    color: #94a3b8;
    font-size: 12px;
    padding: 30px 20px 40px;
}
