:root {
    --bg: #0b0d10;
    --bg-soft: #14181d;
    --bg-card: #1a1f26;
    --border: #2a313a;
    --text: #e6e8eb;
    --muted: #8a949f;
    --accent: #f97316;
    --accent-hover: #fb923c;
    --ok: #22c55e;
    --err: #ef4444;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
}
.topbar nav { display: flex; align-items: center; gap: 18px; }
.topbar nav a { color: var(--text); font-weight: 500; }

.brand { display: flex; align-items: center; gap: 10px; }
.brand .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 8px var(--ok);
}
.brand-name { font-weight: 600; letter-spacing: 0.5px; }
.brand-sub { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }

main { padding: 24px; max-width: 1100px; margin: 0 auto; }
.page h2 { margin: 0 0 16px; font-weight: 600; }
.breadcrumb { margin: 0 0 8px; }

.filters {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 16px;
}
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }

input, select, textarea, button {
    font: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 10px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }

button, .link-btn {
    cursor: pointer;
    background: var(--bg-soft);
    border: 1px solid var(--border);
}
button:hover { border-color: var(--accent); }
button.primary {
    background: var(--accent);
    color: #0b0d10;
    border-color: var(--accent);
    font-weight: 600;
}
button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.danger {
    background: transparent;
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.4);
}
button.danger:hover {
    background: var(--err);
    color: #0b0d10;
    border-color: var(--err);
}
.delete-form { margin-top: 24px; }

.downloads { display: flex; gap: 10px; margin: 4px 0 20px; }

.detail-nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.link-btn.disabled {
    color: var(--muted);
    opacity: 0.4;
    pointer-events: none;
    cursor: default;
}
.link-btn {
    display: inline-block;
    padding: 8px 10px;
    border-radius: 6px;
    color: var(--text);
    text-decoration: none;
}
form.inline { display: inline; }

table.recordings {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
table.recordings th, table.recordings td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}
table.recordings th { background: var(--bg-soft); color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
table.recordings tr:last-child td { border-bottom: none; }
table.recordings tr:hover td { background: rgba(249, 115, 22, 0.05); }

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    background: var(--bg-soft);
    color: var(--muted);
    border: 1px solid var(--border);
}
.badge.ok { color: var(--ok); border-color: rgba(34, 197, 94, 0.3); }

.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }

audio { width: 100%; margin: 12px 0 20px; }

.meta { display: grid; grid-template-columns: 120px 1fr; gap: 6px 16px; margin: 12px 0 20px; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; }

.transcript-form label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
textarea {
    width: 100%;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    resize: vertical;
}
.transcript-form .row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    gap: 12px;
}

details.original { margin-top: 20px; }
details.original summary { cursor: pointer; color: var(--muted); }
details.original pre {
    margin-top: 8px;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    white-space: pre-wrap;
    word-break: break-word;
}

.login-wrap {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-card {
    width: 360px;
    padding: 28px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.login-card h1 { margin: 0; font-size: 20px; }
.login-card label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; }

.error {
    padding: 8px 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    border-radius: 6px;
}
