/* Labels CRM Styles */

:root {
    /* Backgrounds */
    --bg-primary: #1a1a2e;
    --bg-darker: #0f0f1a;
    --bg-hover: #252542;
    --bg-card: #16162a;

    /* Borders */
    --border-color: #2a2a4e;
    --border-hover: #3a3a5e;
    --border-light: #3d3d6b;

    /* Text */
    --text-primary: #f0f0f0;
    --text-secondary: #e0e0e0;
    --text-muted: #a0a0a0;
    --text-dim: #8a8a8a;
    --text-soft: #a0a0b8;

    /* Accent */
    --accent-primary: #6366f1;
    --accent-hover: #818cf8;
    --accent-secondary: #a78bfa;
    --accent-purple: #8b5cf6;

    /* Status colors */
    --color-success: #10b981;
    --color-success-dark: #059669;
    --color-success-bg: #064e3b;
    --color-success-light: #34d399;
    --color-error: #ef4444;
    --color-error-dark: #dc2626;
    --color-error-bg: #4a1d1d;
    --color-error-light: #f87171;
    --color-warning: #f59e0b;
    --color-warning-bg: #78350f;
    --color-warning-light: #fbbf24;
    --color-info: #3b82f6;
    --color-info-bg: #1e3a5f;
    --color-info-light: #60a5fa;
    --color-teal: #5eead4;
    --color-teal-bg: #1f3f3f;
    --color-purple-bg: #3b1f5f;

    /* Fonts */
    --font-mono: 'JetBrains Mono', monospace;
}

.labels-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: var(--bg-primary);
    border-radius: 8px;
}

.labels-stats .stat {
    color: var(--text-muted);
    font-size: 14px;
}

.labels-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.search-box input {
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-darker);
    color: var(--text-primary);
    width: 250px;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Filter dropdown */
.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-darker);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
}
.filter-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Table */
.labels-table-container {
    overflow-x: auto;
}

.labels-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-primary);
    border-radius: 8px;
    overflow: hidden;
}

.labels-table th {
    text-align: left;
    padding: 12px 15px;
    background: var(--bg-darker);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Sortable columns */
.labels-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s, color 0.2s;
}

.labels-table th.sortable:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.labels-table th.sortable .sort-icon {
    margin-left: 4px;
    font-size: 10px;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.labels-table th.sortable .sort-icon.active {
    opacity: 1;
    color: var(--accent-primary);
}

.labels-table th.sortable:hover .sort-icon {
    opacity: 0.8;
}

.labels-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 14px;
}

.labels-table tr:hover {
    background: var(--bg-hover);
}

.labels-table .label-name strong {
    color: var(--text-primary);
}
.label-name-link {
    text-decoration: none;
    color: inherit;
}
.label-name-link:hover strong {
    color: #8b5cf6;
}

.discogs-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 6px;
    background: #4a4a6a;
    color: var(--text-primary);
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
}

/* KURTEZY brand badge — rules/81 SSOT: brand-config.js
   Gold (#c4956a) matches EMAIL_STYLE.ACCENT and Kurtezy brand palette. */
.kurtezy-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 6px;
    background: rgba(196, 149, 106, 0.18);
    color: #c4956a;
    border: 1px solid rgba(196, 149, 106, 0.45);
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* Contract sent, signature pending — the account exists (2026-09-04) */
.pending-contract-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 6px;
    background: rgba(234, 179, 8, 0.14);
    color: #eab308;
    border: 1px solid rgba(234, 179, 8, 0.4);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* Account status button */
.btn-account-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    margin-right: 6px;
    background: var(--accent-primary);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    vertical-align: middle;
}

.btn-account-status svg {
    color: white;
}

.btn-account-status:hover {
    background: var(--accent-hover);
    transform: scale(1.1);
}

/* Account status popup */
.account-status-popup {
    position: fixed;
    z-index: 1000;
    min-width: 280px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.account-status-popup .popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.account-status-popup .popup-header h4 {
    margin: 0;
    font-size: 14px;
    color: var(--text-primary);
}

.account-status-popup .popup-body {
    padding: 12px 16px;
}

.account-status-popup .stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
}

