/* CSS Variables for theming */
:root {
    --bg-primary: #1a1a2e;
    --bg-secondary: #2a2a3e;
    --bg-tertiary: #333;
    --text-primary: #eee;
    --text-secondary: #888;
    --text-muted: #666;
    --accent-primary: #3B82F6;
    --accent-success: #10B981;
    --accent-danger: #EF4444;
    --accent-warning: #F59E0B;
    --border-color: #444;
    --card-shadow: none;
    --glow-effect: none;
}

/* Stranger Things Theme - 80s Retro Neon */
.stranger-things-theme {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1e0707;
    --bg-tertiary: #1e193c;
    --text-primary: #f0e6e6;
    --text-secondary: #b85c51;
    --text-muted: #6b4444;
    --accent-primary: #ff1515;
    --accent-success: #3a5fe5;
    --accent-danger: #ff1515;
    --accent-warning: #ff6b35;
    --border-color: #3d1515;
    --card-shadow: 0 0 15px rgba(255, 21, 21, 0.3);
    --glow-effect: 0 0 10px rgba(255, 21, 21, 0.5), 0 0 20px rgba(255, 21, 21, 0.3);
}

/* Stranger Things Theme - Neon Glow Effects */
.stranger-things-theme h1 {
    text-shadow: 0 0 10px rgba(255, 21, 21, 0.8), 0 0 20px rgba(255, 21, 21, 0.5), 0 0 30px rgba(255, 21, 21, 0.3);
    color: #ff1515;
    font-family: 'Times New Roman', Times, serif;
    font-weight: bold;
    letter-spacing: 2px;
}

