/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #0b0f19;
    --panel-bg: rgba(17, 24, 39, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --violet-accent: #8b5cf6;
    --violet-glow: rgba(139, 92, 246, 0.15);
    --cyan-accent: #06b6d4;
    --cyan-glow: rgba(6, 182, 212, 0.15);
    --green-accent: #10b981;
    --green-glow: rgba(16, 185, 129, 0.15);
    --orange-accent: #f97316;
    --orange-glow: rgba(249, 115, 22, 0.15);
    --red-accent: #ef4444;
    --red-glow: rgba(239, 68, 68, 0.15);
}

body {
    background-color: var(--bg-dark);
    font-family: 'Plus Jakarta Sans', 'Outfit', system-ui, -apple-system, sans-serif;
    color: var(--text-primary);
    line-height: 1.5;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(139, 92, 246, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(6, 182, 212, 0.08) 0%, transparent 40%);
    background-attachment: fixed;
    min-height: 100vh;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Glassmorphism utility */
.glass {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 2.25rem;
}

.logo-area h1 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.8rem;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.badge {
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--violet-accent), var(--cyan-accent));
    color: white;
    -webkit-text-fill-color: white;
    vertical-align: middle;
    margin-left: 0.5rem;
    font-weight: 600;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-indicator.online {
    background-color: var(--green-accent);
    box-shadow: 0 0 8px var(--green-accent);
}

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

/* Form and Upload */
.control-panel {
    padding: 2rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

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

.form-column {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.justify-center {
    justify-content: center;
}

.form-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: -0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
}

.required {
    color: var(--red-accent);
}

/* Dropzone styling */
.dropzone {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--violet-accent);
    background: rgba(139, 92, 246, 0.03);
    box-shadow: 0 0 16px rgba(139, 92, 246, 0.1);
}

.dropzone-icon {
    font-size: 2.5rem;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

.dropzone:hover .dropzone-icon {
    transform: translateY(-4px);
}

.dropzone-text {
    font-weight: 600;
    font-size: 1rem;
}

.dropzone-subtext {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.file-hidden {
    display: none;
}

/* File Selected Info */
.file-selected-name {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
}

.file-selected-name.hidden {
    display: none !important;
}

.file-icon {
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

#fileNameSpan {
    font-weight: 500;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-grow: 1;
}

.clear-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 0.5rem;
    line-height: 1;
}

.clear-btn:hover {
    color: var(--red-accent);
}

/* Input Fields */
.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

input[type="text"], input[type="url"], input[type="password"], select {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: white;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
}

input[type="text"]:focus, input[type="url"]:focus, input[type="password"]:focus, select:focus {
    border-color: var(--violet-accent);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.15);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    border: none;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: 0.95rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--violet-accent), #7c3aed);
    color: white;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
}

.btn-secondary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-submit {
    width: 100%;
    margin-top: 1rem;
    padding: 0.9rem;
}

/* Spinner and loading states */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

.spinner.hidden {
    display: none;
}

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

/* Progress Tracker Panel */
.progress-tracker {
    margin-top: 2rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.01);
    border-radius: 8px;
}

.progress-tracker.hidden {
    display: none;
}

.progress-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.progress-title-row h3 {
    font-size: 1rem;
    font-weight: 600;
}

#progressPercentage {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--violet-accent);
}

.progress-bar-bg {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--violet-accent) 0%, var(--cyan-accent) 100%);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.stages-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
}

.stage-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.3s ease;
    flex: 1 1 180px;
}

.stage-bullet {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.stage-item.active {
    color: white;
}

.stage-item.active .stage-bullet {
    background: var(--violet-accent);
    border-color: var(--violet-accent);
    color: white;
    box-shadow: 0 0 8px var(--violet-glow);
}

.stage-item.completed {
    color: var(--green-accent);
}

.stage-item.completed .stage-bullet {
    background: var(--green-accent);
    border-color: var(--green-accent);
    color: white;
    content: "✓";
}

/* Dashboard Area */
.dashboard-area {
    opacity: 1;
    transition: opacity 0.5s ease;
}

.dashboard-area.hidden {
    display: none !important;
}

/* Summary Meta Row */
.summary-meta-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 1000px) {
    .summary-meta-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .summary-meta-row {
        grid-template-columns: 1fr;
    }
}

