.babb-arkiv {
            --bg:              #1a1a2e;
            --surface:         #16213e;
            --surface-hover:   #1e2d52;
            --surface-card:    #192140;
            --gold:            #e8b84b;
            --gold-light:      #f5d78e;
            --gold-dim:        rgba(232,184,75,0.18);
            --text:            #e8e8d0;
            --text-muted:      #8a8a7a;
            --border:          #2a3550;
            --border-gold:     rgba(232,184,75,0.35);
            --complete-bg:     rgba(74,222,128,0.12);
            --complete-text:   #6dde98;
            --incomplete-bg:   rgba(251,146,60,0.12);
            --incomplete-text: #fb923c;
            --danger:          #f87171;
        }
        .babb-arkiv * { margin: 0; padding: 0; box-sizing: border-box; }

        .babb-arkiv {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            line-height: 1.6;
            color: var(--text);
            background: var(--bg);
            min-height: 100vh;
        }

        /* ── HEADER ──────────────────────────────────────────── */
        .babb-arkiv .header {
            position: relative;
            background: linear-gradient(135deg, #12122a 0%, #0f3060 100%);
            border-bottom: 2px solid var(--gold);
            padding: 1.8rem 2rem 1.5rem;
            overflow: hidden;
        }
        .babb-arkiv .header::before {
            content: '';
            position: absolute;
            inset: 0;
            background: repeating-linear-gradient(
                180deg,
                transparent 0px, transparent 20px,
                rgba(232,184,75,0.18) 20px, rgba(232,184,75,0.18) 22px
            );
            pointer-events: none;
        }
        .babb-arkiv .header-inner {
            position: relative;
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            flex-wrap: wrap;
            gap: 0.75rem;
        }
        .babb-arkiv .header h1 {
            font-size: 2.2rem;
            font-weight: 800;
            color: var(--gold);
            letter-spacing: -0.5px;
            text-shadow: 0 2px 8px rgba(0,0,0,0.5);
        }
        .babb-arkiv .header h1 .clef { font-size: 3.5rem; line-height: 1; display: block; }
        .babb-arkiv .header-sub {
            font-size: 0.95rem;
            color: var(--text-muted);
            margin-top: 0.2rem;
        }
        .babb-arkiv .header-nav {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            flex-wrap: wrap;
        }
        .babb-arkiv .btn-nav {
            display: inline-flex;
            align-items: center;
            gap: 0.4rem;
            padding: 0.5rem 1rem;
            border: 1px solid var(--border-gold);
            border-radius: 6px;
            color: var(--gold);
            background: rgba(232,184,75,0.08);
            text-decoration: none;
            font-size: 0.9rem;
            cursor: pointer;
            transition: all 0.2s;
        }
        .babb-arkiv .btn-nav:hover {
            background: rgba(232,184,75,0.18);
            border-color: var(--gold);
        }
        .babb-arkiv .data-ts {
            font-size: 0.8rem;
            color: var(--text-muted);
            margin-top: 0.3rem;
        }

        /* ── STATS ───────────────────────────────────────────── */
        .babb-arkiv .stats {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
            gap: 1rem;
            padding: 1.5rem 2rem;
            max-width: 1400px;
            margin: 0 auto;
        }
        .babb-arkiv .stat-card {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 1.2rem;
            transition: border-color 0.2s, transform 0.2s;
        }
        .babb-arkiv .stat-card:hover {
            border-color: var(--border-gold);
            transform: translateY(-2px);
        }
        .babb-arkiv .stat-card .icon { font-size: 1.5rem; margin-bottom: 0.4rem; }
        .babb-arkiv .stat-card h3 {
            font-size: 0.78rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 0.3rem;
        }
        .babb-arkiv .stat-card .value {
            font-size: 2rem;
            font-weight: bold;
            color: var(--gold);
        }

        /* ── FILTERS ─────────────────────────────────────────── */
        .babb-arkiv .container { max-width: 1400px; margin: 0 auto; padding: 0 2rem 2rem; }

        .babb-arkiv .filters {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 1.25rem;
            margin-bottom: 1.5rem;
        }
        .babb-arkiv .filters-row {
            display: flex;
            gap: 0.75rem;
            flex-wrap: wrap;
            margin-bottom: 0.85rem;
        }
        .babb-arkiv .search-box { flex: 1; min-width: 240px; }
        .search-box input,
        .babb-arkiv .select-box select {
            width: 100%;
            padding: 0.65rem 1rem;
            border: 1px solid var(--border);
            border-radius: 8px;
            font-size: 0.95rem;
            background: var(--bg);
            color: var(--text);
            transition: border-color 0.2s;
        }
        .search-box input:focus,
        .babb-arkiv .select-box select:focus {
            outline: none;
            border-color: var(--gold);
        }
        .babb-arkiv .search-box input::placeholder { color: var(--text-muted); }
        .babb-arkiv .select-box { min-width: 180px; }
        .babb-arkiv .select-box select option { background: var(--bg); }

        .babb-arkiv .filter-group { display: flex; gap: 0.5rem; flex-wrap: wrap; }
        .babb-arkiv .filter-btn {
            padding: 0.45rem 0.9rem;
            border: 1px solid var(--border);
            background: transparent;
            border-radius: 6px;
            cursor: pointer;
            font-size: 0.85rem;
            color: var(--text-muted);
            transition: all 0.2s;
        }
        .babb-arkiv .filter-btn:hover { border-color: var(--gold); color: var(--gold); }
        .babb-arkiv .filter-btn.active {
            background: var(--gold-dim);
            border-color: var(--gold);
            color: var(--gold);
        }

        /* ── PIECE GRID ──────────────────────────────────────── */
        .babb-arkiv .results-count {
            margin-bottom: 1rem;
            color: var(--text-muted);
            font-size: 0.9rem;
        }
        .babb-arkiv .pieces-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
            gap: 1.25rem;
        }
        .babb-arkiv .piece-card {
            background: var(--surface-card);
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 1.25rem;
            display: flex;
            flex-direction: column;
            transition: border-color 0.2s, transform 0.2s;
        }
        .babb-arkiv .piece-card:hover {
            border-color: var(--border-gold);
            transform: translateY(-3px);
        }
        .babb-arkiv .piece-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 0.85rem;
        }
        .babb-arkiv .archive-id {
            font-family: 'Courier New', monospace;
            font-weight: bold;
            font-size: 0.85rem;
            color: var(--gold);
            background: var(--gold-dim);
            padding: 0.2rem 0.6rem;
            border-radius: 5px;
        }
        .babb-arkiv .status-badge {
            padding: 0.2rem 0.65rem;
            border-radius: 6px;
            font-size: 0.78rem;
            font-weight: 600;
        }
        .babb-arkiv .status-badge.complete {
            background: var(--complete-bg);
            color: var(--complete-text);
        }
        .babb-arkiv .status-badge.incomplete {
            background: var(--incomplete-bg);
            color: var(--incomplete-text);
        }
        .babb-arkiv .status-badge.vedligehold {
            background: rgba(167,139,250,0.15);
            color: #a78bfa;
        }
        .babb-arkiv .piece-title {
            font-size: 1.15rem;
            font-weight: 700;
            color: var(--text);
            margin-bottom: 0.6rem;
        }
        .babb-arkiv .piece-meta {
            font-size: 0.88rem;
            color: var(--text-muted);
            margin-bottom: 0.3rem;
        }
        .babb-arkiv .piece-meta strong { color: var(--text); }
        .babb-arkiv .style-tempo-tags {
            display: flex;
            gap: 0.4rem;
            margin: 0.6rem 0;
            flex-wrap: wrap;
        }
        .babb-arkiv .style-tag {
            background: rgba(232,184,75,0.14);
            color: var(--gold-light);
            padding: 0.2rem 0.65rem;
            border-radius: 5px;
            font-size: 0.78rem;
            font-weight: 600;
        }
        .babb-arkiv .tempo-tag {
            background: rgba(192,132,252,0.14);
            color: #d8b4fe;
            padding: 0.2rem 0.65rem;
            border-radius: 5px;
            font-size: 0.78rem;
            font-weight: 600;
        }
        .babb-arkiv .filename-notes {
            margin: 0.6rem 0;
            padding: 0.65rem 0.85rem;
            background: rgba(251,191,36,0.08);
            border-left: 3px solid var(--gold);
            border-radius: 0 5px 5px 0;
            font-size: 0.82rem;
            color: #d4c090;
        }
        .babb-arkiv .filename-notes-title { font-weight: 600; margin-bottom: 0.2rem; }
        .babb-arkiv .instruments-label {
            font-size: 0.75rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin: 0.6rem 0 0.4rem;
        }
        .babb-arkiv .instrument-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
        .babb-arkiv .instrument-tag {
            background: rgba(255,255,255,0.06);
            border: 1px solid var(--border);
            padding: 0.15rem 0.5rem;
            border-radius: 4px;
            font-size: 0.73rem;
            color: var(--text-muted);
        }
        .babb-arkiv .missing-instruments {
            margin-top: 0.65rem;
            padding: 0.65rem;
            background: rgba(248,113,113,0.1);
            border-left: 3px solid var(--danger);
            border-radius: 0 5px 5px 0;
            font-size: 0.82rem;
            color: #fca5a5;
        }
        /* Card footer: open-folder button */
        .babb-arkiv .card-footer {
            margin-top: auto;
            padding-top: 0.85rem;
            border-top: 1px solid var(--border);
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 0.5rem;
            margin-top: 0.85rem;
        }
        .babb-arkiv .btn-folder {
            display: inline-flex;
            align-items: center;
            gap: 0.3rem;
            padding: 0.35rem 0.75rem;
            border: 1px solid var(--border);
            border-radius: 5px;
            background: transparent;
            color: var(--text-muted);
            font-size: 0.82rem;
            cursor: pointer;
            transition: all 0.2s;
        }
        .babb-arkiv .btn-folder:hover {
            border-color: var(--gold);
            color: var(--gold);
            background: var(--gold-dim);
        }
        .babb-arkiv .btn-vedligehold {
            display: inline-flex;
            align-items: center;
            gap: 0.3rem;
            padding: 0.35rem 0.75rem;
            border: 1px solid var(--border);
            border-radius: 5px;
            background: transparent;
            color: var(--text-muted);
            font-size: 0.82rem;
            cursor: pointer;
            transition: all 0.2s;
        }
        .babb-arkiv .btn-vedligehold:hover, .babb-arkiv .btn-vedligehold.active {
            border-color: #a78bfa;
            color: #a78bfa;
            background: rgba(167,139,250,0.12);
        }

        /* ── LOADING / EMPTY / ERROR ─────────────────────────── */
        .babb-arkiv .loading, .babb-arkiv .no-results {
            text-align: center;
            padding: 4rem 2rem;
            color: var(--text-muted);
            font-size: 1.05rem;
        }
        .babb-arkiv .server-error {
            text-align: center;
            padding: 4rem 2rem;
            max-width: 520px;
            margin: 0 auto;
        }
        .babb-arkiv .server-error .error-icon { font-size: 3.5rem; margin-bottom: 1rem; }
        .babb-arkiv .server-error h2 { font-size: 1.5rem; color: var(--gold); margin-bottom: 0.75rem; }
        .babb-arkiv .server-error p { color: var(--text-muted); margin-bottom: 0.75rem; }
        .babb-arkiv .server-error code {
            display: block;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 6px;
            padding: 0.6rem 1rem;
            font-family: 'Courier New', monospace;
            font-size: 0.95rem;
            color: var(--gold-light);
            margin: 0.5rem auto 1rem;
            width: fit-content;
        }
        .babb-arkiv .server-error .error-detail {
            font-size: 0.8rem;
            color: var(--danger);
            opacity: 0.7;
        }

        /* ── LOADING SPINNER ─────────────────────────────────── */
        @keyframes spin { to { transform: rotate(360deg); } }
        .babb-arkiv .spinner {
            display: inline-block;
            width: 24px; height: 24px;
            border: 3px solid var(--border);
            border-top-color: var(--gold);
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
            vertical-align: middle;
            margin-right: 0.5rem;
        }

        /* ── TABLE VIEW ──────────────────────────────────────── */
        .babb-arkiv .view-toggle { display:flex; gap:.5rem; margin-bottom:.75rem; }
        .babb-arkiv .view-btn {
            padding:.35rem .85rem; border-radius:6px; border:1px solid var(--border);
            background:transparent; color:var(--text-muted); cursor:pointer; font-size:.85rem;
            transition:color .2s, border-color .2s, background .2s;
        }
        .babb-arkiv .view-btn.active { background:var(--gold-dim); border-color:var(--border-gold); color:var(--gold); }
        .babb-arkiv .pieces-table { width:100%; border-collapse:collapse; font-size:.88rem; }
        .babb-arkiv .pieces-table th {
            text-align:left; padding:.5rem .75rem; color:var(--text-muted);
            border-bottom:2px solid var(--border); white-space:nowrap;
        }
        .babb-arkiv .pieces-table td { padding:.5rem .75rem; border-bottom:1px solid var(--border); vertical-align:middle; }
        .babb-arkiv .pieces-table tr:hover td { background:var(--surface-hover); }
        .babb-arkiv .pieces-table .col-id { font-family:monospace; color:var(--gold); }
        .babb-arkiv .pieces-table .col-ok { color:var(--complete-text); }
        .babb-arkiv .pieces-table .col-warn { color:var(--incomplete-text); }
        .babb-arkiv .pieces-table .col-maint { color:#a78bfa; }
        .babb-arkiv .pieces-table .btn-sm {
            padding:.2rem .6rem; font-size:.8rem; border-radius:5px;
            border:1px solid var(--border); background:transparent; color:var(--text-muted); cursor:pointer;
        }
        .babb-arkiv .pieces-table .btn-sm:hover { color:var(--gold); border-color:var(--border-gold); }

        /* ── EDIT PANEL ──────────────────────────────────────────── */
        .babb-arkiv .edit-panel {
            margin-top: 1rem;
            padding: 1rem;
            background: var(--surface);
            border-radius: 8px;
            border: 1px solid var(--border);
        }
        .babb-arkiv .edit-panel-title {
            font-weight: 600;
            margin-bottom: 0.75rem;
            color: var(--text-muted);
            font-size: 0.85rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }
        .babb-arkiv .edit-panel label {
            display: flex;
            flex-direction: column;
            gap: 0.2rem;
            margin-bottom: 0.55rem;
            font-size: 0.78rem;
            color: var(--text-muted);
        }
        .babb-arkiv .edit-panel input {
            padding: 0.35rem 0.5rem;
            border: 1px solid var(--border);
            border-radius: 4px;
            background: var(--surface-card);
            color: var(--text);
            font-size: 0.92rem;
            font-family: inherit;
        }
        .babb-arkiv .edit-panel input:focus {
            outline: none;
            border-color: var(--border-gold);
        }
        .babb-arkiv .edit-footer {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            margin-top: 0.6rem;
        }
        .babb-arkiv .btn-save {
            padding: 0.4rem 1.1rem;
            background: var(--gold);
            color: #12122a;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 0.88rem;
            font-weight: 600;
        }
        .babb-arkiv .btn-save:hover { opacity: 0.85; }
        .babb-arkiv .edit-status { font-size: 0.85rem; }