:root {
    --primary: #0f1729;
    --primary-light: #1a2742;
    --primary-lighter: #243352;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-light: #60a5fa;
    --accent-bg: #eff6ff;
    --accent-bg-hover: #dbeafe;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #0f172a;
    --text-secondary: #334155;
    --text-light: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --success: #10b981;
    --success-bg: #ecfdf5;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --info: #0ea5e9;
    --info-bg: #f0f9ff;
    --purple: #8b5cf6;
    --purple-bg: #f5f3ff;
    --orange: #f97316;
    --orange-bg: #fff7ed;
    --sidebar-w: 250px;
    --topbar-h: 60px;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    -webkit-font-smoothing: antialiased;
}

/* ═══ SCROLLBAR ═══ */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ═══ SIDEBAR ═══ */
.sidebar {
    width: var(--sidebar-w);
    background: var(--primary);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand {
    padding: 1.25rem 1.25rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-logo {
    flex-shrink: 0;
}

.brand-text h1 {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.brand-sub {
    font-size: 0.65rem;
    opacity: 0.45;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 500;
}

.sidebar-nav {
    flex: 1;
    padding: 0.5rem 0;
    overflow-y: auto;
}

.nav-section-label {
    padding: 1rem 1.25rem 0.4rem;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.3);
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 1.25rem;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.835rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    margin: 1px 0;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.9);
}

.nav-item.active {
    background: rgba(59, 130, 246, 0.12);
    color: #fff;
    border-left-color: var(--accent);
}

.nav-item .nav-icon {
    width: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.nav-item.active .nav-icon {
    opacity: 1;
}

.sidebar-bottom {
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.new-transaction-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    margin-bottom: 0.6rem;
}

.new-transaction-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.sidebar-links {
    padding: 0.3rem 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.4rem;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.8rem;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
}

.sidebar-link:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.4rem 0.2rem;
    margin-top: 0.3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), #818cf8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.user-name {
    font-size: 0.8rem;
    font-weight: 600;
}

.user-role {
    font-size: 0.65rem;
    opacity: 0.4;
}

/* ═══ MAIN CONTENT ═══ */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-height: 100vh;
}

/* ═══ TOPBAR ═══ */
.topbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.topbar-left h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.3px;
}

.topbar-tabs {
    display: flex;
    gap: 0.25rem;
}

.topbar-tab {
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
    color: var(--text-light);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
    font-weight: 500;
}

.topbar-tab:hover {
    color: var(--text);
    background: var(--border-light);
}

.topbar-tab.active {
    color: var(--text);
    background: var(--border-light);
    font-weight: 600;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.85rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}

.search-bar:hover {
    border-color: var(--text-muted);
}

.search-bar input {
    border: none;
    background: transparent;
    font-size: 0.8rem;
    color: var(--text-muted);
    outline: none;
    width: 150px;
    font-family: inherit;
    cursor: pointer;
}

/* ═══ PAGE CONTENT ═══ */
.page-content {
    padding: 1.5rem 2rem 2rem;
}

.section-header {
    margin-bottom: 1.25rem;
}

.section-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.2rem;
}

.section-desc {
    font-size: 0.835rem;
    color: var(--text-light);
}

/* ═══ TABS ═══ */
.tab-page {
    display: none;
}

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

/* ═══ CARDS ═══ */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.4rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.card-header h4 {
    font-size: 0.92rem;
    font-weight: 650;
    color: var(--text);
}

.card-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-icon.blue {
    background: var(--accent-bg);
    color: var(--accent);
}

.card-icon.green {
    background: var(--success-bg);
    color: var(--success);
}

.card-icon.purple {
    background: var(--purple-bg);
    color: var(--purple);
}

.card-icon.orange {
    background: var(--orange-bg);
    color: var(--orange);
}

/* ═══ GRID ═══ */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

/* ═══ FORMS ═══ */
.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.6rem;
}

.form-group label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.6rem 0.85rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: inherit;
    transition: all 0.2s;
    background: #fff;
    color: var(--text);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

