/*! Card Throne batches.html page styles.
    Extracted from the template's inline <style> so it is cached with the
    immutable static policy instead of re-sent and re-parsed on every load. */
:root {
            --surface: #ffffff;
            --surface-hover: #f8fafc;
            --border: rgba(0, 0, 0, 0.08);
            --border-hover: rgba(0, 0, 0, 0.12);
            --text-primary: var(--throne-text-primary);
            --text-secondary: var(--throne-text-secondary);
            --text-muted: #94a3b8;
            --accent: var(--throne-sidebar-bg);
            --accent-gradient: linear-gradient(135deg, var(--throne-sidebar-bg) 0%, var(--throne-accent-blue) 100%);
            --radius: 16px;
            --radius-sm: 10px;
            --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
            --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
        }

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

        body {
            font-family: var(--throne-font);
            background: var(--throne-body-gradient);
            color: var(--text-primary);
            min-height: 100vh;
        }


        /* ─── Topbar ─────────────────────────────────── */
        .topbar {
            display: flex; align-items: center; justify-content: space-between;
            padding: 1rem 2rem; background: rgba(255, 255, 255, 0.8);
            backdrop-filter: blur(12px);
            border-bottom: 1px solid var(--border);
            position: sticky; top: 0; z-index: 100;
        }
        .topbar-left { display: flex; align-items: center; gap: 2rem; }
        .topbar-logo {
            font-size: 1.1rem; font-weight: 800; color: var(--accent);
            text-decoration: none; letter-spacing: -0.02em;
            display: flex; align-items: center; gap: 0.5rem;
        }
        .topbar-nav { display: flex; gap: 0.25rem; }
        .topbar-nav a {
            padding: 0.5rem 1rem; border-radius: 8px; font-size: 0.85rem; font-weight: 600;
            color: var(--text-secondary); text-decoration: none; transition: all 0.2s;
        }
        .topbar-nav a:hover { color: var(--accent); background: rgba(3, 83, 164, 0.05); }
        .topbar-nav a.active { color: #fff; background: var(--accent-gradient); box-shadow: 0 4px 12px rgba(3, 83, 164, 0.2); }


        /* ─── Buttons ────────────────────────────────── */
        .btn {
            padding: 0.6rem 1.25rem; border-radius: var(--radius-sm); font-size: 0.85rem;
            font-weight: 700; cursor: pointer; border: none; font-family: inherit;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            display: inline-flex; align-items: center; gap: 0.5rem;
            white-space: nowrap;
        }
        .btn svg { width: 16px; height: 16px; flex: 0 0 auto; stroke: currentColor; }
        .btn-primary { background: var(--accent-gradient); color: white; box-shadow: 0 4px 12px rgba(3, 83, 164, 0.2); }
        .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 15px rgba(3, 83, 164, 0.3); }
        .btn-green { background: #10b981; color: white; box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2); }
        .btn-green:hover { background: #059669; transform: translateY(-1px); }
        .btn-listed {
            background: #ecfdf5;
            color: #047857;
            border: 1px solid rgba(16, 185, 129, 0.26);
            box-shadow: var(--shadow-sm);
        }
        .btn-listed:hover { background: #d1fae5; transform: translateY(-1px); }
        .btn-stage {
            background: #eef6ff;
            color: var(--accent);
            border: 1px solid rgba(3, 83, 164, 0.16);
            box-shadow: var(--shadow-sm);
        }
        .btn-stage:hover { background: #dbeafe; transform: translateY(-1px); }
        .btn-danger { background: #ef4444; color: white; }
        .btn-icon-only {
            width: 40px;
            height: 38px;
            padding: 0;
            justify-content: center;
        }
        .btn-export-icon {
            border: 1px solid rgba(5, 150, 105, 0.22);
            border-radius: 999px;
            background: #10b981;
            color: #ffffff;
            box-shadow: 0 4px 10px rgba(16, 185, 129, 0.16);
        }
        .btn-export-icon:hover {
            background: #059669;
            border-color: rgba(5, 150, 105, 0.34);
            transform: translateY(-1px);
            box-shadow: 0 6px 14px rgba(16, 185, 129, 0.22);
        }
        .btn-danger-icon {
            border-radius: 999px;
            background: #fee2e2;
            color: #b91c1c;
            border: 1px solid rgba(239, 68, 68, 0.2);
        }
        .btn-danger-icon:hover { background: #ef4444; color: #ffffff; transform: translateY(-1px); }
        .btn-danger-icon.confirming { width: auto; min-width: 58px; padding: 0 12px; border-radius: 999px; }
        .btn-secondary {
            background: #ffffff; color: var(--text-secondary);
            border: 1px solid var(--border); box-shadow: var(--shadow-sm);
        }
        .btn-secondary:hover { background: var(--surface-hover); border-color: var(--border-hover); }
        .btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }


        /* ─── Main Layout ────────────────────────────── */
        .main { max-width: 1400px; margin: 0 auto; padding: 1.5rem 2rem 3rem; }


        .header-row {
            display: flex; flex-direction: column;
            margin-bottom: 24px;
            gap: 18px;
        }
        .header-primary {
            display: flex; justify-content: space-between; align-items: center;
            gap: 16px;
        }
        .header-row h2 { flex: 0 0 auto; white-space: nowrap; }
        .header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; min-width: 0; }
        .bulk-actions { display: none; align-items: center; gap: 10px; flex-wrap: wrap; }
        .selection-count { color: var(--text-secondary); font-size: 13px; font-weight: 700; min-width: 76px; }
        .btn-new-batch {
            min-height: 46px;
            padding: 0.78rem 1.45rem;
            border-radius: 12px;
            font-size: 0.92rem;
            box-shadow: 0 10px 22px rgba(3, 83, 164, 0.26);
        }
        .btn-new-batch svg { width: 18px; height: 18px; }
        .btn-new-batch:hover { box-shadow: 0 12px 26px rgba(3, 83, 164, 0.34); }
        .batch-status-tabs {
            display: inline-flex;
            align-items: center;
            padding: 4px;
            background: #ffffff;
            border: 1px solid var(--border);
            border-radius: 999px;
            box-shadow: var(--shadow-sm);
        }
        .batch-status-tab {
            border: 0;
            background: transparent;
            color: var(--text-secondary);
            font-family: inherit;
            font-size: 0.82rem;
            font-weight: 800;
            cursor: pointer;
            padding: 0.48rem 0.95rem;
            border-radius: 999px;
            transition: all 0.2s;
        }
        .batch-status-tab.active {
            color: #ffffff;
            background: var(--accent-gradient);
            box-shadow: 0 4px 12px rgba(3, 83, 164, 0.18);
        }
        h2 { font-size: 1.5rem; font-weight: 800; color: var(--text-primary); }


        /* ─── Batches Table ──────────────────────────── */
        .batch-grid {
            display: flex; flex-direction: column; gap: 12px;
        }
        .batch-pagination {
            display: flex; align-items: center; justify-content: space-between; gap: 12px;
            margin: 12px 0; color: var(--text-secondary); font-size: 13px; font-weight: 700;
        }
        .batch-pagination[hidden] { display: none !important; }
        .batch-page-controls {
            display: inline-flex; align-items: center; gap: 8px;
        }
        .batch-page-current {
            color: var(--text-primary); padding: 0 4px; white-space: nowrap;
        }
        .batch-page-btn {
            height: 36px; padding: 0 12px; border: 1px solid var(--border);
            border-radius: 10px; background: var(--bg-input); color: var(--text-primary);
            font-family: inherit; font-weight: 800; cursor: pointer;
        }
        .batch-page-btn:hover:not(:disabled) {
            border-color: var(--accent); background: #ffffff; color: var(--accent);
        }
        .batch-page-btn:disabled {
            opacity: 0.46; cursor: not-allowed;
        }
        .batch-card {
            background: #ffffff; border: 1px solid var(--border);
            border-radius: var(--radius); padding: 1.1rem 1.25rem;
            display: flex; justify-content: space-between; align-items: center; gap: 18px;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: var(--shadow-sm);
        }
        .batch-card.status-listed {
            border-color: rgba(16, 185, 129, 0.3);
            background: linear-gradient(90deg, rgba(16, 185, 129, 0.08) 0, #ffffff 72px);
        }
        .batch-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }
        .batch-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(3, 83, 164, 0.18), var(--shadow-md); }
        .batch-select-cell { display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
        .batch-checkbox {
            width: 20px; height: 20px; cursor: pointer; accent-color: var(--accent);
        }
        .batch-main { display: flex; align-items: center; gap: 16px; flex: 1; min-width: 0; }
        .batch-preview {
            width: 74px; height: 98px; flex: 0 0 74px;
            border-radius: 10px; overflow: hidden;
            background: #f1f5f9; border: 1px solid var(--border);
            display: flex; align-items: center; justify-content: center;
            box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
        }
        .batch-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
        .batch-preview-placeholder {
            font-size: 11px; line-height: 1.2; text-align: center;
            color: var(--text-muted); font-weight: 800; padding: 8px;
            text-transform: uppercase; letter-spacing: 0.04em;
        }
        .batch-info { flex: 1; min-width: 0; }
        .batch-name { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.75rem; color: var(--text-primary); }
        .batch-name input {
            background: #f8fafc; border: 1px solid var(--border); color: var(--text-primary);
            padding: 0.4rem 0.75rem; border-radius: 8px; font-size: 1.1rem; font-weight: 700;
            width: 300px; font-family: inherit; display: none;
        }

        .batch-name input:focus { outline: none; border-color: var(--accent); }
        .btn-rename { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 14px; }
        .btn-rename svg { width: 15px; height: 15px; stroke: currentColor; }
        .btn-rename:hover { color: var(--text-primary); }
        .batch-meta { font-size: 13px; color: var(--text-secondary); display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
        .batch-meta span { display: inline-flex; align-items: center; gap: 4px; }
        .batch-meta-icon { width: 14px; height: 14px; stroke: currentColor; color: #64748b; flex: 0 0 auto; }
        .batch-actions { display: flex; flex-direction: row; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; min-width: 0; max-width: 620px; }
        .batch-actions .btn { justify-content: center; }

        .game-tag {
            font-size: 11px; padding: 2px 6px; border-radius: 4px; font-weight: 600;
            background: var(--bg-secondary); border: 1px solid var(--border);
        }
        .batch-sku-tag {
            font-size: 11px; padding: 2px 7px; border-radius: 999px; font-weight: 800;
            color: #334155; background: #f8fafc; border: 1px solid var(--border);
            max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
        }
        .batch-lot-tag {
            font-size: 11px; padding: 2px 7px; border-radius: 999px; font-weight: 900;
            color: #7c2d12; background: #fff7ed; border: 1px solid rgba(234, 88, 12, 0.22);
            text-transform: uppercase; letter-spacing: 0.04em;
        }
        .batch-variation-tag {
            font-size: 11px; padding: 2px 7px; border-radius: 999px; font-weight: 900;
            color: #075985; background: #e0f2fe; border: 1px solid rgba(14, 165, 233, 0.24);
            text-transform: uppercase; letter-spacing: 0.04em;
        }
        .batch-inventory-tag {
            font-size: 11px; padding: 2px 7px; border-radius: 999px; font-weight: 900;
            color: #6d28d9; background: #f5f3ff; border: 1px solid rgba(124, 58, 237, 0.22);
            text-transform: uppercase; letter-spacing: 0.04em;
        }
        .status-pill {
            font-size: 11px; padding: 2px 7px; border-radius: 999px; font-weight: 800;
            text-transform: uppercase; letter-spacing: 0.04em;
        }
        .status-pill.staged { color: var(--accent); background: #eef6ff; border: 1px solid rgba(3, 83, 164, 0.14); }
        .status-pill.listed { color: #047857; background: #ecfdf5; border: 1px solid rgba(16, 185, 129, 0.22); }

        .empty-state {
            border: 2px dashed var(--border); border-radius: var(--radius);
            padding: 60px 24px; text-align: center; background: var(--bg-secondary);
        }
        .empty-state-icon { margin: 0 auto 12px; width: 48px; height: 48px; opacity: 0.55; color: var(--text-muted); }
        .empty-state-icon svg { width: 100%; height: 100%; stroke: currentColor; }
        .empty-state h3 { font-size: 16px; margin-bottom: 6px; }
        .empty-state p { color: var(--text-secondary); font-size: 13px; margin-bottom: 20px; }

        @media (max-width: 900px) {
            .header-primary { align-items: flex-start; flex-direction: column; }
            .header-actions { justify-content: flex-start; width: 100%; }
            .batch-card { align-items: flex-start; flex-wrap: wrap; }
            .batch-main { align-items: flex-start; }
            .batch-actions { width: 100%; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; }
        }

        @media (max-width: 620px) {
            .main { padding: 1.25rem 1rem 2rem; }
            .header-actions { flex-direction: column; align-items: stretch; }
            .batch-status-tabs { align-self: flex-start; }
            .bulk-actions { width: 100%; align-items: stretch; }
            .bulk-actions .btn { flex: 1 1 128px; justify-content: center; }
            .selection-count { min-width: auto; align-self: center; }
            .header-primary .btn-new-batch { width: 100%; justify-content: center; }
            .batch-pagination { align-items: flex-start; flex-direction: column; }
            .batch-card { padding: 1rem; }
            .batch-main { flex-direction: column; gap: 12px; }
            .batch-preview { width: 92px; height: 122px; }
            .batch-name { align-items: flex-start; flex-wrap: wrap; }
            .batch-name input { width: 100%; }
            .batch-actions .btn:not(.btn-icon-only) { flex: 1 1 150px; }
        }

        /* Option 1: compact operational ledger. */
        .batches-page {
            --batch-surface: var(--throne-surface);
            --batch-surface-muted: var(--throne-surface-muted);
            --batch-surface-hover: var(--throne-surface-hover);
            --batch-border: var(--throne-border);
            --batch-text: var(--throne-text-primary);
            --batch-muted: var(--throne-text-secondary);
            --batch-soft: var(--throne-text-muted);
            --batch-accent: var(--tr-blue-700);
            --batch-accent-soft: var(--throne-status-info-bg);
            --batch-success: var(--throne-status-success-text);
            --batch-success-soft: var(--throne-status-success-bg);
            --batch-danger: var(--throne-status-danger-text);
            --batch-danger-soft: var(--throne-status-danger-bg);
            max-width: 1680px;
            padding: 26px clamp(18px, 2.6vw, 42px) 44px;
        }

        .batches-page .header-row {
            gap: 12px;
            margin-bottom: 16px;
        }

        .batches-page .header-primary {
            min-height: 52px;
        }

        .batch-title-block {
            min-width: 0;
        }

        .batches-page .header-row h2 {
            color: var(--batch-text);
            font-size: clamp(1.55rem, 2vw, 1.85rem);
            letter-spacing: -0.025em;
            line-height: 1.05;
        }

        .batch-header-summary {
            color: var(--batch-muted);
            font-size: 0.82rem;
            font-weight: 700;
            margin-top: 6px;
        }

        .batches-page .btn {
            border-radius: var(--tr-radius-md);
            box-shadow: none;
            min-height: 38px;
            padding: 0.55rem 0.9rem;
            transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
        }

        .batches-page .btn:focus-visible,
        .batch-status-tab:focus-visible,
        .batch-checkbox:focus-visible,
        .btn-rename:focus-visible,
        .batch-page-btn:focus-visible {
            box-shadow: 0 0 0 3px var(--throne-focus-ring);
            outline: none;
        }

        .batches-page .btn-primary,
        .batches-page .btn-open-batch {
            background: var(--batch-accent);
            border: 1px solid var(--batch-accent);
            color: #ffffff;
        }

        .batches-page .btn-primary:hover,
        .batches-page .btn-open-batch:hover {
            background: var(--tr-blue-800);
            border-color: var(--tr-blue-800);
            box-shadow: none;
            transform: translateY(-1px);
        }

        html[data-throne-theme="dark"] .batches-page .btn-primary,
        html[data-throne-theme="dark"] .batches-page .btn-open-batch {
            color: #07111f;
        }

        .batches-page .btn-new-batch {
            border-radius: var(--tr-radius-md);
            box-shadow: 0 8px 18px rgba(3, 83, 164, 0.16);
            min-height: 44px;
            padding: 0.7rem 1.15rem;
        }

        .batches-page .btn-new-batch:hover {
            box-shadow: 0 10px 20px rgba(3, 83, 164, 0.2);
        }

        .batches-page .header-actions {
            align-items: stretch;
            display: flex;
            flex-direction: column;
            gap: 10px;
            justify-content: flex-start;
            width: 100%;
        }

        .batches-page .batch-status-tabs {
            align-items: stretch;
            align-self: stretch;
            background: var(--batch-surface);
            border-bottom: 1px solid var(--batch-border);
            border-top: 1px solid var(--batch-border);
            border-radius: 0;
            box-shadow: none;
            gap: 18px;
            padding: 0;
        }

        .batches-page .batch-status-tab {
            align-items: center;
            border-bottom: 2px solid transparent;
            border-radius: 0;
            color: var(--batch-muted);
            display: inline-flex;
            font-size: 0.88rem;
            gap: 8px;
            margin-bottom: 0;
            min-height: 46px;
            padding: 0 10px;
        }

        .batches-page .batch-status-tab:hover {
            color: var(--batch-text);
        }

        .batches-page .batch-status-tab.active {
            background: transparent;
            border-bottom-color: var(--batch-accent);
            box-shadow: none;
            color: var(--batch-accent);
        }

        .batches-page .bulk-actions {
            align-items: center;
            background: var(--batch-surface);
            border: 1px solid var(--batch-border);
            border-radius: var(--tr-radius-md);
            display: none;
            gap: 8px;
            min-height: 54px;
            padding: 7px 9px;
            width: 100%;
        }

        .batches-page .selection-count {
            color: var(--batch-muted);
            font-size: 0.8rem;
            font-weight: 750;
            min-width: 84px;
        }

        .batches-page #bulkExportBtn {
            margin-left: auto;
        }

        .batches-page .btn-secondary,
        .batches-page .btn-listed,
        .batches-page .btn-stage,
        .batches-page .btn-export {
            background: var(--batch-surface);
            border: 1px solid var(--batch-border);
            color: var(--batch-text);
        }

        .batches-page .btn-secondary:hover,
        .batches-page .btn-export:hover {
            background: var(--batch-surface-hover);
            border-color: var(--batch-accent);
            color: var(--batch-accent);
            transform: none;
        }

        .batches-page .btn-listed {
            border-color: color-mix(in srgb, var(--batch-success) 38%, transparent);
            color: var(--batch-success);
        }

        .batches-page .btn-listed:hover {
            background: var(--batch-success-soft);
            transform: none;
        }

        .batches-page .btn-stage {
            border-color: color-mix(in srgb, var(--batch-accent) 32%, transparent);
            color: var(--batch-accent);
        }

        .batches-page .btn-stage:hover {
            background: var(--batch-accent-soft);
            transform: none;
        }

        .batches-page .btn-danger {
            background: var(--batch-surface);
            border: 1px solid color-mix(in srgb, var(--batch-danger) 48%, transparent);
            color: var(--batch-danger);
        }

        .batches-page .btn-danger:hover {
            background: var(--batch-danger-soft);
        }

        .batches-page .btn:disabled {
            background: var(--batch-surface-muted);
            border-color: var(--batch-border);
            color: var(--batch-soft);
            opacity: 0.62;
        }

        .batch-ledger {
            background: var(--batch-surface);
            border: 1px solid var(--batch-border);
            border-radius: var(--tr-radius-md);
            overflow: hidden;
        }

        .batch-ledger-head,
        .batch-card {
            display: grid;
            gap: 14px;
            grid-template-columns: 30px minmax(300px, 2.35fr) minmax(330px, 1.65fr) minmax(325px, 1.5fr);
        }

        .batch-ledger-head {
            align-items: center;
            background: var(--batch-surface-muted);
            border-bottom: 1px solid var(--batch-border);
            color: var(--batch-muted);
            font-size: 0.72rem;
            font-weight: 850;
            letter-spacing: 0.055em;
            min-height: 48px;
            padding: 0 18px;
            text-transform: uppercase;
        }

        .batch-ledger-stat-heads,
        .batch-stats {
            display: grid;
            gap: 12px;
            grid-template-columns: minmax(132px, 1.15fr) minmax(92px, 0.8fr) minmax(96px, 0.85fr);
        }

        .batch-grid {
            display: flex;
            flex-direction: column;
            gap: 0;
        }

        .batch-card {
            align-items: center;
            background: var(--batch-surface);
            border: 0;
            border-bottom: 1px solid var(--batch-border);
            border-radius: 0;
            box-shadow: none;
            min-height: 108px;
            padding: 10px 18px;
            transition: background 0.18s ease, box-shadow 0.18s ease;
        }

        .batch-card:last-child {
            border-bottom: 0;
        }

        .batch-card:hover {
            background: var(--batch-surface-hover);
            border-color: var(--batch-border);
            box-shadow: inset 3px 0 0 var(--batch-accent);
        }

        .batch-card.selected {
            background: var(--batch-accent-soft);
            border-color: var(--batch-border);
            box-shadow: inset 3px 0 0 var(--batch-accent);
        }

        .batch-card.status-listed {
            background: var(--batch-surface);
            border-color: var(--batch-border);
        }

        .batch-card.status-listed:hover {
            background: var(--batch-surface-hover);
            box-shadow: inset 3px 0 0 var(--batch-success);
        }

        .batch-card.status-listed.selected {
            background: var(--batch-success-soft);
            box-shadow: inset 3px 0 0 var(--batch-success);
        }

        .batch-checkbox {
            accent-color: var(--batch-accent);
            height: 18px;
            width: 18px;
        }

        .batch-main {
            align-items: center;
            display: flex;
            gap: 14px;
            min-width: 0;
        }

        .batch-preview {
            background: var(--batch-surface-muted);
            border: 1px solid var(--batch-border);
            border-radius: var(--tr-radius-sm);
            box-shadow: none;
            flex: 0 0 58px;
            height: 80px;
            width: 58px;
        }

        .batch-name {
            color: var(--batch-text);
            font-size: 0.98rem;
            font-weight: 800;
            gap: 7px;
            line-height: 1.2;
            margin-bottom: 7px;
        }

        .batch-name input {
            background: var(--throne-input-bg);
            border-color: var(--batch-border);
            color: var(--batch-text);
            font-size: 0.98rem;
        }

        .btn-rename {
            align-items: center;
            border-radius: 5px;
            color: var(--batch-soft);
            display: inline-flex;
            justify-content: center;
            min-height: 28px;
            min-width: 28px;
        }

        .btn-rename:hover {
            background: var(--batch-surface-hover);
            color: var(--batch-accent);
        }

        .batch-meta {
            color: var(--batch-muted);
            font-size: 0.72rem;
            gap: 6px;
        }

        .game-tag,
        .batch-sku-tag,
        .batch-lot-tag,
        .batch-variation-tag,
        .batch-inventory-tag,
        .status-pill {
            background: var(--batch-surface-muted);
            border: 1px solid var(--batch-border);
            border-radius: 999px;
            color: var(--batch-muted);
            font-size: 0.67rem;
            font-weight: 800;
            min-height: 23px;
            padding: 3px 8px;
        }

        .status-pill.staged {
            background: var(--batch-accent-soft);
            border-color: color-mix(in srgb, var(--batch-accent) 24%, transparent);
            color: var(--batch-accent);
        }

        .status-pill.listed {
            background: var(--batch-success-soft);
            border-color: color-mix(in srgb, var(--batch-success) 26%, transparent);
            color: var(--batch-success);
        }

        .batch-stat {
            color: var(--batch-text);
            font-size: 0.82rem;
            font-weight: 720;
            line-height: 1.35;
            min-width: 0;
        }

        .batch-stat-label {
            color: var(--batch-soft);
            display: none;
            font-size: 0.65rem;
            font-weight: 850;
            letter-spacing: 0.05em;
            text-transform: uppercase;
        }

        .batch-actions {
            align-items: center;
            display: flex;
            flex-wrap: nowrap;
            gap: 7px;
            justify-content: flex-end;
            max-width: none;
            min-width: 0;
        }

        .batch-actions .btn {
            font-size: 0.75rem;
            justify-content: center;
            min-height: 36px;
            padding: 0.48rem 0.72rem;
        }

        .batch-actions .btn-open-batch {
            min-width: 96px;
        }

        .batch-actions .btn-export {
            min-width: 84px;
        }

        .batch-actions .btn-icon-only {
            border-radius: var(--tr-radius-md);
            height: 36px;
            min-height: 36px;
            width: 38px;
        }

        .batch-actions .btn-danger-icon {
            background: var(--batch-surface);
            border: 1px solid color-mix(in srgb, var(--batch-danger) 46%, transparent);
            box-shadow: none;
            color: var(--batch-danger);
        }

        .batch-actions .btn-danger-icon:hover {
            background: var(--batch-danger-soft);
            color: var(--batch-danger);
            transform: none;
        }

        .batch-actions .btn-danger-icon.confirming,
        .batch-actions .btn-danger-icon.confirming:hover {
            background: var(--batch-danger);
            border-color: var(--batch-danger);
            box-shadow: 0 0 0 3px color-mix(in srgb, var(--batch-danger) 16%, transparent);
            color: #ffffff;
            font-size: 0.76rem;
            font-weight: 850;
            min-width: 74px;
            padding: 0 12px;
            width: auto;
        }

        .batch-pagination {
            color: var(--batch-muted);
            margin: 10px 0;
        }

        .batch-page-btn {
            background: var(--batch-surface);
            border-color: var(--batch-border);
            color: var(--batch-text);
        }

        .batch-page-btn:hover:not(:disabled) {
            background: var(--batch-surface-hover);
            color: var(--batch-accent);
        }

        .batches-page .empty-state {
            background: var(--batch-surface);
            border: 1px dashed var(--batch-border);
            color: var(--batch-text);
        }

        .batch-export-dialog-overlay {
            align-items: center;
            background: rgba(15, 23, 42, 0.56);
            backdrop-filter: blur(5px);
            display: none;
            inset: 0;
            justify-content: center;
            padding: 20px;
            position: fixed;
            z-index: 10050;
        }

        .batch-export-dialog-overlay.is-open { display: flex; }

        .batch-export-dialog {
            background: var(--batch-surface);
            border: 1px solid var(--batch-border);
            border-radius: 14px;
            box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
            color: var(--batch-text);
            max-width: min(560px, calc(100vw - 32px));
            overflow: hidden;
            width: 100%;
        }

        .batch-export-dialog-header {
            align-items: flex-start;
            border-bottom: 1px solid var(--batch-border);
            display: flex;
            gap: 16px;
            justify-content: space-between;
            padding: 20px 22px 17px;
        }

        .batch-export-dialog-title {
            color: var(--batch-text);
            font-size: 1.08rem;
            font-weight: 850;
            margin: 0 0 5px;
        }

        .batch-export-dialog-copy {
            color: var(--batch-muted);
            font-size: 0.86rem;
            font-weight: 600;
            line-height: 1.45;
            margin: 0;
        }

        .batch-export-dialog-close {
            align-items: center;
            background: var(--batch-surface-muted);
            border: 1px solid var(--batch-border);
            border-radius: 8px;
            color: var(--batch-muted);
            cursor: pointer;
            display: inline-flex;
            flex: 0 0 auto;
            font: inherit;
            font-size: 1.15rem;
            height: 34px;
            justify-content: center;
            width: 34px;
        }

        .batch-export-options {
            display: grid;
            gap: 10px;
            padding: 18px 22px;
        }

        .batch-export-option {
            align-items: center;
            background: var(--batch-surface);
            border: 1px solid var(--batch-border);
            border-radius: 10px;
            color: var(--batch-text);
            cursor: pointer;
            display: grid;
            font: inherit;
            gap: 3px 14px;
            grid-template-columns: 42px minmax(0, 1fr) auto;
            padding: 13px 14px;
            text-align: left;
            transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
            width: 100%;
        }

        .batch-export-option:hover {
            background: var(--batch-surface-hover);
            border-color: var(--batch-accent);
            transform: translateY(-1px);
        }

        .batch-export-option-icon {
            align-items: center;
            background: var(--batch-accent-soft);
            border-radius: 9px;
            color: var(--batch-accent);
            display: inline-flex;
            font-size: 0.72rem;
            font-weight: 900;
            grid-row: 1 / 3;
            height: 42px;
            justify-content: center;
            letter-spacing: 0.02em;
            width: 42px;
        }

        .batch-export-option-title { font-size: 0.9rem; font-weight: 850; }
        .batch-export-option-copy { color: var(--batch-muted); font-size: 0.78rem; font-weight: 600; }
        .batch-export-option-arrow { color: var(--batch-muted); font-size: 1.2rem; grid-column: 3; grid-row: 1 / 3; }

        .batch-export-dialog-footer {
            align-items: center;
            background: var(--batch-surface-muted);
            border-top: 1px solid var(--batch-border);
            display: flex;
            justify-content: flex-end;
            padding: 13px 22px;
        }

        body.batch-export-dialog-open { overflow: hidden; }

        @media (max-width: 1180px) {
            .batch-ledger-head {
                display: none;
            }

            .batch-card {
                gap: 10px 12px;
                grid-template-columns: 28px minmax(0, 1fr);
                min-height: 0;
                padding: 14px 16px;
            }

            .batch-select-cell {
                grid-row: 1 / span 3;
                align-self: start;
                padding-top: 8px;
            }

            .batch-main,
            .batch-stats,
            .batch-actions {
                grid-column: 2;
            }

            .batch-stats {
                background: var(--batch-surface-muted);
                border-radius: var(--tr-radius-sm);
                padding: 8px 10px;
            }

            .batch-stat-label {
                display: block;
                margin-bottom: 2px;
            }

            .batch-actions {
                justify-content: flex-start;
            }
        }

        @media (max-width: 760px) {
            .batches-page {
                padding: 20px 14px 34px;
            }

            .batches-page .header-primary {
                align-items: stretch;
                flex-direction: column;
            }

            .batches-page .btn-new-batch {
                justify-content: center;
                width: 100%;
            }

            .batches-page .bulk-actions {
                align-items: center;
                flex-direction: row;
                overflow-x: auto;
                padding-bottom: 8px;
            }

            .batches-page #bulkExportBtn {
                margin-left: 0;
            }

            .batches-page .selection-count {
                align-self: center;
                flex: 0 0 auto;
            }

            .batch-stats {
                grid-template-columns: 1fr;
            }

            .batch-main {
                flex-direction: row;
            }

            .batch-actions {
                flex-wrap: wrap;
            }

            .batch-actions .btn:not(.btn-icon-only) {
                flex: 1 1 118px;
            }
        }

        @media (max-width: 520px) {
            .batch-card {
                padding: 12px;
            }

            .batch-main {
                align-items: flex-start;
            }

            .batch-preview {
                flex-basis: 52px;
                height: 72px;
                width: 52px;
            }

            .batch-name {
                align-items: flex-start;
                flex-wrap: wrap;
                font-size: 0.9rem;
            }

            .batch-meta {
                gap: 5px;
            }
        }
