/* Transcriber — Socialudo
   Lightweight, mobile-first. System fonts, minimal custom CSS. */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --brand-red: #cd1417;
    --brand-dark: #3c3c3b;
    --primary: #cd1417;
    --primary-hover: #a8100f;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-text-size-adjust: 100%;
}

/* ── Layout ─────────────────────────────────────────────────────── */

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

/* ── Topbar ─────────────────────────────────────────────────────── */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border-bottom: 2px solid var(--brand-red);
    box-shadow: var(--shadow);
}

.topbar .logo {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--brand-red);
    text-decoration: none;
}

.topbar nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
}

.topbar nav a {
    color: var(--text);
    text-decoration: none;
}

.topbar nav a:hover {
    color: var(--brand-red);
}

/* ── Cards ──────────────────────────────────────────────────────── */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.card h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

/* ── Login Card ─────────────────────────────────────────────────── */

.login-card {
    max-width: 400px;
    margin: 4rem auto;
    padding: 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.login-card h1 {
    font-size: 1.5rem;
    color: var(--brand-red);
    margin-bottom: 0.5rem;
}

.login-card p {
    margin-bottom: 1.5rem;
}

/* ── Headings ───────────────────────────────────────────────────── */

h1 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

/* ── Buttons ────────────────────────────────────────────────────── */

.btn {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    background: #cbd5e1;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ── Alerts ─────────────────────────────────────────────────────── */

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ── Badges ─────────────────────────────────────────────────────── */

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 4px;
    text-transform: capitalize;
}

/* In-progress states (blue) */
.badge-pending,
.badge-provisioning,
.badge-transferring,
.badge-installing,
.badge-installing_whisper,
.badge-transcribing {
    background: #dbeafe;
    color: #1e40af;
}

/* QA / retry states (amber) */
.badge-qa,
.badge-retrying {
    background: #fef3c7;
    color: #92400e;
}

/* Complete (green) */
.badge-complete {
    background: #dcfce7;
    color: #166534;
}

/* Failed (red) */
.badge-failed {
    background: #fee2e2;
    color: #991b1b;
}

/* ── Tables ─────────────────────────────────────────────────────── */

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

thead th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

tbody td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

tbody tr:hover {
    background: #f1f5f9;
}

tbody a {
    color: var(--primary);
    text-decoration: none;
}

tbody a:hover {
    text-decoration: underline;
}

/* ── Forms ──────────────────────────────────────────────────────── */

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

input[type="text"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(205, 20, 23, 0.1);
}

/* ── Detail Table ───────────────────────────────────────────────── */

.detail-table {
    width: auto;
}

.detail-table td {
    padding: 0.35rem 0.75rem 0.35rem 0;
    border: none;
    vertical-align: top;
}

.detail-table td:first-child {
    white-space: nowrap;
    padding-right: 1.5rem;
}

/* ── Transcript ─────────────────────────────────────────────────── */

.transcript-area {
    max-height: 500px;
    overflow-y: auto;
    white-space: pre-wrap;
    font-size: 0.875rem;
    line-height: 1.6;
    padding: 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

/* ── Small text ─────────────────────────────────────────────────── */

small {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ── Utility ────────────────────────────────────────────────────── */

.text-muted {
    color: var(--text-muted);
}

.text-center {
    text-align: center;
}

/* ── Responsive ─────────────────────────────────────────────────── */

@media (max-width: 640px) {
    .container {
        padding: 0.75rem;
    }

    .topbar {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .topbar nav {
        gap: 0.75rem;
    }
}
