/*
 * GetEasyLoans Portal — Frontend User Dashboard Styles
 * Premium Mobile-First Banking App Design
 * @version 2.0
 */

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

/* ─── Base Reset ─────────────────────────────────── */
.gel-user-app {
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
    box-sizing: border-box;
    line-height: 1.5;
    color: #09090b;
    background: #f8fafc;
    min-height: 100vh;
}

.gel-user-app *, .gel-user-app *::before, .gel-user-app *::after {
    box-sizing: inherit;
}

/* ─── Targeted WP button reset — ONLY kills browser appearance & WP pink, does NOT touch layout ── */
.gel-user-app button {
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
    outline: none !important;
    margin: 0;
    box-shadow: none;
}

.gel-user-app button:focus,
.gel-user-app button:active {
    outline: none !important;
}

/* ─── Top Bar (Mobile) ───────────────────────────── */
.gel-top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.gel-top-bar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gel-top-bar-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.gel-top-bar-name {
    font-size: 15px;
    font-weight: 800;
    color: #09090b;
    letter-spacing: -0.3px;
}

/* ─── Layout ─────────────────────────────────────── */
.gel-layout {
    display: flex;
    min-height: calc(100vh - 57px);
}

/* ─── Desktop Sidebar ────────────────────────────── */
.gel-desktop-sidebar {
    display: none;
    width: 240px;
    flex-shrink: 0;
    background: #0f172a;
    min-height: 100%;
}

@media (min-width: 1024px) {
    .gel-top-bar { display: none; }
    .gel-layout { min-height: 100vh; }
    .gel-desktop-sidebar { display: block; }
}

.gel-ds-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 100vh;
    padding: 28px 20px;
    position: sticky;
    top: 0;
}

.gel-ds-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 36px;
}

.gel-ds-logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gel-ds-logo span {
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.3px;
}

.gel-ds-nav-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #475569;
    margin-bottom: 8px;
}

.gel-ds-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gel-ds-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #94a3b8;
    background: transparent;
    border: none;
    outline: none;
    box-shadow: none;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
    width: 100%;
    font-family: inherit;
}

.gel-ds-link:hover,
.gel-ds-link:focus,
.gel-ds-link:active {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #e2e8f0 !important;
}

/* Active sidebar link — dark semi-transparent, explicitly NOT pink */
.gel-ds-link-active {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #fff !important;
    font-weight: 700;
}

