/* ==========================================

   Pawn.guru — Official Modern Theme

   ========================================== */



/* ---------- Base ---------- */

body {

    font-family: 'Inter', system-ui, -apple-system, sans-serif;

    -webkit-font-smoothing: antialiased;

    -moz-osx-font-smoothing: grayscale;

}

/* Constrain sidebar+content layout to match the header width (max-w-7xl = 80rem = 1280px) */
body > .flex {
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}


.font-display {

    font-family: 'Space Grotesk', 'Inter', sans-serif;

}



/* ---------- Animations ---------- */

@keyframes fadeIn {

    from { opacity: 0; transform: translateY(16px); }

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

}

@keyframes slideUp {

    from { opacity: 0; transform: translateY(30px); }

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

}

@keyframes float {

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

    50%      { transform: translateY(-12px); }

}

@keyframes pulseSoft {

    0%, 100% { opacity: 1; }

    50%      { opacity: .6; }

}

@keyframes shimmer {

    0%   { background-position: -200% 0; }

    100% { background-position: 200% 0; }

}

@keyframes countUp {

    from { opacity: 0; transform: scale(.8); }

    to   { opacity: 1; transform: scale(1); }

}

@keyframes gradient-shift {

    0%   { background-position: 0% 50%; }

    50%  { background-position: 100% 50%; }

    100% { background-position: 0% 50%; }

}



.anim-fade    { animation: fadeIn .6s ease-out forwards; }

.anim-slide   { animation: slideUp .7s ease-out forwards; }

.anim-float   { animation: float 6s ease-in-out infinite; }

.anim-pulse   { animation: pulseSoft 3s ease-in-out infinite; }

.anim-shimmer {

    background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent);

    background-size: 200% 100%;

    animation: shimmer 2s infinite;

}



[data-anim] {

    opacity: 0;

    transform: translateY(20px);

    transition: opacity .6s ease, transform .6s ease;

}

[data-anim].visible {

    opacity: 1;

    transform: translateY(0);

}



/* ---------- Gradient backgrounds ---------- */

