/* ── Reset & Base ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-tap-highlight-color: transparent; }
body {
    font-family: 'Outfit', 'Segoe UI', sans-serif;
    background: #F1F3F4;
    color: #1a1a2e;
    min-height: 100vh;
    overscroll-behavior: none;
}
a { text-decoration: none; color: inherit; }

/* ── App Bar (Top) ─────────────────────────────────── */
.app-bar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    background: linear-gradient(135deg, #1565C0 0%, #0d47a1 100%);
    height: 58px;
    box-shadow: 0 2px 8px rgba(21,101,192,0.4);
}
.app-bar-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 100%; padding: 0 16px;
}
.app-bar-left { display: flex; flex-direction: column; gap: 1px; }
.app-bar-title { color: #fff; font-size: 15px; font-weight: 700; line-height: 1.2; }
.app-bar-branch { color: rgba(255,255,255,0.75); font-size: 11px; }
.app-bar-right { display: flex; align-items: center; gap: 10px; }
.online-chip { font-size: 11px; background: rgba(255,255,255,0.15); color: #fff; padding: 3px 8px; border-radius: 12px; }
.agent-initials {
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(255,255,255,0.2); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
}
.logout-btn {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(255,255,255,0.12); color: #fff;
    transition: background 0.2s;
}
.logout-btn:hover { background: rgba(255,80,80,0.35); }

/* ── Main Content ──────────────────────────────────── */
.app-content {
    margin-top: 58px;
    padding-bottom: 72px;
    min-height: calc(100vh - 58px);
}
.page-content { padding: 16px 14px; max-width: 540px; margin: 0 auto; }

/* ── Bottom Navigation ─────────────────────────────── */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;
    background: #fff;
    display: flex;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
    height: 60px;
}
.nav-item {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 3px; color: #9e9e9e;
    font-size: 11px; font-weight: 500;
    padding: 6px 0;
    transition: color .2s;
    cursor: pointer;
}
.nav-item svg { width: 22px; height: 22px; fill: currentColor; }
.nav-item.active { color: #1565C0; }
.nav-item.active svg { fill: #1565C0; }

/* ── Cards ─────────────────────────────────────────── */
.card {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.08);
}
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.card-title { font-size: 14px; font-weight: 600; color: #333; }

/* ── Stats Row ─────────────────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 10px; margin-bottom: 12px; }
.stat-card {
    border-radius: 16px; padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.stat-blue { background: linear-gradient(135deg,#1565C0,#1976D2); color: #fff; }
.stat-green { background: linear-gradient(135deg,#2E7D32,#388E3C); color: #fff; }
.stat-orange { background: linear-gradient(135deg,#EF6C00,#F57C00); color: #fff; }
.stat-label { font-size: 11px; font-weight: 500; opacity: 0.85; margin-bottom: 6px; }
.stat-value { font-size: 20px; font-weight: 700; }

/* ── Progress Bar ──────────────────────────────────── */
.progress-bar-wrap {
    background: #e8f4fd; border-radius: 8px; height: 10px;
    overflow: hidden; margin: 8px 0;
}
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg,#1565C0,#00897B);
    border-radius: 8px;
    transition: width .5s ease;
}
.progress-label { display: flex; justify-content: space-between; font-size: 12px; color: #666; }
.text-orange { color: #E65100; }
.text-green { color: #2E7D32; }
.text-red { color: #C62828; }

/* ── Greeting ──────────────────────────────────────── */
.greeting-section {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 14px;
}
.greeting-name { font-size: 20px; font-weight: 700; color: #1a1a2e; }
.greeting-date { font-size: 12px; color: #888; margin-top: 2px; }

/* ── Section Title ─────────────────────────────────── */
.section-title {
    font-size: 13px; font-weight: 700; color: #666;
    text-transform: uppercase; letter-spacing: 0.6px;
    margin: 16px 0 8px;
}

/* ── Quick Action Buttons ──────────────────────────── */
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 4px; }
.action-btn {
    border-radius: 16px; padding: 16px 12px;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 600; color: #fff;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
    transition: transform .1s, box-shadow .1s;
    cursor: pointer;
}
.action-btn:active { transform: scale(0.96); box-shadow: 0 1px 4px rgba(0,0,0,0.15); }
.action-icon { font-size: 28px; }
.action-blue { background: linear-gradient(135deg,#1565C0,#1976D2); }
.action-teal { background: linear-gradient(135deg,#00695c,#00897B); }
.action-orange { background: linear-gradient(135deg,#BF360C,#E64A19); }
.action-green { background: linear-gradient(135deg,#1B5E20,#2E7D32); }

/* ── Report Links ──────────────────────────────────── */
.report-links { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 1px 6px rgba(0,0,0,0.08); margin-bottom: 12px; }
.report-link-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 16px; border-bottom: 1px solid #f5f5f5;
    font-size: 14px; font-weight: 500; cursor: pointer;
    transition: background .15s;
}
.report-link-item:last-child { border-bottom: none; }
.report-link-item:active { background: #f5f5f5; }
.chevron { color: #bbb; font-size: 20px; }

/* ── Activity List ─────────────────────────────────── */
.activity-list { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 1px 6px rgba(0,0,0,0.08); margin-bottom: 12px; }
.activity-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; border-bottom: 1px solid #f5f5f5;
    transition: background .15s; cursor: pointer;
}
.activity-item:last-child { border-bottom: none; }
.activity-item:active, .activity-item:hover { background: #fafafa; }
.activity-item.item-danger { background: #FFF3E0; }
.activity-avatar {
    width: 40px; height: 40px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; color: #fff;
    flex-shrink: 0;
}
.av-blue { background: #1565C0; }
.av-teal { background: #00897B; }
.av-orange { background: #E64A19; }
.av-green { background: #2E7D32; }
.av-red { background: #C62828; }
.activity-info { flex: 1; min-width: 0; }
.activity-name { font-size: 14px; font-weight: 600; color: #222; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-sub { font-size: 12px; color: #888; }
.activity-amount { font-size: 14px; font-weight: 700; color: #2E7D32; white-space: nowrap; }
.danger-tag { font-size: 11px; color: #C62828; font-weight: 600; margin-top: 2px; }

/* ── Pill Tabs ─────────────────────────────────────── */
.pill-tabs {
    display: flex; gap: 8px; overflow-x: auto;
    scrollbar-width: none; padding: 4px 0 12px;
}
.pill-tabs::-webkit-scrollbar { display: none; }
.pill {
    border: 2px solid #1565C0; border-radius: 20px;
    padding: 6px 16px; font-size: 13px; font-weight: 600;
    color: #1565C0; white-space: nowrap;
    transition: all .2s;
}
.pill.active { background: #1565C0; color: #fff; }

/* ── Search ────────────────────────────────────────── */
.search-bar-wrap { margin-bottom: 10px; }
.search-input {
    width: 100%; border: 2px solid #e0e0e0; border-radius: 14px;
    padding: 13px 16px; font-size: 14px; font-family: 'Outfit',sans-serif;
    outline: none; background: #fff;
    transition: border-color .2s;
}
.search-input:focus { border-color: #1565C0; }
.search-results {
    background: #fff; border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    margin-bottom: 10px; overflow: hidden;
}
.search-result-item {
    padding: 12px 16px; border-bottom: 1px solid #f5f5f5;
    cursor: pointer; font-size: 14px;
}
.search-result-item:active { background: #f0f4ff; }
.search-result-item strong { display: block; font-weight: 600; }
.search-result-item span { font-size: 12px; color: #888; }

/* ── Collection Form ───────────────────────────────── */
.member-selected-card { border-left: 4px solid #1565C0; }
.member-info-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.member-avatar {
    width: 44px; height: 44px; border-radius: 14px;
    background: #1565C0; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 700; flex-shrink: 0;
}
.member-name { font-size: 15px; font-weight: 700; }
.member-sub { font-size: 12px; color: #888; }
.account-info-row {
    display: flex; justify-content: space-between;
    font-size: 13px; color: #555;
    background: #f8f9ff; border-radius: 8px; padding: 8px 12px;
}
.input-label {
    display: block; font-size: 11px; font-weight: 700;
    color: #666; text-transform: uppercase;
    letter-spacing: 0.5px; margin-bottom: 6px;
}
.amount-input {
    width: 100%; border: 2px solid #e0e0e0; border-radius: 12px;
    padding: 14px 16px; font-size: 24px; font-weight: 700;
    font-family: 'Outfit', sans-serif; outline: none; text-align: center;
    color: #1565C0; transition: border-color .2s;
}
.amount-input:focus { border-color: #1565C0; }
.text-input {
    width: 100%; border: 2px solid #e0e0e0; border-radius: 12px;
    padding: 12px 14px; font-size: 14px; font-family: 'Outfit',sans-serif;
    outline: none; transition: border-color .2s;
}
.text-input:focus { border-color: #1565C0; }
.expected-hint { font-size: 12px; color: #888; text-align: center; margin-top: 6px; }

/* ── Buttons ───────────────────────────────────────── */
.btn-primary {
    background: linear-gradient(135deg,#1565C0,#0d47a1); color: #fff;
    border: none; border-radius: 14px; padding: 15px 24px;
    font-size: 15px; font-weight: 700; font-family: 'Outfit',sans-serif;
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    transition: transform .1s, box-shadow .1s;
    box-shadow: 0 4px 15px rgba(21,101,192,0.35);
}
.btn-primary:active { transform: scale(0.97); }
.btn-outline {
    background: #fff; color: #1565C0;
    border: 2px solid #1565C0; border-radius: 14px; padding: 13px 24px;
    font-size: 14px; font-weight: 600; font-family: 'Outfit',sans-serif;
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    transition: all .15s;
}
.btn-outline:active { background: #e8f0fe; }
.btn-ghost {
    background: transparent; color: #888;
    border: none; border-radius: 14px; padding: 13px 24px;
    font-size: 14px; font-family: 'Outfit',sans-serif;
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.btn-full { width: 100%; margin-top: 10px; }

/* ── Badges ────────────────────────────────────────── */
.badge {
    border-radius: 20px; padding: 3px 10px;
    font-size: 12px; font-weight: 600;
}
.badge-blue { background: #e8f0fe; color: #1565C0; }
.badge-green { background: #e8f5e9; color: #2E7D32; }
.badge-orange { background: #FFF3E0; color: #E65100; }

/* ── Product Tags ──────────────────────────────────── */
.product-tag {
    border-radius: 8px; padding: 3px 8px;
    font-size: 12px; font-weight: 700;
}
.tag-blue { background: #e3f2fd; color: #1565C0; }
.tag-teal { background: #e0f2f1; color: #00695c; }
.tag-orange { background: #FBE9E7; color: #BF360C; }
.tag-green { background: #e8f5e9; color: #1B5E20; }

/* ── Receipt ───────────────────────────────────────── */
.receipt-success { text-align: center; padding: 20px 0 10px; }
.success-icon { font-size: 56px; margin-bottom: 8px; }
.receipt-success h2 { font-size: 20px; font-weight: 700; color: #2E7D32; }
.receipt-card {
    background: #fff; border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    overflow: hidden; margin: 16px 0;
}
.receipt-header {
    background: #1565C0; color: #fff;
    text-align: center; padding: 12px;
    font-size: 14px; font-weight: 700; letter-spacing: 1px;
}
.receipt-row {
    display: flex; justify-content: space-between;
    padding: 10px 16px; font-size: 13px;
    border-bottom: 1px solid #f5f5f5;
}
.receipt-row:last-child { border-bottom: none; }
.receipt-amount { font-size: 16px; color: #1565C0; }
.receipt-divider { height: 1px; background: #1565C0; margin: 0 16px; }

/* ── Summary Table ─────────────────────────────────── */
.summary-table-card {
    background: #fff; border-radius: 16px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.08);
    overflow: hidden; margin-bottom: 12px;
}
.summary-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; border-bottom: 1px solid #f5f5f5;
    font-size: 13px;
}
.summary-total {
    display: flex; justify-content: space-between;
    padding: 14px 16px; background: #1a1a2e; color: #fff;
    font-size: 14px; font-weight: 700;
}

/* ── Report Header ─────────────────────────────────── */
.report-header-section { margin-bottom: 16px; }
.report-title { font-size: 20px; font-weight: 700; color: #1a1a2e; }
.report-sub { font-size: 13px; color: #888; margin-top: 2px; }
.date-picker {
    border: 2px solid #e0e0e0; border-radius: 10px;
    padding: 8px 12px; font-size: 14px;
    font-family: 'Outfit',sans-serif; outline: none;
    margin-top: 8px;
}

/* ── Scroll Report Table ───────────────────────────── */
.scroll-table { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 1px 6px rgba(0,0,0,0.08); }
.scroll-table-header {
    display: grid; grid-template-columns: 30px 1fr 80px 50px 60px 70px;
    gap: 4px; padding: 10px 12px;
    background: #1565C0; color: #fff;
    font-size: 11px; font-weight: 700;
}
.scroll-table-row {
    display: grid; grid-template-columns: 30px 1fr 80px 50px 60px 70px;
    gap: 4px; padding: 10px 12px;
    border-bottom: 1px solid #f5f5f5;
    font-size: 12px; align-items: center;
}
.row-collected { background: #f0fff4; }

/* ── Print Actions ─────────────────────────────────── */
.print-actions { display: flex; gap: 8px; margin-bottom: 14px; align-items: center; }

/* ── Radio Group ───────────────────────────────────── */
.radio-group { display: flex; gap: 16px; margin: 8px 0 14px; font-size: 14px; }
.radio-group label { display: flex; align-items: center; gap: 6px; cursor: pointer; }

/* ── Empty State ───────────────────────────────────── */
.empty-state {
    text-align: center; padding: 48px 24px;
    color: #888; font-size: 15px;
    display: flex; flex-direction: column; align-items: center; gap: 12px;
}

/* ── Toast ─────────────────────────────────────────── */
.toast {
    position: fixed; top: 68px; left: 50%; transform: translateX(-50%);
    padding: 10px 20px; border-radius: 20px;
    font-size: 13px; font-weight: 600; z-index: 9999;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    animation: slideDown .3s ease;
}
.toast-success { background: #2E7D32; color: #fff; }
.toast-error { background: #C62828; color: #fff; }
@keyframes slideDown { from { top: 48px; opacity:0; } to { top:68px; opacity:1; } }

/* ── Field Helper ──────────────────────────────────── */
.field { margin-bottom: 12px; }

/* ── Assigned Row ──────────────────────────────────── */
.assigned-row { cursor: pointer; }

/* ── Print Media ───────────────────────────────────── */
@media print {
    .app-bar, .bottom-nav, .btn-primary, .btn-outline, .btn-ghost, .nav-item, .print-actions { display: none !important; }
    .app-content { margin-top: 0 !important; padding-bottom: 0 !important; }
    body { background: #fff; }
    .receipt-card, .summary-table-card, .scroll-table { box-shadow: none; }
}