.stranger-things-theme .btn-primary {
    background: linear-gradient(180deg, #ff1515 0%, #aa0000 100%);
    box-shadow: 0 0 15px rgba(255, 21, 21, 0.5);
    border: 1px solid #ff3333;
}

.stranger-things-theme .btn-primary:hover {
    background: linear-gradient(180deg, #ff3333 0%, #cc0000 100%);
    box-shadow: 0 0 25px rgba(255, 21, 21, 0.7);
}

.stranger-things-theme .btn-secondary {
    background: var(--bg-tertiary);
    border: 1px solid #3a5fe5;
    color: #3a5fe5;
}

.stranger-things-theme .btn-secondary:hover {
    background: rgba(58, 95, 229, 0.2);
    box-shadow: 0 0 10px rgba(58, 95, 229, 0.5);
}

.stranger-things-theme .tab-nav button.active,
.stranger-things-theme .subnav-btn.active {
    border-bottom-color: #ff1515;
    color: #ff1515;
    text-shadow: 0 0 8px rgba(255, 21, 21, 0.6);
    transform: scaleY(-1);
}

.stranger-things-theme .entity-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}

.stranger-things-theme .entity-card:hover {
    box-shadow: 0 0 20px rgba(255, 21, 21, 0.4);
    border-color: #ff1515;
}

.stranger-things-theme .badge {
    box-shadow: 0 0 8px rgba(255, 21, 21, 0.3);
}

.stranger-things-theme .status-completed,
.stranger-things-theme .status-posted,
.stranger-things-theme .status-active {
    background: #073e1e;
    color: #4ade80;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.3);
}

.stranger-things-theme .status-pending,
.stranger-things-theme .status-processing {
    background: #1e193c;
    color: #3a5fe5;
    box-shadow: 0 0 8px rgba(58, 95, 229, 0.3);
}

.stranger-things-theme .status-failed,
.stranger-things-theme .status-rejected {
    background: #3d1515;
    color: #ff1515;
    box-shadow: 0 0 8px rgba(255, 21, 21, 0.3);
}

.stranger-things-theme select,
.stranger-things-theme input,
.stranger-things-theme .search-input {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.stranger-things-theme select:focus,
.stranger-things-theme input:focus {
    border-color: #ff1515;
    box-shadow: 0 0 10px rgba(255, 21, 21, 0.3);
    outline: none;
}

.stranger-things-theme .info-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.stranger-things-theme .modal-content {
    background: var(--bg-primary);
    border: 2px solid #ff1515;
    box-shadow: 0 0 30px rgba(255, 21, 21, 0.4);
}

.stranger-things-theme .spinner {
    border-color: var(--bg-tertiary);
    border-top-color: #ff1515;
}

.stranger-things-theme header {
    border-bottom-color: #3d1515;
}

.stranger-things-theme .toggle-btn.active {
    background-color: #ff1515;
    border-color: #ff1515;
    box-shadow: 0 0 10px rgba(255, 21, 21, 0.5);
}

.stranger-things-theme .wallet-address,
.stranger-things-theme .explorer-link {
    color: #3a5fe5;
}

/* Stranger Things - Lead Bank Subnav (Vertical Tabs) */
.stranger-things-theme .lead-bank-subnav {
    background: linear-gradient(180deg, #0d0d0d 0%, #1a0a0a 100%);
    border: 1px solid #3d1515;
    box-shadow: inset 0 0 20px rgba(255, 21, 21, 0.1);
}

.stranger-things-theme .subnav-btn {
    color: #b85c51;
    border-left: 3px solid transparent;
}

.stranger-things-theme .subnav-btn:hover {
    background: rgba(255, 21, 21, 0.15);
    color: #ff6b6b;
    text-shadow: 0 0 8px rgba(255, 21, 21, 0.4);
}

.stranger-things-theme .subnav-btn.active {
    background: rgba(255, 21, 21, 0.2);
    border-left-color: #ff1515;
    color: #ff1515;
    text-shadow: 0 0 10px rgba(255, 21, 21, 0.6);
    box-shadow: inset 0 0 15px rgba(255, 21, 21, 0.15);
    transform: scaleY(-1);
}

.stranger-things-theme .subnav-separator {
    background: linear-gradient(90deg, transparent, #ff1515, transparent);
    opacity: 0.3;
}

/* Stranger Things - Entity List & Cards */
.stranger-things-theme .entity-list {
    gap: 20px;
}

.stranger-things-theme .entity-card {
    background: linear-gradient(145deg, #1a0808 0%, #0d0505 100%);
    border: 1px solid #3d1515;
    box-shadow: 0 0 15px rgba(255, 21, 21, 0.15), inset 0 0 30px rgba(0, 0, 0, 0.5);
}

.stranger-things-theme .entity-card:hover {
    border-color: #ff1515;
    box-shadow: 0 0 25px rgba(255, 21, 21, 0.4), 0 0 50px rgba(255, 21, 21, 0.15);
    transform: translateY(-3px);
}

.stranger-things-theme .entity-card-header {
    border-bottom-color: #3d1515;
}

.stranger-things-theme .entity-card-header h3 {
    color: #ff6b6b;
    text-shadow: 0 0 5px rgba(255, 21, 21, 0.3);
}

.stranger-things-theme .entity-card-actions {
    border-top-color: #3d1515;
}

.stranger-things-theme .entity-field .label {
    color: #6b4444;
}

.stranger-things-theme .entity-field .value {
    color: #e0d0d0;
}

/* Stranger Things - Config Box */
.stranger-things-theme .config-box {
    background: linear-gradient(145deg, #0d0505 0%, #1a0808 100%);
    border: 1px solid #3d1515;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.stranger-things-theme .config-box h4 {
    color: #ff6b6b;
    text-shadow: 0 0 5px rgba(255, 21, 21, 0.3);
}

/* Stranger Things - Detail View */
.stranger-things-theme .entity-detail {
    background: linear-gradient(145deg, #1a0808 0%, #0d0505 100%);
    border: 1px solid #3d1515;
    box-shadow: 0 0 20px rgba(255, 21, 21, 0.2);
}

.stranger-things-theme .detail-row .label {
    color: #6b4444;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stranger-things-theme .detail-row .value {
    color: #e0d0d0;
}

.stranger-things-theme .detail-header h3 {
    color: #ff6b6b;
    text-shadow: 0 0 8px rgba(255, 21, 21, 0.4);
}

/* Stranger Things - Legs Flow Visualization */
.stranger-things-theme .legs-section {
    background: linear-gradient(145deg, #0d0505 0%, #1a0808 100%);
    border: 1px solid #3d1515;
}

.stranger-things-theme .leg-box {
    box-shadow: 0 0 15px rgba(255, 21, 21, 0.2);
}

.stranger-things-theme .leg-connector {
    color: #ff1515;
    text-shadow: 0 0 10px rgba(255, 21, 21, 0.5);
}

/* Stranger Things - Raw JSON */
.stranger-things-theme .raw-json {
    background: #0a0505;
    border: 1px solid #3d1515;
    color: #ff6b6b;
}

/* Stranger Things - Webhook Cards */
.stranger-things-theme .webhook-card {
    background: linear-gradient(145deg, #1a0808 0%, #0d0505 100%);
    border-left-color: #ff1515;
    border: 1px solid #3d1515;
    border-left: 3px solid #ff1515;
}

.stranger-things-theme .webhook-card:hover {
    background: linear-gradient(145deg, #2a1010 0%, #1a0808 100%);
    box-shadow: 0 0 20px rgba(255, 21, 21, 0.3);
}

/* Stranger Things - Lead Bank Global Filter */
.stranger-things-theme .lb-global-filter {
    background: linear-gradient(145deg, #0d0505 0%, #1a0808 100%);
    border-color: #3d1515;
}

.stranger-things-theme .lb-global-filter label {
    color: #b85c51;
}

/* Stranger Things - Tab Buttons */
.stranger-things-theme .tab-btn {
    color: #6b4444;
}

.stranger-things-theme .tab-btn:hover {
    background: rgba(255, 21, 21, 0.15);
    color: #ff6b6b;
}

.stranger-things-theme .tab-btn.active {
    background: linear-gradient(180deg, #ff1515 0%, #aa0000 100%);
    color: #fff;
    box-shadow: 0 0 15px rgba(255, 21, 21, 0.5);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
    transform: scaleY(-1);
}

/* Stranger Things - Vendor Entity Cards */
.stranger-things-theme .vendor-entity-card {
    background: linear-gradient(145deg, #0d0505 0%, #1a0808 100%);
    border: 1px solid #3d1515;
}

.stranger-things-theme .vendor-name {
    color: #ff6b6b;
}

/* Stranger Things - Toast Notifications */
.stranger-things-theme .toast {
    background: linear-gradient(145deg, #1a0808 0%, #0d0505 100%);
    border-color: #ff1515;
    box-shadow: 0 0 20px rgba(255, 21, 21, 0.3);
}

/* Stranger Things - Failed Delivery Cards */
.stranger-things-theme .failed-delivery-card {
    background: linear-gradient(145deg, #1a0808 0%, #0d0505 100%);
    border-left-color: #ff1515;
    border: 1px solid #3d1515;
    border-left: 4px solid #ff1515;
}

/* Stranger Things - No Data State */
.stranger-things-theme .no-data {
    color: #6b4444;
    text-shadow: 0 0 5px rgba(255, 21, 21, 0.2);
}

/* Stranger Things - Info Section */
.stranger-things-theme .info-section {
    background: linear-gradient(145deg, #1a0808 0%, #0d0505 100%);
    border: 1px solid #3d1515;
    box-shadow: 0 0 15px rgba(255, 21, 21, 0.1);
}

/* Stranger Things - Mode Badge */
.stranger-things-theme .mode-badge.mock {
    background: linear-gradient(135deg, #ff1515 0%, #aa0000 100%);
    color: #fff;
    box-shadow: 0 0 15px rgba(255, 21, 21, 0.4);
}

.stranger-things-theme .mode-badge.real {
    background: linear-gradient(135deg, #3a5fe5 0%, #2a4fc5 100%);
    box-shadow: 0 0 15px rgba(58, 95, 229, 0.4);
}

/* Stranger Things - Copy Button */
.stranger-things-theme .copy-btn {
    border-color: #3d1515;
    color: #6b4444;
}

.stranger-things-theme .copy-btn:hover {
    background: rgba(255, 21, 21, 0.2);
    border-color: #ff1515;
    color: #ff1515;
}

/* Stranger Things - Mock Mode Notice */
.stranger-things-theme .mock-mode-notice {
    background: rgba(255, 21, 21, 0.1);
    border-color: rgba(255, 21, 21, 0.3);
}

.stranger-things-theme .mock-mode-notice p {
    color: #ff6b6b;
}

.stranger-things-theme .mock-mode-notice code {
    background: rgba(255, 21, 21, 0.2);
    color: #ff1515;
}

/* Theme toggle button */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.stranger-things-theme .theme-toggle {
    border-color: #ff1515;
    color: #ff1515;
    box-shadow: 0 0 10px rgba(255, 21, 21, 0.3);
}

.theme-toggle-icon {
    font-size: 1.1rem;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 20px;
    transition: background 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--bg-tertiary);
}

.header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

h2 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.controls {
    display: flex;
    gap: 20px;
    align-items: center;
}

select {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
}

.search-input {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    min-width: 180px;
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
}

.toggle input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.hidden {
    display: none !important;
}

.no-data {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 20px auto;
    border: 3px solid #333;
    border-top-color: #3B82F6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.info-section {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.info-section h2 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-section h2 .btn {
    font-size: 0.7rem;
    padding: 4px 10px;
    vertical-align: middle;
}

.info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.info-row:last-child {
    margin-bottom: 0;
}

.label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.value {
    font-weight: 500;
}

.mono {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 0.85rem;
}

.arrow {
    color: #666;
    font-weight: bold;
}

.wallet-address {
    color: #60A5FA;
    font-size: 0.75rem;
    word-break: break-all;
}

.full-id {
    font-size: 0.75rem;
    word-break: break-all;
    color: #9CA3AF;
}

.chain-badge {
    background: #374151;
    color: #9CA3AF;
    font-size: 0.7rem;
    margin-left: 8px;
}

.explorer-link {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.75rem;
    color: #60A5FA;
    text-decoration: none;
}

.explorer-link:hover {
    text-decoration: underline;
}

.leg-network {
    font-size: 0.7rem;
    opacity: 0.8;
    margin-top: 4px;
}

.badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    flex-shrink: 0;
    flex-grow: 0;
    width: fit-content;
}

/* Transaction status colors */
.badge.status-paused_float,
.badge.status-paused_manual_review {
    background: #F97316;
    color: #fff;
}

.badge.status-funds_received,
.badge.status-funds_swept {
    background: #3B82F6;
    color: #fff;
}

.badge.status-outbound_staged {
    background: #6366F1;
    color: #fff;
}

.badge.status-transfer_initiated {
    background: #06B6D4;
    color: #fff;
}

.badge.status-completed {
    background: #10B981;
    color: #fff;
}

.badge.status-failed {
    background: #EF4444;
    color: #fff;
}

.badge.status-reversed,
.badge.status-canceled {
    background: #6B7280;
    color: #fff;
}

/* Reason text styling */
.reason-text {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 4px;
    padding: 4px 8px;
    color: #EF4444;
    font-size: 0.9em;
    word-break: break-word;
    max-width: 100%;
}

/* Transaction action buttons */
.tx-action-buttons {
    display: flex;
    gap: 8px;
}

.tx-action-buttons .btn-sm {
    padding: 4px 12px;
    font-size: 0.85em;
}

/* Type badges */
.badge.type-onramp {
    background: #8B5CF6;
    color: #fff;
}

.badge.type-offramp {
    background: #EC4899;
    color: #fff;
}

.badge.type-swap {
    background: #F59E0B;
    color: #fff;
}

/* Legs section */
.legs-section {
    background: #2a2a3e;
    border-radius: 10px;
    padding: 20px;
}

.legs-flow {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

.leg-box {
    width: 160px;
    padding: 14px 12px;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.leg-box.clickable {
    cursor: pointer;
}

.leg-box.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.leg-title {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.leg-status {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    opacity: 0.85;
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    display: inline-block;
}

.leg-amount {
    font-size: 0.95rem;
    font-weight: 600;
    margin-top: 4px;
}

.leg-connector {
    font-size: 1.5rem;
    color: #444;
    font-weight: bold;
}

/* Leg status colors - full box background */
.leg-box.status-not_started,
.leg-box.status-not_created {
    background: #4B5563;
    color: #D1D5DB;
}

.leg-box.status-pending {
    background: #F59E0B;
    color: #1a1a2e;
}

.leg-box.status-initiated {
    background: #3B82F6;
    color: #fff;
    animation: pulse 2s infinite;
}

.leg-box.status-completed {
    background: #10B981;
    color: #fff;
}

.leg-box.status-failed {
    background: #EF4444;
    color: #fff;
}

.leg-box.status-reversed {
    background: #8B5CF6;
    color: #fff;
}

.leg-box.status-cancelled {
    background: #6B7280;
    color: #fff;
}

.leg-box.status-paused {
    background: #F97316;
    color: #fff;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }
}

/* =====================
   Tab Navigation
   ===================== */

.tab-nav {
    display: flex;
    gap: 8px;
}

.tab-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #888;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: #333;
    color: #fff;
}

.tab-btn.active {
    background: #3B82F6;
    color: #fff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.tab-header h2 {
    margin-bottom: 0;
}

/* =====================
   Buttons
   ===================== */

.btn {
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #3B82F6;
    color: #fff;
}

.btn-primary:hover {
    background: #2563EB;
}

.btn-primary:disabled {
    background: #6B7280;
    cursor: not-allowed;
}

.btn-secondary {
    background: #4B5563;
    color: #fff;
}

.btn-secondary:hover {
    background: #6B7280;
}

.btn-danger {
    background: #DC2626;
    color: #fff;
}

.btn-danger:hover {
    background: #B91C1C;
}

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

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

.section-header h3,
.section-header h4 {
    margin: 0;
}

.flow-hint {
    display: block;
    margin-top: 8px;
    padding: 6px 10px;
    background: #1a1a2e;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #60A5FA;
}

/* =====================
   Entity Cards
   ===================== */

.entity-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.entity-card {
    background: #2a2a3e;
    border-radius: 10px;
    padding: 16px;
    transition: all 0.2s;
}

.entity-card.clickable {
    cursor: pointer;
}

.entity-card.clickable:hover {
    background: #333355;
    transform: translateY(-2px);
}

.entity-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #444;
}

.entity-card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.entity-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.entity-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.entity-card-actions .btn {
    padding: 4px 12px;
    font-size: 0.75rem;
}

.entity-field {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0; /* Allow flex children to shrink below content size */
}

.entity-field .label {
    min-width: 70px;
    flex-shrink: 0;
}

.entity-field .value {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0; /* Allow truncation */
    flex: 1;
}

.entity-field .value > span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* Badges should not stretch even when they have .value class */
.entity-field .value.badge {
    flex: 0 0 auto;
    width: fit-content;
}

/* =====================
   Entity Detail View
   ===================== */

.entity-detail {
    background: #2a2a3e;
    border-radius: 10px;
    padding: 20px;
}

.entity-detail .btn-secondary {
    margin-bottom: 16px;
}

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

.detail-header h3 {
    font-size: 1.25rem;
    margin: 0;
}

.detail-actions {
    display: flex;
    gap: 8px;
}

.detail-content h3 {
    font-size: 1.25rem;
    margin-bottom: 16px;
}

.detail-content h4 {
    font-size: 1rem;
    color: #888;
    margin: 24px 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Configuration box for auto account sections */
.config-box {
    background: #1a1a2e;
    border: 1px solid #3a3a4a;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 16px;
}

.config-box h4 {
    margin: 0 0 16px 0;
    font-size: 0.9rem;
    color: #9ca3af;
}

.config-box .detail-grid {
    gap: 16px 40px;
}

/* Add spacing between status row and first config box */
.detail-content > .detail-grid + .config-box {
    margin-top: 16px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 40px;
}

.detail-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-row .label {
    font-size: 0.8rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-row .value {
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0; /* Allow truncation */
}

.detail-row .value.mono {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 0.85rem;
}

/* Truncate long values in detail rows */
.detail-row .value > span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.copy-btn {
    background: transparent;
    border: 1px solid #4a4a5e;
    border-radius: 4px;
    color: #888;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 2px 6px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.copy-btn:hover {
    background: #3a3a4e;
    border-color: #5a5a6e;
    color: #fff;
}

.copy-btn.copied {
    background: #22c55e;
    border-color: #22c55e;
    color: #fff;
}

@media (max-width: 768px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

/* Vendor Entities */

.vendor-entities {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.vendor-entity-card {
    background: #1a1a2e;
    border-radius: 8px;
    padding: 12px;
}

.vendor-entity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.vendor-name {
    font-weight: 600;
    text-transform: capitalize;
}

.vendor-entity-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.vendor-entity-body .label {
    font-size: 0.85rem;
    color: #888;
}

.vendor-entity-body .value {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
}

.vendor-entity-body .value > span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: calc(100% - 30px);
}

.no-data-text {
    color: #666;
    font-size: 0.9rem;
}

/* =====================
   Modal
   ===================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #2a2a3e;
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content.modal-large {
    max-width: 720px;
}

.modal-content.modal-leg-detail {
    max-width: 600px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #444;
}

.modal-header h3 {
    font-size: 1.1rem;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: #fff;
}

.modal-body {
    padding: 16px 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #444;
}

.section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #60A5FA;
    margin: 20px 0 12px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid #333;
}

.section-title:first-of-type {
    margin-top: 16px;
}

#leg-detail-explorer-section {
    margin-top: 20px;
    text-align: center;
}

/* =====================
   Forms
   ===================== */

form {
    padding: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 8px;
    white-space: nowrap;
}

.form-group label .required {
    color: #EF4444;
    font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #444;
    background: #1a1a2e;
    color: #eee;
    font-family: inherit;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3B82F6;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #666;
}

.fee-hint {
    display: block;
    margin-top: 4px;
    font-size: 0.75rem;
    color: #60A5FA;
}

.supported-networks-hint {
    display: block;
    margin-top: 12px;
    padding: 10px 12px;
    background: rgba(96, 165, 250, 0.1);
    border-radius: 6px;
    border-left: 3px solid #60A5FA;
}

.supported-networks-hint .hint-label {
    display: block;
    font-size: 0.75rem;
    color: #60A5FA;
    font-weight: 600;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.supported-networks-hint .hint-networks {
    display: block;
    font-size: 0.85rem;
    color: #ccc;
    line-height: 1.4;
}

.form-hint {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 12px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-row .form-group {
    margin-bottom: 0;
}

.form-hint {
    font-size: 0.8rem;
    color: #888;
    margin: 0 0 12px 0;
    font-style: italic;
}

.input-with-suffix {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-with-suffix input {
    flex: 1;
}

.input-suffix {
    color: #888;
    font-weight: 500;
    min-width: 50px;
}

.type-details {
    background: #1a1a2e;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.type-details h4 {
    font-size: 0.95rem;
    margin: 0 0 16px;
    color: #fff;
}

.type-details h5 {
    font-size: 0.85rem;
    color: #888;
    margin: 16px 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Toggle Group */

.toggle-group {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

button.toggle-btn {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #444;
    border-radius: 6px;
    background-color: #2a2a3e;
    color: #888;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

button.toggle-btn:hover {
    border-color: #666;
    color: #fff;
}

button.toggle-btn:focus {
    outline: none;
    border-color: #666;
}

button.toggle-btn.active {
    background-color: #3B82F6;
    border-color: #3B82F6;
    color: #fff;
}

/* =====================
   Entity Status Badges
   ===================== */

.badge.status-pending {
    background: #F59E0B;
    color: #1a1a2e;
}

.badge.status-active {
    background: #10B981;
    color: #fff;
}

.badge.status-suspended {
    background: #EF4444;
    color: #fff;
}

.badge.status-closed {
    background: #6B7280;
    color: #fff;
}

/* Customer Type Badges */

.badge.type-individual {
    background: #6366F1;
    color: #fff;
}

.badge.type-business {
    background: #8B5CF6;
    color: #fff;
}

/* Account Type Badges */

.badge.type-fiat {
    background: #059669;
    color: #fff;
}

.badge.type-crypto {
    background: #7C3AED;
    color: #fff;
}

/* Status Badges */

.badge.status-inactive {
    background: #6B7280;
    color: #fff;
}

/* =====================
   Lead Bank Tab - Vertical Sub-Tabs
   ===================== */

.lead-bank-container {
    display: flex;
    gap: 20px;
}

.lead-bank-subnav {
    display: flex;
    flex-direction: column;
    min-width: 180px;
    background: #2a2a3e;
    border-radius: 10px;
    padding: 8px;
    gap: 4px;
    height: fit-content;
}

.subnav-btn {
    padding: 12px 16px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #888;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    border-left: 3px solid transparent;
}

.subnav-btn:hover {
    background: #333;
    color: #fff;
}

.subnav-btn.active {
    background: #1a1a2e;
    border-left: 3px solid #3B82F6;
    color: #3B82F6;
}

.lead-bank-content {
    flex: 1;
    min-width: 0;
}

.lb-global-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #1e1e2e;
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid #3a3a4a;
}

.lb-global-filter label {
    color: #a0a0b0;
    font-size: 14px;
    white-space: nowrap;
}

.lb-global-filter select {
    flex: 1;
    max-width: 400px;
}

.subtab-content {
    display: none;
}

.subtab-content.active {
    display: block;
}

/* Raw JSON display */
.raw-json {
    background: #1a1a2e;
    border-radius: 6px;
    padding: 12px;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 0.75rem;
    color: #9CA3AF;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 300px;
    overflow-y: auto;
}

/* Lead Bank specific status badges */
.badge.status-processing {
    background: #3B82F6;
    color: #fff;
}

.badge.status-scheduled {
    background: #6366F1;
    color: #fff;
}

.badge.status-submitted {
    background: #06B6D4;
    color: #fff;
}

.badge.status-approved {
    background: #10B981;
    color: #fff;
}

.badge.status-posted {
    background: #10B981;
    color: #fff;
}

.badge.status-rejected {
    background: #EF4444;
    color: #fff;
}

.badge.status-returned {
    background: #F97316;
    color: #fff;
}

.badge.status-succeeded {
    background: #10B981;
    color: #fff;
}

.badge.status-unassigned {
    background: #6B7280;
    color: #fff;
}

.badge.status-created {
    background: #6366F1;
    color: #fff;
}

/* Direction badges */
.badge.direction-incoming {
    background: #10B981;
    color: #fff;
}

.badge.direction-outgoing {
    background: #F59E0B;
    color: #1a1a2e;
}

/* Entity type badges */
.badge.type-person {
    background: #6366F1;
    color: #fff;
}

.badge.type-company {
    background: #8B5CF6;
    color: #fff;
}

/* =====================
   Responsive
   ===================== */

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 15px;
    }

    .tab-nav {
        width: 100%;
        justify-content: center;
    }

    .legs-flow {
        flex-direction: column;
    }

    .leg-connector {
        transform: rotate(90deg);
    }

    .entity-list {
        grid-template-columns: 1fr;
    }

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

    .vendor-entities {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-content {
        max-height: 80vh;
    }

    .lead-bank-container {
        flex-direction: column;
    }

    .lead-bank-subnav {
        flex-direction: row;
        min-width: unset;
        overflow-x: auto;
    }

    .subnav-btn {
        border-left: none;
        border-bottom: 3px solid transparent;
        white-space: nowrap;
    }

    .subnav-btn.active {
        border-left: none;
        border-bottom: 3px solid #3B82F6;
    }
}

/* =====================
   Lead Bank Mode Indicator
   ===================== */

.mode-indicator {
    display: flex;
    align-items: center;
}

.mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mode-badge.mock {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    color: #1a1a2e;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.mode-badge.real {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* Subnav separator */
.subnav-separator {
    height: 1px;
    background: #444;
    margin: 8px 4px;
}

/* Mock mode notice banner */
.mock-mode-notice {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.mock-mode-notice p {
    margin: 0;
    font-size: 0.85rem;
    color: #F59E0B;
}

.mock-mode-notice code {
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 0.8rem;
}

/* Webhook list styling */
.webhook-card {
    background: #2a2a3e;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid #F59E0B;
}

.webhook-card:hover {
    background: #333355;
    transform: translateX(4px);
}

.webhook-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.webhook-card-header h4 {
    margin: 0;
    font-size: 0.95rem;
    color: #fff;
}

.webhook-card .timestamp {
    font-size: 0.75rem;
    color: #888;
}

.webhook-card-body {
    display: flex;
    gap: 12px;
    align-items: center;
}

.webhook-card-body .badge {
    font-size: 0.7rem;
}

/* Detail view timestamp */
.detail-header .timestamp {
    font-size: 0.8rem;
    color: #888;
}

/* Failed Deliveries Styles */
.failed-delivery-card {
    background: #2d2d3a;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    border-left: 4px solid #ff6b6b;
}

.failed-delivery-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.failed-delivery-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.failed-delivery-info .event-type {
    font-weight: 600;
    color: #fff;
}

.failed-delivery-info .resource-info {
    font-size: 0.8rem;
    color: #888;
    font-family: monospace;
}

.failed-delivery-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.failed-delivery-field {
    display: flex;
    gap: 8px;
}

.failed-delivery-field .label {
    color: #888;
    font-size: 0.8rem;
    min-width: 80px;
}

.failed-delivery-field .value {
    color: #ccc;
    font-size: 0.8rem;
    word-break: break-all;
}

.failed-delivery-field .error-text {
    color: #ff6b6b;
}

.failed-delivery-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.btn-small {
    padding: 4px 12px;
    font-size: 0.8rem;
}

/* Badge count for nav buttons */
.badge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 9px;
    background: #ff6b6b;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 6px;
}

.badge-count.hidden {
    display: none;
}

/* Status badge for failed */
.badge.status-failed {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.toast {
    padding: 12px 16px;
    border-radius: 8px;
    background: #2a2a4a;
    border: 1px solid #444;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.toast.success {
    border-color: #4ecdc4;
    background: rgba(78, 205, 196, 0.15);
}

.toast.error {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.15);
}

.toast.info {
    border-color: #ffd93d;
    background: rgba(255, 217, 61, 0.15);
}

.toast-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.toast-message {
    font-size: 0.85rem;
    color: #aaa;
    word-break: break-word;
}

.toast-close {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 0;
    font-size: 1.2rem;
    line-height: 1;
}

.toast-close:hover {
    color: #fff;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast.hiding {
    animation: slideOut 0.3s ease-in forwards;
}

/* =====================
   Webhooks Tab Styles
   ===================== */

.webhook-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.webhook-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.webhook-item:hover {
    border-color: var(--accent-color);
    transform: translateX(2px);
}

.webhook-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.webhook-type {
    font-weight: 600;
}

.webhook-time {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.webhook-entity {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.webhook-entity .label {
    color: var(--text-muted);
    margin-right: 0.25rem;
}

/* Webhook Detail Modal */
.webhook-detail-content {
    max-width: 700px;
}

.webhook-detail-content .modal-body {
    padding: 20px 24px;
}

.webhook-detail-content .detail-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px 32px;
    margin-bottom: 20px;
}

.webhook-detail-content .detail-row .value {
    word-break: break-all;
}

.webhook-detail-content .detail-row .value.mono {
    font-size: 0.8rem;
}

.webhook-detail-content .modal-body > .label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.8rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.webhook-detail-content .code-block-wrapper {
    position: relative;
}

.webhook-detail-content .code-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 1;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 4px 6px;
}

.webhook-detail-content .code-copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.webhook-detail-content .code-block {
    background: var(--code-bg, #1a1a2e);
    color: var(--code-text, #e0e0e0);
    padding: 1rem;
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    overflow-x: auto;
    max-height: 400px;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Badge variations for webhook events */
.badge-success {
    background: var(--success-bg, #22c55e);
    color: var(--success-text, #fff);
}

.badge-info {
    background: var(--info-bg, #3b82f6);
    color: var(--info-text, #fff);
}

.badge-warning {
    background: var(--warning-bg, #f59e0b);
    color: var(--warning-text, #fff);
}

.badge-danger {
    background: var(--danger-bg, #ef4444);
    color: var(--danger-text, #fff);
}

.badge-default {
    background: var(--default-bg, #6b7280);
    color: var(--default-text, #fff);
}

/* =====================
   Webhook Timeline Styles (Entity Detail Views)
   ===================== */

.webhook-timeline {
    margin-top: 0.75rem;
    padding-left: 1rem;
    border-left: 2px solid var(--border-color);
}

.webhook-timeline .timeline-empty,
.webhook-timeline .timeline-loading,
.webhook-timeline .timeline-error {
    color: var(--text-muted);
    font-size: 0.875rem;
    padding: 0.5rem 0;
}

.webhook-timeline .timeline-error {
    color: var(--danger-bg, #ef4444);
}

.timeline-item {
    position: relative;
    padding: 0.5rem 0 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-radius: 4px;
    margin-left: -1rem;
    padding-left: 1.5rem;
}

.timeline-item:hover {
    background: var(--card-hover-bg, rgba(255, 255, 255, 0.05));
}

.timeline-marker {
    position: absolute;
    left: -0.375rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background: var(--default-bg, #6b7280);
    border: 2px solid var(--card-bg);
}

.timeline-marker.badge-success {
    background: var(--success-bg, #22c55e);
}

.timeline-marker.badge-info {
    background: var(--info-bg, #3b82f6);
}

.timeline-marker.badge-warning {
    background: var(--warning-bg, #f59e0b);
}

.timeline-marker.badge-danger {
    background: var(--danger-bg, #ef4444);
}

.timeline-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.timeline-event {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.timeline-time {
    color: var(--text-secondary);
    font-size: 0.75rem;
    white-space: nowrap;
}

.timeline-time .time-utc {
    color: var(--text-muted);
    font-size: 0.7rem;
}

/* =====================
   Related Entities Styles (Client Detail View)
   ===================== */

.related-entities {
    margin-top: 0.5rem;
}

.related-empty {
    color: var(--text-muted);
    font-size: 0.875rem;
    padding: 0.5rem 0;
}

.related-entity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--card-bg);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    transition: background-color 0.2s ease;
}

.related-entity-item.clickable {
    cursor: pointer;
}

.related-entity-item.clickable:hover {
    background: var(--card-hover-bg, rgba(255, 255, 255, 0.05));
}

.related-entity-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.related-entity-name {
    font-weight: 500;
    color: var(--text-primary);
}

.related-entity-id {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* =====================
   Float Tab Styles
   ===================== */

.float-section {
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 8px;
}

.float-section h3 {
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Float Balances Table */
.float-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.float-table th,
.float-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.float-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
}

.float-table tbody tr:hover {
    background: var(--card-hover-bg, rgba(255, 255, 255, 0.03));
}

/* Health Badge */
.health-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
}

.health-good {
    background: var(--success-bg, rgba(34, 197, 94, 0.2));
    color: var(--success-text, #22c55e);
}

.health-warning {
    background: var(--warning-bg, rgba(245, 158, 11, 0.2));
    color: var(--warning-text, #f59e0b);
}

.health-critical {
    background: var(--danger-bg, rgba(239, 68, 68, 0.2));
    color: var(--danger-text, #ef4444);
}

.health-neutral {
    background: var(--neutral-bg, rgba(156, 163, 175, 0.2));
    color: var(--neutral-text, #9ca3af);
}

/* Inactive ledger rows */
.ledger-inactive {
    opacity: 0.5;
}

/* Float Targets Grid */
.float-targets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.target-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
}

.target-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.target-currency {
    font-weight: 600;
    color: var(--text-primary);
}

.target-amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-color, #3b82f6);
}

/* Paused Transactions List */
.paused-tx-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.paused-tx-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--warning-text, #f59e0b);
    border-radius: 8px;
    padding: 1rem;
}

.paused-tx-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.paused-tx-id {
    font-size: 0.875rem;
}

.paused-tx-type {
    font-size: 0.75rem;
}

.paused-tx-details {
    margin-bottom: 0.75rem;
}

.paused-tx-amount {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.paused-tx-reason {
    font-size: 0.813rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.paused-tx-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.paused-tx-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* Warning text in modals */
.warning-text {
    color: var(--warning-text, #f59e0b);
    font-size: 0.813rem;
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--warning-bg, rgba(245, 158, 11, 0.1));
    border-radius: 4px;
}

/* Info text in modals */
.info-text {
    color: var(--info-text, #3b82f6);
    font-size: 0.813rem;
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--info-bg, rgba(59, 130, 246, 0.1));
    border-radius: 4px;
}

/* Badge count */
.badge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    background: var(--danger-bg, #ef4444);
    border-radius: 999px;
}

/* No data text for inline use */
.no-data-text {
    color: var(--text-muted);
    font-size: 0.875rem;
    padding: 0.5rem 0;
}

/* Stranger Things theme overrides for Float tab */
body.stranger-things .float-section {
    background: rgba(139, 0, 0, 0.2);
    border: 1px solid rgba(255, 0, 0, 0.3);
}

body.stranger-things .target-card,
body.stranger-things .paused-tx-card {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 0, 0, 0.3);
}

body.stranger-things .health-good {
    background: rgba(0, 255, 0, 0.2);
    color: #00ff00;
}

body.stranger-things .health-warning {
    background: rgba(255, 165, 0, 0.2);
    color: #ffa500;
}

body.stranger-things .health-critical {
    background: rgba(255, 0, 0, 0.3);
    color: #ff4444;
}

body.stranger-things .health-neutral {
    background: rgba(128, 128, 128, 0.2);
    color: #888888;
}

/* =====================
   Event Replay Controls
   ===================== */

.replay-controls {
    margin-top: 24px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.replay-controls h4 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.replay-description {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.replay-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.replay-form label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.replay-url-input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: monospace;
    font-size: 0.9rem;
    width: 100%;
    box-sizing: border-box;
}

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

.replay-event-btn {
    align-self: flex-start;
    margin-top: 8px;
}

/* Stranger Things Theme - Replay Controls */
body.stranger-things .replay-controls {
    border-color: #3d1515;
    box-shadow: var(--card-shadow);
}

body.stranger-things .replay-url-input {
    border-color: #3d1515;
}

body.stranger-things .replay-url-input:focus {
    border-color: var(--accent-primary);
    box-shadow: var(--glow-effect);
}

/* =====================
   Rebalancing & Capital Injection Modals
   ===================== */

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

.modal-description {
    color: #9ca3af;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.rebalance-side {
    background: #1a1a2e;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.rebalance-side h4 {
    margin: 0 0 12px 0;
    font-size: 0.95rem;
    color: #fff;
    font-weight: 600;
}

.rebalance-fees {
    background: #1a1a2e;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.rebalance-fees h4 {
    margin: 0 0 12px 0;
    font-size: 0.95rem;
    color: #9ca3af;
    font-weight: 500;
}

.balance-preview {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 6px;
    padding: 12px;
    margin-top: 12px;
}

.balance-preview-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.balance-preview-row .label {
    color: #9ca3af;
    font-size: 0.85rem;
}

.balance-preview-row .value {
    color: #fff;
    font-weight: 500;
    font-size: 0.95rem;
}

.balance-preview-row.highlight .value {
    color: #4ecdc4;
    font-weight: 600;
}

.rebalance-validation {
    background: #1a1a2e;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
}

.validation-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.validation-row .label {
    color: #9ca3af;
    font-size: 0.85rem;
}

.validation-row .value {
    font-weight: 500;
    font-family: 'SF Mono', Monaco, monospace;
}

.validation-status {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    text-align: center;
}

.validation-status.valid {
    background: rgba(78, 205, 196, 0.15);
    color: #4ecdc4;
    border: 1px solid rgba(78, 205, 196, 0.3);
}

.validation-status.invalid {
    background: rgba(255, 107, 107, 0.15);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.validation-status.warning {
    background: rgba(245, 158, 11, 0.15);
    color: #F59E0B;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Section hint text */
.section-hint {
    color: #6b7280;
    font-size: 0.85rem;
    margin: 0;
}

/* Button group in section header */
.section-header .button-group {
    display: flex;
    gap: 8px;
}

/* Form row for side-by-side inputs */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* ===================================================================
   Transactions V2 Tab Styles
   =================================================================== */

/* V2 Table */
.v2-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.v2-table th,
.v2-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.v2-table th {
    background-color: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-primary);
}

.v2-table tbody tr:hover {
    background-color: rgba(59, 130, 246, 0.1);
}

.v2-table .clickable-row {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

/* ID text styling for clickable IDs */
.v2-table .id-text {
    cursor: pointer;
}

.v2-table .id-text:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* Clickable link styling for Client/Customer columns */
.v2-table .clickable-link {
    cursor: pointer;
    color: var(--accent-primary);
}

.v2-table .clickable-link:hover {
    text-decoration: underline;
}

/* Timestamp columns - compact display */
.v2-table .timestamp-cell {
    white-space: nowrap;
    font-size: 0.9em;
    color: var(--text-secondary);
    min-width: 70px;
}

/* Amount column styling */
.v2-table .amount-cell {
    white-space: nowrap;
    font-weight: 500;
    font-family: monospace;
    text-align: right;
}

/* Amount filter input group */
.amount-filter-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.amount-filter-group input[type="number"] {
    width: 80px;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.amount-filter-group input[type="number"]:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.amount-filter-group input[type="number"]::placeholder {
    color: var(--text-muted);
}

.amount-filter-group .amount-separator {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* V2 Detail View */
#v2-detail-view {
    padding: 16px 0;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

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

/* V2 Leg Cards */
#v2-legs-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
}

.leg-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    min-width: 200px;
    max-width: 280px;
}

.leg-card.leg-completed {
    border-color: var(--accent-success);
}

.leg-card.leg-pending,
.leg-card.leg-initiated {
    border-color: var(--accent-warning);
}

.leg-card.leg-failed {
    border-color: var(--accent-danger);
}

.leg-card.leg-not_started {
    border-color: var(--text-muted);
}

.leg-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.leg-sequence {
    background: var(--accent-primary);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.leg-type {
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    font-size: 13px;
}

.leg-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.leg-row {
    display: flex;
    gap: 8px;
    font-size: 12px;
}

.leg-row .label {
    color: var(--text-secondary);
    min-width: 70px;
}

.leg-row .value {
    color: var(--text-primary);
    word-break: break-all;
}

.leg-row.leg-error .value {
    color: var(--accent-danger);
}

.leg-connector {
    display: flex;
    align-items: center;
    padding: 0 8px;
}

.leg-connector .arrow {
    font-size: 20px;
    color: var(--text-secondary);
}

/* V2 Pagination */
.pagination {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

#v2-page-info {
    color: var(--text-secondary);
}

/* No data text */
.no-data-text {
    color: var(--text-secondary);
    font-style: italic;
}

/* Badge variants for transaction types and statuses */
.badge-onramp {
    background-color: var(--accent-success);
    color: white;
}

.badge-offramp {
    background-color: var(--accent-primary);
    color: white;
}

.badge-swap {
    background-color: #9333EA;
    color: white;
}

.badge-pending {
    background-color: var(--accent-warning);
    color: black;
}

.badge-processing {
    background-color: var(--accent-primary);
    color: white;
}

.badge-completed {
    background-color: var(--accent-success);
    color: white;
}

.badge-failed {
    background-color: var(--accent-danger);
    color: white;
}

.badge-cancelled,
.badge-canceled {
    background-color: var(--text-muted);
    color: white;
}

.badge-reversed {
    background-color: #6366F1;
    color: white;
}

.badge-paused_float,
.badge-paused_manual_review {
    background-color: var(--accent-warning);
    color: black;
}

.badge-not_started {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.badge-initiated {
    background-color: var(--accent-warning);
    color: black;
}

/* ===================================================================
   V2 Transaction Legs - Visual Flow Style (like V1)
   =================================================================== */

.legs-visual {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 0;
}

/* Base leg box styling */
.leg-box {
    width: 160px;
    padding: 14px 12px;
    border-radius: 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.leg-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Leg box status colors */
.leg-box.leg-completed {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: #fff;
}

.leg-box.leg-pending {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    color: #1a1a2e;
}

.leg-box.leg-failed {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    color: #fff;
}

.leg-box.leg-not-started {
    background: linear-gradient(135deg, #6B7280 0%, #4B5563 100%);
    color: #D1D5DB;
}

/* Leg name (type) */
.leg-name {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Leg status badge */
.leg-status-badge {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    display: inline-block;
}

/* Leg amount */
.leg-box .leg-amount {
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 4px;
}

/* Arrow connector between legs */
.leg-arrow {
    font-size: 1.5rem;
    color: #444;
    font-weight: bold;
    display: flex;
    align-items: center;
    align-self: center;
}

/* Stranger Things Theme - V2 Legs */
.stranger-things-theme .leg-box.leg-completed {
    background: linear-gradient(135deg, #3a5fe5 0%, #2a4fc5 100%);
    box-shadow: 0 0 10px rgba(58, 95, 229, 0.4);
}

.stranger-things-theme .leg-box.leg-pending {
    background: linear-gradient(135deg, #ff6b35 0%, #cc5528 100%);
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.4);
}

.stranger-things-theme .leg-box.leg-failed {
    background: linear-gradient(135deg, #ff1515 0%, #aa0000 100%);
    box-shadow: 0 0 10px rgba(255, 21, 21, 0.4);
}

.stranger-things-theme .leg-box.leg-not-started {
    background: linear-gradient(135deg, #3d1515 0%, #2d1010 100%);
    border: 1px solid #3d1515;
    box-shadow: 0 0 10px rgba(255, 21, 21, 0.2);
}

.stranger-things-theme .leg-arrow {
    color: #ff1515;
    text-shadow: 0 0 10px rgba(255, 21, 21, 0.5);
}

/* Leg network label */
.leg-network {
    font-size: 0.7rem;
    opacity: 0.85;
    margin-top: 2px;
}

/* Explorer link in leg boxes */
.leg-box .explorer-link {
    font-size: 0.65rem;
    color: inherit;
    text-decoration: underline;
    opacity: 0.85;
    margin-top: 4px;
    transition: opacity 0.2s ease;
}

.leg-box .explorer-link:hover {
    opacity: 1;
}

/* ===================================================================
   V2 Transaction Detail - Failure/Reason Styling
   =================================================================== */

/* Failure reason box with red background (like V1) */
#v2-tx-reason {
    background-color: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 4px;
    padding: 8px 12px;
    color: #f87171;
    display: inline-block;
}

.stranger-things-theme #v2-tx-reason {
    background-color: rgba(255, 21, 21, 0.2);
    border: 1px solid rgba(255, 21, 21, 0.5);
    color: #ff6b6b;
}

/* ===================================================================
   Embedded Transactions - For Customer/Client Detail Views
   =================================================================== */

.embedded-transactions {
    margin-top: 0.75rem;
}

.embedded-tx-controls {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.embedded-tx-filters {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    flex: 1;
}

.embedded-tx-controls select {
    background: var(--input-bg, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 4px;
    padding: 0.375rem 0.5rem;
    color: var(--text-color, #fff);
    font-size: 0.8rem;
}

.embedded-tx-controls select.locked-filter {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--input-bg, rgba(255, 255, 255, 0.02));
}

.embedded-tx-controls .btn {
    flex-shrink: 0;
}

.embedded-tx-loading,
.embedded-tx-empty {
    color: var(--text-muted);
    font-size: 0.875rem;
    padding: 1rem 0;
    text-align: center;
}

.embedded-tx-loading .spinner {
    margin: 0.5rem auto;
}

.embedded-tx-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.embedded-tx-table th,
.embedded-tx-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

.embedded-tx-table th {
    background: var(--card-bg, rgba(255, 255, 255, 0.03));
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.embedded-tx-table tr.clickable-row {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.embedded-tx-table tr.clickable-row:hover {
    background: var(--card-hover-bg, rgba(255, 255, 255, 0.05));
}

.embedded-tx-pagination {
    margin-top: 0.75rem;
    text-align: center;
}

/* ================================================
   Shared Transactions Table with Column Filters
   ================================================ */

/* Table controls bar */
.tx-table-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    flex-wrap: wrap;
}

.tx-active-filters {
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex: 1;
}

/* Saved Views Dropdown */
.tx-saved-views {
    position: relative;
}

.saved-views-dropdown {
    position: relative;
}

.saved-views-btn {
    min-width: 110px;
}

.saved-views-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 200;
    margin-top: 4px;
}

.saved-views-menu.hidden {
    display: none;
}

.saved-views-list {
    max-height: 200px;
    overflow-y: auto;
}

.saved-view-empty {
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-style: italic;
}

.saved-view-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.1s;
}

.saved-view-item:last-child {
    border-bottom: none;
}

.saved-view-item:hover {
    background: var(--bg-secondary);
}

.saved-view-item .saved-view-name {
    flex: 1;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.25rem 0;
}

.saved-view-item .saved-view-delete {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
    opacity: 0.5;
    transition: opacity 0.1s, color 0.1s;
}

.saved-view-item .saved-view-delete:hover {
    opacity: 1;
    color: var(--error-color, #ff4444);
}

.saved-views-divider {
    height: 1px;
    background: var(--border-color);
}

.save-view-form {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
}

.save-view-form input {
    flex: 1;
    min-width: 0;
    padding: 0.375rem 0.5rem;
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.save-view-form input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.save-view-form button {
    flex-shrink: 0;
}

/* Loading and empty states */
.tx-loading,
.tx-empty {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
}

.tx-loading .spinner {
    margin-top: 1rem;
}

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

/* Filterable table */
.tx-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.tx-table th,
.tx-table td {
    padding: 0.625rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.tx-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    white-space: nowrap;
    position: relative;
}

.tx-table tbody tr:hover {
    background: var(--card-hover-bg, rgba(255, 255, 255, 0.03));
}

.tx-table .clickable-row {
    cursor: pointer;
}

/* Filterable column headers */
.tx-table th.filterable {
    cursor: pointer;
    user-select: none;
}

.tx-table th.filterable .th-content {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.tx-table th.filterable .filter-icon {
    font-size: 0.7rem;
    opacity: 0.5;
    transition: opacity 0.15s, transform 0.15s;
}

.tx-table th.filterable:hover .filter-icon {
    opacity: 1;
}

.tx-table th.filterable.dropdown-open .filter-icon {
    opacity: 1;
    transform: rotate(180deg);
}

.tx-table th.filterable.has-filter .filter-icon {
    opacity: 1;
    color: var(--accent-primary);
}

.tx-table th.filterable.filter-locked {
    cursor: default;
}

.tx-table th.filterable.filter-locked .filter-icon {
    opacity: 0.7;
    font-size: 0.6rem;
}

/* Hide filter icon when only one option exists */
.tx-table th.filterable.filter-hidden .filter-icon {
    display: none;
}

.tx-table th.filterable.filter-hidden .th-content {
    cursor: default;
}

.tx-table th.filterable.filter-hidden .th-content:hover {
    background: transparent;
}

/* Column filter dropdown */
.column-filter-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    max-width: 280px;
    max-height: 320px;
    overflow-y: auto;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 100;
    padding: 0.5rem;
}

.column-filter-dropdown.open {
    display: block;
}

/* Filter options (checkboxes/radios) */
.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.filter-options label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: normal;
    white-space: nowrap;
    transition: background 0.1s;
}

.filter-options label:hover {
    background: var(--bg-secondary);
}

.filter-options input[type="checkbox"],
.filter-options input[type="radio"] {
    accent-color: var(--accent-primary);
    width: 14px;
    height: 14px;
}

.filter-empty {
    padding: 0.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-style: italic;
}

/* Amount filter inputs in dropdown */
.filter-amount-inputs {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.25rem;
}

.filter-amount-inputs input[type="number"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.85rem;
}

.filter-amount-inputs input[type="number"]:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.filter-amount-inputs span {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.filter-amount-inputs .filter-amount-apply {
    margin-top: 0.25rem;
    padding: 0.375rem 0.75rem;
}

/* ID filter input */
.filter-id-input {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.25rem;
    min-width: 200px;
}

.filter-id-input input[type="text"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: var(--font-mono);
}

.filter-id-input input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.filter-id-input .filter-id-apply,
.filter-id-input .filter-id-clear {
    padding: 0.375rem 0.75rem;
}

.filter-id-input .filter-id-clear {
    margin-top: -0.25rem;
}

/* Pagination */
.tx-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem 0;
}

.tx-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Cell styles */
.tx-table .mono {
    font-family: monospace;
    font-size: 0.85rem;
}

.tx-table .amount-cell {
    font-family: monospace;
    text-align: right;
    white-space: nowrap;
}

.tx-table .timestamp-cell {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.tx-table .clickable-link {
    color: var(--accent-primary);
    cursor: pointer;
}

.tx-table .clickable-link:hover {
    text-decoration: underline;
}

/* Copy button in cells */
.tx-table .copy-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 0.25rem;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.15s;
}

.tx-table tr:hover .copy-btn {
    opacity: 0.7;
}

.tx-table .copy-btn:hover {
    opacity: 1;
    color: var(--accent-primary);
}

.tx-table .copy-btn.copied {
    color: var(--success);
    opacity: 1;
}

/* ===================================================================
   All Accounts Section - Account Type Badges
   =================================================================== */

.section-header-with-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.section-header-with-toggle h3 {
    margin: 0;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

.toggle-label input[type="checkbox"] {
    accent-color: var(--accent-primary);
}

.account-type-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-asset {
    background-color: rgba(16, 185, 129, 0.2);
    color: #10B981;
}

.badge-liability {
    background-color: rgba(239, 68, 68, 0.2);
    color: #EF4444;
}

.badge-equity {
    background-color: rgba(139, 92, 246, 0.2);
    color: #8B5CF6;
}

.badge-income {
    background-color: rgba(59, 130, 246, 0.2);
    color: #3B82F6;
}

.badge-expense {
    background-color: rgba(249, 115, 22, 0.2);
    color: #F97316;
}

.badge-neutral {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
}

.account-zero-balance {
    opacity: 0.5;
}

.account-zero-balance td {
    color: var(--text-tertiary);
}

#all-accounts-table .text-right {
    text-align: right;
}
