/* ── Reset / base ── */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #f6f7f9;
    color: #1f2937;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: #6b7280; }
.small { font-size: 12px; }

/* ── Auth (login page) ── */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #eef2f7; }
.auth-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 32px; width: 360px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.auth-card h1 { margin: 0 0 18px; font-size: 22px; }
.auth-card label { display: block; margin-bottom: 14px; font-weight: 500; }
.auth-card input[type=email], .auth-card input[type=text] {
    display: block; width: 100%; margin-top: 6px; padding: 9px 11px;
    border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px;
}
.auth-card button { width: 100%; padding: 10px; background: #2563eb; color: #fff; border: 0; border-radius: 6px; font-weight: 500; cursor: pointer; }
.auth-card button:hover { background: #1d4ed8; }

.banner { padding: 10px 12px; border-radius: 6px; margin-bottom: 14px; font-size: 13px; }
.banner.ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.banner.err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ── Top bar ── */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 24px; background: #fff; border-bottom: 1px solid #e5e7eb;
}
.topbar .brand a { font-weight: 600; color: #111; }
.topbar nav a { margin-left: 16px; color: #4b5563; }
.topbar nav a.active { color: #111; font-weight: 600; }

/* ── Container ── */
.container { max-width: 1100px; margin: 24px auto; padding: 0 24px; }
h1 { font-size: 22px; margin-top: 0; }
h2 { font-size: 18px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 10px; }

/* ── Tabs ── */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid #e5e7eb; margin-bottom: 22px; }
.tab {
    background: transparent; border: 0; padding: 10px 16px; cursor: pointer; color: #6b7280;
    font-size: 14px; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: #111; }
.tab.active { color: #2563eb; border-bottom-color: #2563eb; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Dropzone ── */
.dropzone {
    border: 2px dashed #cbd5e1; border-radius: 10px; padding: 40px; text-align: center;
    background: #fff; transition: background .15s, border-color .15s;
}
.dropzone.dragover { border-color: #2563eb; background: #eff6ff; }
.dropzone .link { color: #2563eb; cursor: pointer; }

/* ── Upload progress list ── */
.upload-list { margin: 16px 0; }
.upload-row {
    display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px 12px;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 6px; margin-bottom: 6px;
    align-items: center;
}
.upload-row .meta { font-size: 13px; color: #4b5563; }
.upload-row .progress {
    grid-column: 1 / -1; height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden;
}
.upload-row .progress > div { height: 100%; background: #2563eb; width: 0%; transition: width .15s; }
.upload-row.error .progress > div { background: #dc2626; }
.upload-row.done .progress > div { background: #16a34a; }

/* ── Tables ── */
table.data { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e5e7eb; border-radius: 6px; overflow: hidden; }
table.data th, table.data td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
table.data th { background: #f9fafb; font-weight: 600; font-size: 12px; color: #6b7280; text-transform: uppercase; letter-spacing: .03em; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover { background: #fafbfc; }

/* ── Buttons ── */
button {
    background: #fff; border: 1px solid #d1d5db; padding: 6px 12px; border-radius: 5px;
    cursor: pointer; font-size: 13px; color: #1f2937;
}
button:hover { background: #f3f4f6; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary { background: #2563eb; color: #fff; border-color: #2563eb; }
button.primary:hover { background: #1d4ed8; }
button.danger { color: #b91c1c; border-color: #fca5a5; }
button.danger:hover { background: #fef2f2; }

input[type=email], input[type=text], select {
    padding: 7px 10px; border: 1px solid #d1d5db; border-radius: 5px; font-size: 13px;
}

.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }

/* ── Status pills ── */
.pill {
    display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px;
    font-weight: 600; text-transform: uppercase; letter-spacing: .03em;
}
.pill.uploaded   { background: #e0f2fe; color: #075985; }
.pill.processing { background: #fef3c7; color: #92400e; }
.pill.done       { background: #dcfce7; color: #166534; }
.pill.failed     { background: #fee2e2; color: #991b1b; }
.pill.stopped    { background: #f3f4f6; color: #6b7280; }

/* ── Inline progress bar ── */
.bar { width: 160px; height: 8px; background: #e5e7eb; border-radius: 4px; overflow: hidden; display: inline-block; vertical-align: middle; }
.bar > div { height: 100%; background: #2563eb; transition: width .25s; }
.bar-label { font-size: 12px; color: #6b7280; margin-left: 8px; }

/* ── Spinner (small inline) ── */
.spinner {
    width: 14px; height: 14px; display: inline-block; border: 2px solid #cbd5e1;
    border-top-color: #2563eb; border-radius: 50%; animation: spin .8s linear infinite;
    vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* Append to existing app.css */

.dl-btn {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 5px;
    color: #fff !important;
    background: #2563eb;
    text-decoration: none !important;
    font-size: 12px;
    font-weight: 500;
}
.dl-btn:hover { background: #1d4ed8; }