/* ═══ BUTTONS ═══ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.3rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.835rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

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

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

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

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

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

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn.full-width {
    width: 100%;
}

/* ═══ DROPZONE ═══ */
.dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 1.8rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg);
    margin-bottom: 0.8rem;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--accent);
    background: var(--accent-bg);
}

.dropzone.has-file {
    border-color: var(--accent);
    border-style: solid;
    background: var(--accent-bg);
}

.dropzone-graphic {
    margin-bottom: 0.6rem;
    opacity: 0.7;
}

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

.dropzone-text span {
    color: var(--accent);
    font-weight: 600;
}

.dropzone-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.file-info {
    background: var(--accent-bg);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-sm);
    padding: 0.6rem 1rem;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
}

.file-info .file-name {
    font-weight: 600;
    color: var(--accent);
}

.file-info .file-remove {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
}

/* ═══ PRESETS ═══ */
.presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.8rem;
}

.preset-btn {
    padding: 0.3rem 0.7rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.73rem;
    cursor: pointer;
    color: var(--text-light);
    font-weight: 500;
    transition: all 0.15s;
    font-family: inherit;
}

.preset-btn:hover {
    background: var(--accent-bg);
    color: var(--accent);
    border-color: #bfdbfe;
}

/* ═══ COPILOT LAYOUT ═══ */
.copilot-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 0;
    height: calc(100vh - var(--topbar-h));
}

.copilot-main {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 2rem;
    background: var(--bg);
}

.chat-msg {
    margin-bottom: 1.25rem;
    display: flex;
    gap: 0.75rem;
    animation: msgFadeIn 0.3s ease;
}

@keyframes msgFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-msg.user {
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.bot-avatar {
    background: var(--primary);
    color: #fff;
}

.user-chat-avatar {
    background: var(--accent);
    color: #fff;
}

.chat-body {
    max-width: 70%;
    min-width: 0;
}

.chat-bubble {
    padding: 0.85rem 1.1rem;
    border-radius: 14px;
    font-size: 0.87rem;
    line-height: 1.65;
    word-wrap: break-word;
}

.chat-msg.bot .chat-bubble {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-top-left-radius: 4px;
    color: var(--text-secondary);
}

.chat-msg.user .chat-bubble {
    background: var(--accent);
    color: white;
    border-top-right-radius: 4px;
}

.chat-meta {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    padding: 0 0.2rem;
}

.chat-msg.user .chat-meta {
    text-align: right;
}

/* Inline data card inside chat */
.chat-data-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    margin-top: 0.6rem;
    font-size: 0.82rem;
}

.chat-data-card .data-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.3rem;
}

.chat-data-card .data-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
}

.chat-data-card .data-change {
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.4rem;
}

.data-change.positive {
    color: var(--success);
}

.data-change.negative {
    color: var(--danger);
}

/* Chat bottom */
.chat-bottom {
    border-top: 1px solid var(--border);
    background: var(--card-bg);
}

.quick-prompts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.85rem 1.25rem 0.5rem;
}

.quick-prompt {
    padding: 0.35rem 0.8rem;
    background: var(--accent-bg);
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    font-size: 0.75rem;
    cursor: pointer;
    color: var(--accent);
    font-weight: 500;
    transition: all 0.15s;
    font-family: inherit;
}

.quick-prompt:hover {
    background: var(--accent-bg-hover);
    border-color: var(--accent-light);
}

.chat-input-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem 0.85rem;
}

.chat-input-icon {
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

.chat-input-bar input {
    flex: 1;
    padding: 0.7rem 0;
    border: none;
    font-size: 0.87rem;
    outline: none;
    color: var(--text);
    font-family: inherit;
    background: transparent;
}

.chat-input-bar input::placeholder {
    color: var(--text-muted);
}

.chat-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

/* ═══ COPILOT SIDEBAR (insights) ═══ */
.copilot-sidebar {
    padding: 1.25rem;
    overflow-y: auto;
    background: var(--card-bg);
    height: calc(100vh - var(--topbar-h));
}

.insight-card {
    /* No border/shadow — it's already inside a panel */
}

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

.insight-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text);
}

