/* ============================================
   FundExys Premium CRM Stylesheet
   Color Scheme: Blue, Black, Golden, White
   Design: Mobile-First, Enterprise SaaS
   ============================================ */

:root {
    --primary-blue: #007bff;
    --dark-black: #1a1a2e;
    --darker-black: #0f3460;

    /* Metallic gold palette (for gradients) */
    --gold-1: #FFD700; /* deep gold */
    --gold-2: #FFC107; /* warm amber */
    --gold-3: #FFB300; /* bronze */
    --gold-4: #FFF3B0; /* light metallic highlight */

    /* Backwards-compatible tokens */
    --golden: var(--gold-1);
    --golden-dark: #d4af37;

    --white: #ffffff;
    --light-gray: #f8f9fa;
    --medium-gray: #e9ecef;
    --text-dark: #212529;

    /* Gold gradients */
    --metallic-gold: linear-gradient(135deg, var(--gold-4) 0%, var(--gold-2) 30%, var(--gold-3) 65%, var(--gold-1) 100%);
    --metallic-gold-border: linear-gradient(90deg, var(--gold-4), var(--gold-2), var(--gold-1));
}

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

html, body {
    height: 100%;
}

body {
    min-height: 100%;
    position: relative;
}

/* Premium background (metallic gold + blue, mobile-first) */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
      radial-gradient(900px circle at 15% 10%, rgba(0, 123, 255, 0.12), transparent 55%),
      radial-gradient(900px circle at 90% 20%, rgba(255, 193, 7, 0.10), transparent 50%),
      linear-gradient(180deg, rgba(26, 26, 46, 0.04) 0%, rgba(248, 249, 250, 0.0) 100%);
    pointer-events: none;
    z-index: -1;
}

.page-shell {
    padding: 2rem 1rem 4rem;
}

.dashboard-hero {
    padding-top: 1.25rem;
}

.section-head {
    margin: 0 auto 1.25rem;
    max-width: 1100px;
}

.section-head .subtle {
    color: rgba(33, 37, 41, 0.68);
    font-weight: 500;
}

.search-toolbar {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

body { 
    background-color: var(--light-gray);
    color: var(--text-dark);
    font-family: 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
}

html, body { overflow-x: hidden; }

.kpi-amount { word-break: break-word; }


/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }

.text-gold {
    font-weight: 700;
    background-image: var(--metallic-gold);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--golden);
}

