/* =====================================================
   CLAUX - CARDS
   ===================================================== */

.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: var(--transition);
}

.card-header {
    padding: 16px 20px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

/* Info icon spacing */
.card-header i,
.card-header .bi-info-circle {
    margin-left: 6px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    cursor: help;
}

.card-header i:hover,
.card-header .bi-info-circle:hover {
    opacity: 1;
}


.card-body {
    padding: 20px;
}

.card-body.p-0 {
    padding: 0;
}

/* ── STAT CARDS ───────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    padding: 20px 20px 16px;
    border: 1px solid var(--border);
    border-left: 3px solid transparent;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.stat-card:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.stat-card.blue  { border-left-color: #2563eb; }
.stat-card.green { border-left-color: #16a34a; }
.stat-card.orange{ border-left-color: #d97706; }
.stat-card.red   { border-left-color: #dc2626; }
.stat-card.purple{ border-left-color: #7c3aed; }
.stat-card.teal  { border-left-color: #0891b2; }
.stat-card.amber { border-left-color: #ea580c; }
.stat-card.indigo{ border-left-color: #4f46e5; }

/* Top row: label left, icon right */
.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-icon-wrap {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    color: white;
}

.stat-icon-wrap.blue   { background: #2563eb; }
.stat-icon-wrap.green  { background: #16a34a; }
.stat-icon-wrap.orange { background: #d97706; }
.stat-icon-wrap.red    { background: #dc2626; }
.stat-icon-wrap.purple { background: #7c3aed; }
.stat-icon-wrap.teal   { background: #0891b2; }
.stat-icon-wrap.amber  { background: #ea580c; }
.stat-icon-wrap.indigo { background: #4f46e5; }

/* Value row */
.stat-value {
    font-size: 1.625rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.5px;
}

/* Footer row: helper text + optional badge */
.stat-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    min-height: 20px;
}

.stat-helper {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-badge {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.stat-badge.green  { background: rgba(22,163,74,0.15);  color: #4ade80; }
.stat-badge.orange { background: rgba(217,119,6,0.15);  color: #fbbf24; }
.stat-badge.red    { background: rgba(220,38,38,0.15);  color: #f87171; }
.stat-badge.muted  { background: var(--bg-tertiary);    color: var(--text-muted); }

/* ── CHART CARD HEADER SUBTITLE ──────────────────── */
.chart-header-sub {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-left: auto;
}

/* ── ACTIVITY FEED IMPROVEMENTS ──────────────────── */
.activity-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.activity-value {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* ── CHART CONTAINERS ─────────────────────────────── */
.chart-container-donut {
    position: relative;
    width: 100%;
    max-width: 300px;
    height: 300px;
    margin: 0 auto;
}

.chart-container-bar {
    position: relative;
    height: 280px;
}

/* ── COUNTERPARTY LIST ────────────────────────────── */
.counterparty-list {
    padding: 4px 0;
}

.cp-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

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

.cp-item:hover {
    background: rgba(255,255,255,0.02);
}

.cp-rank {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.cp-item:first-child .cp-rank {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}

.cp-body {
    flex: 1;
    min-width: 0;
}

.cp-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.cp-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cp-value {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent);
    white-space: nowrap;
    flex-shrink: 0;
}

.cp-bar-track {
    height: 3px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    margin-bottom: 5px;
    overflow: hidden;
}

.cp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-light) 100%);
    border-radius: 2px;
    transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
}

.cp-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ── ACTIVITY FEED ────────────────────────────────── */
.activity-feed {
    max-height: 400px;
    overflow-y: auto;
    padding: 8px 16px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

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

.activity-item:hover {
    background: var(--hover-bg);
    border-radius: var(--radius);
    margin: 0 -12px;
    padding-left: 12px;
    padding-right: 12px;
}

.activity-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.activity-dot.green {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.2);
}

.activity-dot.orange {
    background: var(--warning);
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.2);
}

.activity-dot.red {
    background: var(--danger);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2);
}

.activity-body {
    flex: 1;
    min-width: 0;
}

.activity-title {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-meta {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* ── AUTH — SPLIT LAYOUT ──────────────────────────── */
#authSection {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    background: var(--bg-primary);
}

.auth-split {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* ── Left panel ────────────────────────────────────── */
.auth-left {
    width: 50%;
    background: #080d1a;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 48px;
    flex-shrink: 0;
}

.auth-left-inner {
    position: relative;
    z-index: 2;
    max-width: 340px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Decorative orbs */
.auth-left-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
    z-index: 1;
}

.auth-left-orb--1 {
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, rgba(37,99,235,0.3) 0%, transparent 70%);
    top: -100px;
    right: -100px;
}

.auth-left-orb--2 {
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, rgba(124,58,237,0.22) 0%, transparent 70%);
    bottom: -80px;
    left: -60px;
}

.auth-left-orb--3 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(8,145,178,0.18) 0%, transparent 70%);
    top: 50%;
    left: 30%;
    transform: translate(-50%, -50%);
}

/* Dot grid overlay */
.auth-left-grid {
    position: absolute;
    inset: 0;
    z-index: 1;
    background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
}

/* Brand */
.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 52px;
    align-self: flex-start;
}

.auth-brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
    box-shadow: 0 4px 16px rgba(37,99,235,0.45);
}

.auth-brand-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
}

/* Geometric visual */
.auth-left-visual {
    position: relative;
    width: 240px;
    height: 240px;
    margin: 0 auto 44px;
}

/* Concentric rings */
.auth-geo--ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.08);
    transform: translate(-50%, -50%);
}

.auth-geo--ring-1 {
    width: 240px;
    height: 240px;
    border-color: rgba(37,99,235,0.2);
    animation: auth-spin 18s linear infinite;
}

.auth-geo--ring-2 {
    width: 170px;
    height: 170px;
    border-color: rgba(124,58,237,0.2);
    animation: auth-spin 12s linear infinite reverse;
}

.auth-geo--ring-3 {
    width: 100px;
    height: 100px;
    border-color: rgba(8,145,178,0.2);
}

/* Diagonal lines */
.auth-geo--line {
    position: absolute;
    top: 50%;
    left: 50%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(37,99,235,0.3), transparent);
    transform-origin: left center;
}

.auth-geo--line-1 {
    width: 240px;
    transform: translate(-50%, -50%) rotate(30deg);
}

.auth-geo--line-2 {
    width: 240px;
    transform: translate(-50%, -50%) rotate(-30deg);
}

/* Centre icon */
.auth-geo-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    background: rgba(37,99,235,0.15);
    border: 1px solid rgba(37,99,235,0.4);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #60a5fa;
    box-shadow: 0 0 40px rgba(37,99,235,0.2);
}