.live-badge {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--accent-bg);
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
}

.live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(0.85);
    }
}

.insight-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
}

.insight-empty svg {
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

.insight-empty p {
    font-size: 0.82rem;
}

/* Insight metric blocks */
.insight-metric {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s;
}

.insight-metric:hover {
    border-color: var(--accent-light);
}

.insight-metric-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 0.25rem;
}

.insight-metric-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.insight-metric-value {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.5px;
}

.insight-metric-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* Insight items list */
.insight-section-title {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 0.6rem;
    margin-top: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.insight-section-title a {
    font-size: 0.68rem;
    color: var(--accent);
    text-decoration: none;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
}

.anomaly-item {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
}

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

.anomaly-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 5px;
    flex-shrink: 0;
}

.anomaly-dot.critical {
    background: var(--danger);
}

.anomaly-dot.high {
    background: var(--orange);
}

.anomaly-dot.medium {
    background: var(--warning);
}

.anomaly-dot.info {
    background: var(--success);
}

.anomaly-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.anomaly-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

/* Compliance card */
.compliance-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-lighter) 100%);
    border-radius: var(--radius);
    padding: 1.1rem;
    color: white;
    margin-top: 0.75rem;
}

.compliance-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
    margin-bottom: 0.5rem;
}

.compliance-header svg {
    opacity: 0.6;
}

.compliance-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.compliance-desc {
    font-size: 0.75rem;
    opacity: 0.6;
    line-height: 1.5;
}

.compliance-btn {
    display: inline-block;
    margin-top: 0.7rem;
    padding: 0.4rem 0.85rem;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.compliance-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ═══ BADGES ═══ */
.badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 5px;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-low {
    background: var(--success-bg);
    color: var(--success);
}

.badge-medium {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-high {
    background: #fff1f2;
    color: #e11d48;
}

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

.badge-approved {
    background: var(--success-bg);
    color: var(--success);
}

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

.badge-flagged {
    background: var(--danger-bg);
    color: var(--danger);
}

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

/* ═══ ROUTING BADGES ═══ */
.routing-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 600;
}

.routing-auto {
    background: var(--success-bg);
    color: var(--success);
}

.routing-manager {
    background: var(--accent-bg);
    color: var(--accent);
}

.routing-head {
    background: var(--warning-bg);
    color: var(--warning);
}

.routing-hr {
    background: var(--purple-bg);
    color: var(--purple);
}

.routing-flagged {
    background: var(--danger-bg);
    color: var(--danger);
}

/* ═══ RESULT PANEL ═══ */
.result-panel {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 1.25rem;
    display: none;
    box-shadow: var(--shadow);
}

.result-panel.visible {
    display: block;
    animation: fadeInUp 0.35s ease;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border);
}

.result-header h3 {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

/* Result grid */
.result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem 2rem;
}

.result-field {
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border-light);
}

.result-field:last-child,
.result-field:nth-last-child(2) {
    border-bottom: none;
}

.result-field-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.2rem;
}

.result-field-value {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
}

.result-field-value.amount {
    font-size: 1.1rem;
    font-weight: 700;
}

/* Alert cards in results */
.alert-card {
    padding: 0.7rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    font-size: 0.82rem;
    border-left: 4px solid;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.alert-card.critical {
    background: var(--danger-bg);
    border-color: var(--danger);
}

.alert-card.high {
    background: #fff1f2;
    border-color: #e11d48;
}

.alert-card.medium {
    background: var(--warning-bg);
    border-color: var(--warning);
}

.alert-card.info {
    background: var(--info-bg);
    border-color: var(--info);
}

.alert-card.success {
    background: var(--success-bg);
    border-color: var(--success);
}

.alert-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.alert-text {
    flex: 1;
    line-height: 1.5;
}

/* Line items */
.line-items {
    margin-top: 1rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--border);
}

.line-items h5 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.line-items ul {
    padding-left: 1.2rem;
    font-size: 0.82rem;
    color: var(--text-light);
}

