/* ═══════════════════════════════════════════════════════════════════════════
   Reviva Portal — app.css
   Domiex-style visual overrides on top of MudBlazor 9
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Brand tokens ─────────────────────────────────────────────────────────── */
:root {
    --reviva-primary:        #E8500A;
    --reviva-sidebar-bg:     #002B42;
    --reviva-sidebar-hover:  rgba(255,255,255,0.07);
    --reviva-sidebar-active: rgba(232,80,10,0.18);
    --reviva-sidebar-text:   rgba(255,255,255,0.6);
    --reviva-orange:         #E8500A;
    --reviva-navy:           #00557F;
    --reviva-navy-deep:      #002B42;
}

/* ── Base reset ───────────────────────────────────────────────────────────── */
html, body { margin: 0; padding: 0; }

/* ── Utility ──────────────────────────────────────────────────────────────── */
.cursor-pointer { cursor: pointer; }


/* ══════════════════════════════════════════════════════════════════════════
   DARK SIDEBAR
   ══════════════════════════════════════════════════════════════════════════ */

.mud-drawer,
.mud-drawer-content { background-color: var(--reviva-sidebar-bg) !important; }
.mud-drawer         { border-right: none !important; }

/* Brand header */
.reviva-nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.reviva-nav-brand-text {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -.01em;
}

