/* ═══════════════════════════════════════════════════════════════
   AppChecker — mbanc.ai Theme
   Matches the mbanc.ai console design system:
   - Dark navy backgrounds (#020810, #091638)
   - Montserrat + JetBrains Mono fonts
   - Glassmorphism cards (backdrop-blur, translucent borders)
   - Red accent (#FF3300) with glow effects
   - Grid overlay background
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
    --bg-deep:      #020810;
    --bg-base:      #091638;
    --bg-card:      rgba(9, 22, 56, 0.45);
    --bg-card-solid:#0d1f4a;
    --bg-input:     rgba(9, 22, 56, 0.6);
    --border-glass: rgba(255, 255, 255, 0.10);
    --border-subtle:rgba(255, 255, 255, 0.06);
    --border-focus: rgba(255, 51, 0, 0.4);

    --red:          #FF3300;
    --red-dark:     #cc2900;
    --red-glow:     rgba(255, 51, 0, 0.25);
    --red-bg:       rgba(255, 51, 0, 0.08);
    --green:        #22c55e;
    --green-glow:   rgba(34, 197, 94, 0.2);
    --amber:        #f59e0b;
    --amber-glow:   rgba(245, 158, 11, 0.2);
    --blue:         #3b82f6;
    --blue-glow:    rgba(59, 130, 246, 0.2);

    --ink:          #e2e8f0;
    --ink-2:        #c8d4e6;
    --ink-3:        #8899b4;
    --ink-muted:    #5a6d8a;

    --pass-bg:      rgba(34, 197, 94, 0.12);
    --pass-text:    #4ade80;
    --pass-border:  rgba(34, 197, 94, 0.25);
    --fail-bg:      rgba(239, 68, 68, 0.12);
    --fail-text:    #f87171;
    --fail-border:  rgba(239, 68, 68, 0.25);
    --warn-bg:      rgba(245, 158, 11, 0.12);
    --warn-text:    #fbbf24;
    --warn-border:  rgba(245, 158, 11, 0.25);
    --info-bg:      rgba(59, 130, 246, 0.12);
    --info-text:    #60a5fa;
    --info-border:  rgba(59, 130, 246, 0.25);

    --radius-sm:    8px;
    --radius-md:    12px;
    --radius-lg:    16px;
    --radius-xl:    24px;

    --font-sans:    "Montserrat", -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono:    "JetBrains Mono", "Fira Code", monospace;

    --header-h:     68px;
    --glass-blur:   blur(20px) saturate(1.3);
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg-deep);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Space background — matches mbanc.ai / PricingProfessor */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: url('/static/img/space-bg.svg') center center / cover no-repeat;
    pointer-events: none;
    z-index: 0;
}

a { color: var(--red); text-decoration: none; transition: color 0.2s; }
a:hover { color: #ff5c33; }

::selection { background: var(--red); color: #fff; }

/* ── Scrollbars — transparent track, orange thumb (matches PP/dashboard) ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 51, 0, 0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 51, 0, 0.5); }
::-webkit-scrollbar-corner { background: transparent; }
* { scrollbar-width: thin; scrollbar-color: rgba(255, 51, 0, 0.3) transparent; }


/* ═══════════════════════════════════════════════════════════════
   TOP BAR (matches mbanc.ai header)
   ═══════════════════════════════════════════════════════════════ */
.app-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    height: var(--header-h);
    padding: 0 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
    background: linear-gradient(180deg,
        rgba(9, 22, 56, 0.7) 0%,
        rgba(9, 22, 56, 0.25) 75%,
        transparent 100%);
    backdrop-filter: blur(14px) saturate(1.2);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    mask-image: linear-gradient(to bottom, black 55%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 55%, transparent 100%);
    animation: hdrIn 0.6s ease forwards;
}
.app-header > * { pointer-events: auto; }
@keyframes hdrIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 18px;
}
.header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #ff6633;
    display: flex;
    align-items: center;
    gap: 14px;
    pointer-events: none;
    opacity: 0;
    animation: centerIn 0.5s 0.2s ease forwards;
}
@keyframes centerIn { from { opacity: 0; } to { opacity: 1; } }
.header-center::before,
.header-center::after {
    content: "";
    width: 50px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 80, 30, 0.4), transparent);
}