.line-items li {
    margin-bottom: 0.2rem;
}

/* ═══ TABLES ═══ */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.data-table th {
    text-align: left;
    padding: 0.6rem 0.8rem;
    background: var(--bg);
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
}

.data-table td {
    padding: 0.65rem 0.8rem;
    border-bottom: 1px solid var(--border-light);
}

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

/* ═══ LOADING ═══ */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
}

.loading-white {
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: white;
}

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

/* Typing indicator */
.typing-dots {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    padding: 0.3rem 0;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typingBounce 1.2s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes typingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* ═══ TOAST ═══ */
#toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.1rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.835rem;
    animation: toastIn 0.3s ease;
    min-width: 260px;
    max-width: 400px;
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.info {
    border-left: 4px solid var(--accent);
}

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

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

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

/* ═══ ANIMATIONS ═══ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══ DASHBOARD ═══ */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.kpi-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem 1.4rem;
    box-shadow: var(--shadow-sm);
}

.kpi-card.kpi-danger {
    border-left: 3px solid var(--danger);
}

.kpi-card.kpi-success {
    border-left: 3px solid var(--success);
}

.kpi-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.4rem;
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
}

.kpi-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.insights-panel {
    margin-bottom: 1.2rem;
}

.insights-panel .card {
    margin-bottom: 0;
}

.insights-panel .alert-card {
    margin-bottom: 0.5rem;
}

.cat-bar-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border-light);
}

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

.cat-bar-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 140px;
    flex-shrink: 0;
}

.cat-bar-track {
    flex: 1;
    height: 8px;
    background: var(--border-light);
    border-radius: 4px;
    overflow: hidden;
}

.cat-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    border-radius: 4px;
    transition: width 0.6s ease;
}

.cat-bar-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    min-width: 100px;
    text-align: right;
    flex-shrink: 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.data-table thead th {
    text-align: left;
    padding: 0.7rem 0.8rem;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 2px solid var(--border);
}

.data-table tbody td {
    padding: 0.7rem 0.8rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: var(--border-light);
}

.data-table .amount {
    font-weight: 600;
}

.data-table code {
    font-size: 0.75rem;
    color: var(--accent);
    background: var(--accent-bg);
    padding: 2px 6px;
    border-radius: 4px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 4rem 2rem;
    text-align: center;
}

.empty-state h3 {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 0.88rem;
    color: var(--text-muted);
    max-width: 400px;
}

.card-icon.red {
    background: var(--danger-bg);
    color: var(--danger);
}

/* ═══ APPROVAL QUEUE ═══ */
.approval-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.approval-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.3rem;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s;
}

.approval-card.flagged {
    border-left: 3px solid var(--danger);
}

.approval-card.pending {
    border-left: 3px solid var(--warning);
}

.approval-card.approved {
    border-left: 3px solid var(--success);
}

.approval-card.rejected {
    border-left: 3px solid var(--text-muted);
    opacity: 0.7;
}

.approval-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.6rem;
}

.approval-card-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
}

.approval-card-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.approval-card-sub code {
    font-size: 0.73rem;
    color: var(--accent);
    background: var(--accent-bg);
    padding: 1px 5px;
    border-radius: 3px;
}

.approval-card-amount {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text);
    white-space: nowrap;
}

.approval-card-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.approval-flags {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.approval-flag {
    font-size: 0.78rem;
    color: var(--danger);
    background: var(--danger-bg);
    padding: 0.35rem 0.7rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.approval-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--border-light);
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-weight: 600;
    border: none;
    transition: all 0.15s;
}

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

.btn-success:hover {
    background: #059669;
}

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

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

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.15s;
}

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