@keyframes auth-spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Tagline */
.auth-left-tagline {
    font-size: 1.625rem;
    font-weight: 700;
    color: #e2e8f0;
    line-height: 1.3;
    letter-spacing: -0.3px;
    text-align: center;
    margin-bottom: 12px;
}

.auth-left-wordmark {
    font-size: 0.75rem;
    color: #475569;
    text-align: center;
    letter-spacing: 0.5px;
}

/* ── Right panel ───────────────────────────────────── */
.auth-right {
    flex: 1;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 56px;
    min-width: 0;
}

.auth-right-inner {
    width: 100%;
    max-width: 400px;
}

/* Form typography */
.auth-form-eyebrow {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    margin-bottom: 10px;
}

.auth-form-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.4px;
    margin-bottom: 8px;
    line-height: 1.2;
}

.auth-form-sub {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.55;
    margin-bottom: 32px;
}

/* Fields */
.auth-field {
    margin-bottom: 20px;
}

.auth-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.auth-hint {
    font-size: 0.7375rem;
    color: var(--text-muted);
    margin-top: 5px;
}

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 1;
}

.auth-input {
    padding-left: 40px !important;
    padding-right: 44px !important;
    height: 46px;
    background: var(--bg-secondary) !important;
    border-color: var(--border) !important;
    color: var(--text-primary) !important;
    font-size: 0.9rem !important;
    border-radius: var(--radius-lg) !important;
    transition: var(--transition) !important;
}

.auth-input:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15) !important;
    outline: none !important;
}

.auth-input::placeholder {
    color: var(--text-muted) !important;
    opacity: 1 !important;
}

.auth-input-reveal {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    transition: var(--transition);
    z-index: 1;
}

.auth-input-reveal:hover {
    color: var(--text-secondary);
}

/* Submit button */
.auth-submit {
    height: 48px;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--radius-lg) !important;
    margin-top: 8px;
    margin-bottom: 24px;
    letter-spacing: 0.1px;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Switch link */
.auth-switch {
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0;
}

.auth-link {
    color: var(--accent);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.auth-link:hover {
    color: #60a5fa;
    text-decoration: underline;
}

/* 2FA code input */
.auth-2fa-wrap {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.auth-2fa-input {
    width: 100%;
    height: 72px;
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: 0.5em;
    text-align: center;
    font-family: 'SF Mono', 'Courier New', monospace;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--accent);
    transition: var(--transition);
    padding-left: 0.5em;
}

.auth-2fa-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
    outline: none;
}

/* Error box */
.auth-error {
    background: rgba(220,38,38,0.1);
    border: 1px solid rgba(220,38,38,0.3);
    border-radius: var(--radius);
    color: #f87171;
    font-size: 0.8125rem;
    padding: 10px 14px;
    margin-bottom: 16px;
}

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 900px) {
    .auth-left {
        display: none;
    }

    .auth-right {
        padding: 40px 24px;
    }
}

@media (max-width: 480px) {
    .auth-right {
        padding: 32px 20px;
    }

    .auth-form-title {
        font-size: 1.5rem;
    }
}

/* ── RESPONSIVE ADJUSTMENTS ───────────────────────── */
@media (max-width: 1280px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card {
        padding: 16px 16px 12px;
    }

    .stat-value {
        font-size: 1.375rem;
    }

    .chart-container-bar {
        height: 220px;
    }

    .chart-container-donut {
        height: 250px;
        max-width: 250px;
    }
}

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