.gel-ds-logout { color: #64748b; }

.gel-ds-footer {
    margin-top: auto;
    padding-top: 24px;
}

/* ─── Main Content ───────────────────────────────── */
.gel-main {
    flex: 1;
    overflow-x: hidden;
    padding-bottom: 90px; /* space for bottom nav */
}

@media (min-width: 1024px) {
    .gel-main { padding-bottom: 32px; }
}

.gel-main-inner {
    max-width: 680px;
    margin: 0 auto;
    padding: 24px 20px;
}

@media (min-width: 1024px) {
    .gel-main-inner { padding: 36px 40px; }
    /* Stats grid fills the full content width on desktop — equal 50-50 columns */
    .gel-stats { width: 100%; }
}

/* ─── Hero ───────────────────────────────────────── */
.gel-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.gel-hero-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Avatar — large circle, 30% bigger per user request */
.gel-avatar-ring {
    width: 143px;
    height: 143px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, #0f172a, #334155);
    flex-shrink: 0;
    overflow: hidden;
}

.gel-hero-avatar {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    border: 2px solid #f8fafc;
    overflow: hidden;
}

.gel-hero-welcome {
    font-size: 17px;
    font-weight: 500;
    color: #71717a;
    margin: 0 0 2px;
}

.gel-hero-name {
    font-size: 26px;
    font-weight: 800;
    color: #09090b;
    margin: 0 0 2px;
    letter-spacing: -0.5px;
}

.gel-hero-sub {
    font-size: 15px;
    color: #a1a1aa;
    margin: 0;
}

/* ─── Stats Cards ────────────────────────────────── */
.gel-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

/* 2-column variant used when only 2 cards are shown */
.gel-stats-2col {
    grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 640px) {
    .gel-stats { grid-template-columns: repeat(4, 1fr); }
    /* 2-col variant always stays 50-50 regardless of viewport */
    .gel-stats-2col { grid-template-columns: repeat(2, 1fr) !important; }
}

.gel-stat-card {
    border-radius: 16px;
    padding: 18px 16px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gel-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.gel-stat-dark  { background: linear-gradient(135deg, #0f172a, #1e293b); color: #fff; }
.gel-stat-green { background: linear-gradient(135deg, #064e3b, #059669); color: #fff; }
.gel-stat-amber { background: linear-gradient(135deg, #78350f, #d97706); color: #fff; }
.gel-stat-slate { background: linear-gradient(135deg, #1e3a5f, #2563eb); color: #fff; }

.gel-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.gel-stat-value {
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 4px;
    letter-spacing: -0.5px;
}

.gel-stat-label {
    font-size: 11px;
    font-weight: 600;
    opacity: 0.7;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ─── Section ────────────────────────────────────── */
.gel-section {
    margin-bottom: 32px;
}

.gel-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.gel-section-title {
    font-size: 17px;
    font-weight: 700;
    color: #09090b;
    margin: 0;
    letter-spacing: -0.3px;
}

.gel-section-count {
    font-size: 12px;
    font-weight: 600;
    color: #a1a1aa;
    background: #f4f4f5;
    padding: 3px 10px;
    border-radius: 20px;
}

/* ─── Empty State ────────────────────────────────── */
.gel-empty-loans {
    text-align: center;
    padding: 48px 24px;
    background: #fff;
    border: 1px dashed #d4d4d8;
    border-radius: 20px;
}

.gel-empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #f4f4f5;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: #a1a1aa;
}

.gel-empty-text {
    font-size: 15px;
    font-weight: 600;
    color: #3f3f46;
    margin: 0 0 4px;
}

.gel-empty-sub {
    font-size: 13px;
    color: #a1a1aa;
    margin: 0;
}

/* ─── Loan List ──────────────────────────────────── */
.gel-loan-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ─── Loan Card ──────────────────────────────────── */
.gel-loan-card {
    background: #fff;
    border: 1px solid #e4e4e7;
    border-radius: 20px;
    padding: 20px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.gel-loan-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0f172a, #334155);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.gel-loan-card:hover {
    border-color: #d4d4d8;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.gel-loan-card:hover::before {
    opacity: 1;
}

.gel-lc-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.gel-lc-id {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gel-lc-id-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #f4f4f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #52525b;
    flex-shrink: 0;
}

.gel-lc-account {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: 700;
    color: #52525b;
    letter-spacing: 0.05em;
}

.gel-lc-amount {
    font-size: 28px;
    font-weight: 800;
    color: #09090b;
    letter-spacing: -1px;
    margin-bottom: 16px;
    line-height: 1;
}

.gel-lc-currency {
    font-size: 16px;
    font-weight: 700;
    vertical-align: super;
    margin-right: 2px;
}

.gel-lc-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 14px 0;
    border-top: 1px solid #f4f4f5;
    border-bottom: 1px solid #f4f4f5;
    margin-bottom: 16px;
}

.gel-lc-meta-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.gel-lc-meta-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #a1a1aa;
}

.gel-lc-meta-val {
    font-size: 14px;
    font-weight: 700;
    color: #18181b;
}

.gel-lc-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* ─── Status Badges ──────────────────────────────── */
.gel-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.gel-status-blue   { background: #eff6ff; color: #1d4ed8; }
.gel-status-green  { background: #f0fdf4; color: #15803d; }
.gel-status-red    { background: #fef2f2; color: #dc2626; }
.gel-status-yellow { background: #fefce8; color: #a16207; }
.gel-status-gray   { background: #f4f4f5; color: #52525b; }

.gel-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ─── View Details Button — solid black, proper rounded border ──── */
.gel-view-details-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 22px;
    background: #09090b;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    outline: none;
    letter-spacing: 0.01em;
}

.gel-view-details-btn:hover,
.gel-view-details-btn:focus,
.gel-view-details-btn:active {
    background: #27272a !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

/* ─── Quick Link Grid ────────────────────────────── */
.gel-ql-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}

.gel-ql-card {
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    padding: 22px 18px 18px;
    color: #fff;
    text-decoration: none;
    min-height: 140px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    /* Reset browser button defaults so no red/pink border appears */
    border: none;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
    text-align: left;
    box-shadow: none;
    width: 100%;
}

.gel-ql-card:focus,
.gel-ql-card:active {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

.gel-ql-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0);
    transition: background 0.2s;
}

.gel-ql-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}

.gel-ql-card:hover::after {
    background: rgba(255, 255, 255, 0.05);
}

.gel-ql-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.gel-ql-label {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    flex: 1;
}

.gel-ql-meta {
    font-size: 10px;
    opacity: 0.65;
    margin: 4px 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gel-ql-arrow {
    position: absolute;
    bottom: 16px;
    right: 16px;
    opacity: 0.5;
}

/* ─── Bottom Nav ─────────────────────────────────── */
.gel-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.08);
}

@media (min-width: 1024px) {
    .gel-bottom-nav { display: none; }
}

/* Bottom nav items — explicit no-border, proper flex column */
.gel-bn-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 600;
    color: #a1a1aa;
    background: none;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 4px 16px;
    border-radius: 10px;
    text-decoration: none;
    transition: color 0.15s;
    font-family: inherit;
}

.gel-bn-item:hover,
.gel-bn-item:focus,
.gel-bn-item:active { 
    color: #09090b !important;
    background: transparent !important;
}

.gel-bn-active {
    color: #09090b;
}

.gel-bn-home-btn {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: #09090b;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

/* ─── Dark Mode Toggle ───────────────────────────── */
.gel-dark-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    background: #09090b;
    color: #fff;
    border: none;
    outline: none;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
}

.gel-dark-toggle:hover,
.gel-dark-toggle:focus,
.gel-dark-toggle:active {
    background: #27272a !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2) !important;
    color: #fff !important;
}

.gel-dark-toggle-full {
    width: 100%;
    justify-content: center;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 13px;
}


/* ─── Get Help Popup Modal ───────────────────────── */
.gel-help-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 24px;
}

.gel-help-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.gel-help-modal {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.22);
    width: 100%;
    max-width: 460px;
    transform: scale(0.94) translateY(10px);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.gel-help-overlay.active .gel-help-modal {
    transform: scale(1) translateY(0);
}

.gel-help-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 24px 16px;
    border-bottom: 1px solid #f4f4f5;
}

.gel-help-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 800;
    color: #09090b;
    letter-spacing: -0.3px;
}

.gel-help-modal-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #064e3b, #065f46);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.gel-help-modal-close {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 10px;
    background: #09090b;
    color: #fff;
    border: none;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    -webkit-appearance: none;
    appearance: none;
    line-height: 1;
    padding: 0;
}

.gel-help-modal-close svg {
    display: block;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #fff;
    stroke: #fff;
}

.gel-help-modal-close:hover {
    background: #27272a;
    transform: scale(1.05);
}

.gel-help-modal-close:focus {
    outline: none !important;
    box-shadow: none !important;
}

.gel-help-modal-body {
    padding: 24px 24px 28px;
}

.gel-help-modal-message {
    font-size: 15px;
    font-weight: 600;
    color: #18181b;
    line-height: 1.7;
    margin: 0;
    white-space: pre-wrap;
}

/* Dark mode */
.gel-dark .gel-help-modal {
    background: #18181b;
}
.gel-dark .gel-help-modal-header {
    border-color: #27272a;
}
.gel-dark .gel-help-modal-title {
    color: #fafafa;
}
.gel-dark .gel-help-modal-close {
    background: #fafafa;
    color: #09090b;
}
.gel-dark .gel-help-modal-close:hover {
    background: #e4e4e7;
}
.gel-dark .gel-help-modal-message {
    color: #e4e4e7;
}

/* Loan modal — centered on all viewports (not bottom-sheet on mobile) */
.gel-loan-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.gel-loan-modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.gel-loan-modal {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(8px);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.gel-loan-modal-overlay.active .gel-loan-modal {
    transform: scale(1) translateY(0);
}

/* Drag handle hidden — modal is now centered on all viewports */
.gel-loan-modal::before {
    display: none;
}

/* ─── Modal Inner Styles ─────────────────────────── */
.gel-lm-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #f4f4f5;
}

.gel-lm-title {
    font-size: 18px;
    font-weight: 800;
    color: #09090b;
    margin: 0 0 4px;
    letter-spacing: -0.3px;
}

.gel-lm-acct {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: 700;
    color: #71717a;
    margin: 0;
    letter-spacing: 0.05em;
}

/* ── Black Close Button (fixes screenshot issue) ── */
.gel-lm-close {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #09090b;
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: 12px;
}

.gel-lm-close:hover {
    background: #27272a;
    transform: scale(1.05);
}

.gel-lm-body {
    padding: 20px 24px 28px;
}

.gel-lm-status-row {
    margin-bottom: 20px;
}

.gel-lm-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
    background: #f8fafc;
    border-radius: 14px;
    padding: 16px;
}

.gel-lm-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gel-lm-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #a1a1aa;
    margin: 0;
}

.gel-lm-value {
    font-size: 15px;
    font-weight: 700;
    color: #09090b;
}

.gel-lm-amount {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.gel-lm-alerts-wrap,
.gel-lm-desc-wrap {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f4f4f5;
}

.gel-lm-alerts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.gel-lm-tag {
    display: inline-block;
    padding: 3px 10px;
    background: #f4f4f5;
    color: #374151;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.gel-lm-desc {
    font-size: 14px;
    color: #52525b;
    margin: 8px 0 0;
    line-height: 1.6;
}

/* ─── Login Page ─────────────────────────────────── */
/* Always-dark background — white card stands out per design reference */
.gel-login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #09090b;
    padding: 24px;
}

.gel-login-card {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.10);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
}

.gel-login-card h1 {
    font-size: 28px;
    font-weight: 800;
    color: #09090b;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.gel-login-card p.subtitle {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 28px;
}

.gel-login-card .gel-field { margin-bottom: 18px; }

.gel-login-card .gel-field label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.gel-login-card .gel-field input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e4e4e7;
    border-radius: 12px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fafafa;
    color: #09090b;
}