.brand-gold {
    color: var(--golden);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* ============================================
   NAVIGATION & HEADER
   ============================================ */

.premium-navbar {
    background: linear-gradient(135deg, var(--dark-black) 0%, var(--darker-black) 100%) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    padding: 1rem 0;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.btn-nav {
    margin-left: 10px;
    border-radius: 25px;
    padding: 0.5rem 1.2rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-nav:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero-section {
    background: linear-gradient(135deg, var(--dark-black) 0%, var(--darker-black) 50%, #1a3a5c 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(255, 215, 0, 0.1), transparent);
    pointer-events: none;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    border-radius: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    padding: 0.6rem 1.4rem;
}

.btn-gold {
    background-image: var(--metallic-gold);
    color: var(--dark-black);
    border-image: var(--metallic-gold-border) 1;
    border-color: transparent;
}

.btn-gold:hover {
    background-image: linear-gradient(135deg, var(--gold-2) 0%, var(--gold-1) 100%);
    color: var(--dark-black);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(255, 215, 0, 0.35);
}

.btn-outline-gold {
    color: var(--golden);
    border-color: var(--golden);
}

.btn-outline-gold:hover {
    background-color: var(--golden);
    color: var(--dark-black);
    transform: translateY(-2px);
}

.btn-outline-gold.btn-nav {
    border-color: var(--golden);
}

.btn-primary {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    transform: translateY(-2px);
}

.btn-outline-primary {
    color: var(--primary-blue);
    border-color: var(--primary-blue);
}

.btn-outline-primary:hover {
    background-color: var(--primary-blue);
    color: white;
    transform: translateY(-2px);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* ============================================
   CARDS
   ============================================ */

.card {
    border: 1px solid transparent;
    border-image: var(--metallic-gold-border) 1;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.premium-card {
    border: 1px solid transparent;
    border-image: var(--metallic-gold-border) 1;
    border-radius: 12px;
    overflow: hidden;
}

.card-header {
    background-color: var(--dark-black) !important;
    color: white;

    /* Metallic gold underline */
    border-bottom: 2px solid transparent !important;
    border-image: var(--metallic-gold-border) 1;

    padding: 1.2rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
    background-color: white;
}

.border-gold {
    border-color: var(--golden) !important;
}

/* ============================================
   KPI CARDS
   ============================================ */

.kpi-card {
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    color: white;
    transition: all 0.3s ease;
    border-left: 4px solid var(--golden);
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.kpi-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

.kpi-content h5 {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.kpi-content h2 {
    font-size: 2rem;
    margin: 0;
}

/* Ensure KPI cards meet contrast requirements */
.kpi-card.bg-info {
    /* Use a darker blue for Disbursed to improve contrast while keeping theme */
    background-color: #0b5ed7 !important;
    color: #ffffff !important;
}
.kpi-card.bg-warning {
    /* Use a richer gold for Sanctioned and use dark text for readability */
    background-color: #b8860b !important; /* darker gold */
    color: #000000 !important;
}
.kpi-card.bg-primary {
    /* Ensure primary remains readable */
    color: #ffffff !important;
}
.kpi-card.bg-success {
    color: #ffffff !important;
}
.kpi-card.bg-danger {
    color: #ffffff !important;
}

/* Make sure the kpi-content text inherits the card color (overrides text-white) */
.kpi-card .kpi-content h5,
.kpi-card .kpi-content h2,
.kpi-card .kpi-content p {
    color: inherit !important;
}

/* ============================================
   Mobile-first responsive rules
   Breakpoints: 320px+, 480px+, 768px+, 1024px+
   ============================================ */

/* Base (mobile-first) */
:root {
    /* ensure touch targets are roomy */
    --kpi-gap: 1rem;
}

/* KPI cards full-width on small screens */
.kpi-card {
    width: 100%;
    box-sizing: border-box;
    padding: 1rem;
    gap: var(--kpi-gap);
}

/* Quick action cards/buttons become full width */
.dashboard-action-card {
    display: block;
    width: 100%;
    padding: 1rem;
    border-radius: 10px;
    text-align: left;
}

/* Make quick action icons + text wrap nicely */
.dashboard-action-card .dashboard-action-icon {
    font-size: 1.25rem;
    display: inline-block;
    margin-right: 0.75rem;
}

/* Tables -> card-like rows on small screens */
.table-responsive table {
    width: 100%;
    border-collapse: collapse;
}
.table-responsive thead {
    display: none;
}
.table-responsive tbody tr {
    display: block;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 10px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    background: #fff;
}
.table-responsive tbody tr td {
    display: block;
    padding: 0.25rem 0;
    white-space: normal;
}

/* Forms: full width inputs on small screens */
.form-control {
    width: 100% !important;
}

/* Applicant checklist: ensure checkboxes and labels wrap nicely */
.form-check {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Pipeline bar: allow wrapping and consistent spacing */
.pipeline-progress {
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Staff analytics: fallback to card layout on small screens */
.staff-analytics-card {
    display: block;
}

/* Medium screens (>=768px) — two column layout improvements */
@media (min-width: 768px) {
    .kpi-card {
        padding: 1.25rem;
    }
    .dashboard-action-card {
        width: auto;
    }
    .table-responsive tbody tr {
        display: table-row;
        border: none;
        padding: 0;
        margin: 0 0 0 0;
        background: transparent;
    }
    .table-responsive thead {
        display: table-header-group;
    }
    .table-responsive tbody tr td {
        display: table-cell;
        padding: 0.5rem;
    }
}

/* Large screens (>=1024px) — dashboard grid */
@media (min-width: 1024px) {
    .kpi-card {
        padding: 1.5rem;
    }
}

/* ============================================
   FORMS
   ============================================ */

.form-control {
    border: 1.5px solid var(--medium-gray);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: white;
}

.form-control:focus {
    border-color: var(--golden);
    box-shadow: 0 0 0 0.2rem rgba(255, 215, 0, 0.25);
    background-color: white;
}

.form-label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    display: block;
}

.form-section {
    border: 1px solid var(--medium-gray);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background-color: #fafbfc;
}

.form-section legend {
    width: auto;
    padding: 0 0.5rem;
}

.inquiry-form input[type="text"],
.inquiry-form input[type="email"],
.inquiry-form input[type="number"],
.inquiry-form input[type="date"],
.inquiry-form textarea,
.inquiry-form select {
    width: 100%;
    margin-bottom: 0.5rem;
}

fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

/* ============================================
   FEATURE CARDS
   ============================================ */

.feature-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-top: 3px solid transparent;
}

.feature-card:hover {
    border-top-color: var(--golden);
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    font-size: 3rem;
    color: var(--primary-blue);
    margin-bottom: 1rem;
}

.feature-icon.text-gold {
    color: var(--golden);
}

.feature-card h4 {
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-weight: 700;
}

.feature-card p {
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ============================================
   SECTION HEADERS / EMPTY STATES
   ============================================ */

.subtle { color: rgba(33, 37, 41, 0.68); }

.empty-state {
    padding: 1.75rem 1rem;
    border: 1px dashed rgba(212, 175, 55, 0.45);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.empty-state .empty-icon {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-image: var(--metallic-gold);
    color: var(--dark-black);
    margin-bottom: 0.9rem;
    font-size: 1.8rem;
}

/* ============================================
   EMI CALCULATOR
   ============================================ */

.emi-card {
    overflow: hidden;
}

.emi-form {
    display: block;
}

.emi-results-header {
    padding: 0.9rem 1rem;
    border: 1px solid transparent;
    border-image: var(--metallic-gold-border) 1;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(255,215,0,0.05) 100%);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.emi-results-badge {
    font-weight: 800;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    background-image: var(--metallic-gold);
    color: var(--dark-black);
    box-shadow: 0 10px 24px rgba(255, 215, 0, 0.22);
    font-size: 0.85rem;
    white-space: nowrap;
}

.emi-results-title {
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--text-dark);
}

.result-metric {
    background: rgba(255,255,255,0.85);
    border: 1px solid var(--medium-gray);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.04);
}

.metric-label {
    color: rgba(33, 37, 41, 0.75);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.metric-value {
    font-weight: 900;
    font-size: 1.35rem;
    margin-top: 0.35rem;
    color: var(--dark-black);
}

.emi-subhead {
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
    font-weight: 900;
}

.emi-schedule thead th {
    background: linear-gradient(180deg, rgba(248,249,250,1) 0%, rgba(248,249,250,0.6) 100%);
}

/* ============================================
   TABLES
   ============================================ */

.table { 
    margin-bottom: 0;
    border-radius: 12px;
    overflow: hidden;
}

.table thead {
    background-color: var(--light-gray);
    border-bottom: 2px solid var(--golden);
}

.table thead th {
    color: var(--text-dark);
    font-weight: 700;
    border: none;
    padding: 1rem;
    background-color: var(--light-gray);
}

.table tbody tr {
    border-bottom: 1px solid var(--medium-gray);
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background-color: #f5f8ff;
}

.table-hover tbody tr:hover {
    background-color: #f5f8ff;
    box-shadow: inset 4px 0 0 var(--golden);
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

/* ============================================
   BADGES & LABELS
   ============================================ */

.badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.badge.bg-gold {
    background-color: var(--golden) !important;
    color: var(--dark-black);
}

.badge.bg-primary {
    background-color: var(--primary-blue) !important;
}

/* ============================================
   PROGRESS BARS
   ============================================ */

.progress {
    border-radius: 8px;
    background-color: var(--medium-gray);
    height: 8px;
}

.progress-bar {
    background-color: var(--golden);
    border-radius: 8px;
}

/* ============================================
   ALERTS
   ============================================ */

.alert {
    border-radius: 8px;
    border: 1px solid;
    padding: 1rem 1.5rem;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffeeba;
    color: #856404;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* ============================================
   FOOTER
   ============================================ */

/* Sticky footer layout: footer pinned at bottom for short pages */
html, body {
    height: 100%;
}

.app-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-layout main {
    flex: 1;
}

footer {
    background-color: var(--dark-black);
    color: white;
    border-top: 1px solid var(--golden);
}


footer h5 {
    color: var(--golden);
    margin-bottom: 1rem;
}

footer p {
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

/* ============================================
   DASHBOARD ACTION CARDS
   ============================================ */

.dashboard-action-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;

    text-align: center;
    text-decoration: none;

    background: linear-gradient(180deg, rgba(255,255,255,0.9), #ffffff);
    border-radius: 14px;

    border: 1px solid transparent;
    border-image: var(--metallic-gold-border) 1;

    padding: 1.25rem 1rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);

    min-height: 120px;
}

.dashboard-action-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 30px rgba(0,0,0,0.18);
    background: linear-gradient(180deg, rgba(255,255,255,1), rgba(255,215,0,0.06));
}

.dashboard-action-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    background-image: var(--metallic-gold);
    color: var(--dark-black);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05);

    font-size: 1.6rem;
}

.dashboard-action-title {
    font-weight: 800;
    letter-spacing: 0.2px;
    color: var(--text-dark);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.min-vh-100 {
    min-height: 100vh;
}

.gap-3 {
    gap: 1rem;
}

.gap-4 {
    gap: 1.5rem;
}

.fw-bold {
    font-weight: 700;
}

.text-center {
    text-align: center;
}

.text-muted {
    opacity: 0.7;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.py-5 {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }

    .kpi-card {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        padding: 1.2rem;
    }

    .kpi-icon {
        font-size: 2rem;
    }

    .kpi-content h2 {
        font-size: 1.6rem;
    }

    table {
        font-size: 0.9rem;
    }

    .table thead th,
    .table tbody td {
        padding: 0.75rem 0.5rem;
    }

    .form-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .table-responsive {
        overflow-x: auto;
    }
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */

@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.1rem; }

    .navbar-brand {
        font-size: 1.2rem;
    }

    .btn {
        display: block;
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .btn-group {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .d-flex.gap-3 {
        flex-direction: column;
    }

    .row {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }

    .col-md-3, .col-md-4, .col-md-6, .col-lg-3, .col-lg-4, .col-lg-8 {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .card {
        margin-bottom: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .table {
        font-size: 0.85rem;
    }

    .table thead th,
    .table tbody td {
        padding: 0.5rem 0.25rem;
    }

    .kpi-card {
        padding: 1rem;
    }

    .kpi-icon {
        font-size: 1.75rem;
    }

    .kpi-content h5 {
        font-size: 0.8rem;
    }

    .kpi-content h2 {
        font-size: 1.4rem;
    }

    .form-section {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .form-control {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 0.6rem 0.8rem;
    }

    .py-5 {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }

    .hero-section {
        min-height: auto;
    }

    .hero-section .container {
        padding: 2rem 1rem;
    }

    .display-2 {
        font-size: 1.75rem;
    }

    .lead {
        font-size: 1rem;
    }

    footer {
        text-align: center;
    }

    footer .text-md-end {
        text-align: center;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

:focus-visible {
    outline: 2px solid var(--golden);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--golden);
    outline-offset: 2px;
}

/* ============================================
   ADD INQUIRY (MANUAL LEAD CREATION) FORM
   ============================================ */

.premium-card form p {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
    max-width: 560px;
}

.premium-card form p label {
    font-weight: 600;
    color: #0F2A44;
    margin-bottom: 0;
}

.premium-card form p input,
.premium-card form p select,
.premium-card form p textarea {
    width: 100%;
}

.premium-card form p .errorlist {
    color: #EF4444;
    font-size: 0.85rem;
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.premium-card form p .helptext {
    color: #64748B;
    font-size: 0.82rem;
    margin: 0;
}

/* ============================================
   MULTI-STEP INQUIRY WIZARD
   ============================================ */

#inquiryWizardForm .wizard-step .form-label {
    font-weight: 600;
    color: #0F2A44;
    font-size: 0.9rem;
}

#inquiryWizardForm .wizard-step .border.rounded {
    background: #f8fafc;
    border-color: #e2e8f0 !important;
}

#inquiryWizardForm .wizard-step .border.rounded h6 {
    color: #0B2C4A;
}

#addLoanRow,
#addInsuranceRow {
    margin-top: 4px;
}

.loan-row,
.insurance-row {
    background: #fff;
    border-color: #e2e8f0 !important;
}

.delete-flag + .form-check-label {
    color: #dc3545;
}

@media (max-width: 768px) {
    #inquiryWizardForm .wizard-step .border.rounded {
        padding: 14px !important;
    }
    #inquiryWizardForm .wizard-tabs .btn {
        flex: 1 1 30%;
        margin-bottom: 4px;
    }
}

/* Global CRM Back Button Component */
.back-btn {
    background: transparent;
    border: none;
    color: #0B2C4A;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    text-decoration: none;
    transition: color 0.2s ease;
}

.back-btn:hover {
    color: #F97316;
}

.page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.page-header h1:empty,
.page-header h2:empty {
    display: none;
}

/* Breadcrumb Navigation & Dynamic Page Title */
.breadcrumb-container {
    font-size: 13px;
    margin-bottom: 10px;
    color: #6b7280;
}

.breadcrumb-container a {
    color: #0B2C4A;
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb-container a:hover {
    color: #F97316;
}

.breadcrumb-container .separator {
    margin: 0 6px;
    color: #9ca3af;
}

.breadcrumb-container .current {
    color: #111827;
    font-weight: 600;
}

.page-title {
    font-size: 22px;
    font-weight: 600;
    color: #0B2C4A;
    margin: 0;
}

.page-title:empty {
    display: none;
}

/* ============================================
   GLOBAL MICRO-INTERACTIONS & TRANSITIONS
   ============================================ */

/* Card hover elevations */
.card, .premium-card, .fintech-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover, .premium-card:hover, .fintech-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* Button micro-interactions */
.btn, .btn-primary, .btn-gold, .btn-accent, .btn-secondary, .btn-outline-primary {
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Form input & select micro-interactions */
.form-control, .form-select, .fintech-input, .fintech-select {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus, .form-select:focus, .fintech-input:focus, .fintech-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.15);
    outline: none;
}

/* Empty state styling */
.empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
}

.empty-state img {
    width: 140px;
    max-width: 100%;
    margin-bottom: 1.25rem;
    opacity: 0.9;
    transition: transform 0.3s ease;
}

.empty-state:hover img {
    transform: scale(1.03);
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #64748b;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}

/* Centered 1100px max-width container */
.page-container {
    max-width: 1100px;
    margin: 20px auto;
    padding: 0 16px;
    width: 100%;
}

/* Responsive mobile adjustments */
@media (max-width: 768px) {
    .assignment-options {
        flex-direction: column !important;
    }
    .assignment-options .assign-card {
        width: 100% !important;
    }
    .card, .premium-card, .fintech-card {
        padding: 16px !important;
        margin-bottom: 16px !important;
    }
    .page-title {
        font-size: 18px !important;
    }
}

/* ============================================
   REAL-TIME WEBSOCKET SYNC ANIMATIONS
   ============================================ */
.pulse-update {
    animation: realtimePulse 1.2s cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes realtimePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.06);
        background-color: rgba(212, 175, 55, 0.25);
        border-radius: 4px;
    }
}

.row-highlight,
.pulse-highlight {
    animation: realtimeRowHighlight 2.5s ease-out forwards;
}

@keyframes realtimeRowHighlight {
    0% {
        background-color: rgba(25, 135, 84, 0.25) !important;
    }
    100% {
        background-color: transparent;
    }
}

/* ============================================
   REAL-TIME CONNECTION STATUS PILL
   ============================================ */
.realtime-status-pill {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9998;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
    user-select: none;
    pointer-events: none;
}

.realtime-status-pill .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.realtime-status-pill.status-live {
    background: rgba(15, 23, 42, 0.88);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.3);
}
.realtime-status-pill.status-live .status-dot {
    background: #22c55e;
    box-shadow: 0 0 8px #22c55e;
}

.realtime-status-pill.status-reconnecting {
    background: rgba(15, 23, 42, 0.88);
    color: #facc15;
    border: 1px solid rgba(250, 204, 21, 0.3);
}
.realtime-status-pill.status-reconnecting .status-dot {
    background: #eab308;
    box-shadow: 0 0 8px #eab308;
}

.realtime-status-pill.status-offline {
    background: rgba(15, 23, 42, 0.88);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.3);
}
.realtime-status-pill.status-offline .status-dot {
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444;
}

/* Navbar Docked Live Indicator */
.navbar .realtime-status-pill {
    position: static;
    display: inline-flex;
    margin: 0;
    font-size: 12px;
    padding: 5px 12px;
}

/* ============================================
   PHASE 2 & 6: SPACING SYSTEM & UI POLISH
   ============================================ */
:root {
    --space-16: 16px;
    --space-24: 24px;
    --space-32: 32px;
}

.p-card-standard { padding: var(--space-24) !important; }
.mb-section-standard { margin-bottom: var(--space-24) !important; }
.gap-standard { gap: var(--space-16) !important; }

/* Status flash animation */
.status-flash {
    animation: statusFlashAnim 1.6s ease-out;
}
@keyframes statusFlashAnim {
    0% { background-color: rgba(234, 179, 8, 0.45); }
    100% { background-color: transparent; }
}

/* Table Enhancements */
.table-responsive {
    border-radius: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: var(--space-24);
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table-hover tbody tr:hover {
    background-color: rgba(212, 175, 55, 0.08) !important;
}

.table td, .table th {
    padding: 14px 16px;
    vertical-align: middle;
}

/* Button Loading State & Double Submit Guard */
.btn.is-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

/* ============================================
   PHASE 7: MOBILE PERFECTION
   ============================================ */
/* Prevent global horizontal overflow */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Touch targets min 44px */
.btn, .form-control, .form-select, .nav-link, .back-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Mobile Sticky Bottom Action Bar */
.mobile-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #0f172a;
    padding: 12px 16px;
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.35);
    z-index: 1050;
    display: flex;
    gap: 12px;
}

/* Mobile card view for dense tables */
@media (max-width: 768px) {
    .table-mobile-card thead {
        display: none;
    }
    .table-mobile-card, 
    .table-mobile-card tbody, 
    .table-mobile-card tr, 
    .table-mobile-card td {
        display: block;
        width: 100%;
    }
    .table-mobile-card tr {
        margin-bottom: 16px;
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        padding: 14px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    }
    .table-mobile-card td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid #f1f5f9;
        text-align: right;
    }
    .table-mobile-card td:last-child {
        border-bottom: none;
        padding-top: 12px;
    }
    .table-mobile-card td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #64748b;
        font-size: 0.85rem;
        text-align: left;
    }
}

/* Notification Bell & Dropdown Styles */
.notification-bell-btn {
    background: rgba(255, 255, 255, 0.08) !important;
    border-radius: 8px;
    padding: 6px 12px;
    transition: background 0.2s ease, transform 0.15s ease;
}
.notification-bell-btn:hover {
    background: rgba(255, 255, 255, 0.18) !important;
    transform: scale(1.05);
}
#notificationBadge {
    font-size: 10px;
    padding: 3px 6px;
    box-shadow: 0 0 8px rgba(220, 53, 69, 0.8);
    animation: badgePop 0.3s ease;
}
@keyframes badgePop {
    0% { transform: translate(-50%, -50%) scale(0.5); }
    50% { transform: translate(-50%, -50%) scale(1.3); }
    100% { transform: translate(-50%, -50%) scale(1); }
}
.bell-ring-animation {
    animation: bellRing 0.8s ease;
}
@keyframes bellRing {
    0%, 100% { transform: rotate(0); }
    20%, 60% { transform: rotate(15deg); }
    40%, 80% { transform: rotate(-15deg); }
}
.notification-dropdown-menu {
    width: 340px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    background: #ffffff !important;
    overflow: hidden;
}
.notification-list-container::-webkit-scrollbar {
    width: 5px;
}
.notification-list-container::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 4px;
}
.notification-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    text-decoration: none !important;
    color: #1e293b;
    transition: background 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
    background: #ffffff;
    border-left: 3px solid transparent;
}
.notification-item:hover {
    background: #f8fafc;
}
.notification-item.unread {
    background: #f0f7ff;
    border-left: 3px solid #2563eb;
}
.notification-item.unread:hover {
    background: #e6f0fd;
}
.notification-item.read {
    background: #ffffff;
    border-left: 3px solid transparent;
}
.notification-item-new {
    animation: notifSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes notifSlideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.notification-item .notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}