.logo-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px; height: 42px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(9, 22, 56, 0.4);
    backdrop-filter: blur(8px);
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    flex-shrink: 0;
    text-decoration: none;
}
.logo-btn:hover {
    border-color: rgba(255, 51, 0, 0.5);
    box-shadow: 0 0 16px var(--red-glow);
    transform: scale(1.05);
}
.logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-sep {
    width: 1px;
    height: 28px;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.app-title {
    font-weight: 700;
    font-size: 1.44rem;
    color: var(--ink);
    letter-spacing: -0.3px;
    opacity: 0;
    animation: navIn 0.4s 0.15s ease forwards;
}
@keyframes navIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: translateX(0); } }
.app-title .title-accent {
    color: var(--red);
}

/* Header nav links */
.header-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: 20px;
}
.header-nav a {
    padding: 6px 18px;
    border-radius: 10px;
    font-size: 1.06rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.45);
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    white-space: nowrap;
    text-decoration: none;
}
.header-nav a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.85);
}
.header-nav a.active {
    background: rgba(255, 51, 0, 0.12);
    color: #FF3300;
    box-shadow: 0 0 12px rgba(255, 51, 0, 0.08);
}

.user-info {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 500;
}

.btn-settings {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border-radius: var(--radius-sm);
    background: var(--red-bg);
    border: 1px solid rgba(255, 51, 0, 0.2);
    color: var(--ink-3);
    font-size: 0.85rem;
    transition: all 0.25s;
    cursor: pointer;
    text-decoration: none;
}
.btn-settings:hover {
    background: rgba(255, 51, 0, 0.15);
    color: var(--red);
    box-shadow: 0 0 12px rgba(255, 51, 0, 0.15);
}

.user-role {
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    background: rgba(255, 51, 0, 0.12);
    color: #FF3300;
    letter-spacing: 0.5px;
}

.btn-header-logout {
    padding: 5px 14px;
    border: 1px solid rgba(255, 51, 0, 0.2);
    border-radius: var(--radius-sm);
    background: var(--red-bg);
    color: var(--ink-3);
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    text-decoration: none;
}
.btn-header-logout:hover {
    background: rgba(255, 51, 0, 0.15);
    color: var(--red);
    box-shadow: 0 0 12px rgba(255, 51, 0, 0.15);
}

/* Live indicator dot */
.live-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 6px var(--green-glow);
    animation: blink-dot 2s infinite;
}
@keyframes blink-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}


/* ═══════════════════════════════════════════════════════════════
   LOGIN OVERLAY (glassmorphism, matches mbanc.ai)
   ═══════════════════════════════════════════════════════════════ */
.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-deep);
}

/* Glass card */
.lo-card {
    position: relative;
    z-index: 2;
    width: 400px;
    max-width: 92vw;
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    padding: 44px 36px 36px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.06);
    text-align: center;
}

.lo-logo-ring {
    width: 64px; height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--red-bg);
    border: 2px solid rgba(255, 51, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 24px var(--red-glow);
}
.lo-logo-ring .lo-logo-icon {
    font-size: 28px;
    color: var(--red);
}

.lo-brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--ink);
    margin-bottom: 2px;
}
.lo-brand .dot { color: var(--red); }
.lo-brand .ai { color: var(--red); font-weight: 700; }

.lo-sub {
    font-size: 0.78rem;
    color: var(--ink-3);
    margin-bottom: 28px;
    font-weight: 500;
}

.lo-field {
    margin-bottom: 14px;
}
.lo-field input {
    width: 100%;
    padding: 13px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 14px;
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s;
}
.lo-field input::placeholder {
    color: var(--ink-muted);
}
.lo-field input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(255, 51, 0, 0.1);
}

.lo-btn {
    width: 100%;
    padding: 14px;
    margin-top: 8px;
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    border: none;
    border-radius: var(--radius-md);
    color: #fff;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: box-shadow 0.3s, transform 0.2s;
}
.lo-btn:hover {
    box-shadow: 0 0 30px rgba(255, 51, 0, 0.5), 0 4px 20px rgba(255, 51, 0, 0.3);
    transform: translateY(-1px);
}
.lo-btn:active {
    transform: translateY(0);
}
.lo-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.lo-error {
    margin-top: 12px;
    font-size: 0.82rem;
    color: var(--fail-text);
    min-height: 20px;
}

.lo-footer {
    margin-top: 20px;
    font-size: 0.78rem;
    color: var(--ink-muted);
}
.lo-footer a {
    color: var(--ink-3);
    transition: color 0.2s;
}
.lo-footer a:hover {
    color: var(--red);
}


/* ═══════════════════════════════════════════════════════════════
   MAIN CONTENT AREA
   ═══════════════════════════════════════════════════════════════ */
