:root {
    --bg-color: #f5f6f8;
    --surface: #ffffff;
    --text-main: #1a1a1a;
    --text-sub: #757575;
    --green-primary: #118C3A;
    --green-light: #e6f4ea;
    --blue-primary: #1877F2;
    --dark-bg: #000000;
    --danger: #d93025;
    --border: #e0e0e0;
    --purple: #5c3b8e;
    --orange: #f57c00;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; }

body { background-color: var(--bg-color); color: var(--text-main); -webkit-font-smoothing: antialiased; }
.bg-gray { background-color: #eef0f3; }

#app { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg-color); position: relative; overflow-x: hidden; }
.full-center { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 20px; }

.view { display: none; min-height: 100vh; background: var(--bg-color); animation: fadeIn 0.2s ease-in; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Helpers */
.text-center { text-align: center; }
.text-left { text-align: left; }
.mb-30 { margin-bottom: 30px; }
.mb-20 { margin-bottom: 20px; }
.mb-10 { margin-bottom: 10px; }
.mt-20 { margin-top: 20px; }
.mt-10 { margin-top: 10px; }
.mt-5 { margin-top: 5px; }
.pt-20 { padding-top: 20px; }
.pb-30 { padding-bottom: 30px; }
.block { display: block; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.text-sub { color: var(--text-sub); font-size: 13px; }
.text-main { color: var(--text-main); }
.text-green { color: var(--green-primary); }
.text-danger { color: var(--danger); }
.text-success { color: var(--green-primary); }
.border-top { border-top: 1px solid var(--border); }

/* Buttons */
button { cursor: pointer; font-weight: 500; font-size: 15px; border-radius: 8px; border: none; transition: opacity 0.2s; padding: 14px; }
button:active { opacity: 0.8; }
.btn-dark { background: var(--dark-bg); color: white; flex: 1; }
.btn-green { background: var(--green-primary); color: white; flex: 1; }
.btn-blue { background: var(--blue-primary); color: white; border-radius: 8px; font-weight: 600; }
.btn-text { background: transparent; color: var(--blue-primary); }
.btn-text-grey { background: transparent; color: var(--text-sub); }
.btn-outline { background: transparent; border: 1.5px solid #dcdcdc; color: var(--text-main); flex: 1; font-weight: 600; }
.full-width { width: 100%; }
.flex-2 { flex: 2; }
.action-row { display: flex; gap: 12px; align-items: center; }

/* Login Page Specifics */
.login-card { background: var(--surface); padding: 30px 20px; border-radius: 16px; width: 100%; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.icon-brand { font-size: 56px; }
.otp-container { display: flex; gap: 12px; justify-content: center; }
.otp-input { width: 50px; height: 50px; border: 1.5px solid var(--border); border-radius: 8px; text-align: center; font-size: 24px; font-weight: 600; color: var(--text-main); outline: none; transition: border-color 0.2s; }
.otp-input:focus { border-color: var(--blue-primary); }

/* Headers & App Shell */
.app-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background: var(--surface); position: sticky; top: 0; z-index: 10; border-bottom: 1px solid #f0f0f0; }
.app-header h1 { font-size: 18px; font-weight: 600; flex: 1; text-align: left; margin-left: 16px; }
.back-btn, .header-action { cursor: pointer; color: var(--text-main); font-size: 24px; }

.content-padding { padding: 16px; }

/* Banners & Cards */
.conductor-banner { background: linear-gradient(135deg, #e6f4ea 0%, #ffffff 100%); border-radius: 12px; padding: 20px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); border: 1px solid #d4edda; }
.banner-text h2 { font-size: 16px; font-weight: 600; line-height: 1.4; margin-bottom: 4px; }
.highlight-green { color: var(--green-primary); font-weight: 700; }
.banner-icon { font-size: 48px; color: var(--green-primary); opacity: 0.8; }

.wallet-card { background: var(--surface); border-radius: 12px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.wallet-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.wallet-header h2 { font-size: 16px; font-weight: 500; }
.subtitle { font-size: 13px; color: var(--text-sub); margin-top: 2px; }
.balance { font-size: 28px; font-weight: 600; }
.wallet-actions { display: flex; gap: 12px; }
.wallet-actions button { padding: 12px 14px; } 

.mini-wallet { display: flex; justify-content: space-between; align-items: center; background: var(--surface); padding: 16px 20px; border-radius: 12px; margin-bottom: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.balance-large { font-size: 24px; font-weight: 600; margin-top: 4px; color: var(--green-primary); }
.mini-wallet .btn-green { flex: none; padding: 10px 24px; }

/* Tabs */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab { flex: 1; text-align: center; padding: 12px 0; font-weight: 500; font-size: 15px; color: var(--text-sub); cursor: pointer; position: relative; }
.tab.active { color: var(--purple); font-weight: 600; }
.tab.active::after { content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--purple); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Lists & Headers */
.date-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; padding: 0 4px; }
.date-header { font-size: 13px; font-weight: 500; color: var(--text-sub); font-style: italic; }
.daily-total { font-size: 14px; background: var(--green-light); padding: 4px 10px; border-radius: 20px;}
.list-container { display: flex; flex-direction: column; gap: 12px; }

/* Ticket Cards (Horizontal Route) */
.txn-card { background: var(--surface); border-radius: 12px; padding: 16px; box-shadow: 0 1px 4px rgba(0,0,0,0.03); border: 1px solid #f0f0f0; }
.txn-header { display: flex; justify-content: space-between; margin-bottom: 12px; }
.txn-time { font-size: 12px; color: var(--text-sub); }
.txn-amt { font-size: 14px; font-weight: 600; }

.route-horizontal { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 15px; color: var(--text-main); }
.route-arrow { color: #ccc; font-size: 20px; }
.empty-loc { color: var(--text-sub); font-weight: 400;}

.txn-meta { display: flex; justify-content: space-between; padding-top: 12px; border-top: 1px dashed var(--border); font-size: 12px; color: var(--text-sub); }
.badge { background: #f0f0f0; padding: 4px 8px; border-radius: 4px; color: var(--text-main); font-weight: 500;}

/* Withdrawal Cards Revamp */
.w-card { background: var(--surface); border-radius: 12px; padding: 16px; border: 1px solid #f0f0f0; position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 10px;}
.w-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--orange); }
.w-card.success::before { background: var(--green-primary); }

.w-header { display: flex; justify-content: space-between; align-items: center; }
.w-title { font-size: 14px; font-weight: 600; }
.w-amount { font-size: 16px; font-weight: 700; color: var(--text-main); }
.w-bank { font-size: 13px; color: var(--text-sub); display: flex; align-items: center; gap: 4px; }
.w-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 10px; border-top: 1px solid #f5f5f5; }
.w-date { font-size: 11px; color: var(--text-sub); }
.w-status { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 12px; }
.status-pending { background: #fff3e0; color: var(--orange); }
.status-success { background: var(--green-light); color: var(--green-primary); }

/* Modals */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 20; }
.modal-overlay.active { display: block; }
.bottom-sheet { position: fixed; bottom: -100%; left: 0; right: 0; background: var(--surface); border-radius: 20px 20px 0 0; z-index: 30; transition: bottom 0.3s cubic-bezier(0.1, 0.8, 0.2, 1); max-width: 480px; margin: 0 auto; max-height: 90vh; overflow-y: auto; }
.bottom-sheet.active { bottom: 0; }
.full-height { height: 90vh; }
.sheet-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 20px 10px; }
.sheet-header h3 { font-size: 18px; font-weight: 600; margin: 0;}
.sheet-body { padding: 0 20px 20px; }
.close-modal { cursor: pointer; color: var(--text-sub); font-size: 26px; }

/* Input Styling & Uppercase Support */
.uppercase-form input { text-transform: uppercase; }
.uppercase-form input::placeholder { text-transform: none; }

.input-group { margin: 20px 0; text-align: left; }
.input-group label { display: block; font-size: 13px; margin-bottom: 8px; color: var(--text-main); font-weight: 500;}
.input-wrapper { display: flex; border: 1.5px solid var(--border); border-radius: 8px; overflow: hidden; transition: border-color 0.2s; }
.input-wrapper:focus-within { border-color: var(--blue-primary); }
.input-wrapper.error { border-color: var(--danger); }
.currency-symbol { padding: 14px; color: var(--text-sub); font-weight: 600; background: #fafafa; display: flex; align-items: center; border-right: 1px solid var(--border); }
.input-wrapper input { flex: 1; border: none; padding: 14px 14px 14px 12px; font-size: 16px; outline: none; font-weight: 500; color: var(--text-main); }
.error-text { display: block; color: var(--danger); font-size: 12px; margin-top: 4px; min-height: 18px; text-align: left; }

.form-clean .form-group { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 16px; padding: 4px 12px; background: #fafafa; }
.form-icon { color: var(--text-sub); margin-right: 12px; font-size: 20px; }
.form-group input, .form-group select { flex: 1; border: none; padding: 14px 0; font-size: 14px; outline: none; background: transparent; font-weight: 500; }

.icon-large { font-size: 60vw; margin-bottom: 12px; }
.text-blue { color: var(--blue-primary); }
.bank-info-box { background: #f0f7ff; border: 1px solid #d0e3ff; border-radius: 8px; padding: 16px; margin-top: 20px; text-align: left; }
.bank-info-box p { margin-bottom: 6px; font-size: 14px; }

/* Filter UI */
.filter-body { padding-top: 10px; }
.filter-header-ui { display: flex; justify-content: space-between; align-items: center; background: #f5f6f8; padding: 12px 16px; border-radius: 8px; border: 1px solid var(--border); }
.selected-date-display { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--text-main); }

.calendar-wrapper { margin-top: 24px; }
.cal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.cal-header h4 { color: var(--purple); font-weight: 500; font-size: 15px; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; text-align: center; font-size: 14px; }
.cal-day-name { font-size: 11px; font-weight: 600; color: var(--text-sub); margin-bottom: 8px; }
.cal-date { padding: 10px 0; color: var(--text-main); font-weight: 500; cursor: pointer; border-radius: 8px; transition: 0.2s; }
.cal-date:hover { background: #f0f0f0; }
.cal-date.active { background: var(--green-primary); color: white; box-shadow: 0 4px 8px rgba(17, 140, 58, 0.3); }
.cal-date.fade { color: #d0d0d0; cursor: default; pointer-events: none; }


/* =========================================
   PREMIUM LOGIN PAGE STYLES
   ========================================= */
.login-layout { min-height: 100vh; display: flex; flex-direction: column; background: linear-gradient(135deg, var(--green-primary) 0%, #0a5221 100%); position: relative; overflow: hidden; }
.login-layout::before { content: ''; position: absolute; top: -10%; right: -20%; width: 300px; height: 300px; background: rgba(255, 255, 255, 0.05); border-radius: 50%; z-index: 0; }
.login-hero { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; color: white; padding: 40px 20px; text-align: center; z-index: 1; }
.login-hero h1 { font-size: 32px; font-weight: 700; margin-bottom: 4px; letter-spacing: 0.5px; }
.login-hero p { font-size: 15px; opacity: 0.9; font-weight: 500; }
.login-form-container { background: var(--surface); border-radius: 32px 32px 0 0; padding: 40px 24px 60px; box-shadow: 0 -10px 40px rgba(0,0,0,0.15); min-height: 55vh; z-index: 1; display: flex; flex-direction: column; }

/* Smooth transitions for steps */
.auth-step { opacity: 0; transform: translateY(10px); transition: all 0.4s ease; display: none; }
.auth-step.active { opacity: 1; transform: translateY(0); display: block; animation: slideUpFade 0.4s ease forwards; }
@keyframes slideUpFade { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

/* Refined OTP Inputs for Login */
.otp-container { display: flex; gap: 16px; justify-content: space-between; margin-top: 10px; }
.otp-input { flex: 1; height: 56px; border: 1.5px solid var(--border); border-radius: 12px; text-align: center; font-size: 24px; font-weight: 600; color: var(--text-main); outline: none; transition: all 0.2s; background: #fafafa; }
.otp-input:focus { border-color: var(--green-primary); background: var(--surface); box-shadow: 0 0 0 4px var(--green-light); }

.opacity-90 { opacity: 0.9; }
@keyframes spin { 100% { transform: rotate(360deg); } }

/* =========================================
   CUSTOM ALERTS MODALS & BUTTONS
   ========================================= */
.alert-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.6); z-index: 9999; justify-content: center; align-items: center; padding: 20px; }
.alert-overlay.active { display: flex; animation: fadeIn 0.2s; }
.alert-box { background: var(--surface); border-radius: 16px; padding: 24px; text-align: center; width: 100%; max-width: 320px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); transform: scale(0.95); animation: popIn 0.2s forwards; }
@keyframes popIn { to { transform: scale(1); } }
.alert-icon { font-size: 48px; margin-bottom: 12px; }
.alert-box h3 { font-size: 18px; margin-bottom: 8px; color: var(--text-main); font-weight: 600;}
.alert-box p { font-size: 14px; color: var(--text-sub); margin-bottom: 20px; }

/* Fixed small, text-based cancel button */
.btn-cancel-small { 
    background: #f5f5f5; 
    color: var(--text-main); 
    font-weight: 500; 
    padding: 14px 16px; 
    border-radius: 8px; 
    border: none; 
    font-size: 14px; 
}
.btn-danger { background: var(--danger); color: white; border-radius: 8px; }
#pull-refresh {
    position: fixed;
    top: -70px;
    left: 0;
    right: 0;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: top 0.25s ease;
    z-index: 9999;
    pointer-events: none;
}

.refresh-circle {
    width: 40px;
    height: 40px;
    display: none;
}

.refresh-circle svg {
    width: 100%;
    height: 100%;
    animation: rotate 3s linear infinite;
}

.refresh-circle circle {
    fill: none;
    stroke: #1976D2;
    stroke-width: 5;
    stroke-linecap: round;
    stroke-dasharray: 100;
    stroke-dashoffset: 60;
    animation: dash 1.3s ease-in-out infinite;
}

@keyframes rotate {
    100% { transform: rotate(360deg); }
}

@keyframes dash {
    0% { stroke-dashoffset: 100; }
    50% { stroke-dashoffset: 20; }
    100% { stroke-dashoffset: 100; }
}

html, body {
    overscroll-behavior-y: contain;
}