/* User identity block */
.reviva-nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px 8px;
}
.reviva-nav-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--reviva-primary);
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    font-size: .75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.reviva-nav-user-info { min-width: 0; }
.reviva-nav-user-name {
    font-family: 'Inter', sans-serif;
    font-size: .8125rem;
    font-weight: 600;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.reviva-nav-user-role {
    font-family: 'Inter', sans-serif;
    font-size: .6875rem;
    color: var(--reviva-sidebar-text);
    text-transform: capitalize;
}

/* Section label */
.reviva-nav-section-label {
    font-family: 'Inter', sans-serif;
    font-size: .6875rem;
    font-weight: 600;
    color: #475569;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 16px 20px 4px;
}

/* Nav links */
.mud-nav-link {
    color: var(--reviva-sidebar-text) !important;
    border-radius: 6px !important;
    margin: 2px 8px !important;
    font-family: 'Inter', sans-serif !important;
    font-size: .8125rem !important;
    font-weight: 500 !important;
    transition: background-color .15s ease, color .15s ease !important;
}
.mud-nav-link:hover {
    background-color: var(--reviva-sidebar-hover) !important;
    color: #ffffff !important;
}
.mud-nav-link.active,
.mud-nav-link[aria-current="page"] {
    background-color: var(--reviva-sidebar-active) !important;
    color: #FF8A5C !important;
    box-shadow: inset 3px 0 0 var(--reviva-orange) !important;
    font-weight: 500 !important;
}
.mud-nav-link .mud-icon-root {
    color: var(--reviva-sidebar-text) !important;
    transition: color .15s ease !important;
}
.mud-nav-link:hover .mud-icon-root,
.mud-nav-link.active .mud-icon-root,
.mud-nav-link[aria-current="page"] .mud-icon-root {
    color: #FF8A5C !important;
}
.mud-nav-group .mud-icon-button,
.mud-nav-group-header-text { color: var(--reviva-sidebar-text) !important; }
.mud-drawer .mud-divider   { border-color: rgba(255,255,255,0.1) !important; }


/* ══════════════════════════════════════════════════════════════════════════
   WHITE APPBAR
   ══════════════════════════════════════════════════════════════════════════ */

.mud-appbar { box-shadow: none !important; }
.mud-appbar .mud-icon-button       { color: #64748b !important; }
.mud-appbar .mud-icon-button:hover { color: #1e293b !important; background-color: rgba(0,0,0,0.04) !important; }


/* ══════════════════════════════════════════════════════════════════════════
   CARDS & PAPER
   ══════════════════════════════════════════════════════════════════════════ */

.mud-card,
.mud-paper      { border-radius: 12px !important; }
.mud-elevation-1 {
    box-shadow: 0 1px 3px rgba(15,23,42,0.06),
                0 1px 2px rgba(15,23,42,0.04) !important;
}


/* ══════════════════════════════════════════════════════════════════════════
   TABLES
   ══════════════════════════════════════════════════════════════════════════ */

.mud-table-container { border-radius: 12px; overflow: hidden; }

.mud-table-head .mud-table-cell {
    font-family: 'Inter', sans-serif;
    font-size: .6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
.mud-table-body .mud-table-cell {
    font-family: 'Inter', sans-serif;
    font-size: .8125rem;
    color: #1e293b;
    border-bottom: 1px solid #f1f5f9;
}
.mud-table-body .mud-table-row:hover .mud-table-cell { background-color: #f8fafc; }


/* ══════════════════════════════════════════════════════════════════════════
   CHIPS
   ══════════════════════════════════════════════════════════════════════════ */

.mud-chip {
    font-family: 'Inter', sans-serif !important;
    font-size: .6875rem !important;
    font-weight: 600 !important;
    text-transform: none !important;
    border-radius: 6px !important;
}


/* ══════════════════════════════════════════════════════════════════════════
   SIDEBAR SHELL (flex column so user card stays at bottom)
   ══════════════════════════════════════════════════════════════════════════ */

.reviva-sidebar-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 100vh;
}

.reviva-nav-scroll {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 8px;
}

/* Bottom user card */
.reviva-nav-user-bottom {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0;
    cursor: default;
}

.reviva-nav-user-bottom .reviva-nav-avatar { flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════════════════════
   TOPBAR — BREADCRUMB, MFA BADGE, SYNC STRIP
   ══════════════════════════════════════════════════════════════════════════ */

.reviva-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    margin-left: 14px;
}

.reviva-bc-root { color: var(--reviva-orange); font-weight: 600; }
.reviva-bc-sep  { color: #CBD5E1; }
.reviva-bc-page { color: #64748b; font-weight: 500; }

/* MFA badge */
.reviva-mfa-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: #E6F5EE;
    color: #0A7C4B;
    border: 1px solid rgba(10,124,75,.2);
    border-radius: 14px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .04em;
    white-space: nowrap;
}

/* Sync strip */
.reviva-sync-strip {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    background: #F8FAFC;
    font-size: 11px;
    color: #64748b;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    white-space: nowrap;
}

.reviva-sync-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #0A7C4B;
    flex-shrink: 0;
    animation: reviva-pulse 2s infinite;
}

@keyframes reviva-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(10,124,75,.5); }
    70%  { box-shadow: 0 0 0 5px rgba(10,124,75,0); }
    100% { box-shadow: 0 0 0 0 rgba(10,124,75,0); }
}

/* ══════════════════════════════════════════════════════════════════════════
   SESSION BANNER
   ══════════════════════════════════════════════════════════════════════════ */

.reviva-session-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #E6F5EE;
    border: 1px solid rgba(10,124,75,.15);
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 12.5px;
    color: #0A7C4B;
    flex-wrap: wrap;
    gap: 8px;
}

.reviva-session-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.reviva-session-right {
    font-size: 11px;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    color: #64748b;
    letter-spacing: .04em;
}

/* ══════════════════════════════════════════════════════════════════════════
   ENTITY HERO PANEL
   ══════════════════════════════════════════════════════════════════════════ */

.reviva-entity-hero {
    background: linear-gradient(105deg, #002B42 0%, #8c6248 100%);
    border-radius: 10px;
    padding: 22px 26px;
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 24px;
    color: white;
    position: relative;
    overflow: hidden;
}

.reviva-entity-hero::before,
.reviva-entity-hero::after { content: none; }

.reviva-eh-waves {
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: auto;
    opacity: 0.55;
    pointer-events: none;
    display: block;
}

.reviva-eh-monogram {
    width: 52px; height: 52px;
    border-radius: 10px;
    background: var(--reviva-orange);
    display: flex; align-items: center; justify-content: center;
    font-family: 'Poppins', 'Inter', sans-serif;
    font-weight: 800; font-size: 20px; color: white;
    flex-shrink: 0; z-index: 1;
}

.reviva-eh-info { z-index: 1; flex: 1; min-width: 0; }

.reviva-eh-name {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-weight: 700; font-size: 20px; color: white;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.reviva-eh-meta {
    font-size: 12px; color: rgba(255,255,255,.55); margin-top: 3px;
}

.reviva-eh-meta span { margin-right: 14px; }

.reviva-eh-tags { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }

.reviva-eh-tag {
    padding: 2px 9px; border-radius: 4px;
    font-size: 10px; font-weight: 600; letter-spacing: .03em;
    border: 1px solid; z-index: 1;
}

.reviva-eht-orange { border-color: rgba(232,80,10,.5);  color: #FF8A5C;             background: rgba(232,80,10,.15); }
.reviva-eht-green  { border-color: rgba(74,222,128,.4); color: #4ADE80;             background: rgba(10,124,75,.2); }
.reviva-eht-white  { border-color: rgba(255,255,255,.25); color: rgba(255,255,255,.75); background: rgba(255,255,255,.08); }

.reviva-eh-actions { display: flex; gap: 8px; z-index: 1; flex-shrink: 0; }

.reviva-eh-btn {
    padding: 8px 16px; border-radius: 6px; border: 1.5px solid;
    font-size: 12px; font-weight: 600; cursor: pointer;
    font-family: 'Inter', sans-serif; transition: all .15s;
    display: inline-flex; align-items: center; gap: 6px;
    text-decoration: none;
}

.reviva-eh-btn-outline {
    border-color: rgba(255,255,255,.3); color: white; background: rgba(255,255,255,.1);
}

.reviva-eh-btn-outline:hover { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.5); }

.reviva-eh-btn-solid {
    border-color: white; color: #002B42; background: white;
}

.reviva-eh-btn-solid:hover { background: #F0F4F8; }

/* ══════════════════════════════════════════════════════════════════════════
   LENDER DASHBOARD
   ══════════════════════════════════════════════════════════════════════════ */

/* ── KPI Strip ── */
.reviva-kpi-strip {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}
@media (max-width: 1100px) { .reviva-kpi-strip { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .reviva-kpi-strip { grid-template-columns: repeat(2, 1fr); } }

.reviva-kpi-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

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

.reviva-kpi-val {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-size: 1.5rem; font-weight: 700;
    color: #1e293b; line-height: 1.1;
}

.reviva-kpi-lbl {
    font-size: 11px; font-weight: 600;
    color: #64748b; text-transform: uppercase;
    letter-spacing: .04em; margin-top: 2px;
}

.reviva-kpi-sub {
    font-size: 11px; color: #94a3b8; margin-top: 2px;
}

.reviva-kpi-pos { color: #059669 !important; }

.reviva-kpi-accent {
    position: absolute; bottom: 0; left: 0; right: 0;
    height: 3px; border-radius: 0 0 10px 10px;
}

/* ── Main 2-col layout ── */
.reviva-lender-main {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 16px;
    align-items: start;
}
@media (max-width: 1050px) { .reviva-lender-main { grid-template-columns: 1fr; } }

.reviva-lender-table-card { overflow: hidden; }

.reviva-lender-right { display: flex; flex-direction: column; }

/* ── Bottom 3-col layout ── */
.reviva-lender-bottom {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    align-items: start;
}
@media (max-width: 900px) { .reviva-lender-bottom { grid-template-columns: 1fr; } }

/* ── Card header shared ── */
.reviva-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid #f1f5f9;
}

.reviva-card-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 700; color: #1e293b;
}

.reviva-card-action {
    font-size: 12px; font-weight: 600;
    color: #E8500A; text-decoration: none;
}
.reviva-card-action:hover { text-decoration: underline; }

/* ── Participations table ── */
.reviva-tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    font-family: 'Inter', sans-serif;
}

.reviva-tbl thead th {
    padding: 8px 12px;
    text-align: left;
    font-size: 10.5px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 1px solid #f1f5f9;
    white-space: nowrap;
}

.reviva-tbl thead th.r,
.reviva-tbl tbody td.r { text-align: right; }

.reviva-tbl tbody tr {
    border-bottom: 1px solid #f8fafc;
    transition: background .1s;
}
.reviva-tbl tbody tr:hover { background: #f8fafc; }
.reviva-tbl tbody tr:last-child { border-bottom: none; }

.reviva-tbl tbody td {
    padding: 10px 12px;
    color: #334155;
    vertical-align: middle;
}

.reviva-tbl-primary { font-weight: 600; color: #1e293b; }
.reviva-tbl-secondary { font-size: 11px; color: #94a3b8; margin-top: 1px; }

.mono { font-family: 'JetBrains Mono', 'Courier New', monospace; font-variant-numeric: tabular-nums; font-size: 12px; }

/* Structure chips */
.reviva-structure-chip {
    padding: 2px 8px; border-radius: 4px;
    font-size: 10.5px; font-weight: 600;
    white-space: nowrap; border: 1px solid;
}
.reviva-sc-lbo     { color: #7C3AED; background: #EDE9FE; border-color: rgba(124,58,237,.25); }
.reviva-sc-re      { color: #0369A1; background: #E0F2FE; border-color: rgba(3,105,161,.25); }
.reviva-sc-pf      { color: #059669; background: #D1FAE5; border-color: rgba(5,150,105,.25); }
.reviva-sc-uni     { color: #D97706; background: #FEF3C7; border-color: rgba(217,119,6,.25); }
.reviva-sc-syn     { color: #E8500A; background: #FFF0E8; border-color: rgba(232,80,10,.25); }
.reviva-sc-bil     { color: #0F766E; background: #CCFBF1; border-color: rgba(15,118,110,.25); }
.reviva-sc-default { color: #64748b; background: #F1F5F9; border-color: #E2E8F0; }

/* Status pills */
.reviva-status-pill {
    padding: 2px 8px; border-radius: 20px;
    font-size: 10.5px; font-weight: 600;
    white-space: nowrap;
}
.reviva-sp-active  { background: #D1FAE5; color: #065F46; }
.reviva-sp-watch   { background: #FEF3C7; color: #92400E; }
.reviva-sp-breach  { background: #FEE2E2; color: #991B1B; }
.reviva-sp-default { background: #F1F5F9; color: #64748b; }

/* ── Cashflows ── */
.reviva-cashflow-list { padding: 4px 0 8px; }

.reviva-cashflow-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid #f8fafc;
}
.reviva-cashflow-item:last-child { border-bottom: none; }

.reviva-cf-date {
    width: 36px; height: 36px; border-radius: 8px;
    background: #FFF0E8;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    flex-shrink: 0;
}
.reviva-cf-day { font-size: 13px; font-weight: 800; color: #E8500A; line-height: 1; }
.reviva-cf-mon { font-size: 8px; font-weight: 700; color: #E8500A; letter-spacing: .06em; }

.reviva-cf-info { flex: 1; min-width: 0; }
.reviva-cf-title { font-size: 12.5px; font-weight: 600; color: #1e293b; }
.reviva-cf-type  { font-size: 11px; color: #94a3b8; margin-top: 1px; }

.reviva-cf-amount {
    font-size: 13px; font-weight: 700;
    color: #059669;
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
}

/* ── Votes ── */
.reviva-votes-list { padding: 4px 0 8px; }

.reviva-badge-pending {
    background: #FEF3C7; color: #92400E;
    border-radius: 20px; padding: 1px 8px;
    font-size: 10px; font-weight: 700;
    letter-spacing: .04em;
}

.reviva-vote-card {
    padding: 12px 16px;
    border-bottom: 1px solid #f8fafc;
}
.reviva-vote-card:last-child { border-bottom: none; }

.reviva-vote-title { font-size: 12.5px; font-weight: 700; color: #1e293b; margin-bottom: 2px; }
.reviva-vote-ref   { font-size: 11px; color: #94a3b8; margin-bottom: 6px; }

.reviva-vote-deadline {
    display: flex; align-items: center; gap: 4px;
    font-size: 11px; color: #E8500A; font-weight: 600;
    margin-bottom: 8px;
}

.reviva-vote-progress { margin-bottom: 10px; }
.reviva-vp-bar { background: #F1F5F9; border-radius: 4px; height: 5px; overflow: hidden; margin-bottom: 4px; }
.reviva-vp-fill { height: 100%; background: #E8500A; border-radius: 4px; }
.reviva-vp-labels { display: flex; justify-content: space-between; font-size: 10.5px; color: #94a3b8; }

.reviva-vote-actions { display: flex; gap: 6px; }

.reviva-vbtn {
    flex: 1; padding: 6px 4px;
    border: 1px solid; border-radius: 5px;
    font-size: 11px; font-weight: 600;
    cursor: pointer; transition: all .12s;
    font-family: 'Inter', sans-serif;
}
.reviva-vbtn-approve { border-color: #059669; color: #059669; background: #F0FDF4; }
.reviva-vbtn-approve:hover { background: #059669; color: white; }
.reviva-vbtn-reject  { border-color: #DC2626; color: #DC2626; background: #FEF2F2; }
.reviva-vbtn-reject:hover  { background: #DC2626; color: white; }
.reviva-vbtn-abstain { border-color: #94a3b8; color: #64748b; background: #F8FAFC; }
.reviva-vbtn-abstain:hover { background: #e2e8f0; }

/* ── Exposure bars ── */
.reviva-exposure-list { padding: 10px 16px 12px; }

.reviva-exposure-row {
    display: grid;
    grid-template-columns: 110px 1fr 60px;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.reviva-exposure-row:last-child { margin-bottom: 0; }

.reviva-exp-label { font-size: 12px; color: #334155; font-weight: 500; }

.reviva-exp-bar-wrap { background: #F1F5F9; border-radius: 4px; height: 7px; overflow: hidden; }
.reviva-exp-bar { height: 100%; background: linear-gradient(90deg, #00557F, #E8500A); border-radius: 4px; }

.reviva-exp-val {
    font-size: 12px; font-weight: 600; color: #1e293b;
    font-family: 'JetBrains Mono', monospace; text-align: right;
}

/* ── Covenants ── */
.reviva-covenant-list { padding: 4px 0 8px; }

.reviva-covenant-row {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 16px;
    border-bottom: 1px solid #f8fafc;
}
.reviva-covenant-row:last-child { border-bottom: none; }

.reviva-cov-dot {
    width: 9px; height: 9px; border-radius: 50%;
    flex-shrink: 0;
}
.reviva-cov-passing { background: #22C55E; }
.reviva-cov-warning { background: #F59E0B; }
.reviva-cov-breach  { background: #EF4444; }

.reviva-cov-info { flex: 1; min-width: 0; }
.reviva-cov-name     { font-size: 12.5px; font-weight: 600; color: #1e293b; }
.reviva-cov-facility { font-size: 11px; color: #94a3b8; }

.reviva-cov-vals { text-align: right; }
.reviva-cov-actual    { font-size: 13px; font-weight: 700; color: #1e293b; font-family: 'JetBrains Mono', monospace; }
.reviva-cov-breach-text { color: #DC2626 !important; }
.reviva-cov-threshold { font-size: 10.5px; color: #94a3b8; }

/* ── Notices ── */
.reviva-notice-list { padding: 4px 0 8px; }

.reviva-notice-row {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid #f8fafc;
}
.reviva-notice-row:last-child { border-bottom: none; }
.reviva-notice-unread { background: #FAFBFF; }

.reviva-notice-dot {
    width: 8px; height: 8px; border-radius: 50%;
    flex-shrink: 0; margin-top: 4px;
}
.reviva-nd-breach   { background: #EF4444; }
.reviva-nd-warning  { background: #F59E0B; }
.reviva-nd-info     { background: #3B82F6; }
.reviva-nd-resolved { background: #D1D5DB; }

.reviva-notice-info { flex: 1; min-width: 0; }
.reviva-notice-title { font-size: 12.5px; font-weight: 600; color: #1e293b; }
.reviva-notice-meta  { font-size: 11px; color: #94a3b8; margin-top: 1px; }

/* ── Portal footer bar ── */
.reviva-portal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0 4px;
    border-top: 1px solid #e2e8f0;
    font-size: 11px;
    color: #94a3b8;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    letter-spacing: .02em;
    flex-wrap: wrap;
    gap: 8px;
}

/* ══════════════════════════════════════════════════════════════════════════
   BORROWER DASHBOARD
   ══════════════════════════════════════════════════════════════════════════ */

/* Hero — green gradient variant */
.reviva-entity-hero-borrower {
    background: linear-gradient(105deg, #0F2A1E 0%, #1A4030 100%);
    border-radius: 10px;
    padding: 22px 26px;
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 24px;
    color: white;
    position: relative;
    overflow: hidden;
}

/* 4-col KPI strip for borrower */
.reviva-borrower-kpi-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}
@media (max-width: 1000px) { .reviva-borrower-kpi-strip { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .reviva-borrower-kpi-strip { grid-template-columns: 1fr; } }

/* 2-col main layout */
.reviva-borrower-main {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    align-items: start;
    margin-bottom: 16px;
}
@media (max-width: 1050px) { .reviva-borrower-main { grid-template-columns: 1fr; } }

.reviva-borrower-left  { display: flex; flex-direction: column; gap: 16px; }
.reviva-borrower-right { display: flex; flex-direction: column; gap: 16px; }

/* Calendar items (certificates) */
.reviva-cal-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid #f8fafc;
}
.reviva-cal-item:last-child { border-bottom: none; }

.reviva-cal-box {
    width: 38px; height: 38px; border-radius: 8px;
    background: #EEF2FF; flex-shrink: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
}
.reviva-cal-day { font-size: 13px; font-weight: 800; color: #4F46E5; line-height: 1; }
.reviva-cal-mon { font-size: 8px; font-weight: 700; color: #4F46E5; letter-spacing: .05em; text-transform: uppercase; }

.reviva-cal-info { flex: 1; min-width: 0; }
.reviva-cal-title { font-size: 12.5px; font-weight: 600; color: #1e293b; }
.reviva-cal-sub   { font-size: 11px; color: #94a3b8; margin-top: 1px; }

/* Generic status pills (reusable across borrower + agent) */
.reviva-pill {
    padding: 2px 8px; border-radius: 20px;
    font-size: 10.5px; font-weight: 600;
    white-space: nowrap; display: inline-block;
}
.reviva-pill-passing    { background: #D1FAE5; color: #065F46; }
.reviva-pill-warning    { background: #FEF3C7; color: #92400E; }
.reviva-pill-breach     { background: #FEE2E2; color: #991B1B; }
.reviva-pill-overdue    { background: #FEE2E2; color: #991B1B; }
.reviva-pill-due_soon   { background: #FEF3C7; color: #92400E; }
.reviva-pill-scheduled  { background: #EEF2FF; color: #3730A3; }
.reviva-pill-confirmed  { background: #D1FAE5; color: #065F46; }
.reviva-pill-pending    { background: #FEF3C7; color: #92400E; }
.reviva-pill-settled    { background: #F1F5F9; color: #475569; }
.reviva-pill-active     { background: #D1FAE5; color: #065F46; }

/* ══════════════════════════════════════════════════════════════════════════
   AGENT / OPS DASHBOARD
   ══════════════════════════════════════════════════════════════════════════ */

/* Alert banner */
.reviva-agent-alert {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    background: #FEF2F2;
    border: 1px solid rgba(239,68,68,.3);
    border-left: 4px solid #EF4444;
    border-radius: 8px;
    margin-bottom: 20px;
}
.reviva-agent-alert-icon { color: #DC2626; flex-shrink: 0; }
.reviva-agent-alert-body { flex: 1; min-width: 0; }
.reviva-agent-alert-title { font-size: 13px; font-weight: 700; color: #991B1B; }
.reviva-agent-alert-msg   { font-size: 12px; color: #B91C1C; margin-top: 1px; }
.reviva-agent-alert-timer {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px; color: #DC2626; font-weight: 700;
    background: rgba(239,68,68,.1); border-radius: 4px;
    padding: 2px 7px; flex-shrink: 0;
}
.reviva-agent-alert-btn {
    padding: 7px 14px; border-radius: 6px;
    background: #DC2626; color: white;
    border: none; font-size: 12px; font-weight: 700;
    cursor: pointer; font-family: 'Inter', sans-serif;
    white-space: nowrap; flex-shrink: 0;
}
.reviva-agent-alert-btn:hover { background: #B91C1C; }

/* 5-col KPI strip */
.reviva-agent-kpi-strip {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}
@media (max-width: 1200px) { .reviva-agent-kpi-strip { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .reviva-agent-kpi-strip { grid-template-columns: repeat(2, 1fr); } }

/* Agent 2-col main layout */
.reviva-agent-main {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    align-items: start;
    margin-bottom: 20px;
}
@media (max-width: 1050px) { .reviva-agent-main { grid-template-columns: 1fr; } }

/* Agent bottom 3-col layout */
.reviva-agent-bottom {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    align-items: start;
    margin-bottom: 16px;
}
@media (max-width: 900px) { .reviva-agent-bottom { grid-template-columns: 1fr; } }

/* Exception queue rows */
.reviva-exc-item {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid #f1f5f9;
}
.reviva-exc-item:last-child { border-bottom: none; }

.reviva-exc-sev {
    width: 4px; flex-shrink: 0; border-radius: 0;
}
.reviva-sev-r { background: #EF4444; }
.reviva-sev-a { background: #F59E0B; }
.reviva-sev-b { background: #7C3AED; }

.reviva-exc-body {
    flex: 1; padding: 10px 12px;
    min-width: 0;
}
.reviva-exc-title { font-size: 12.5px; font-weight: 700; color: #1e293b; }
.reviva-exc-meta  { font-size: 11px; color: #94a3b8; margin-top: 2px; }

.reviva-sla-badge {
    align-self: center;
    padding: 2px 8px; border-radius: 20px;
    font-size: 10.5px; font-weight: 700;
    white-space: nowrap; margin: 10px 12px 10px 0;
    flex-shrink: 0;
}
.reviva-sla-breach { background: #FEE2E2; color: #991B1B; }
.reviva-sla-warn   { background: #FEF3C7; color: #92400E; }
.reviva-sla-ok     { background: #D1FAE5; color: #065F46; }

/* Activity feed */
.reviva-act-list { padding: 4px 0 8px; }

.reviva-act-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 16px;
    position: relative;
}
.reviva-act-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 22px; top: 30px;
    width: 1px; height: calc(100% - 14px);
    background: #e2e8f0;
}

.reviva-act-dot {
    width: 10px; height: 10px; border-radius: 50%;
    flex-shrink: 0; margin-top: 3px; z-index: 1;
}
.reviva-act-body { flex: 1; min-width: 0; }
.reviva-act-title { font-size: 12.5px; font-weight: 600; color: #1e293b; }
.reviva-act-time  { font-size: 11px; color: #94a3b8; margin-top: 1px; }

/* KYC meter bars */
.reviva-meter-list { padding: 10px 16px 12px; }

.reviva-meter-row {
    display: grid;
    grid-template-columns: 110px 1fr 40px;
    align-items: center;
    gap: 8px;
    margin-bottom: 9px;
}
.reviva-meter-row:last-child { margin-bottom: 0; }

.reviva-meter-label { font-size: 11.5px; color: #334155; font-weight: 500; }
.reviva-meter-track { background: #F1F5F9; border-radius: 4px; height: 7px; overflow: hidden; }
.reviva-meter-fill  { height: 100%; border-radius: 4px; }
.reviva-mf-green  { background: #22C55E; }
.reviva-mf-orange { background: #F59E0B; }
.reviva-mf-navy   { background: #00557F; }
.reviva-mf-red    { background: #EF4444; }
.reviva-meter-val { font-size: 11px; font-weight: 700; color: #334155; text-align: right; }

/* KYC stat rows */
.reviva-kyc-stats { padding: 10px 16px 4px; border-top: 1px solid #f1f5f9; }
.reviva-kyc-stat-row { display: flex; justify-content: space-between; font-size: 12px; color: #64748b; padding: 4px 0; }
.reviva-kyc-stat-val { font-weight: 700; color: #1e293b; }

/* Portfolio health stat rows */
.reviva-ph-list { padding: 6px 0 4px; }
.reviva-ph-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 7px 16px;
    border-bottom: 1px solid #f8fafc;
    font-size: 12.5px;
}
.reviva-ph-row:last-child { border-bottom: none; }
.reviva-ph-label { color: #64748b; }
.reviva-ph-val   { font-weight: 700; color: #1e293b; font-family: 'JetBrains Mono', monospace; }
.reviva-ph-val-red   { color: #DC2626 !important; }
.reviva-ph-val-amber { color: #D97706 !important; }
.reviva-ph-val-green { color: #059669 !important; }

/* DORA block */
.reviva-dora-block {
    margin: 0 16px 12px;
    padding: 10px 12px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
}
.reviva-dora-title { font-size: 10.5px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.reviva-dora-row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: #334155; margin-bottom: 4px; }
.reviva-dora-row:last-child { margin-bottom: 0; }
.reviva-dora-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════════════════════
   LOGIN / AUTHENTICATION SCREEN
   ══════════════════════════════════════════════════════════════════════════ */

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

/* ── Left panel ── */
.auth-side {
    /* Teal-navy → warm-orange diagonal — matches revivacapital.com hero */
    background: linear-gradient(
        145deg,
        #001A28  0%,
        #002B42  22%,
        #003D5C  48%,
        #7B2A00  78%,
        #C44208 100%
    );
    position: relative;
    overflow: hidden;
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: white;
}

/* Subtle warm glow in bottom-right corner */
.auth-side::before {
    content: '';
    position: absolute;
    right: -80px; bottom: -80px;
    width: 420px; height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(232,80,10,.22) 0%, transparent 65%);
    pointer-events: none;
}

/* Very faint top-left cool highlight */
.auth-side::after {
    content: '';
    position: absolute;
    left: -60px; top: -60px;
    width: 280px; height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,110,158,.25) 0%, transparent 70%);
    pointer-events: none;
}

/* Wave image overlay — the actual Reviva website asset (white lines, transparent bg) */
.auth-waves-img {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center bottom;
    opacity: 0.18;
    pointer-events: none;
    mix-blend-mode: screen;
}

/* .auth-grid retained but hidden */
.auth-grid {
    display: none;
    pointer-events: none;
}

/* Brand — .brand-mark/.brand-logo/.brand-text removed; logo is now an <img> */

/* Hero */
.auth-hero {
    position: relative;
    z-index: 2;
    max-width: 460px;
}

.auth-eyebrow {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 11px;
    letter-spacing: .18em;
    color: #F47139;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-eyebrow::before {
    content: '';
    width: 32px; height: 1px;
    background: #E8500A;
    flex-shrink: 0;
}

.auth-headline {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 40px;
    line-height: 1.1;
    color: white;
    letter-spacing: -.02em;
    margin-bottom: 16px;
}

.auth-headline span { color: #F47139; }

.auth-lead {
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255,255,255,.7);
    max-width: 420px;
}

/* Stats bar */
.auth-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    position: relative;
    z-index: 2;
    padding-top: 28px;
    border-top: 1px solid rgba(255,255,255,.1);
}

.auth-stat-num {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 24px;
    color: white;
}

.auth-stat-num span { color: #F47139; }

.auth-stat-lbl {
    font-size: 11px;
    color: rgba(255,255,255,.5);
    margin-top: 4px;
    letter-spacing: .03em;
}

/* Footer */
.auth-foot {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: rgba(255,255,255,.4);
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    letter-spacing: .04em;
}

/* ── Right form panel ── */
.auth-form-side {
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    position: relative;
}

.auth-topnav {
    position: absolute;
    top: 28px; right: 32px;
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 12px;
    color: #7A8EA8;
}

.auth-topnav a {
    color: #E8500A;
    text-decoration: none;
    font-weight: 600;
}

.auth-topnav a:hover { text-decoration: underline; }

.auth-card {
    width: 100%;
    max-width: 420px;
}

.auth-card-title {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 26px;
    color: #003D5C;
    letter-spacing: -.01em;
    margin-bottom: 6px;
}

.auth-card-sub {
    font-size: 13px;
    color: #7A8EA8;
    margin-bottom: 28px;
    line-height: 1.5;
}

/* Sign-in button */
.btn-auth {
    width: 100%;
    padding: 13px 18px;
    background: #E8500A;
    color: white;
    border: none;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    text-decoration: none;
    transition: all .15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-sizing: border-box;
}

.btn-auth:hover {
    background: #D44508;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(232,80,10,.28);
    color: white;
    text-decoration: none;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 22px 0;
    font-size: 11px;
    color: #A8B5C4;
    letter-spacing: .1em;
    text-transform: uppercase;
    font-weight: 600;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #D8DCE5;
}

/* Security notice */
.security-hint {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: #DFF0F7;
    border-left: 3px solid #00557F;
    border-radius: 6px;
    font-size: 12px;
    color: #1A4560;
    line-height: 1.55;
}

.security-hint-icon {
    width: 16px; height: 16px;
    flex-shrink: 0;
    color: #00557F;
    margin-top: 1px;
}

/* Bottom help text */
.auth-bottom {
    margin-top: 32px;
    text-align: center;
    font-size: 12px;
    color: #7A8EA8;
}

.auth-bottom a {
    color: #E8500A;
    font-weight: 600;
    text-decoration: none;
}

.auth-bottom a:hover { text-decoration: underline; }

/* Mobile: stack panels, hide left on small screens */
@media (max-width: 768px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-side   { display: none; }
    .auth-form-side { padding: 40px 24px; min-height: 100vh; }
}
