:root {
    --accent: #5b2dd6;
    --accent-strong: #4a1fbe;
    --accent-soft: #f0ebfc;
    --accent-grad: linear-gradient(135deg, #6d4ae0, #4a1fbe);
    --bg: #f6f7fb;
    --surface: #ffffff;
    --surface-2: #f2f3f9;
    --border: #e5e8f2;
    --text: #1d2333;
    --text-soft: #3f4660;
    --muted: #69708a;
    --danger: #d63d3d;
    --teal: #0e8f8e;
    --teal-soft: #e2f4f3;
    --amber: #a86a12;
    --amber-soft: #faf0dc;
    --rose: #c93a72;
    --rose-soft: #fbe5ee;
    --indigo: #4540c9;
    --indigo-soft: #e9e9fc;
    --slate: #5a6275;
    --slate-soft: #eceef4;
    --green: #157a4a;
    --green-soft: #e3f5e9;
    --shadow-sm: 0 1px 2px rgba(20, 24, 60, .06);
    --shadow-md: 0 8px 28px rgba(20, 24, 60, .10);
    --shadow-lg: 0 20px 55px rgba(10, 14, 34, .22);
    --radius: 14px;
    --sidebar-w: 264px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 14px; line-height: 1.5; }

/* ================= Shell & Sidebar ================= */
.admin-shell { display: flex; min-height: 100vh; }
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 1040;
    width: var(--sidebar-w);
    background: linear-gradient(180deg, #1a2034, #131828);
    display: flex; flex-direction: column;
    transform: translateX(-100%);
    transition: transform .25s ease;
    overflow-y: auto;
}
.sidebar.sidebar-open { transform: none; box-shadow: 12px 0 40px rgba(10, 14, 34, .25); }

.sidebar-head { display: flex; align-items: center; gap: 12px; padding: 20px 20px 16px; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 11px; background: var(--accent-grad); box-shadow: 0 6px 16px rgba(91, 45, 214, .4); color: #fff; flex-shrink: 0; }
.brand-mark svg { width: 19px; height: 19px; }
.brand-text { line-height: 1.15; }
.brand-text .b1 { color: #fff; font-weight: 800; font-size: 15px; letter-spacing: -.01em; display: block; }
.brand-text .b2 { color: #8b93ad; font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }

.sidebar-nav { padding: 14px 14px 8px; }
.nav-section-label { color: #6d7694; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: 8px 10px 6px; }
.sidebar-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; margin-bottom: 4px; border-radius: 10px;
    color: #b9c0d8; font-weight: 600; font-size: 13.5px; text-decoration: none;
    transition: background .15s, color .15s;
}
.sidebar-link svg { width: 18px; height: 18px; opacity: .75; flex-shrink: 0; }
.sidebar-link:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.sidebar-link.active { background: var(--accent-grad); color: #fff; box-shadow: 0 6px 18px rgba(91, 45, 214, .35); }
.sidebar-link.active svg { opacity: 1; }

.sidebar-foot { margin-top: auto; padding: 14px; border-top: 1px solid rgba(255, 255, 255, .07); }
.sidebar-user { display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, .05); border-radius: 12px; padding: 10px; }
.sidebar-user .user-meta { flex: 1; min-width: 0; }
.sidebar-user .user-name { color: #fff; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .user-role { color: #8b93ad; font-size: 11px; }

.sidebar-backdrop { position: fixed; inset: 0; z-index: 1035; background: rgba(10, 14, 34, .5); }

/* ================= Topbar ================= */
.topbar {
    position: sticky; top: 0; z-index: 1020;
    display: flex; align-items: center; gap: 12px;
    height: 60px; padding: 0 20px;
    background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}
.topbar-brand { display: none; font-weight: 800; font-size: 15px; }
.hamburger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 10px;
    border: 1px solid var(--border); background: var(--surface); color: var(--text-soft);
    cursor: pointer;
}
.hamburger svg { width: 18px; height: 18px; }
.hamburger:hover { background: var(--surface-2); }

/* ================= Content ================= */
.admin-content { flex: 1; width: 100%; padding: 24px 20px 48px; }
.content-wrap { max-width: 1280px; margin: 0 auto; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 4px 0 22px; }
.page-head h1 { font-size: 22px; font-weight: 800; margin: 0; letter-spacing: -.02em; }
.page-head .sub { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ================= Cards & stats ================= */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-hover { transition: transform .18s ease, box-shadow .18s ease; }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-card { border-radius: var(--radius); padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 14px; transition: transform .18s ease, box-shadow .18s ease; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon { width: 48px; height: 48px; border-radius: 13px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-icon svg { width: 22px; height: 22px; }
.stat-value { font-size: 22px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.stat-label { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-top: 3px; }
.stat-purple .stat-icon { background: var(--accent-soft); color: var(--accent); }
.stat-teal .stat-icon { background: var(--teal-soft); color: var(--teal); }
.stat-amber .stat-icon { background: var(--amber-soft); color: var(--amber); }
.stat-rose .stat-icon { background: var(--rose-soft); color: var(--rose); }
.stat-indigo .stat-icon { background: var(--indigo-soft); color: var(--indigo); }
.stat-slate .stat-icon { background: var(--slate-soft); color: var(--slate); }

/* ================= Tables ================= */
.table { color: var(--text); margin-bottom: 0; font-size: 13.5px; }
.table > :not(caption) > * > * { background-color: transparent; border-color: var(--border); }
.table thead th { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); border-bottom: 1px solid var(--border); padding: 10px 12px; white-space: nowrap; }
.table tbody td { padding: 12px; vertical-align: middle; }
.table-hover > tbody > tr:hover > * { background-color: #f8f9fe; }
.table-responsive { -webkit-overflow-scrolling: touch; }

/* ================= Forms & buttons ================= */
.form-control, .form-select { background: var(--surface); border-color: var(--border); color: var(--text); border-radius: 10px; font-size: 13.5px; }
.form-control:focus, .form-select:focus { border-color: var(--accent); color: var(--text); box-shadow: 0 0 0 .2rem rgba(91, 45, 214, .12); }
.form-control::placeholder { color: #a5aac0; }
.form-label { font-size: 12px; font-weight: 700; color: var(--text-soft); margin-bottom: 5px; }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }

.btn { border-radius: 10px; font-weight: 600; font-size: 13.5px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn-sm svg { width: 13px; height: 13px; }
.btn-primary { background: var(--accent-grad); border: none; box-shadow: 0 4px 12px rgba(91, 45, 214, .3); }
.btn-primary:hover { background: linear-gradient(135deg, #5b2dd6, #3d179e); transform: translateY(-1px); }
.btn-outline-light { color: var(--text-soft); border-color: var(--border); background: var(--surface); }
.btn-outline-light:hover { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.btn-soft { background: var(--accent-soft); color: var(--accent-strong); border: none; }
.btn-soft:hover { background: #e3daf9; color: var(--accent-strong); }
.btn-ai { background: linear-gradient(135deg, #7c3aed, #4f2bb3); color: #fff; border: none; box-shadow: 0 4px 12px rgba(91, 45, 214, .25); }
.btn-ai:hover { background: linear-gradient(135deg, #6d28d9, #3d179e); color: #fff; }
.btn-ai:disabled { opacity: .65; box-shadow: none; transform: none; }
.btn-outline-danger { color: var(--danger); border-color: #efc4c4; background: var(--surface); }
.btn-outline-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-icon { width: 30px; height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; }
.btn-icon svg { width: 14px; height: 14px; transition: transform .12s; }
.btn-icon:hover svg { transform: scale(1.12); }

/* ================= Badges & dots ================= */
.badge { font-weight: 600; font-size: 11px; padding: 5px 9px; }
.badge-purple { background: var(--accent-soft); color: var(--accent-strong); }
.badge-teal { background: var(--teal-soft); color: #0b6f6e; }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-rose { background: var(--rose-soft); color: var(--rose); }
.badge-indigo { background: var(--indigo-soft); color: var(--indigo); }
.badge-sky { background: #e3eefe; color: #1e5fbf; }
.badge-slate { background: var(--slate-soft); color: var(--slate); }
.badge-success-soft { background: var(--green-soft); color: var(--green); }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-orange { background: var(--amber-soft); color: var(--amber); }
.text-purple { color: var(--accent-strong); }
.link-purple { color: var(--accent-strong); }
.link-purple:hover { text-decoration: underline; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.status-live { background: #1a9e63; }
.status-mock { background: var(--amber); }

/* ================= Avatars ================= */
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 12px; flex-shrink: 0; }
.avatar-sm { width: 26px; height: 26px; font-size: 10px; }
.avatar-rose { background: linear-gradient(135deg, #e0457b, #b4235f); }
.avatar-indigo { background: linear-gradient(135deg, #6366f1, #4338ca); }
.avatar-teal { background: linear-gradient(135deg, #14b8a6, #0d9488); }
.avatar-amber { background: linear-gradient(135deg, #f59e0b, #b45309); }
.avatar-slate { background: linear-gradient(135deg, #64748b, #334155); }
.avatar-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); }

/* ================= Taxonomy rows ================= */
.meta-row { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.meta-head { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }

/* ================= Modal ================= */
.modal-overlay { position: fixed; inset: 0; z-index: 1050; background: rgba(10, 14, 34, .55); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; width: 100%; max-width: 800px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: modalIn .22s ease; overflow: hidden; }
.modal-head { background: linear-gradient(135deg, #f7f5ff, #f1effc); border-bottom: 1px solid var(--border); padding: 16px 22px; flex-shrink: 0; }
.modal-head h5 { font-weight: 800; margin: 0; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); background: #fafbff; display: flex; justify-content: flex-end; gap: 8px; flex-shrink: 0; }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

/* ================= Toast ================= */
.toast-wrap { position: fixed; top: 74px; right: 16px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-md); padding: 12px 16px; min-width: 280px; max-width: 360px; font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 10px; animation: toastIn .2s ease; border-left: 4px solid var(--accent); }
.toast .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--accent); }
.toast-ok { border-left-color: var(--teal); }
.toast-ok .dot { background: var(--teal); }
.toast-err { border-left-color: var(--danger); }
.toast-err .dot { background: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }

/* ================= Empty state ================= */
.empty-state { border: 2px dashed #dfe2ef; border-radius: 14px; padding: 44px 20px; text-align: center; color: var(--muted); background: #fafbff; }
.empty-state svg { width: 40px; height: 40px; stroke: #b9bfd6; margin-bottom: 10px; }
.empty-state .empty-title { font-weight: 700; color: var(--text-soft); margin-bottom: 2px; }
.empty-state .empty-sub { font-size: 13px; }

/* ================= Misc ================= */
.muted { color: var(--muted); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: none; }
.text-monospace { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.pagination-bar { display: flex; justify-content: space-between; align-items: center; padding: 14px 4px 0; gap: 10px; flex-wrap: wrap; }
.page-btn { min-width: 88px; }
.fade-up { animation: fadeUp .35s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.divider { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
.section-title { font-size: 14px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.section-title svg { width: 16px; height: 16px; color: var(--accent); }

/* ================= Clickable cards & rows ================= */
.stat-card-link { display: flex; color: var(--text); text-decoration: none; cursor: pointer; }
.stat-card-link:hover { color: var(--text); }
.row-click { cursor: pointer; }
.row-click:hover { background-color: #f3f0fd !important; }
[x-cloak] { display: none !important; }

/* ================= Records page ================= */
.record-tabs .btn svg { width: 14px; height: 14px; }
.modal-panel-lg { max-width: 880px; }
.avatar-lg { width: 52px; height: 52px; font-size: 17px; border-radius: 16px; }
.detail-name { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.detail-section { border: 1px solid var(--border); background: #fafbff; border-radius: 14px; padding: 16px; margin-bottom: 14px; }
.detail-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.occasion-row { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }
.occasion-row .form-select { font-size: 13px; }
.history-line { color: var(--muted); padding-left: 14px; position: relative; }
.history-line::before { content: ''; position: absolute; left: 2px; top: 6px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent-soft); border: 1px solid var(--accent); }
.kv { display: flex; flex-direction: column; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.kv-k { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.kv-v { font-size: 14px; font-weight: 700; margin-top: 2px; }
.danger-zone { margin-top: 18px; border-top: 1px solid #efd2d2; padding-top: 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.danger-zone .btn { flex-shrink: 0; }
.raw-json { margin-top: 12px; border: 1px solid var(--border); border-radius: 10px; background: #0f1422; overflow: auto; max-height: 320px; }
.raw-json pre { margin: 0; padding: 12px 14px; font-size: 11.5px; line-height: 1.55; color: #9fe8c8; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.gen-list { display: flex; flex-direction: column; gap: 10px; }
.gen-item { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.gen-detail { margin-top: 4px; line-height: 1.55; word-break: break-word; }
.timeline { display: flex; flex-direction: column; gap: 8px; }
.timeline-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; }
.timeline-row .tl-slot { flex: 0 0 110px; text-align: center; }

/* ================= Responsive ================= */
@media (min-width: 992px) {
    .sidebar { transform: none; }
    .sidebar-backdrop { display: none; }
    .hamburger { display: none; }
    .admin-main { margin-left: var(--sidebar-w); }
    .topbar-brand { display: none; }
}
@media (max-width: 991.98px) {
    .topbar-brand { display: block; }
    .topbar { padding: 0 14px; }
    .admin-content { padding: 18px 14px 40px; }
    .page-head h1 { font-size: 19px; }
    .session-name { display: none; }
    .toast-wrap { right: 12px; }
}
@media (max-width: 575.98px) {
    .stat-card { padding: 14px; gap: 12px; }
    .stat-icon { width: 42px; height: 42px; }
    .stat-value { font-size: 19px; }
    .modal-overlay { padding: 10px; align-items: flex-end; }
    .modal-panel { max-height: calc(100vh - 20px); border-radius: 16px 16px 0 0; }
    .modal-head, .modal-body { padding: 16px; }
    .toast-wrap { top: auto; bottom: 12px; right: 12px; left: 12px; }
    .toast { min-width: 0; max-width: none; width: 100%; }
    .page-head { align-items: flex-start; flex-direction: column; }
}

.gen-logic-table { margin-bottom: 10px; }
.gen-logic-table th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: #8b93a7; border-bottom-color: #e6e2f5 !important; }
.gen-logic-table td { font-size: 12.5px; vertical-align: middle; }
.gen-logic-table tr.gen-picked td { background: #f3f0ff !important; font-weight: 600; }
.gen-logic-table tr.gen-skipped { opacity: 0.72; }
.gen-logic-table .gen-score { font-weight: 700; color: #5b2dd6; font-variant-numeric: tabular-nums; }

/* ================= Logs viewer ================= */
.log-tabs { border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.log-tab { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 5px 10px; }
.log-tab:hover { border-color: var(--accent); }
.log-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.log-tab-size { opacity: 0.62; font-size: 10.5px; margin-left: 6px; }
.log-tab.active .log-tab-size { opacity: 0.85; }
.log-tab-arch { background: rgba(0,0,0,0.15); border-radius: 4px; font-size: 9px; text-transform: uppercase; padding: 1px 4px; margin-left: 5px; letter-spacing: .05em; }
.log-toolbar { border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.log-pane { background: #0c1020; border: 1px solid #1e2640; border-radius: 10px; height: 62vh; min-height: 320px; overflow: auto; padding: 12px 14px; }
.log-lines { margin: 0; color: #c7d2ea; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: 12px; line-height: 1.6; white-space: pre; user-select: text; }
.log-lines::-webkit-scrollbar { width: 10px; height: 10px; }
.log-lines::-webkit-scrollbar-thumb { background: #2a3552; border-radius: 5px; }
.log-lines::-webkit-scrollbar-track { background: transparent; }
.log-foot { font-size: 11.5px; }
code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; font-size: 11.5px; }
kbd { background: var(--surface-2); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; padding: 1px 5px; font-size: 11px; font-family: ui-monospace, Menlo, Consolas, monospace; }

/* ---------- Catalog & Taxonomy console ---------- */
.type-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; transition: border-color .15s, background .15s; }
.type-card:hover { border-color: var(--accent); }
.type-card-active { border-color: var(--accent); background: rgba(91, 45, 214, .06); }

.cat-list { list-style: none; margin: 0; padding: 0; min-height: 4px; }
.cat-root { border: 1px dashed var(--border); border-radius: 10px; padding: 6px; }
.cat-node { position: relative; }
.cat-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 4px; background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; }
.cat-row:hover { border-color: var(--accent); }
.cat-node.cat-selected > .cat-row { border-color: var(--accent); background: rgba(91, 45, 214, .10); }
.cat-depth-2 > .cat-row { margin-left: 26px; }
.cat-depth-3 > .cat-row { margin-left: 52px; }
.cat-name { font-weight: 600; font-size: 13.5px; }
.cat-actions { display: flex; gap: 4px; opacity: .25; transition: opacity .15s; }
.cat-row:hover .cat-actions { opacity: 1; }
.drag-handle { color: var(--muted); cursor: grab; display: inline-flex; }
.drag-handle:active { cursor: grabbing; }
.sortable-ghost > .cat-row { opacity: .45; border-style: dashed; }
.sortable-chosen > .cat-row { border-color: var(--accent); box-shadow: var(--shadow-md); }

.tag-pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; cursor: pointer; font-size: 13px; user-select: none; }
.tag-pill input { display: none; }
.tag-pill-on { border-color: var(--accent); background: rgba(91, 45, 214, .10); color: var(--accent-soft); }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.media-card { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.media-card.media-primary { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(32, 201, 151, .25); }
.media-thumb { width: 100%; height: 110px; object-fit: cover; display: block; background: var(--surface-2); }
.media-thumb.media-missing { display: none; }
.media-meta { padding: 6px 8px; }
.media-actions { display: flex; gap: 4px; padding: 0 8px 8px; justify-content: flex-end; }

.nav-tabs .nav-link { color: var(--muted); border: none; border-bottom: 2px solid transparent; padding: 6px 12px; }
.nav-tabs .nav-link:hover { color: var(--text); }
.nav-tabs .nav-link.active { color: var(--accent-soft); border-bottom-color: var(--accent); background: transparent; }