.approval-empty {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.alert-card.success {
    background: var(--success-bg);
    border-color: var(--success);
}

/* ═══ INCOME & EXPENDITURE (P&L) ═══ */

/* Hero Banner */
.pnl-hero {
    margin-bottom: 1.25rem;
}

.pnl-hero-card {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 40%, #047857 100%);
    border-radius: var(--radius);
    padding: 2rem 2.5rem;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 24px rgba(4, 120, 87, 0.2);
    animation: fadeInUp 0.4s ease;
    position: relative;
    overflow: hidden;
}

.pnl-hero-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.pnl-hero-card.loss {
    background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 40%, #b91c1c 100%);
    box-shadow: 0 4px 24px rgba(185, 28, 28, 0.2);
}

.pnl-hero-card.mixed {
    background: linear-gradient(135deg, #78350f 0%, #92400e 40%, #b45309 100%);
    box-shadow: 0 4px 24px rgba(180, 83, 9, 0.2);
}

.pnl-hero-left {
    flex: 1;
}

.pnl-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 0.3rem 0.85rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 0.8rem;
    backdrop-filter: blur(4px);
}

.pnl-hero-label {
    font-size: 0.78rem;
    opacity: 0.7;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.35rem;
}

.pnl-hero-amount {
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.2;
    margin-bottom: 0.4rem;
}

.pnl-hero-amount.positive {
    text-shadow: 0 2px 12px rgba(255, 255, 255, 0.15);
}

.pnl-hero-amount.negative {
    text-shadow: 0 2px 12px rgba(255, 255, 255, 0.15);
}

.pnl-hero-amount .positive {
    color: #6ee7b7;
}

.pnl-hero-amount .negative {
    color: #fca5a5;
}

.pnl-hero-sub {
    font-size: 0.78rem;
    opacity: 0.55;
}

.pnl-hero-right {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-left: 2.5rem;
    border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.pnl-hero-stat {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

.pnl-hero-stat-dot.income {
    background: #34d399;
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.4);
}

.pnl-hero-stat-dot.expense {
    background: #f87171;
    box-shadow: 0 0 8px rgba(248, 113, 113, 0.4);
}

.pnl-hero-stat-label {
    font-size: 0.68rem;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.pnl-hero-stat-value {
    font-size: 1.15rem;
    font-weight: 700;
}

/* P&L KPI Row */
.pnl-kpi-row {
    margin-bottom: 1.25rem;
}

/* Gauge Cards */
.pnl-gauges-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.pnl-gauge-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem 1.4rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.pnl-gauge-card:hover {
    border-color: var(--accent-light);
    box-shadow: var(--shadow);
}

.pnl-gauge-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.85rem;
}

.pnl-gauge-currency {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.3px;
}

.pnl-gauge-net {
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 5px;
}

.pnl-gauge-net.positive {
    color: var(--success);
    background: var(--success-bg);
}

.pnl-gauge-net.negative {
    color: var(--danger);
    background: var(--danger-bg);
}

/* Stacked Bar */
.pnl-gauge-bar {
    display: flex;
    height: 32px;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.65rem;
    background: var(--border-light);
}

.pnl-gauge-income {
    background: linear-gradient(90deg, #059669, #34d399);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 4px;
}

.pnl-gauge-expense {
    background: linear-gradient(90deg, #f87171, #ef4444);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 4px;
}

.pnl-gauge-income span,
.pnl-gauge-expense span {
    font-size: 0.68rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    padding: 0 0.4rem;
}

.pnl-gauge-legend {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.pnl-legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 500;
}

.pnl-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}

.pnl-legend-dot.income {
    background: #059669;
}

.pnl-legend-dot.expense {
    background: #ef4444;
}

/* P&L Category Bars */
.pnl-bar-income {
    background: linear-gradient(90deg, #059669, #34d399) !important;
}

.pnl-bar-expense {
    background: linear-gradient(90deg, #ef4444, #f87171) !important;
}

/* Card Icons */
.pnl-income-icon {
    background: var(--success-bg);
    color: var(--success);
}

.pnl-expense-icon {
    background: var(--danger-bg);
    color: var(--danger);
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 1200px) {
    .copilot-layout {
        grid-template-columns: 1fr 280px;
    }

    .pnl-hero-card {
        flex-direction: column;
        gap: 1.5rem;
    }

    .pnl-hero-right {
        padding-left: 0;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
        padding-top: 1rem;
        flex-direction: row;
        gap: 2rem;
    }
}

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

    .copilot-layout {
        grid-template-columns: 1fr;
    }

    .copilot-sidebar {
        height: auto;
        border-top: 1px solid var(--border);
    }

    .kpi-row {
        grid-template-columns: repeat(2, 1fr);
    }

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

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

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

    .topbar {
        padding: 0 1rem;
    }

    .page-content {
        padding: 1rem;
    }

    .chat-messages {
        padding: 1rem;
    }

    .topbar-tabs {
        display: none;
    }

    .pnl-hero-card {
        padding: 1.5rem;
    }

    .pnl-hero-amount {
        font-size: 1.8rem;
    }

    .pnl-hero-right {
        flex-direction: column;
        gap: 0.75rem;
    }
}


/* ═══════════════════════════════════════════
   AI INSIGHTS PANEL
   ═══════════════════════════════════════════ */

.ai-insight-card {
    animation: fadeInUp 0.4s ease;
}

.ai-insight-body {
    padding: 0.25rem 0;
}

.ai-insight-empty {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.ai-narrative {
    background: var(--bg-subtle, #f0f4ff);
    border-left: 3px solid var(--accent);
    padding: 0.85rem 1rem;
    border-radius: 0 8px 8px 0;
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.ai-change-summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.ai-change-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
}

.ai-change-badge.negative {
    background: var(--danger-bg, #fef2f2);
    color: var(--danger);
}

.ai-change-badge.positive {
    background: var(--success-bg, #f0fdf4);
    color: var(--success);
}

.ai-change-detail {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.ai-section-title {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin: 1rem 0 0.5rem;
}

.ai-changes-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.ai-change-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.75rem;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: 8px;
    font-size: 0.82rem;
}

.ai-change-name {
    flex: 1;
    font-weight: 500;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-change-amounts {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.ai-arrow {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.ai-prev {
    opacity: 0.65;
}

.ai-curr {
    font-weight: 500;
    color: var(--text-primary);
}

.ai-change-pct {
    font-weight: 600;
    font-size: 0.8rem;
    min-width: 60px;
    text-align: right;
}

.ai-change-pct.negative {
    color: var(--danger);
}

.ai-change-pct.positive {
    color: var(--success);
}

/* Fraud Detection Styles */
.ai-fraud-summary {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--warning);
    margin-bottom: 0.5rem;
}

.ai-fraud-item {
    width: 100%;
}

.ai-fraud-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.3rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ai-fraud-header code {
    font-size: 0.75rem;
    background: rgba(0,0,0,0.06);
    padding: 1px 5px;
    border-radius: 3px;
}

.ai-fraud-score {
    font-size: 0.75rem;
    font-weight: 600;
}

.ai-fraud-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.ai-fraud-amount {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.ai-fraud-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.4rem;
}

.ai-fraud-flag {
    font-size: 0.7rem;
    padding: 2px 8px;
    background: var(--danger-bg, #fef2f2);
    color: var(--danger);
    border-radius: 4px;
    font-weight: 500;
}

/* Forecast Styles */
.ai-forecast-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.ai-forecast-kpi {
    background: var(--bg-subtle, #f8fafc);
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
}

.ai-forecast-kpi-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.ai-forecast-kpi-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.ai-forecast-kpi-value.negative {
    color: var(--danger);
}

.ai-forecast-kpi-value.positive {
    color: var(--success);
}

.ai-forecast-bars {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ai-forecast-bar-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.ai-forecast-bar-label {
    flex: 0 0 140px;
    font-size: 0.8rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-forecast-bar-track {
    flex: 1;
    height: 10px;
    background: var(--bg-subtle, #f1f5f9);
    border-radius: 5px;
    overflow: hidden;
}

.ai-forecast-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #60a5fa);
    border-radius: 5px;
    transition: width 0.6s ease;
}

.ai-forecast-bar-value {
    font-size: 0.78rem;
    font-weight: 600;
    min-width: 120px;
    text-align: right;
}

.ai-forecast-share {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.72rem;
}

.loading-placeholder {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}