.meta-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
}

.meta-icon {
    font-size: 1.75rem;
    background: rgba(255, 255, 255, 0.03);
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.meta-info {
    display: flex;
    flex-direction: column;
}

.meta-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 600;
}

.meta-info h4 {
    font-size: 1rem;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 190px;
}

/* Metrics Cards Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

@media (max-width: 1100px) {
    .metrics-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 750px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

.metric-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.metric-card-icon {
    font-size: 1.1rem;
}

.metric-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.7rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.metric-subtext {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Metric Colors */
.text-violet { color: #a78bfa; }
.text-cyan { color: #22d3ee; }
.text-green { color: #34d399; }
.text-orange { color: #fb923c; }
.text-red { color: #f87171; }

.glow-violet:hover { box-shadow: 0 8px 30px var(--violet-glow); border-color: rgba(139, 92, 246, 0.2); }
.glow-cyan:hover { box-shadow: 0 8px 30px var(--cyan-glow); border-color: rgba(6, 182, 212, 0.2); }
.glow-green:hover { box-shadow: 0 8px 30px var(--green-glow); border-color: rgba(16, 185, 129, 0.2); }
.glow-orange:hover { box-shadow: 0 8px 30px var(--orange-glow); border-color: rgba(249, 115, 22, 0.2); }
.glow-red:hover { box-shadow: 0 8px 30px var(--red-glow); border-color: rgba(239, 68, 68, 0.2); }

/* Dashboard Split Layout */
.dashboard-split {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 2rem;
}

@media (max-width: 1100px) {
    .dashboard-split {
        grid-template-columns: 1fr;
    }
}

.split-column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Panels */
.dashboard-panel {
    border-radius: 16px;
    overflow: hidden;
}

.panel-header {
    background: rgba(255, 255, 255, 0.02);
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.panel-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
}

.panel-title-icon {
    font-size: 1.25rem;
}

.panel-body {
    padding: 1.5rem;
}

/* Markdown Rendering formatting */
.markdown-body {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.markdown-body p {
    margin-bottom: 1rem;
}

.markdown-body p:last-child {
    margin-bottom: 0;
}

.markdown-body ul {
    margin-bottom: 1rem;
    padding-left: 1.25rem;
}

.markdown-body li {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.markdown-body strong {
    color: white;
    font-weight: 600;
}

.markdown-body blockquote {
    border-left: 3px solid var(--violet-accent);
    background: rgba(139, 92, 246, 0.05);
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-style: italic;
    color: var(--text-secondary);
}

/* Warnings and Alerts */
.warnings-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.warning-item {
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.15);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #fca5a5;
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.warning-item::before {
    content: "⚠️";
}

.warning-item.hidden {
    display: none !important;
}

/* Tab Navigation */
.tabs-nav {
    display: flex;
    padding: 0.35rem;
    gap: 0.25rem;
    border-radius: 12px;
}

.tab-btn {
    flex-grow: 1;
    background: none;
    border: none;
    outline: none;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.tab-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
    color: white;
    background: linear-gradient(135deg, var(--violet-accent), #7c3aed);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
}

/* Tab Content Visibility */
.tab-content {
    display: none;
}

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

/* Tables */
.table-container {
    overflow-x: auto;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.85rem;
}

th {
    padding: 1rem 1.25rem;
    font-weight: 700;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.01);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

td {
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.015);
}

/* Payment subtabs */
.payment-subtabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.subtab-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.2s ease;
}

.subtab-btn:hover {
    color: white;
    border-color: rgba(255, 255, 255, 0.15);
}

.subtab-btn.active {
    color: white;
    border-color: var(--cyan-accent);
    background: rgba(6, 182, 212, 0.08);
}

.subtab-content {
    display: none;
}

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

.payment-summary-bar {
    display: flex;
    justify-content: space-between;
    background: rgba(6, 182, 212, 0.04);
    border: 1px solid rgba(6, 182, 212, 0.12);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

@media (max-width: 600px) {
    .payment-summary-bar {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Transaction Log Controls */
.log-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.log-controls input {
    flex-grow: 1;
}

.log-controls select {
    width: 180px;
}

@media (max-width: 600px) {
    .log-controls {
        flex-direction: column;
    }
    .log-controls select {
        width: 100%;
    }
}

.log-table-container {
    max-height: 480px;
    overflow-y: auto;
}

.pagination-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Manual Insights Tab widgets */
.insights-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

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

.insight-detail-card {
    padding: 1.5rem;
}

.insight-detail-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    font-family: 'Outfit', sans-serif;
    color: white;
}

.peak-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.peak-item:last-child {
    margin-bottom: 0;
}

.peak-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.peak-label.debit { color: #f87171; }
.peak-label.credit { color: #34d399; }

.peak-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0.25rem 0;
}

.peak-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.65rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.85rem;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    color: var(--text-secondary);
}

.stat-val {
    font-weight: 700;
}

/* Trend chart styling (HTML / CSS based bar chart) */
.trend-card {
    padding: 1.5rem;
}

.trend-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    font-family: 'Outfit', sans-serif;
}

.trend-bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 180px;
    padding-top: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.trend-bar-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}

.trend-bar-hover-box {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
}

.trend-bar {
    width: 28px;
    border-radius: 4px 4px 0 0;
    min-height: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
    cursor: pointer;
}

.trend-bar.positive {
    background: linear-gradient(180deg, var(--green-accent) 0%, rgba(16, 185, 129, 0.4) 100%);
}

.trend-bar.negative {
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.4) 0%, var(--red-accent) 100%);
    border-radius: 0 0 4px 4px;
}

.trend-bar:hover {
    transform: scaleY(1.05);
    opacity: 0.9;
}

.trend-tooltip {
    position: absolute;
    bottom: 100%;
    background: black;
    color: white;
    padding: 0.35rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 10;
    margin-bottom: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
}

.trend-bar-container:hover .trend-tooltip {
    opacity: 1;
}

.trend-bar-label {
    margin-top: 0.5rem;
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Category Badges for Log */
.badge-category {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-block;
}

.badge-Salary { background: rgba(16, 185, 129, 0.15); color: #a7f3d0; border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-Rent { background: rgba(249, 115, 22, 0.15); color: #ffedd5; border: 1px solid rgba(249, 115, 22, 0.2); }
.badge-EMI { background: rgba(239, 68, 68, 0.15); color: #fee2e2; border: 1px solid rgba(239, 68, 68, 0.2); }
.badge-Utility { background: rgba(6, 182, 212, 0.15); color: #cffafe; border: 1px solid rgba(6, 182, 212, 0.2); }
.badge-Bounce { background: rgba(220, 38, 38, 0.25); color: #fca5a5; border: 1px solid rgba(220, 38, 38, 0.3); font-weight: 800; }
.badge-Other { background: rgba(255, 255, 255, 0.05); color: var(--text-secondary); border: 1px solid rgba(255, 255, 255, 0.05); }

/* Top 5 Counterparties Section */
.counterparties-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

@media (max-width: 750px) {
    .counterparties-section {
        grid-template-columns: 1fr;
    }
}

.counterparties-section .insight-detail-card table {
    width: 100%;
}

.counterparties-section td:first-child,
.counterparties-section th:first-child {
    width: 36px;
    text-align: center;
}

.counterparty-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.75rem;
}

.rank-1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #000; }
.rank-2 { background: linear-gradient(135deg, #d1d5db, #9ca3af); color: #000; }
.rank-3 { background: linear-gradient(135deg, #d97706, #b45309); color: #fff; }
.rank-4, .rank-5 { background: rgba(255,255,255,0.06); color: var(--text-secondary); }