.main-content {
    position: relative;
    z-index: 1;
    padding-top: calc(var(--header-h) + 24px);
    padding-left: 28px;
    padding-right: 28px;
    padding-bottom: 40px;
    min-height: 100vh;
}

.page-header {
    margin-bottom: 24px;
}
.page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
}
.page-subtitle {
    font-size: 0.82rem;
    color: var(--ink-3);
    margin-top: 4px;
}


/* ═══════════════════════════════════════════════════════════════
   GLASS CARDS
   ═══════════════════════════════════════════════════════════════ */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}
.glass-card:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.glass-card.no-hover:hover {
    transform: none;
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}

.card-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 16px;
}


/* ═══════════════════════════════════════════════════════════════
   STAT CARDS (Dashboard)
   ═══════════════════════════════════════════════════════════════ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--ink);
    font-family: var(--font-mono);
    line-height: 1.1;
}
.stat-value.accent { color: var(--red); }
.stat-value.green  { color: var(--green); }

.stat-label {
    font-size: 0.72rem;
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    margin-top: 6px;
}

.stat-sub {
    font-size: 0.75rem;
    color: var(--ink-3);
    margin-top: 4px;
    font-weight: 500;
}


/* ═══════════════════════════════════════════════════════════════
   STATUS BADGES
   ═══════════════════════════════════════════════════════════════ */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.badge-pass {
    background: var(--pass-bg);
    color: var(--pass-text);
    border: 1px solid var(--pass-border);
}
.badge-fail {
    background: var(--fail-bg);
    color: var(--fail-text);
    border: 1px solid var(--fail-border);
}
.badge-warning {
    background: var(--warn-bg);
    color: var(--warn-text);
    border: 1px solid var(--warn-border);
}
.badge-info-custom {
    background: var(--info-bg);
    color: var(--info-text);
    border: 1px solid var(--info-border);
}
.badge-error {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}
.badge-pending {
    background: rgba(255,255,255,0.06);
    color: var(--ink-3);
    border: 1px solid var(--border-glass);
}
.badge-running {
    background: var(--info-bg);
    color: var(--info-text);
    border: 1px solid var(--info-border);
}
.badge-completed {
    background: var(--pass-bg);
    color: var(--pass-text);
    border: 1px solid var(--pass-border);
}


/* ═══════════════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════════════ */
.table-glass {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.table-glass thead th {
    background: rgba(255, 51, 0, 0.08);
    color: var(--ink-2);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-glass);
    white-space: nowrap;
}
.table-glass thead th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.table-glass thead th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }

.table-glass tbody td {
    padding: 11px 16px;
    font-size: 0.85rem;
    color: var(--ink-2);
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}
.table-glass tbody tr {
    transition: background 0.15s;
}
.table-glass tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}
.table-glass tbody tr:last-child td {
    border-bottom: none;
}

/* Monospace cells (loan numbers, amounts, etc.) */
.mono {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    letter-spacing: 0.02em;
}


/* ═══════════════════════════════════════════════════════════════
   LOAN SUMMARY BANNER
   ═══════════════════════════════════════════════════════════════ */
.loan-banner {
    background: linear-gradient(135deg, var(--bg-base) 0%, #0d1f4a 100%);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}
.loan-banner .loan-id {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ink);
}
.loan-banner .borrower {
    font-size: 1rem;
    color: var(--ink-2);
    margin-top: 2px;
}
.loan-banner .loan-metrics {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}
.loan-banner .metric {
    text-align: center;
}
.loan-banner .metric-val {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--ink);
}
.loan-banner .metric-lbl {
    font-size: 0.65rem;
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}


/* ═══════════════════════════════════════════════════════════════
   INVESTOR SECTIONS (Compliance Results)
   ═══════════════════════════════════════════════════════════════ */
.investor-section {
    margin-bottom: 24px;
}
.investor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: rgba(255, 51, 0, 0.06);
    border: 1px solid rgba(255, 51, 0, 0.12);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}
.investor-header .investor-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--ink);
}
.investor-header .investor-counts {
    display: flex;
    gap: 8px;
}

/* Result rows */
.result-row {
    display: flex;
    align-items: center;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    font-size: 0.85rem;
    gap: 12px;
    transition: background 0.15s;
}
.result-row:hover { background: rgba(255,255,255,0.03); }
.result-row.pass    { border-left: 3px solid var(--pass-text); }
.result-row.fail    { border-left: 3px solid var(--fail-text); }
.result-row.warning { border-left: 3px solid var(--warn-text); }
.result-row.info    { border-left: 3px solid var(--info-text); }

