/* ============================================================
   TOI Commodities ERP — Trade Finance
   Complete CSS Theme
   ============================================================ */

:root {
    /* Colors */
    --primary: #1a56db;
    --primary-light: #e8eefb;
    --primary-dark: #1240a8;
    --secondary: #0f172a;
    --accent: #f59e0b;
    --accent-light: #fef3c7;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;

    /* Neutrals */
    --bg: #f1f5f9;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    /* Sidebar */
    --sidebar-bg: #0f172a;
    --sidebar-text: #cbd5e1;
    --sidebar-active: #1a56db;
    --sidebar-hover: #1e293b;
    --sidebar-width: 260px;

    /* Sizing */
    --topbar-height: 60px;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
}

/* ---- Reset ---- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    font-size: 14px;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.logo i {
    font-size: 24px;
    color: var(--accent);
}

.version {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-muted);
}

.nav-menu {
    list-style: none;
    padding: 12px 0;
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    font-size: 13.5px;
    position: relative;
}

.nav-item:hover {
    background: var(--sidebar-hover);
}

.nav-item.active {
    background: rgba(26, 86, 219, 0.15);
    border-left-color: var(--sidebar-active);
    color: #fff;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 15px;
}

.nav-item .badge {
    margin-left: auto;
    background: rgba(255,255,255,0.15);
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.nav-item .badge.warn {
    background: var(--warning);
    color: #000;
}

.nav-item .badge.alert {
    background: var(--danger);
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

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

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    height: 100vh;
    overflow-y: auto;
    transition: margin-left 0.3s ease;
}

.main-content.expanded {
    margin-left: 0;
}

/* ---- Topbar ---- */
.topbar {
    height: var(--topbar-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-secondary);
    display: none;
}

.topbar-left h1 {
    font-size: 18px;
    font-weight: 600;
}

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

.entity-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.entity-selector label {
    color: var(--text-secondary);
    font-weight: 500;
}

.entity-selector select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    background: #fff;
    cursor: pointer;
}

.topbar-actions {
    display: flex;
    gap: 4px;
}

.icon-btn {
    background: none;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background 0.2s;
}

.icon-btn:hover {
    background: var(--bg);
}

.notification-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
}