.account-status-popup .stat-label {
    color: var(--text-muted);
    font-size: 12px;
}

.account-status-popup .stat-value {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
}

.account-status-popup .stat-value.positive {
    color: var(--color-success-light);
}

.account-status-popup .stat-value.negative {
    color: var(--color-error-light);
}

.account-status-popup .popup-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

/* Deal badges */
.deal-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

.deal-badge.distribution {
    background: var(--color-info-bg);
    color: var(--color-info-light);
}

.deal-badge.pnd,
.deal-badge.p_and_d {
    background: var(--color-purple-bg);
    color: var(--accent-secondary);
}

.deal-badge.semi_pnd,
.deal-badge.semi_p_and_d {
    background: var(--color-teal-bg);
    color: var(--color-teal);
}

.deal-badge.licensing {
    background: var(--color-warning-bg);
    color: var(--color-warning-light);
}

.deal-badge.exclusive {
    background: var(--color-success-bg);
    color: var(--color-success-light);
}

.deal-badge.consignment {
    background: #3f1f2f;
    color: #f472b6;
}

/* Status badges */
.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.status-badge.active {
    background: var(--color-success-bg);
    color: var(--color-success-light);
}

.status-badge.inactive {
    background: var(--color-error-bg);
    color: var(--color-error-light);
}

.status-badge.deleted {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Restore button styling */
.btn-icon.restore-label {
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.3);
}

.btn-icon.restore-label:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
}

/* Danger button styling */
.btn-danger,
.btn.btn-danger {
    background: #ef4444;
    color: #fff;
    border: 1px solid #dc2626;
}

.btn-danger:hover,
.btn.btn-danger:hover {
    background: #dc2626;
    border-color: #b91c1c;
}

/* Language badges */
.langue-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    background: var(--border-color);
    color: var(--text-secondary);
}