.gel-login-card .gel-field input:focus {
    border-color: #09090b;
    box-shadow: 0 0 0 3px rgba(9, 9, 11, 0.08);
    background: #fff;
}

.gel-login-btn {
    width: 100%;
    padding: 13px;
    background: #09090b;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.gel-login-btn:hover {
    background: #27272a;
    box-shadow: 0 6px 20px rgba(9, 9, 11, 0.25);
    transform: translateY(-1px);
}

.gel-login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.gel-login-error {
    background: #fef2f2;
    color: #b91c1c;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
    display: none;
}

.gel-login-error.visible { display: block; }

/* ─── Spinner ────────────────────────────────────── */
.gel-user-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: gel-spin 0.6s linear infinite;
}

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

/* ═══════════════════════════════════════════════════
   DARK MODE
═══════════════════════════════════════════════════ */

/* When dark mode is active, force html+body backgrounds dark too
   (fixes the white space you see on mobile below the bottom nav) */
.gel-dark,
.gel-dark * { color: inherit; }

.gel-dark { color: #e4e4e7; }

/* Target the page-level backgrounds via the root element */
#gel-user-app-root.gel-dark {
    background: #09090b;
}

/* Force html and body backgrounds dark when in dark mode */
body:has(#gel-user-app-root.gel-dark),
html:has(#gel-user-app-root.gel-dark) {
    background: #09090b !important;
}

.gel-dark .gel-user-app { background: #09090b !important; }

/* Top bar */
.gel-dark .gel-top-bar {
    background: rgba(9, 9, 11, 0.95);
    border-color: rgba(255, 255, 255, 0.08);
}
.gel-dark .gel-top-bar-name { color: #fafafa; }

/* Layout */
.gel-dark .gel-layout { background: #09090b; }

/* Sidebar */
.gel-dark .gel-desktop-sidebar { background: #050508; }

/* Main */
.gel-dark .gel-main { background: #09090b; }

/* Hero */
.gel-dark .gel-hero-name { color: #fafafa; }
.gel-dark .gel-hero-welcome,
.gel-dark .gel-hero-sub { color: #71717a; }
.gel-dark .gel-avatar-ring { background: linear-gradient(135deg, #27272a, #3f3f46); }

/* Stats */
.gel-dark .gel-stat-dark  { background: linear-gradient(135deg, #18181b, #27272a); }
.gel-dark .gel-stat-green { background: linear-gradient(135deg, #052e16, #064e3b); }
.gel-dark .gel-stat-amber { background: linear-gradient(135deg, #431407, #78350f); }
.gel-dark .gel-stat-slate { background: linear-gradient(135deg, #0c1a2e, #1e3a5f); }

/* Section */
.gel-dark .gel-section-title { color: #fafafa; }
.gel-dark .gel-section-count { background: #27272a; color: #a1a1aa; }

/* Loan Cards */
.gel-dark .gel-loan-card {
    background: #18181b;
    border-color: #27272a;
}
.gel-dark .gel-loan-card:hover {
    border-color: #3f3f46;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
}
.gel-dark .gel-loan-card::before {
    background: linear-gradient(90deg, #3f3f46, #52525b);
}
.gel-dark .gel-lc-id-icon {
    background: #27272a;
    color: #a1a1aa;
}
.gel-dark .gel-lc-account { color: #a1a1aa; }
.gel-dark .gel-lc-amount { color: #fafafa; }
.gel-dark .gel-lc-meta { border-color: #27272a; }
.gel-dark .gel-lc-meta-val { color: #e4e4e7; }

/* Status badges dark */
.gel-dark .gel-status-blue   { background: #1e3a5f; color: #93c5fd; }
.gel-dark .gel-status-green  { background: #052e16; color: #86efac; }
.gel-dark .gel-status-red    { background: #450a0a; color: #fca5a5; }
.gel-dark .gel-status-yellow { background: #431407; color: #fde68a; }
.gel-dark .gel-status-gray   { background: #27272a; color: #a1a1aa; }

/* View details button — stays BLACK even in dark mode (user request) */
.gel-dark .gel-view-details-btn {
    background: #09090b !important;
    color: #fff !important;
    border: 1px solid #3f3f46;
}
.gel-dark .gel-view-details-btn:hover,
.gel-dark .gel-view-details-btn:focus,
.gel-dark .gel-view-details-btn:active {
    background: #27272a !important;
    color: #fff !important;
}

/* Empty state */
.gel-dark .gel-empty-loans {
    background: #18181b;
    border-color: #27272a;
}
.gel-dark .gel-empty-icon { background: #27272a; color: #71717a; }
.gel-dark .gel-empty-text { color: #e4e4e7; }

/* Quick links */
.gel-dark .gel-ql-card { opacity: 0.92; }

/* Bottom nav */
.gel-dark .gel-bottom-nav {
    background: rgba(9, 9, 11, 0.95);
    border-color: rgba(255, 255, 255, 0.08);
}
.gel-dark .gel-bn-item { color: #52525b; }
.gel-dark .gel-bn-active { color: #fafafa; }

/* Dark toggle */
.gel-dark .gel-dark-toggle {
    background: #fafafa;
    color: #09090b;
}
.gel-dark .gel-dark-toggle:hover { background: #e4e4e7; }

/* Modal */
.gel-dark .gel-loan-modal {
    background: #18181b;
}
.gel-dark .gel-loan-modal::before { background: #3f3f46; }
.gel-dark .gel-lm-header { border-color: #27272a; }
.gel-dark .gel-lm-title { color: #fafafa; }
.gel-dark .gel-lm-acct { color: #71717a; }
.gel-dark .gel-lm-close { background: #fafafa; color: #09090b; }
.gel-dark .gel-lm-close:hover { background: #e4e4e7; }
.gel-dark .gel-lm-grid { background: #09090b; }
.gel-dark .gel-lm-value { color: #fafafa; }
.gel-dark .gel-lm-alerts-wrap,
.gel-dark .gel-lm-desc-wrap { border-color: #27272a; }
.gel-dark .gel-lm-tag { background: #27272a; color: #d4d4d8; }
.gel-dark .gel-lm-desc { color: #a1a1aa; }

/* Help modal dark mode — close button turns light so SVG needs dark stroke */
.gel-dark .gel-help-modal-close {
    background: #e4e4e7;
    color: #09090b;
}
.gel-dark .gel-help-modal-close svg {
    color: #09090b;
    stroke: #09090b;
}
.gel-dark .gel-help-modal-close:hover {
    background: #d4d4d8;
}

/* ─── Login Page — always-dark page background ───── */

/* Force page-level backgrounds dark regardless of dark mode toggle */
body:has(#gel-login-app-root),
html:has(#gel-login-app-root) {
    background: #09090b !important;
}

#gel-login-app-root {
    background: #09090b;
    min-height: 100vh;
}

/* Dark-mode wrapper is same as light — already dark */
.gel-dark .gel-login-wrapper {
    background: #09090b;
}

/* Login card stays white even in dark mode so it pops off the black background */
.gel-dark .gel-login-card {
    background: #fff;
    border: none;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

/* Card text stays dark since card background is white */
.gel-dark .gel-login-card h1 {
    color: #09090b;
}

.gel-dark .gel-login-card p.subtitle {
    color: #64748b;
}

.gel-dark .gel-login-card .gel-field label {
    color: #374151;
}

.gel-dark .gel-login-card .gel-field input {
    background: #fafafa;
    border-color: #e4e4e7;
    color: #09090b;
}

.gel-dark .gel-login-card .gel-field input::placeholder {
    color: #a1a1aa;
}

.gel-dark .gel-login-card .gel-field input:focus {
    border-color: #09090b;
    box-shadow: 0 0 0 3px rgba(9, 9, 11, 0.08);
    background: #fff;
}

.gel-dark .gel-login-error {
    background: #fef2f2;
    color: #b91c1c;
}