.hero-bg {

    background: linear-gradient(135deg, #0f172a 0%, #1e293b 30%, #0f172a 60%, #1a1a2e 100%);

    position: relative;

    overflow: hidden;

}

.hero-bg::before {

    content: '';

    position: absolute;

    inset: 0;

    background:

        radial-gradient(600px circle at 20% 40%, rgba(76,110,245,.15), transparent 50%),

        radial-gradient(400px circle at 80% 60%, rgba(139,92,246,.1), transparent 40%);

    pointer-events: none;

}

.hero-bg::after {

    content: '';

    position: absolute;

    bottom: 0; left: 0; right: 0;

    height: 120px;

    background: linear-gradient(to top, #f8f9fa, transparent);

    pointer-events: none;

}



.section-dark {

    background: linear-gradient(180deg, #0f172a, #1e293b);

}



.gradient-shift {

    background-size: 200% 200%;

    animation: gradient-shift 8s ease infinite;

}



/* ---------- Gradient text ---------- */

.gradient-text {

    background: linear-gradient(135deg, #4c6ef5 0%, #7c3aed 50%, #ec4899 100%);

    -webkit-background-clip: text;

    -webkit-text-fill-color: transparent;

    background-clip: text;

}

.gradient-text-light {

    background: linear-gradient(135deg, #91a7ff, #c084fc);

    -webkit-background-clip: text;

    -webkit-text-fill-color: transparent;

    background-clip: text;

}



/* ---------- Glass morphism ---------- */

.glass {

    background: rgba(255,255,255,.7);

    backdrop-filter: blur(20px) saturate(180%);

    -webkit-backdrop-filter: blur(20px) saturate(180%);

    border: 1px solid rgba(255,255,255,.3);

}

.glass-dark {

    background: rgba(15,23,42,.6);

    backdrop-filter: blur(20px) saturate(180%);

    -webkit-backdrop-filter: blur(20px) saturate(180%);

    border: 1px solid rgba(255,255,255,.08);

}



/* ---------- Cards ---------- */

.card {

    background: #fff;

    border: 1px solid #e9ecef;

    border-radius: 16px;

    transition: all .3s cubic-bezier(.4,0,.2,1);

}

.card:hover {

    border-color: #bac8ff;

    box-shadow: 0 20px 60px -12px rgba(76,110,245,.12), 0 0 0 1px rgba(76,110,245,.05);

    transform: translateY(-4px);

}

.card-static {

    background: #fff;

    border: 1px solid #e9ecef;

    border-radius: 16px;

}



/* ---------- Buttons ---------- */

.btn-primary {

    background: linear-gradient(135deg, #4c6ef5, #4263eb);

    color: #fff;

    font-weight: 600;

    border-radius: 12px;

    padding: 12px 28px;

    transition: all .3s ease;

    box-shadow: 0 4px 14px rgba(66,99,235,.3);

    display: inline-flex;

    align-items: center;

    gap: 8px;

}

.btn-primary:hover {

    background: linear-gradient(135deg, #4263eb, #3b5bdb);

    box-shadow: 0 6px 20px rgba(66,99,235,.4);

    transform: translateY(-1px);

}

.btn-secondary {

    background: #fff;

    color: #343a40;

    font-weight: 600;

    border-radius: 12px;

    padding: 12px 28px;

    border: 1px solid #dee2e6;

    transition: all .3s ease;

    display: inline-flex;

    align-items: center;

    gap: 8px;

}

.btn-secondary:hover {

    background: #f8f9fa;

    border-color: #bac8ff;

    color: #4263eb;

    box-shadow: 0 4px 14px rgba(0,0,0,.05);

    transform: translateY(-1px);

}

.btn-sm {

    padding: 8px 16px;

    font-size: 0.875rem;

    border-radius: 10px;

}

.btn-xs {

    padding: 5px 12px;

    font-size: 0.75rem;

    border-radius: 8px;

}

.btn-danger {

    background: linear-gradient(135deg, #e03131, #c92a2a);

    color: #fff;

    font-weight: 600;

    border-radius: 12px;

    padding: 12px 28px;

    transition: all .3s ease;

    box-shadow: 0 4px 14px rgba(224,49,49,.25);

}

.btn-success {

    background: linear-gradient(135deg, #2f9e44, #2b8a3e);

    color: #fff;

    font-weight: 600;

    border-radius: 12px;

    padding: 12px 28px;

    transition: all .3s ease;

    box-shadow: 0 4px 14px rgba(47,158,68,.25);

}



/* ---------- Form inputs ---------- */

.form-input {

    width: 100%;

    padding: 10px 16px;

    border: 1.5px solid #dee2e6;

    border-radius: 12px;

    font-size: 0.875rem;

    transition: all .2s ease;

    background: #fff;

}

.form-input:focus {

    outline: none;

    border-color: #4c6ef5;

    box-shadow: 0 0 0 3px rgba(76,110,245,.12);

}

.form-input-icon {

    padding-left: 42px;

}



/* ---------- Chat ---------- */

.chat-sent {

    background: linear-gradient(135deg, #4c6ef5, #4263eb);

    color: #fff;

    border-radius: 16px 16px 4px 16px;

}

.chat-received {

    background: #f1f3f5;

    color: #212529;

    border-radius: 16px 16px 16px 4px;

}



/* ---------- Scrollbar ---------- */

::-webkit-scrollbar { width: 6px; height: 6px; }

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

::-webkit-scrollbar-thumb { background: #ced4da; border-radius: 3px; }

::-webkit-scrollbar-thumb:hover { background: #adb5bd; }



/* ---------- Status badges ---------- */

.badge { padding: 4px 12px; border-radius: 8px; font-size: 0.75rem; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }

.badge-pending  { background: #fff3bf; color: #e67700; }

.badge-approved { background: #d0ebff; color: #1971c2; }

.badge-active   { background: #d3f9d8; color: #2b8a3e; }

.badge-repaid   { background: #e9ecef; color: #495057; }

.badge-defaulted, .badge-rejected { background: #ffe3e3; color: #c92a2a; }



/* ---------- Stat cards ---------- */

.stat-card {

    background: #fff;

    border: 1px solid #e9ecef;

    border-radius: 16px;

    padding: 24px;

    position: relative;

    overflow: hidden;

}

.stat-card::before {

    content: '';

    position: absolute;

    top: 0; left: 0; right: 0;

    height: 3px;

    background: linear-gradient(90deg, #4c6ef5, #7c3aed);

    border-radius: 16px 16px 0 0;

}



/* ---------- Mobile bottom nav ---------- */

@media (max-width: 1023px) {

    .dashboard-content { padding-bottom: 5rem; overflow-x: hidden; min-width: 0; }

}



/* ---------- Table ---------- */

.data-table { width: 100%; font-size: 0.875rem; }

.data-table thead { background: #f8f9fa; }

.data-table th { padding: 12px 16px; text-align: left; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #868e96; }

.data-table td { padding: 14px 16px; }

.data-table tbody tr { border-bottom: 1px solid #f1f3f5; transition: background .15s; }

.data-table tbody tr:hover { background: #f8f9fa; }

.data-table tbody tr:last-child { border-bottom: none; }



/* ---------- Misc ---------- */

.nav-link {

    padding: 6px 14px;

    font-size: 0.875rem;

    font-weight: 500;

    color: #adb5bd;

    border-radius: 10px;

    transition: all .2s ease;

}

.nav-link:hover {

    color: #fff;

    background: rgba(255,255,255,.06);

}



.sidebar-link {

    display: flex;

    align-items: center;

    gap: 12px;

    padding: 10px 16px;

    font-size: 0.875rem;

    font-weight: 500;

    color: #495057;

    border-radius: 12px;

    transition: all .2s ease;

}

.sidebar-link:hover {

    background: #f0f4ff;

    color: #4263eb;

}

.sidebar-link.active {

    background: linear-gradient(135deg, #4c6ef5, #4263eb);

    color: #fff;

    box-shadow: 0 4px 12px rgba(66,99,235,.3);

}

.sidebar-link.active i { color: #fff; }



/* Page transitions */

.page-enter {

    animation: fadeIn .4s ease-out;

}



/* Dot grid pattern */

.dot-pattern {

    background-image: radial-gradient(circle, rgba(255,255,255,.05) 1px, transparent 1px);

    background-size: 24px 24px;

}

/* ─── Skeleton loading ────────────────────────────────────────────── */

.skeleton {

    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);

    background-size: 200% 100%;

    animation: shimmer 1.5s infinite;

    border-radius: 8px;

}

.skeleton-text  { height: 14px; width: 100%; }

.skeleton-title { height: 22px; width: 60%; }

.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; }

.skeleton-card  { height: 120px; border-radius: 16px; }

/* ─── Empty states ────────────────────────────────────────────────── */

.empty-state {

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    padding: 3rem 1.5rem;

    text-align: center;

}

.empty-state-icon {

    width: 72px;

    height: 72px;

    border-radius: 20px;

    display: flex;

    align-items: center;

    justify-content: center;

    margin-bottom: 1.25rem;

    font-size: 1.75rem;

}

.empty-state-title { font-size: 1rem; font-weight: 700; color: #212529; margin-bottom: .375rem; }

.empty-state-desc  { font-size: .875rem; color: #868e96; max-width: 280px; line-height: 1.6; }

/* ─── Dark mode ───────────────────────────────────────────────────── */

:root { --dm-transition: background .3s ease, color .3s ease, border-color .3s ease; }

html.dark body                 { background: #0f172a; color: #e2e8f0; }

html.dark .bg-white            { background: #1e293b !important; }

html.dark .bg-gray-50          { background: #0f172a !important; }

html.dark .bg-gray-100         { background: #1e293b !important; }

html.dark .text-gray-900       { color: #f1f5f9 !important; }

html.dark .text-gray-800       { color: #e2e8f0 !important; }

html.dark .text-gray-700       { color: #cbd5e1 !important; }

html.dark .text-gray-600       { color: #94a3b8 !important; }

html.dark .text-gray-500       { color: #64748b !important; }

html.dark .text-gray-400       { color: #475569 !important; }

html.dark .border-gray-100,

html.dark .border-gray-200     { border-color: #334155 !important; }

html.dark .card,

html.dark .stat-card           { background: #1e293b; border-color: #334155; }

html.dark .sidebar-link        { color: #94a3b8; }

html.dark .sidebar-link:hover  { background: rgba(76,110,245,.12); color: #93c5fd; }

html.dark .data-table thead    { background: #1e293b; }

html.dark .data-table tbody tr:hover { background: rgba(255,255,255,.03); }

html.dark .data-table tbody tr { border-color: #1e293b; }

html.dark .form-input          { background: #1e293b; border-color: #334155; color: #e2e8f0; }

html.dark input,

html.dark select,

html.dark textarea             { background: #1e293b !important; border-color: #334155 !important; color: #e2e8f0 !important; }

html.dark .bg-brand-50         { background: rgba(76,110,245,.12) !important; }

html.dark .bg-amber-50         { background: rgba(251,191,36,.08) !important; }

html.dark .bg-green-50         { background: rgba(34,197,94,.08) !important; }

html.dark .bg-red-50           { background: rgba(239,68,68,.08) !important; }

html.dark .bg-purple-50        { background: rgba(139,92,246,.1) !important; }

html.dark .shadow-sm, html.dark .shadow-md { box-shadow: 0 1px 3px rgba(0,0,0,.4); }

/* Dark mode toggle button */

.dm-toggle {

    width: 36px;

    height: 20px;

    background: #334155;

    border-radius: 10px;

    position: relative;

    cursor: pointer;

    transition: background .3s;

    border: none;

    outline: none;

    flex-shrink: 0;

}

.dm-toggle::after {

    content: '';

    position: absolute;

    top: 3px;

    left: 3px;

    width: 14px;

    height: 14px;

    background: #fff;

    border-radius: 50%;

    transition: transform .3s;

}

html.dark .dm-toggle            { background: #4c6ef5; }

html.dark .dm-toggle::after     { transform: translateX(16px); }

/* ─── Progress bars ───────────────────────────────────────────────── */

.loan-progress-bar {

    height: 6px;

    border-radius: 3px;

    background: #e9ecef;

    overflow: hidden;

}

.loan-progress-fill {

    height: 100%;

    border-radius: 3px;

    background: linear-gradient(90deg, #4c6ef5, #7c3aed);

    transition: width 1s ease;

}

/* ── Hide scrollbar utility ─────────────────────────────── */
.no-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* ── Print / PDF export (G) ─────────────────────────────── */
@media print {
    /* Hide navigation and UI chrome */
    nav, aside, .sidebar, header, footer,
    .no-print, #dmToggle, .notification-bell,
    .fixed, .sticky, .anim-pulse, .bottom-tabs,
    button:not(.print-show), a.btn-primary, a.btn-secondary,
    form, .flash-msg, [data-noprint] { display: none !important; }

    /* Page layout */
    html, body { background: #fff !important; color: #111 !important; font-size: 11pt; }
    main { padding: 0 !important; margin: 0 !important; }
    .dashboard-content { max-width: 100% !important; width: 100% !important; padding: 0 !important; }
    * { box-shadow: none !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

    /* Links */
    a { color: #111 !important; text-decoration: none !important; }

    /* Card/gradient cleanup */
    .bg-gradient-to-br, .bg-gradient-to-r, .hero-bg { background: #f8fafc !important; color: #111 !important; }
    .text-white { color: #111 !important; }

    /* Contract header */
    .print-header { display: block !important; text-align: center; padding-bottom: 16px; border-bottom: 2px solid #111; margin-bottom: 24px; }
    .print-header h1 { font-size: 20pt; font-weight: 800; }
    .print-header p  { font-size: 10pt; color: #555; }

    /* Loan detail contract layout */
    .loan-detail-grid { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px; }
    .loan-contract-table { width: 100%; border-collapse: collapse; margin-top: 16px; }
    .loan-contract-table th, .loan-contract-table td { border: 1px solid #ddd; padding: 6px 10px; font-size: 10pt; }
    .loan-contract-table th { background: #f1f5f9; font-weight: 700; }

    /* Signature line */
    .print-signature { margin-top: 48px; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
    .print-signature div { border-top: 1px solid #111; padding-top: 6px; font-size: 9pt; color: #555; }

    /* Page breaks */
    .page-break-before { page-break-before: always; }
    h1, h2, h3 { page-break-after: avoid; }
    img { max-width: 100% !important; page-break-inside: avoid; }
    .rounded-2xl, .rounded-xl { border-radius: 4px !important; }
}

/* ─── Premium Dashboard ───────────────────────────────────── */
.stat-card-v2 {
    background: #fff;
    border: 1px solid #f1f3f5;
    border-radius: 20px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: all .35s cubic-bezier(.4,0,.2,1);
}
.stat-card-v2::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: 20px 20px 0 0;
    opacity: 0;
    transition: opacity .35s;
}
.stat-card-v2:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px -8px rgba(0,0,0,.08);
    border-color: transparent;
}
.stat-card-v2:hover::before { opacity: 1; }
.stat-card-v2.accent-brand::before  { background: linear-gradient(90deg, #4c6ef5, #748ffc); }
.stat-card-v2.accent-green::before  { background: linear-gradient(90deg, #40c057, #69db7c); }
.stat-card-v2.accent-amber::before  { background: linear-gradient(90deg, #fab005, #ffd43b); }
.stat-card-v2.accent-purple::before { background: linear-gradient(90deg, #7c3aed, #a78bfa); }

.stat-icon-v2 {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    position: relative;
}
.stat-icon-v2::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 16px;
    opacity: 0;
    transition: opacity .35s;
}
.stat-card-v2:hover .stat-icon-v2::after { opacity: .15; }

.stat-value-v2 {
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
}

@keyframes countFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.stat-value-v2 {
    animation: countFadeIn .6s ease-out forwards;
}

/* Quick nav v2 */
.quick-tile {
    background: #fff;
    border: 1px solid #f1f3f5;
    border-radius: 16px;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: all .3s cubic-bezier(.4,0,.2,1);
    position: relative;
    overflow: hidden;
    text-decoration: none;
}
.quick-tile::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, var(--tile-glow, rgba(76,110,245,.06)), transparent 70%);
    opacity: 0;
    transition: opacity .3s;
}
.quick-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px -6px var(--tile-shadow, rgba(76,110,245,.15));
    border-color: var(--tile-border, #bac8ff);
}
.quick-tile:hover::before { opacity: 1; }
.quick-tile-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    position: relative;
    transition: transform .3s;
}
.quick-tile:hover .quick-tile-icon { transform: scale(1.08); }

/* Recent loans v2 */
.loan-row-v2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    transition: all .2s;
    text-decoration: none;
    gap: 12px;
}
.loan-row-v2:hover {
    background: #f8f9ff;
}
.loan-row-v2 .loan-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}
.loan-status-chip {
    padding: 3px 10px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* Promo card v2 */
.promo-card-v2 {
    border-radius: 20px;
    padding: 24px;
    position: relative;
    overflow: hidden;
}
.promo-card-v2 .promo-pattern {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,.06) 1px, transparent 1px);
    background-size: 20px 20px;
}
.promo-card-v2 .promo-glow {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    filter: blur(60px);
    opacity: .3;
}

/* ─── Premium Chat Styles ─────────────────────────────────── */
.chat-bubble-v2-mine {
    background: linear-gradient(135deg, #4c6ef5, #5c7cfa);
    color: #fff;
    border-radius: 20px 20px 6px 20px;
    box-shadow: 0 4px 15px -3px rgba(76,110,245,.3);
    position: relative;
}
.chat-bubble-v2-other {
    background: #fff;
    border: 1px solid #e9ecef;
    color: #1f2937;
    border-radius: 20px 20px 20px 6px;
    box-shadow: 0 2px 8px -2px rgba(0,0,0,.06);
    position: relative;
}
.chat-bubble-v2-mine .chat-time { color: rgba(255,255,255,.5); }
.chat-bubble-v2-other .chat-time { color: #9ca3af; }

.chat-input-v2 {
    border: 1.5px solid #e9ecef;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    transition: all .25s;
    background: #fafbfc;
}
.chat-input-v2:focus {
    outline: none;
    border-color: #4c6ef5;
    box-shadow: 0 0 0 3px rgba(76,110,245,.08);
    background: #fff;
}
.chat-send-btn-v2 {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4c6ef5, #7c3aed);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all .25s;
    box-shadow: 0 3px 10px -2px rgba(76,110,245,.3);
    flex-shrink: 0;
}
.chat-send-btn-v2:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px -3px rgba(76,110,245,.45);
}
.chat-send-btn-v2:active {
    transform: scale(.95);
}

.chat-tab-v2 {
    padding: 6px 16px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    border: 1.5px solid #e9ecef;
    background: #fff;
    color: #6b7280;
    transition: all .25s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
    text-decoration: none;
}
.chat-tab-v2:hover {
    border-color: #bac8ff;
    color: #4c6ef5;
    background: #f0f4ff;
}
.chat-tab-v2.active {
    background: linear-gradient(135deg, #4c6ef5, #5c7cfa);
    color: #fff;
    border-color: #4c6ef5;
    box-shadow: 0 4px 12px -2px rgba(76,110,245,.35);
}

/* Chat header glass */
.chat-header-v2 {
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Message animation */
@keyframes msgSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.msg-enter {
    animation: msgSlideIn .3s ease-out forwards;
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE-FIRST RESPONSIVE SYSTEM
   Uses dvh where available, falls back to vh.
   Three tiers: Portrait (<640), Landscape (orientation+max-h), Desktop (1024+)
   ═══════════════════════════════════════════════════════════════ */

/* ─── Safe area ──────────────────────────────────────────── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .mobile-bottom-nav { padding-bottom: env(safe-area-inset-bottom); }
}

/* ─── Mobile portrait base (< 1024px) ───────────────────── */
@media (max-width: 1023px) {
    .dashboard-content { padding-bottom: 5rem; }
    /* Bottom nav: floating pill */
    .mobile-bottom-nav { background: transparent; border: none; }
}

/* ─── Landscape mode (phone flipped sideways) ────────────── */
@media (orientation: landscape) and (max-height: 500px) {
    /* == Header: slim 40px == */
    .landscape-h-compact { height: 40px !important; }
    .landscape-header .w-9 { width: 24px; height: 24px; }
    .landscape-header .text-lg { font-size: 13px; }
    .landscape-header .gap-3 { gap: 6px; }

    /* == Tablet strip nav == */
    .hidden.sm\:flex.lg\:hidden { top: 40px; padding-top: 3px; padding-bottom: 3px; }
    .hidden.sm\:flex.lg\:hidden a { padding: 3px 8px; font-size: 10px; }

    /* == Bottom nav: compact floating pill in landscape == */
    .mobile-bottom-nav { border-top-width: 0; }
    .mobile-bottom-nav > div { margin: 0 4px 2px; padding: 2px 2px; border-radius: 12px; }
    .mobile-bottom-nav a { padding-top: 2px; padding-bottom: 2px; gap: 1px; border-radius: 8px; }
    .mobile-bottom-nav a i { font-size: 13px; }
    .mobile-bottom-nav a span { font-size: 7px; }

    /* == Dashboard content == */
    .dashboard-content {
        padding: 6px 10px 2.5rem 10px !important;
    }

    /* == Desktop aside: hide on landscape phones == */
    aside.w-64 { display: none !important; }

    /* == Stat cards: compact inline == */
    .stat-card-v2 { padding: 8px 10px; border-radius: 12px; }
    .stat-icon-v2 { width: 28px; height: 28px; border-radius: 8px; font-size: 11px; }
    .stat-value-v2 { font-size: 15px; }
    .stat-card-v2 .text-\[11px\] { font-size: 9px; margin-top: 2px; }

    /* == Quick tiles: compact == */
    .quick-tile { padding: 6px 4px; gap: 3px; border-radius: 10px; }
    .quick-tile-icon { width: 28px; height: 28px; border-radius: 8px; font-size: 11px; }
    .quick-tile > span { font-size: 8px; }

    /* == Banners == */
    .banner-carousel, .banner-slide, .banner-slide-single { min-height: 56px; height: auto; }
    .banner-slide-single { padding: 8px 12px !important; }

    /* == Headings / Welcome == */
    .dashboard-content h1 { font-size: 15px; }
    .dashboard-content .w-12.h-12 { width: 36px; height: 36px; font-size: 14px; }
    .dashboard-content .text-xl { font-size: 15px; }

    /* == Promo / Sidebar cards == */
    .promo-card-v2 { padding: 12px; border-radius: 14px; }
    .loan-row-v2 { padding: 6px 10px; }
    .loan-row-v2 .loan-icon { width: 32px; height: 32px; }

    /* == Force single-column on narrow landscape == */
    .grid.grid-cols-1.lg\:grid-cols-3 { grid-template-columns: 1fr; }
    .lg\:col-span-2 { grid-column: span 1; }

    /* == Chat widget == */
    #chatWidget { bottom: 36px !important; }
    #chatToggle { width: 38px; height: 38px; }
    #chatPanel {
        height: calc(100vh - 44px);
        height: calc(100dvh - 44px);
        max-height: none;
        border-radius: 12px;
    }
    #chatPanel .px-4.py-3.bg-brand-600 { padding: 4px 10px; }

    /* == Chat page full height == */
    .chat-page-wrap { height: calc(100vh - 40px - 28px); height: calc(100dvh - 40px - 28px); }
    .chat-header-v2 { padding-top: 4px; padding-bottom: 4px; }
    .chat-header-v2 .w-9 { width: 28px; height: 28px; }
    .chat-input-v2 { padding: 5px 10px; font-size: 13px; }
    .chat-send-btn-v2 { width: 30px; height: 30px; min-width: 30px; }
    .chat-bubble-mine, .chat-bubble-other { padding: 6px 10px; }

    /* == Scrollable content: no min-h-screen == */
    body.min-h-screen { min-height: auto; }
}

/* ─── Landscape >= 640px (tablet-landscape or wide phone) ── */
@media (orientation: landscape) and (max-height: 500px) and (min-width: 640px) {
    .hidden.sm\:flex.lg\:hidden { display: flex !important; }
    .dashboard-content { padding-left: 12px; padding-right: 12px; }
}

/* ─── Tablet landscape (768px+ but short) ────────────────── */
@media (min-width: 768px) and (max-height: 600px) {
    .stat-card-v2 { padding: 12px 14px; }
    .banner-carousel, .banner-slide { min-height: 64px; height: auto; }
}

/* ── Calculator range sliders (E) ───────────────────────── */
.calc-slider {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,.1);
    outline: none;
    cursor: pointer;
    transition: background .3s;
}
.calc-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4c6ef5, #748ffc);
    border: 2px solid rgba(255,255,255,.25);
    box-shadow: 0 2px 10px rgba(76,110,245,.5);
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
}
.calc-slider::-webkit-slider-thumb:hover { transform: scale(1.15); box-shadow: 0 4px 16px rgba(76,110,245,.7); }
.calc-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4c6ef5, #748ffc);
    border: 2px solid rgba(255,255,255,.25);
    box-shadow: 0 2px 10px rgba(76,110,245,.5);
    cursor: pointer;
}
.calc-slider.calc-slider-purple::-webkit-slider-thumb {
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    box-shadow: 0 2px 10px rgba(124,58,237,.5);
}
.calc-slider.calc-slider-purple::-webkit-slider-thumb:hover { box-shadow: 0 4px 16px rgba(124,58,237,.7); }
.calc-slider.calc-slider-purple::-moz-range-thumb { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.calc-slider.calc-slider-green::-webkit-slider-thumb {
    background: linear-gradient(135deg, #059669, #34d399);
    box-shadow: 0 2px 10px rgba(5,150,105,.5);
}
.calc-slider.calc-slider-green::-webkit-slider-thumb:hover { box-shadow: 0 4px 16px rgba(5,150,105,.7); }
.calc-slider.calc-slider-green::-moz-range-thumb { background: linear-gradient(135deg, #059669, #34d399); }

/* ─── Chat page specific heights ──── */
.chat-page-main {
    height: calc(100vh - 64px);
    height: calc(100dvh - 64px);
}
@media (max-width: 1023px) {
    .chat-page-main {
        height: calc(100vh - 64px - 64px);
        height: calc(100dvh - 64px - 64px);
    }
}
@media (orientation: landscape) and (max-height: 500px) {
    .chat-page-main {
        height: calc(100vh - 40px - 32px) !important;
        height: calc(100dvh - 40px - 32px) !important;
    }
}