.result-row .rule-name {
    flex: 1;
    font-weight: 500;
    color: var(--ink-2);
}
.result-row .rule-value {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--ink-3);
    min-width: 80px;
    text-align: right;
}
.result-row .rule-note {
    font-size: 0.78rem;
    color: var(--ink-muted);
    flex: 1;
}


/* ═══════════════════════════════════════════════════════════════
   FILTER TABS
   ═══════════════════════════════════════════════════════════════ */
.filter-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.filter-tab {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid var(--border-glass);
    background: transparent;
    color: var(--ink-3);
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-sans);
}
.filter-tab:hover {
    background: rgba(255,255,255,0.05);
    color: var(--ink);
}
.filter-tab.active {
    background: var(--red-bg);
    border-color: rgba(255, 51, 0, 0.3);
    color: var(--red);
}
.filter-tab .count {
    font-family: var(--font-mono);
    margin-left: 4px;
    opacity: 0.7;
}


/* ═══════════════════════════════════════════════════════════════
   FORMS & INPUTS
   ═══════════════════════════════════════════════════════════════ */
.form-control, .form-select {
    background: var(--bg-input) !important;
    border: 1px solid var(--border-glass) !important;
    border-radius: var(--radius-sm) !important;
    color: var(--ink) !important;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    padding: 10px 14px;
    transition: border-color 0.25s, box-shadow 0.25s;
}
.form-control::placeholder { color: var(--ink-muted) !important; }
.form-control:focus, .form-select:focus {
    border-color: var(--border-focus) !important;
    box-shadow: 0 0 0 3px rgba(255, 51, 0, 0.1) !important;
    outline: none;
}

.form-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

.input-group-text {
    background: rgba(255, 51, 0, 0.06) !important;
    border: 1px solid var(--border-glass) !important;
    color: var(--ink-3) !important;
}


/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */
.btn-primary-red {
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-family: var(--font-sans);
    font-weight: 700;
    padding: 10px 24px;
    cursor: pointer;
    transition: box-shadow 0.3s, transform 0.2s;
}
.btn-primary-red:hover {
    box-shadow: 0 0 24px rgba(255, 51, 0, 0.4), 0 4px 16px rgba(255, 51, 0, 0.25);
    transform: translateY(-1px);
    color: #fff;
}

.btn-glass {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--ink-3);
    font-family: var(--font-sans);
    font-weight: 600;
    padding: 8px 18px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}
.btn-glass:hover {
    background: rgba(255,255,255,0.08);
    color: var(--ink);
    border-color: rgba(255,255,255,0.15);
}

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


/* ═══════════════════════════════════════════════════════════════
   LOOKUP CARD (Loan Search)
   ═══════════════════════════════════════════════════════════════ */
.lookup-card {
    max-width: 640px;
    margin: 40px auto;
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}
.lookup-card .lookup-header {
    background: rgba(255, 51, 0, 0.06);
    border-bottom: 1px solid rgba(255, 51, 0, 0.12);
    padding: 18px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.lookup-card .lookup-header .lookup-icon {
    font-size: 1.3rem;
    color: var(--red);
}
.lookup-card .lookup-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
}
.lookup-card .lookup-body {
    padding: 24px;
}


/* ═══════════════════════════════════════════════════════════════
   PROGRESS BAR (Batch)
   ═══════════════════════════════════════════════════════════════ */
.progress-glass {
    height: 24px;
    background: rgba(255,255,255,0.06);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-glass);
}
.progress-glass .progress-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    transition: width 0.5s ease;
}


/* ═══════════════════════════════════════════════════════════════
   CHART CONTAINER
   ═══════════════════════════════════════════════════════════════ */
.chart-container {
    position: relative;
    height: 260px;
    padding: 12px 0;
}


/* ═══════════════════════════════════════════════════════════════
   FLASH MESSAGES / ALERTS
   ═══════════════════════════════════════════════════════════════ */