.notif-icon.created { background: #f5f3ff; color: #7c3aed; }
.notif-icon.assigned { background: #eff6ff; color: #2563eb; }
.notif-icon.status { background: #f0fdf4; color: #16a34a; }
.notif-icon.updated { background: #f8fafc; color: #64748b; }

/* Real-Time Toast Notification Styles (Slide-in from right) */
#realtime-toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast-msg {
    background: #1e293b;
    color: #fff;
    padding: 12px 18px;
    border-radius: 8px;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.realtime-toast-popup {
    pointer-events: auto;
    width: 350px;
    max-width: 100%;
    background: #ffffff;
    color: #1e293b;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #2563eb;
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.12), 0 4px 6px -4px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}
.realtime-toast-popup.show {
    transform: translateX(0);
    opacity: 1;
}
.realtime-toast-popup.hide {
    transform: translateX(120%);
    opacity: 0;
}
.realtime-toast-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #eff6ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}
.realtime-toast-content {
    flex-grow: 1;
    min-width: 0;
}
.realtime-toast-title {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.3;
    margin-bottom: 2px;
}
.realtime-toast-message {
    font-size: 12px;
    color: #475569;
    line-height: 1.4;
    word-break: break-word;
}
.realtime-toast-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 18px;
    line-height: 1;
    padding: 0 4px;
    cursor: pointer;
    transition: color 0.15s ease;
    margin-top: -2px;
}
.realtime-toast-close:hover {
    color: #475569;
}

.border-gold-soft {
    border: 1px solid rgba(197, 160, 89, 0.35) !important;
    background: linear-gradient(135deg, #ffffff 0%, #faf8f5 100%);
}

/* ============================================
   AUTOSAVE & REALTIME STATUS BADGE
   ============================================ */
.autosave-badge {
    transition: all 0.25s ease;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* ============================================
/* ============================================
   STAFF ROLE BADGES & MOBILE INPUT STANDARDS
   ============================================ */
.badge-role-view-only { background-color: #6c757d !important; color: #ffffff !important; }
.badge-role-editor { background-color: #0d6efd !important; color: #ffffff !important; }
.badge-role-restricted { background-color: #fd7e14 !important; color: #ffffff !important; }

@media (max-width: 768px) {
    /* Form inputs, buttons & dropdowns: min-height 44px, font-size 16px to prevent iOS auto-zoom */
    .form-control,
    .form-select,
    select.lead-status-select,
    input,
    select,
    textarea,
    .btn {
        min-height: 44px;
    }

    .form-control,
    .form-select,
    select.lead-status-select,
    input[type="text"],
    input[type="tel"],
    input[type="email"],
    input[type="number"],
    input[type="password"],
    input[type="search"],
    select,
    textarea {
        font-size: 16px !important;
    }

    /* Form wizard step headers & cards */
    .fintech-card {
        margin-bottom: 1.25rem;
        border-radius: 12px;
    }
    .fintech-card-header {
        padding: 1rem;
    }
    .fintech-card-body {
        padding: 1rem;
    }
    .fintech-step-badge {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
        margin-right: 0.75rem;
    }

    /* Leads Table mobile scrolling */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
        margin-bottom: 1rem;
    }

    .table-responsive table {
        min-width: 850px;
    }

    /* Lead status select in table */
    .lead-status-select {
        min-width: 140px !important;
        padding: 0.35rem 0.6rem;
    }

    /* Autosave indicator position */
    #autosaveBadge {
        font-size: 0.78rem !important;
        padding: 0.25rem 0.65rem !important;
    }

    .container, .container-fluid {
        padding: 10px !important;
    }

    .btn {
        width: 100%;
    }

    .btn:not(.btn-sm):not(.dropdown-toggle):not(.navbar-toggler):not(.btn-close) {
        width: 100% !important;
        margin-bottom: 10px;
    }

    .table-responsive {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    /* 1. Notification dropdown: width 100%, right 0 */
    .notification-dropdown-menu {
        width: 100% !important;
        max-width: 100% !important;
        left: 0 !important;
        right: 0 !important;
        border-radius: 0 0 10px 10px !important;
    }

    /* 4. Forms: stacked layout */
    form .row > [class*="col-"],
    .form-group,
    .form-row > [class*="col-"] {
        width: 100% !important;
        display: block !important;
    }

    /* 5. Toast: full width bottom */
    #realtime-toast-container {
        left: 10px !important;
        right: 10px !important;
        bottom: 10px !important;
        width: calc(100% - 20px) !important;
    }

    .toast-msg,
    .realtime-toast-popup {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
}

/* Message Follow-up Button */
.msg-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.15rem;
    padding: 2px 6px;
    line-height: 1;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, background-color 0.15s ease;
    vertical-align: middle;
}
.msg-btn:hover {
    background-color: rgba(13, 202, 240, 0.15);
    transform: scale(1.18);
}
.msg-btn:active {
    transform: scale(0.95);
}