.date-display {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ---- Module Content ---- */
.module-content {
    display: none;
    padding: 24px;
    animation: fadeIn 0.3s ease;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   CARD SYSTEM
   ============================================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
}

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

.card-header h2 {
    font-size: 15px;
    font-weight: 600;
}

.card-header h3 {
    font-size: 14px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ---- Grid System ---- */
.grid {
    display: grid;
    gap: 20px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* ---- KPI Cards ---- */
.kpi-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 20px;
    box-shadow: var(--shadow);
}

.kpi-card .kpi-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.kpi-card .kpi-value {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
}

.kpi-card .kpi-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.kpi-card .kpi-sub.positive { color: var(--success); }
.kpi-card .kpi-sub.negative { color: var(--danger); }

.kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 12px;
}

.kpi-icon.blue { background: var(--info-light); color: var(--info); }
.kpi-icon.green { background: var(--success-light); color: var(--success); }
.kpi-icon.amber { background: var(--warning-light); color: var(--warning); }
.kpi-icon.red { background: var(--danger-light); color: var(--danger); }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper {
    overflow-x: auto;
}

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

thead th {
    background: var(--bg);
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

tbody tr:hover {
    background: var(--primary-light);
    cursor: pointer;
}

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

/* ---- Status Badges ---- */
.status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-active { background: var(--success-light); color: #065f46; }
.status-frozen { background: var(--info-light); color: #1e40af; }
.status-expired { background: var(--danger-light); color: #991b1b; }
.status-pending { background: var(--warning-light); color: #92400e; }
.status-draft { background: #f1f5f9; color: #475569; }
.status-repaid { background: #e0e7ff; color: #3730a3; }
.status-dormant { background: #f1f5f9; color: #64748b; }
.status-recommended { background: #d1fae5; color: #065f46; border: 1px solid #10b981; }
.status-disqualified { background: #fee2e2; color: #991b1b; }

.status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}
.status-active::before { background: var(--success); }
.status-frozen::before { background: var(--info); }
.status-expired::before { background: var(--danger); }
.status-pending::before { background: var(--warning); }
.status-draft::before { background: var(--text-muted); }
.status-repaid::before { background: #6366f1; }
.status-dormant::before { background: var(--text-muted); }

/* ============================================================
   PROGRESS BARS
   ============================================================ */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-bar .fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease;
}

.progress-bar .fill.green { background: var(--success); }
.progress-bar .fill.blue { background: var(--primary); }
.progress-bar .fill.amber { background: var(--warning); }
.progress-bar .fill.red { background: var(--danger); }

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-top: 4px;
    color: var(--text-secondary);
}

.utilization-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.utilization-bar .progress-bar {
    flex: 1;
    min-width: 100px;
}

.utilization-bar .pct {
    font-size: 13px;
    font-weight: 600;
    min-width: 45px;
    text-align: right;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary {
    background: #fff;
    color: var(--text);
    border-color: var(--border);
}
.btn-secondary:hover { background: var(--bg); }

.btn-success {
    background: var(--success);
    color: #fff;
}
.btn-success:hover { background: #059669; }

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--primary);
}
.btn-ghost:hover { background: var(--primary-light); }

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-group {
    display: flex;
    gap: 8px;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}

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

/* ============================================================
   ALERTS & NOTIFICATIONS
   ============================================================ */
.alert-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 12px;
}

.alert-banner.info { background: var(--info-light); color: #1e40af; border-left: 3px solid var(--info); }
.alert-banner.warn { background: var(--warning-light); color: #92400e; border-left: 3px solid var(--warning); }
.alert-banner.error { background: var(--danger-light); color: #991b1b; border-left: 3px solid var(--danger); }
.alert-banner.success { background: var(--success-light); color: #065f46; border-left: 3px solid var(--success); }

.alert-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline {
    display: flex;
    align-items: center;
    padding: 20px 0;
    position: relative;
}

.timeline-line {
    position: absolute;
    top: 50%;
    left: 40px;
    right: 40px;
    height: 3px;
    background: #e2e8f0;
    transform: translateY(-50%);
    z-index: 0;
}

.timeline-line .filled {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.8s ease;
}

.timeline-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.timeline-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e2e8f0;
    border: 3px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #fff;
    box-shadow: var(--shadow);
    margin-bottom: 8px;
}

.timeline-dot.completed {
    background: var(--success);
}

.timeline-dot.active {
    background: var(--primary);
    box-shadow: 0 0 0 4px rgba(26,86,219,0.2);
}

.timeline-dot.future {
    background: #e2e8f0;
    color: var(--text-muted);
}

.timeline-label {
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    color: var(--text-secondary);
}

.timeline-sub {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 2px;
}

/* ============================================================
   BANK SELECTION CARDS
   ============================================================ */
.selection-card {
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.2s;
    position: relative;
}

.selection-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.selection-card.recommended {
    border-color: var(--success);
    background: linear-gradient(135deg, #f0fdf4 0%, #fff 100%);
}

.selection-card.disqualified {
    border-color: var(--border);
    background: #f8fafc;
    opacity: 0.7;
}

.selection-card.warning-card {
    border-color: var(--warning);
    background: linear-gradient(135deg, #fffbeb 0%, #fff 100%);
}

.recommended-badge {
    position: absolute;
    top: -1px;
    right: 20px;
    background: var(--success);
    color: #fff;
    padding: 4px 12px;
    border-radius: 0 0 var(--radius) var(--radius);
    font-size: 11px;
    font-weight: 600;
}

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

.bank-name-large {
    font-size: 16px;
    font-weight: 600;
}

.cost-breakdown {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: var(--bg);
    border-radius: var(--radius);
    padding: 14px;
    margin: 12px 0;
}

.cost-line {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    padding: 2px 0;
}

.cost-line.total {
    grid-column: 1 / -1;
    border-top: 1px solid var(--border);
    padding-top: 8px;
    margin-top: 4px;
    font-weight: 700;
    font-size: 14px;
}

.cost-comparison-bar {
    height: 24px;
    background: var(--bg);
    border-radius: 4px;
    overflow: hidden;
    margin: 4px 0;
}

.cost-comparison-bar .bar {
    height: 100%;
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    transition: width 0.8s ease;
}

/* ============================================================
   CHARTS (CSS-only simple charts)
   ============================================================ */
.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bar-chart-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bar-chart-item .label {
    width: 100px;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: right;
    flex-shrink: 0;
}

.bar-chart-item .bar-bg {
    flex: 1;
    height: 22px;
    background: var(--bg);
    border-radius: 4px;
    overflow: hidden;
}

.bar-chart-item .bar-fill {
    height: 100%;
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    transition: width 0.8s ease;
}

.bar-chart-item .bar-fill[style*="--amber"] {
    color: #92400e;
}

.bar-chart-item .value {
    width: 80px;
    font-size: 12px;
    font-weight: 600;
}

/* Donut chart (CSS) */
.donut-chart {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.donut-center {
    position: absolute;
    width: 100px;
    height: 100px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.donut-center .pct {
    font-size: 24px;
    font-weight: 700;
}

.donut-center .lbl {
    font-size: 10px;
    color: var(--text-muted);
}

/* ============================================================
   EXPOSURE MAP (simplified)
   ============================================================ */
.exposure-country-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.exposure-country-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.flag-emoji {
    font-size: 18px;
    width: 28px;
    text-align: center;
}

.country-name {
    width: 80px;
    font-size: 12px;
    font-weight: 500;
}

.country-bar {
    flex: 1;
    height: 18px;
    background: var(--bg);
    border-radius: 3px;
    overflow: hidden;
}

.country-bar .fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.8s ease;
}

.country-pct {
    width: 60px;
    font-size: 12px;
    font-weight: 600;
    text-align: right;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-overlay.open {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 12px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--secondary);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 13px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.3s ease;
    min-width: 300px;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.info { border-left: 3px solid var(--info); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ============================================================
   TABS
   ============================================================ */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
}

.tab {
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab:hover {
    color: var(--text);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-bar .search-input {
    padding: 8px 12px 8px 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    width: 250px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") 10px center no-repeat;
    background-size: 16px;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}

.filter-pill.active {
    background: var(--primary);
    color: #fff;
}

/* ============================================================
   DETAIL PANEL (Info pairs)
   ============================================================ */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.detail-item .label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.detail-item .value {
    font-size: 14px;
    font-weight: 500;
}

.money {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.money.positive { color: var(--success); }
.money.negative { color: var(--danger); }

/* ============================================================
   BANK CARD (for ref module)
   ============================================================ */
.bank-group {
    margin-bottom: 20px;
}

.bank-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg);
    border-radius: var(--radius) var(--radius) 0 0;
    border: 1px solid var(--border);
    cursor: pointer;
}

.bank-group-header i {
    color: var(--primary);
    font-size: 18px;
}

.bank-group-header .bank-title {
    font-weight: 600;
    font-size: 14px;
}

.bank-group-header .swift {
    color: var(--text-muted);
    font-size: 12px;
    margin-left: 8px;
}

.bank-group-header .toggle {
    margin-left: auto;
    color: var(--text-muted);
}

.bank-accounts-table {
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
}

/* ============================================================
   WARNINGS INLINE
   ============================================================ */
.warning-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--warning);
    font-weight: 500;
}

.warning-tag i {
    font-size: 12px;
}

.danger-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--danger);
    font-weight: 500;
}

/* ============================================================
   MATURITY SCHEDULE
   ============================================================ */
.maturity-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.maturity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--bg);
    border-radius: var(--radius);
}

.maturity-date {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 60px;
}

.maturity-amount {
    font-size: 13px;
    font-weight: 600;
}

.maturity-bar {
    flex: 1;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.maturity-bar .fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
}

/* ============================================================
   SCORE CIRCLE
   ============================================================ */
.score-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.score-circle.high { background: var(--success); }
.score-circle.medium { background: var(--warning); }
.score-circle.low { background: var(--danger); }

/* ============================================================
   REPORT CARDS
   ============================================================ */
.report-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.report-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.report-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.report-icon.excel { background: #d1fae5; color: #059669; }
.report-icon.pdf { background: #fee2e2; color: #dc2626; }
.report-icon.chart { background: #dbeafe; color: #2563eb; }

.report-info h4 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
}

.report-info p {
    font-size: 12px;
    color: var(--text-muted);
}

.report-meta {
    margin-left: auto;
    text-align: right;
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .menu-toggle {
        display: block;
    }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .topbar-right { gap: 8px; }
    .entity-selector { display: none; }
}

/* ============================================================
   UTILITY
   ============================================================ */
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.font-mono { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 12px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }

.section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
