:root {
    color-scheme: light;
    --ink: #17202a;
    --muted: #667085;
    --line: #d9dee7;
    --surface: #ffffff;
    --page: #f3f5f7;
    --primary: #146c43;
    --primary-hover: #0f5736;
    --danger: #b42318;
    --danger-bg: #fff1f0;
    --success-bg: #ecfdf3;
    --success: #067647;
    --radius: 8px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--page);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: inherit; }

.topbar {
    min-height: 64px;
    padding: 0 24px;
    background: #20252b;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid var(--primary);
}

.brand {
    color: #fff;
    text-decoration: none;
    font-size: 19px;
    font-weight: 800;
}

.user-area { display: flex; align-items: center; gap: 12px; }
.container { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 36px 0 60px; }

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    margin-bottom: 24px;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(28px, 4vw, 40px); }
.page-heading p, .panel-heading p, .empty-state p { color: var(--muted); margin-bottom: 0; }
.eyebrow { color: var(--primary) !important; font-size: 12px; font-weight: 800; letter-spacing: .08em; margin-bottom: 8px !important; }

.count-box {
    min-width: 96px;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-align: center;
}
.count-box strong { display: block; font-size: 24px; }
.count-box span { color: var(--muted); font-size: 13px; }

.auth-panel {
    width: min(460px, 100%);
    margin: 7vh auto 0;
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 12px 36px rgba(16, 24, 40, .08);
}

.panel-heading { margin-bottom: 24px; }
.panel-heading h1 { font-size: 28px; }

.form-stack, .upload-form { display: grid; gap: 16px; }
label span { display: block; margin-bottom: 7px; font-size: 14px; font-weight: 700; }

input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #b8c0cc;
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    font: inherit;
}

input:focus {
    outline: 3px solid rgba(20, 108, 67, .15);
    border-color: var(--primary);
}

.button {
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font: inherit;
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
}

.button-primary { background: var(--primary); color: #fff; }
.button-primary:hover { background: var(--primary-hover); }
.button-secondary { background: #fff; color: #344054; border-color: #b8c0cc; }
.button-danger { background: var(--danger-bg); color: var(--danger); border-color: #f1b6b2; }
.button-ghost { min-height: 34px; padding: 6px 12px; color: #fff; border-color: #667085; }

.alert {
    padding: 13px 15px;
    margin-bottom: 18px;
    border-radius: 6px;
    border: 1px solid;
}
.alert-error { background: var(--danger-bg); color: var(--danger); border-color: #f1b6b2; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: #abefc6; }

.upload-panel {
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.upload-form {
    grid-template-columns: minmax(220px, .8fr) minmax(260px, 1.4fr) auto;
    align-items: end;
}

.file-picker {
    min-height: 72px;
    padding: 12px;
    border: 1px dashed #98a2b3;
    border-radius: 6px;
    cursor: pointer;
}
.file-picker input { min-height: auto; padding: 0; border: 0; }
.file-picker-title { margin: 8px 0 2px; }
.file-picker-note { margin: 0; color: var(--muted); font-size: 12px; font-weight: 500; }

.files-section {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.file-list { display: grid; }
.file-row {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}
.file-row:last-child { border-bottom: 0; }

.file-type {
    width: 52px;
    height: 52px;
    border-radius: 6px;
    background: #eef2f6;
    color: #344054;
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 850;
    overflow: hidden;
}

.file-main { min-width: 0; }
.file-main h2 { margin-bottom: 4px; font-size: 16px; overflow-wrap: anywhere; }
.file-main p { margin-bottom: 7px; color: #475467; font-size: 14px; }
.file-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 12px; }
.file-actions { display: flex; gap: 8px; }
.file-actions form { margin: 0; }
.empty-state { padding: 64px 24px; text-align: center; }
.empty-state h2 { margin-bottom: 8px; font-size: 20px; }

@media (max-width: 760px) {
    .topbar { padding: 0 16px; }
    .container { width: min(100% - 24px, 1120px); padding-top: 24px; }
    .page-heading { align-items: center; }
    .upload-form { grid-template-columns: 1fr; }
    .file-row { grid-template-columns: 48px minmax(0, 1fr); align-items: start; }
    .file-type { width: 44px; height: 44px; }
    .file-actions { grid-column: 1 / -1; }
    .file-actions .button { flex: 1; }
    .file-actions form { display: flex; flex: 1; }
    .file-actions form .button { width: 100%; }
}

