/* ==============================================================================
   Application Portal Mobile-First Fintech Stylesheet
   Compact spacing, tactile touch targets, rounded cards, mobile app shell
   ============================================================================== */

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

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #eef2ff;
    --surface-bg: #f6f7fb;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-sub: #94a3b8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

* {
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    margin: 0;
    padding: 0;
    background-color: #edeef5; /* Neutral desktop canvas */
    color: var(--text-main);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* App Shell: Optimized for Mobile Device Viewport */
.mobile-shell {
    width: 100%;
    max-width: 440px;
    min-height: 100vh;
    background-color: var(--surface-bg);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 10px 40px -10px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(226, 232, 240, 0.8);
}

@media (min-width: 640px) {
    .mobile-shell {
        margin: 20px auto 40px;
        min-height: calc(100vh - 60px);
        border-radius: 28px;
        overflow: hidden;
    }
}

/* Admin Shell Fallback */
body.admin-mode {
    background-color: #f1f5f9;
}
body.admin-mode .admin-shell {
    max-width: 1400px;
    margin: 0 auto;
    box-shadow: none;
}

/* Compact Mobile Header */
.app-header {
    height: 60px;
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 30;
}

/* Fintech Cards */
.app-card {
    background: #ffffff;
    border: 1px solid #eef2f6;
    border-radius: 16px;
    box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.03);
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.app-card:active {
    transform: scale(0.995);
}

/* Brand Accent Card */
.fin-hero-card {
    background: linear-gradient(135deg, #3730a3 0%, #4f46e5 50%, #4338ca 100%);
    color: #ffffff;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 24px -4px rgba(79, 70, 229, 0.28);
}

/* Form Controls: Clean, Touch Friendly 48px */
.form-input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    font-size: 14px;
    font-weight: 500;
    color: #0f172a;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    transition: all 0.15s ease;
    outline: none;
}

.form-input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.form-input.error {
    border-color: #ef4444;
    background: #fef2f2;
}

/* Primary Mobile Button: 48px, Full Width, Strong Contrast */
.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    padding: 0 20px;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    background: #4f46e5;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
    transition: all 0.15s ease;
    text-decoration: none;
}

.btn-primary:hover {
    background: #4338ca;
}

.btn-primary:active {
    transform: scale(0.985);
    background: #3730a3;
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Amount Selection Tiles */
.amount-tile {
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    background: #ffffff;
    text-align: left;
    position: relative;
}

.amount-tile:hover {
    border-color: #cbd5e1;
}

.amount-tile.selected {
    border-color: #4f46e5;
    background: #f5f7ff;
    box-shadow: 0 0 0 1px #4f46e5;
}

.amount-tile .tile-check {
    display: none;
}

.amount-tile.selected .tile-check {
    display: flex;
}

/* Badges */
.badge-status {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.badge-new { background: #e0f2fe; color: #0369a1; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-verified, .badge-paid, .badge-approved { background: #dcfce7; color: #166534; }
.badge-review { background: #f3e8ff; color: #6b21a8; }
.badge-rejected, .badge-failed { background: #fee2e2; color: #991b1b; }

.pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 5px;
    animation: pulse 1.8s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .4; transform: scale(1.2); }
}

/* App Bottom Navigation Bar */
.app-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 440px;
    height: 58px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid #eef2f6;
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 40;
    padding: 0 10px;
}

@media (min-width: 640px) {
    .app-bottom-nav {
        border-bottom-left-radius: 28px;
        border-bottom-right-radius: 28px;
    }
}

.nav-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    padding: 4px 12px;
    border-radius: 12px;
    transition: all 0.15s ease;
}

.nav-tab.active {
    color: #4f46e5;
}

.nav-tab:hover {
    color: #4338ca;
}

/* Bottom Sheet Modal */
.bottom-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 60;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    transition: opacity 0.2s ease;
}

.bottom-sheet-content {
    width: 100%;
    max-width: 440px;
    background: #ffffff;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    padding: 20px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* Unified Mobile-Fintech Toast Notification System */
#toast-container {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: 92%;
    max-width: 390px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast-item {
    pointer-events: auto;
    background: #ffffff;
    color: #1e293b;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 14px;
    box-shadow: 0 10px 25px -4px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.03);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
    transition: opacity 200ms ease, transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-item.toast-enter {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast-item.toast-exit {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
}

.toast-icon-wrap {
    width: 28px;
    height: 28px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transform: scale(0.85);
    transition: transform 180ms ease;
}

.toast-item.toast-enter .toast-icon-wrap {
    transform: scale(1);
}

.toast-success .toast-icon-wrap {
    background-color: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.toast-error .toast-icon-wrap {
    background-color: #fff1f2;
    color: #e11d48;
    border: 1px solid #fecdd3;
}

.toast-warning .toast-icon-wrap {
    background-color: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}

.toast-info .toast-icon-wrap {
    background-color: #eef2ff;
    color: #4f46e5;
    border: 1px solid #c7d2fe;
}

@media (prefers-reduced-motion: reduce) {
    .toast-item {
        transform: none !important;
        transition: opacity 200ms ease !important;
    }
    .toast-icon-wrap {
        transform: none !important;
    }
}