.alert-glass {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    margin-bottom: 16px;
    color: var(--ink-2);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.alert-glass.success { border-left: 3px solid var(--green); }
.alert-glass.danger  { border-left: 3px solid var(--fail-text); }
.alert-glass.warning { border-left: 3px solid var(--amber); }
.alert-glass.info    { border-left: 3px solid var(--blue); }

.alert-glass .alert-close {
    background: none;
    border: none;
    color: var(--ink-3);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0 4px;
}


/* ═══════════════════════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════════════════════ */
.pagination-glass {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 20px;
}
.pagination-glass a, .pagination-glass span {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid var(--border-glass);
    color: var(--ink-3);
    transition: all 0.2s;
    text-decoration: none;
}
.pagination-glass a:hover {
    background: rgba(255,255,255,0.05);
    color: var(--ink);
}
.pagination-glass .active {
    background: var(--red-bg);
    border-color: rgba(255, 51, 0, 0.3);
    color: var(--red);
}
.pagination-glass .disabled {
    opacity: 0.4;
    pointer-events: none;
}


/* ═══════════════════════════════════════════════════════════════
   AUDIT LOG ACTION BADGES
   ═══════════════════════════════════════════════════════════════ */
.action-badge {
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(255,255,255,0.06);
    color: var(--ink-3);
    border: 1px solid var(--border-glass);
}
.action-badge.login     { background: var(--pass-bg); color: var(--pass-text); border-color: var(--pass-border); }
.action-badge.logout    { background: var(--info-bg); color: var(--info-text); border-color: var(--info-border); }
.action-badge.check     { background: rgba(255,51,0,0.1); color: var(--red); border-color: rgba(255,51,0,0.2); }
.action-badge.batch     { background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn-border); }
.action-badge.admin     { background: rgba(139,92,246,0.12); color: #a78bfa; border-color: rgba(139,92,246,0.25); }


/* ═══════════════════════════════════════════════════════════════
   TIMELINE
   ═══════════════════════════════════════════════════════════════ */
.timeline {
    position: relative;
    padding-left: 28px;
}
.timeline::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-glass);
}
.timeline-item {
    position: relative;
    margin-bottom: 20px;
}
.timeline-item::before {
    content: "";
    position: absolute;
    left: -24px;
    top: 16px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--red);
    border: 2px solid var(--bg-deep);
    box-shadow: 0 0 8px var(--red-glow);
}


/* ═══════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════ */
.text-red    { color: var(--red) !important; }
.text-green  { color: var(--green) !important; }
.text-amber  { color: var(--amber) !important; }
.text-blue   { color: var(--blue) !important; }
.text-muted  { color: var(--ink-muted) !important; }
.text-ink    { color: var(--ink) !important; }
.text-ink-2  { color: var(--ink-2) !important; }
.text-ink-3  { color: var(--ink-3) !important; }

.bg-glass    { background: var(--bg-card); backdrop-filter: var(--glass-blur); }
.border-glass{ border: 1px solid var(--border-glass); }

.font-mono   { font-family: var(--font-mono); }
.fw-800      { font-weight: 800; }

.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }


/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .app-header { padding: 0 16px; }
    .header-nav { display: none; }
    .header-center { display: none; }
    .main-content { padding-left: 16px; padding-right: 16px; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .loan-banner { flex-direction: column; text-align: center; }
}

@media (max-width: 640px) {
    .app-header { padding: 0 12px; height: 48px; }
    .main-content { padding-top: calc(48px + 16px); padding-left: 12px; padding-right: 12px; }
    .stat-grid { grid-template-columns: 1fr; }
    .lo-card { padding: 32px 24px 24px; }
    .loan-banner .loan-metrics { gap: 12px; }
}

/* Mobile nav drawer trigger */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--ink-3);
    padding: 4px 8px;
    cursor: pointer;
    font-size: 1.2rem;
}
@media (max-width: 900px) {
    .mobile-nav-toggle { display: flex; }
}

/* Mobile nav dropdown */
.mobile-nav {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    background: rgba(9, 22, 56, 0.95);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-glass);
    padding: 12px 16px;
    z-index: 99;
    flex-direction: column;
    gap: 4px;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--ink-3);
    transition: all 0.2s;
}
.mobile-nav a:hover, .mobile-nav a.active {
    background: rgba(255, 51, 0, 0.08);
    color: var(--ink);
}


/* ═══════════════════════════════════════════════════════════════
   BOOTSTRAP OVERRIDES (dark theme compatibility)
   ═══════════════════════════════════════════════════════════════ */
.dropdown-menu {
    background: rgba(9, 22, 56, 0.95) !important;
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-glass) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.dropdown-item {
    color: var(--ink-2) !important;
    font-size: 0.85rem;
    padding: 8px 16px;
}
.dropdown-item:hover {
    background: rgba(255, 51, 0, 0.08) !important;
    color: var(--ink) !important;
}
.dropdown-divider {
    border-color: var(--border-glass) !important;
}

/* Override Bootstrap card if used */
.card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-glass) !important;
    color: var(--ink) !important;
}