.langue-badge.English { background: #1e3a5f; color: #60a5fa; }
.langue-badge.French { background: #3b1f5f; color: #a78bfa; }
.langue-badge.German { background: #3f2f1f; color: #fbbf24; }
.langue-badge.Spanish { background: #4a1d1d; color: #f87171; }
.langue-badge.Italian { background: #1f3f2f; color: #34d399; }
.langue-badge.Japanese { background: #3f1f3f; color: #f472b6; }

/* Assignee badges */
.assignee-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    background: var(--border-color);
    color: var(--text-secondary);
}

.assignee-badge.Ben { background: #1e3a5f; color: #60a5fa; }
.assignee-badge.Seb { background: #1f3f2f; color: #34d399; }
.assignee-badge.Leo { background: #3b1f5f; color: #a78bfa; }
.assignee-badge.Nizar { background: #3f2f1f; color: #fbbf24; }
.assignee-badge.Didier { background: #2f1f3f; color: #f472b6; }
.assignee-badge.Luo { background: #1f2f3f; color: #22d3ee; }

/* WP Status badges */
.wp-status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    white-space: nowrap;
}

.wp-status-badge.not_started { background: var(--border-color); color: var(--text-muted); }
.wp-status-badge.in_progress { background: var(--color-info-bg); color: var(--color-info-light); }
.wp-status-badge.pending_review { background: var(--color-warning-bg); color: var(--color-warning-light); }
.wp-status-badge.live { background: var(--color-success-bg); color: var(--color-success-light); }
.wp-status-badge.needs_update { background: var(--color-error-bg); color: var(--color-error-light); }

/* Due date styling */
.cell-value.due-overdue {
    color: var(--color-error-light);
    font-weight: 600;
}

.cell-value.due-soon {
    color: var(--color-warning-light);
    font-weight: 500;
}

/* Date input inline */
.inline-date {
    width: 140px;
}

/* Action buttons */
.actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    padding: 6px;
    background: transparent;
    border: 1px solid var(--border-hover);
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--border-color);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.btn-icon:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    padding: 15px;
}

.btn-page {
    padding: 8px 16px;
    background: var(--border-color);
    border: none;
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s;
}

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

.btn-page:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-page:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.page-info {
    color: var(--text-muted);
    font-size: 14px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: var(--bg-primary);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-close:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.modal-footer .footer-left,
.modal-footer .footer-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

.modal-footer .footer-left a.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.modal-footer .footer-left a.btn svg {
    flex-shrink: 0;
}

/* Form */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: 13px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Aliases */
.aliases-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.alias-tag {
    padding: 4px 10px;
    background: var(--border-color);
    border-radius: 4px;
    font-size: 12px;
    color: #c4c4d8;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--accent-primary);
    color: var(--text-primary);
}

.btn-primary:hover {
    background: #5558e3;
}

.btn:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

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

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

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.3s;
    z-index: 1001;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification.success {
    background: var(--color-success-dark);
}

.notification.error {
    background: var(--color-error-dark);
}

.notification.info {
    background: var(--accent-primary);
}

/* Balance column styles */
.balance-cell {
    font-family: var(--font-mono, monospace);
    font-size: 0.85rem;
    white-space: nowrap;
}

.balance-zero {
    color: var(--text-dim);
}

.balance-positive {
    color: var(--color-success);
    font-weight: 500;
}

.balance-negative {
    color: var(--color-error);
    font-weight: 500;
}

/* Checkbox column */
.th-checkbox {
    width: 40px;
    text-align: center;
}

.cell-checkbox {
    width: 40px;
    text-align: center;
}

.label-checkbox {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

/* Editable cells */
.editable {
    cursor: pointer;
    position: relative;
}

.editable:hover {
    background: rgba(139, 92, 246, 0.1);
}

.editable.editing {
    padding: 0;
}

.inline-input, .inline-select {
    width: 100%;
    padding: 8px;
    border: 2px solid var(--accent-purple);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: inherit;
    outline: none;
}

.inline-input:focus, .inline-select:focus {
    border-color: var(--accent-secondary);
}

/* Bulk actions bar */
.bulk-actions-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 8px;
    margin-bottom: 16px;
}

.selected-count {
    font-weight: 600;
    color: var(--accent-secondary);
}

.bulk-actions-bar select {
    padding: 6px 12px;
    border: 1px solid var(--border-color, #2a2a2a);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.85rem;
}

.bulk-actions-bar select:disabled {
    opacity: 0.5;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border-hover, #3a3a3a);
    color: var(--text-secondary, #a0a0a0);
}

.btn-ghost:hover {
    border-color: var(--text-muted, #8a8a8a);
    color: var(--text-primary);
}

/* ============================================
   STATEMENT DETAIL VIEW
   ============================================ */

.modal-wide {
    max-width: 900px;
}

/* Summary cards */
.statement-summary {
    margin-bottom: 24px;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.summary-card {
    background: var(--bg-darker);
    padding: 16px;
    border-radius: 8px;
    text-align: center;
}

.card-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.card-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-value.balance-positive { color: var(--color-success); }
.card-value.balance-negative { color: var(--color-error); }
.card-value.balance-zero { color: var(--text-dim); }

.card-value.status-match { color: var(--color-success); }
.card-value.status-special_case { color: var(--color-warning); }
.card-value.status-needs_review { color: var(--color-error); }
.card-value.status-pending { color: var(--text-muted); }

.statement-notes {
    background: var(--bg-hover);
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-soft);
}

/* Breakdown section */
.breakdown-section {
    margin-bottom: 24px;
}

.breakdown-section h3 {
    font-size: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 12px;
}

.breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-darker);
    border-radius: 6px;
    border-left: 3px solid var(--border-hover);
}

.breakdown-item.positive {
    border-left-color: var(--color-success);
}

.breakdown-item.negative {
    border-left-color: var(--color-error);
}

.type-name {
    font-weight: 500;
    color: var(--text-secondary);
}

.type-count {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 8px;
}

.type-total {
    font-family: monospace;
    font-weight: 600;
}

.breakdown-item.positive .type-total { color: var(--color-success); }
.breakdown-item.negative .type-total { color: var(--color-error); }

/* Lines section */
.lines-section h3 {
    font-size: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 12px;
}

.lines-count {
    font-weight: normal;
    color: var(--text-dim);
}

.lines-table-container {
    max-height: 400px;
    overflow-y: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.lines-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.lines-table th {
    position: sticky;
    top: 0;
    background: var(--bg-darker);
    padding: 10px 12px;
    text-align: left;
    font-weight: 500;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
}

.lines-table th.text-right {
    text-align: right;
}

.lines-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--bg-primary);
    color: var(--text-secondary);
}

.lines-table tr:hover {
    background: var(--bg-primary);
}

.line-type-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    background: var(--border-color);
    color: var(--text-soft);
}

.line-type-badge.sku_balance { background: var(--color-info-bg); color: var(--color-info-light); }
.line-type-badge.other_revenue { background: var(--color-success-bg); color: var(--color-success-light); }
.line-type-badge.other_expense { background: var(--color-error-bg); color: var(--color-error-light); }
.line-type-badge.payment { background: var(--color-purple-bg); color: var(--accent-secondary); }
.line-type-badge.production_cost { background: var(--color-warning-bg); color: var(--color-warning-light); }
.line-type-badge.shipping { background: var(--color-teal-bg); color: var(--color-teal); }

.description-cell {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sku-cell {
    font-family: monospace;
    color: var(--accent-secondary);
}

.amount-cell {
    text-align: right;
    font-family: monospace;
    font-weight: 500;
}

.amount-cell.positive { color: var(--color-success); }
.amount-cell.negative { color: var(--color-error); }

.lines-more {
    text-align: center;
    padding: 12px;
    color: var(--text-muted);
    font-size: 12px;
    background: var(--bg-darker);
}

/* No statement view */
.no-statement {
    text-align: center;
    padding: 40px 20px;
}

.no-statement-icon {
    color: #4a4a6a;
    margin-bottom: 20px;
}

.no-statement h3 {
    color: var(--text-primary);
    margin-bottom: 10px;
}

.no-statement p {
    color: var(--text-muted);
    margin: 0;
}

.no-statement .hint {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-dim);
}

/* Responsive */
@media (max-width: 768px) {
    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .breakdown-grid {
        grid-template-columns: 1fr;
    }

    .modal-wide {
        max-width: 100%;
        margin: 10px;
    }
}

/* ============================================
   STATEMENT TABS VIEW (Universal Import v4)
   ============================================ */

.tabs-section {
    margin-top: 24px;
}

.tabs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.tabs-header h3 {
    color: var(--text-primary);
    margin: 0;
}

.tabs-section h3 {
    color: var(--text-primary);
    margin-bottom: 16px;
}

.tabs-count {
    color: var(--text-muted);
    font-weight: normal;
    font-size: 14px;
}

/* Tab Category Filter */
.tabs-filter {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tabs-filter label {
    color: var(--text-muted);
    font-size: 13px;
    white-space: nowrap;
}

.tabs-filter select {
    padding: 8px 12px;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    min-width: 180px;
    transition: border-color 0.2s;
}

.tabs-filter select:hover {
    border-color: var(--border-hover);
}

.tabs-filter select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.tabs-filter select option {
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 8px;
}

.tabs-table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.tabs-table {
    width: 100%;
    border-collapse: collapse;
}

.tabs-table th {
    background: var(--bg-primary);
    padding: 12px;
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.tabs-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--bg-primary);
    color: var(--text-secondary);
    font-size: 13px;
}

.tabs-table tr:hover {
    background: var(--bg-primary);
}

.tabs-table tr.main-statement {
    background: #1e3a5f20;
}

.tab-name {
    font-weight: 500;
}

.main-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 600;
    background: var(--color-info-bg);
    color: var(--color-info-light);
    margin-right: 6px;
}

.category-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
}

.category-badge.sku { background: var(--border-color); color: var(--accent-secondary); }
.category-badge.digital { background: var(--color-info-bg); color: var(--color-info-light); }
.category-badge.expense { background: var(--color-error-bg); color: var(--color-error-light); }
.category-badge.shipping { background: var(--color-teal-bg); color: var(--color-teal); }
.category-badge.reimbursement { background: var(--color-success-bg); color: var(--color-success-light); }
.category-badge.bandcamp { background: var(--color-purple-bg); color: var(--accent-secondary); }
.category-badge.store_sales { background: var(--color-warning-bg); color: var(--color-warning-light); }
.category-badge.statement { background: var(--bg-primary); color: var(--text-primary); }
.category-badge.other { background: #374151; color: #9ca3af; }

.positive { color: var(--color-success) !important; }
.negative { color: var(--color-error) !important; }
.text-right { text-align: right; }
.text-center { text-align: center; }

/* Tab lines section */
.tab-lines-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.tab-lines-section h3 {
    color: var(--text-primary);
    margin-bottom: 16px;
}

/* Export CSV button header */
.lines-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.lines-header-actions .lines-count {
    color: var(--text-muted);
    font-size: 13px;
}

.export-csv-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12px;
    background: var(--border-color);
    border: 1px solid var(--border-light);
    color: #c4c4d4;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.export-csv-btn:hover {
    background: var(--border-light);
    border-color: #5b5b8b;
    color: var(--text-primary);
}

.export-csv-btn svg {
    flex-shrink: 0;
}

.no-lines {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
}

.row-num {
    color: var(--text-dim);
    font-size: 11px;
}

.line-cat-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 500;
    text-transform: uppercase;
    background: var(--border-color);
    color: var(--text-soft);
}

.line-cat-badge.sales { background: var(--color-success-bg); color: var(--color-success-light); }
.line-cat-badge.wholesale_sales { background: #065f46; color: #6ee7b7; }
.line-cat-badge.digital_sales { background: #164e63; color: #67e8f9; }
.line-cat-badge.production { background: var(--color-warning-bg); color: var(--color-warning-light); }
.line-cat-badge.preliminary_production { background: #92400e; color: #fcd34d; }
.line-cat-badge.cutting { background: #7c3aed20; color: var(--accent-secondary); }
.line-cat-badge.galvanisation { background: #1e3a5f; color: #60a5fa; }
.line-cat-badge.mastering { background: #6d28d920; color: #c4b5fd; }
.line-cat-badge.test_press { background: #1f2937; color: #9ca3af; }
.line-cat-badge.sdrm_rights { background: #4a1d5f; color: #e879f9; }
.line-cat-badge.mechanical_rights { background: #4a1d5f; color: #d8b4fe; }
.line-cat-badge.shipping { background: var(--color-teal-bg); color: var(--color-teal); }
.line-cat-badge.payment { background: var(--color-purple-bg); color: var(--accent-secondary); }
.line-cat-badge.fee { background: #78350f; color: #fbbf24; }
.line-cat-badge.extra { background: #1f2937; color: #d1d5db; }
.line-cat-badge.expense { background: var(--color-error-bg); color: var(--color-error-light); }
.line-cat-badge.revenue { background: var(--color-success-bg); color: var(--color-success-light); }
.line-cat-badge.other { background: #374151; color: #9ca3af; }

.row-positive { background: #064e3b10; }
.row-negative { background: #4a1d1d10; }

/* === OWNERS column (Phase 7 — 2026-05-15) === */
.owners-cell { padding: 6px 8px; vertical-align: middle; }
.owners-chip-stack { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.owner-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px 3px 3px;
    background: var(--bg-card-hover);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 11px;
    text-decoration: none;
    color: var(--text-primary);
    cursor: pointer;
    line-height: 1;
    max-width: 140px;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.owner-chip:hover {
    background: var(--accent-emphasis);
    color: var(--bg-card);
    border-color: var(--accent-emphasis);
}
.owner-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--accent-emphasis);
    color: var(--bg-card);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0;
    flex-shrink: 0;
}
.owner-chip:hover .owner-avatar {
    background: var(--bg-card);
    color: var(--accent-emphasis);
}
.owner-chip-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
}
.owner-chip-more {
    cursor: default;
    background: transparent;
    border-style: dashed;
    color: var(--text-muted);
}
.owner-chip-more:hover {
    background: transparent;
    color: var(--text-muted);
    border-color: var(--border);
}
.owner-chip-add {
    width: 22px; height: 22px;
    padding: 0;
    border-radius: 50%;
    background: transparent;
    border: 1px dashed var(--border);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.owner-chip-add:hover {
    background: var(--accent-emphasis);
    color: var(--bg-card);
    border-color: var(--accent-emphasis);
    border-style: solid;
}

/* === Release Identity panel (Phase 5 — 2026-06-29) === */
.release-identity-panel {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
    margin: 8px 0;
}
.release-identity-panel legend {
    font-size: 13px;
    font-weight: 600;
    padding: 0 6px;
}
.release-identity-skus {
    display: grid;
    gap: 8px;
}
.release-identity-sku-row,
.release-identity-link,
.release-identity-current {
    border: 1px solid var(--border-color);
    border-radius: 6px;
}
.release-identity-sku-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 9px 10px;
}
.release-identity-sku-row strong {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
}
.release-identity-sku-row span,
.release-identity-empty {
    color: var(--text-muted);
    font-size: 12px;
}
.release-identity-chip {
    min-width: 82px;
    min-height: 28px;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 0 9px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.release-identity-chip.ok {
    background: var(--color-success-bg);
    color: var(--color-success-light);
}
.release-identity-chip.conflict {
    background: var(--color-error-bg);
    color: var(--color-error-light);
}
.release-identity-current {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin-bottom: 14px;
}
.release-identity-current div {
    padding: 10px;
    border-right: 1px solid var(--border-color);
}
.release-identity-current div:last-child {
    border-right: 0;
}
.release-identity-current span {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
    margin-bottom: 4px;
}
.release-identity-field {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
}
.release-identity-field select,
.release-identity-field textarea {
    width: 100%;
    margin-top: 6px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 10px;
    background: var(--bg-card);
    color: var(--text-primary);
    font: inherit;
}
.release-identity-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: var(--text-muted);
    font-size: 13px;
}
.release-identity-links {
    display: grid;
    gap: 8px;
}
.release-identity-link {
    display: grid;
    grid-template-columns: 1fr 1fr auto auto;
    gap: 10px;
    align-items: center;
    padding: 9px 10px;
}
.release-identity-link.conflict {
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.08);
}
.release-identity-link-actions {
    display: inline-flex;
    gap: 6px;
}
.release-identity-link-actions button {
    min-height: 28px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 0 8px;
    cursor: pointer;
    font-size: 12px;
}

/* Company or individual, next to the company name (2026-09-21): same labels.entity_type as the forms */
.entity-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
    color: var(--text-muted, #8a8a8a);
    border: 1px solid var(--border, rgba(128, 128, 128, 0.35));
}
.entity-badge.entity-individual { color: #7c3aed; border-color: rgba(124, 58, 237, 0.4); }

/* ── Columns visibility menu (issue #12 — configurable columns) ── */
.labels-columns-menu {
    position: relative;
}

.labels-columns-menu > summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
}

.labels-columns-menu > summary::-webkit-details-marker {
    display: none;
}

.labels-columns-menu > summary::after {
    content: "▾";
    margin-left: 6px;
    font-size: 10px;
    color: var(--text-muted);
}

.labels-columns-menu[open] > summary::after {
    content: "▴";
}

.labels-columns-menu .col-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 300;
    min-width: 170px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.labels-columns-menu .col-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border-radius: 5px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    white-space: nowrap;
}

.labels-columns-menu .col-menu-item:hover {
    background: var(--bg-hover);
}

.labels-columns-menu .col-visibility-toggle {
    accent-color: var(--accent-primary);
    cursor: pointer;
}
