:root {
    --yellow: #F7CF37;
    --red: #EE4944;
    --charcoal: #333333;
    --gray: #6D6E71;
    --light: #F8FAFC;
    --line: #E5E7EB;
    --text: #1F2937;
    --muted: #64748B;
    --success: #16A34A;
    --danger: #DC2626;
    --blue: #2563EB;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #F3F4F6;
    color: var(--text);
}
a { color: inherit; text-decoration: none; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 276px;
    background: #1F2937;
    color: white;
    padding: 22px;
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
}
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 30px; }
.brand-mark {
    width: 44px; height: 44px; border-radius: 14px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--yellow), #F27E20);
    color: #1F2937; font-weight: 900;
}
.brand span, .muted { color: #CBD5E1; }
.nav { display: grid; gap: 8px; }
.nav a {
    padding: 12px 14px;
    border-radius: 12px;
    color: #E5E7EB;
    transition: .15s ease;
}
.nav a:hover { background: rgba(255,255,255,.08); color: white; }
.sidebar-footer { margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12); }
.sidebar-footer strong { display: block; margin: 4px 0 10px; }
.logout { color: var(--yellow); font-weight: 700; }
.main { margin-left: 276px; width: calc(100% - 276px); padding: 28px; }
.topbar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 18px;
}
h1 { margin: 0; font-size: 30px; letter-spacing: -0.03em; }
p { color: var(--muted); margin: 6px 0 0; }
.card {
    background: white;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(15,23,42,.04);
    padding: 20px;
}
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-card span { display: block; color: var(--muted); font-size: 13px; }
.stat-card strong { display: block; font-size: 32px; margin-top: 6px; color: var(--charcoal); }
.stat-card small { color: var(--muted); }
.form-row { display: grid; gap: 8px; margin-bottom: 16px; }
label { font-weight: 700; color: #334155; }
input[type="text"], input[type="email"], input[type="password"], input[type="file"], select, textarea {
    width: 100%;
    border: 1px solid #CBD5E1;
    border-radius: 12px;
    padding: 12px 14px;
    font: inherit;
    background: white;
}
textarea { min-height: 240px; resize: vertical; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 12px;
    padding: 12px 16px;
    font-weight: 800;
    cursor: pointer;
    background: var(--charcoal);
    color: white;
}
.btn.primary { background: linear-gradient(135deg, var(--red), #F97316); }
.btn.secondary { background: #F1F5F9; color: #334155; }
.btn.success { background: var(--success); }
.btn.danger { background: var(--danger); }
.btn.small { padding: 8px 12px; font-size: 13px; }
.table-wrap { overflow: auto; border-radius: 16px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; background: white; min-width: 820px; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #FFF4C2; color: #374151; font-size: 13px; }
.badge { display: inline-flex; border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 800; background: #E2E8F0; color: #334155; }
.badge.completed { background: #DCFCE7; color: #166534; }
.badge.failed { background: #FEE2E2; color: #991B1B; }
.badge.processing, .badge.uploaded { background: #DBEAFE; color: #1E40AF; }
.alert { padding: 14px 16px; border-radius: 14px; margin-bottom: 16px; font-weight: 700; }
.alert.success { background: #DCFCE7; color: #166534; }
.alert.error { background: #FEE2E2; color: #991B1B; }
.progress {
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: #E2E8F0;
}
.progress > div { height: 100%; background: linear-gradient(90deg, var(--yellow), #F97316); width: 0%; transition: width .2s; }
.login-bg {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at top left, #FFF4C2 0, transparent 34%), #F8FAFC;
    padding: 20px;
}
.login-card { width: 100%; max-width: 430px; }
.login-card .brand { color: var(--text); margin-bottom: 18px; }
.login-card .brand span { color: var(--muted); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.small { font-size: 12px; }
.help-text { color: var(--muted); font-size: 13px; }
.code-list { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
@media (max-width: 980px) {
    .sidebar { position: relative; width: 100%; inset: auto; }
    .app-shell { display: block; }
    .main { margin-left: 0; width: 100%; padding: 18px; }
    .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}
