:root {
    --pigmy-primary: #1e40af;
    --pigmy-primary-hover: #1d4ed8;
    --pigmy-primary-light: #eff6ff;
    --pigmy-accent-success: #059669;
    --pigmy-accent-success-light: #ecfdf5;
    --pigmy-accent-danger: #dc2626;
    --pigmy-accent-danger-light: #fef2f2;
    --pigmy-accent-warning: #d97706;
    --pigmy-accent-warning-light: #fffbeb;
    --pigmy-bg-surface: #ffffff;
    --pigmy-bg-body: #f8fafc;
    --pigmy-border: #e2e8f0;
    --pigmy-border-subtle: #f1f5f9;
    --pigmy-text-primary: #0f172a;
    --pigmy-text-muted: #64748b;
    --pigmy-radius-sm: 8px;
    --pigmy-radius-md: 12px;
    --pigmy-radius-lg: 16px;
    --pigmy-radius-pill: 9999px;
    --pigmy-shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
    --pigmy-shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
    --pigmy-shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
    
    /* Mahadani Chits Official Brand Tokens */
    --mahadani-navy: #0e2554;
    --mahadani-navy-dark: #071530;
    --mahadani-gold: #c59b27;
    --mahadani-gold-hover: #b48a1d;
    --mahadani-gold-light: #fef9c3;
    --mahadani-steel: #2563eb;
}

html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    background-color: var(--pigmy-bg-body);
    color: var(--pigmy-text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    letter-spacing: -0.01em;
    -webkit-tap-highlight-color: transparent;
}

.tabular-nums {
    font-variant-numeric: tabular-nums;
}

.min-w-0 {
    min-width: 0 !important;
}

/* Custom Financial Card */
.pigmy-card {
    background-color: var(--pigmy-bg-surface);
    border: 1px solid var(--pigmy-border);
    border-radius: var(--pigmy-radius-md);
    box-shadow: var(--pigmy-shadow-sm);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.pigmy-card:hover {
    box-shadow: var(--pigmy-shadow-md);
}

/* Status Badges */
.badge-active, .badge-completed, .badge-verified, .badge-approved {
    background-color: var(--pigmy-accent-success-light);
    color: var(--pigmy-accent-success);
    border: 1px solid rgba(5, 150, 105, 0.2);
    font-weight: 600;
}

.badge-pending, .badge-discrepancy_flagged {
    background-color: var(--pigmy-accent-warning-light);
    color: var(--pigmy-accent-warning);
    border: 1px solid rgba(217, 119, 6, 0.2);
    font-weight: 600;
}

.badge-reversed, .badge-rejected, .badge-suspended, .badge-closed, .badge-cancelled {
    background-color: var(--pigmy-accent-danger-light);
    color: var(--pigmy-accent-danger);
    border: 1px solid rgba(220, 38, 38, 0.2);
    font-weight: 600;
}

/* Buttons */
.btn-pigmy-primary {
    background-color: var(--pigmy-primary);
    color: #ffffff;
    border: 1px solid var(--pigmy-primary);
    font-weight: 600;
    border-radius: var(--pigmy-radius-sm);
    padding: 0.6rem 1.15rem;
    min-height: 44px; /* Accessible minimum touch target */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease-in-out;
}

.btn-pigmy-primary:hover, .btn-pigmy-primary:focus {
    background-color: var(--pigmy-primary-hover);
    color: #ffffff;
    border-color: var(--pigmy-primary-hover);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.btn-pigmy-success {
    background-color: var(--pigmy-accent-success);
    color: #ffffff;
    border: 1px solid var(--pigmy-accent-success);
    font-weight: 600;
    border-radius: var(--pigmy-radius-sm);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-pigmy-success:hover {
    background-color: #047857;
    color: #ffffff;
}

/* Mahadani Brand Classes */
.text-navy {
    color: var(--mahadani-navy) !important;
}
.bg-navy {
    background-color: var(--mahadani-navy) !important;
}
.text-gold {
    color: var(--mahadani-gold) !important;
}
.bg-gold {
    background-color: var(--mahadani-gold) !important;
}
.border-gold {
    border-color: var(--mahadani-gold) !important;
}
.btn-mahadani {
    background-color: var(--mahadani-navy);
    color: #ffffff;
    border: 1px solid var(--mahadani-navy);
    font-weight: 600;
    transition: all 0.2s ease-in-out;
}
.btn-mahadani:hover {
    background-color: var(--mahadani-navy-dark);
    color: #ffffff;
    border-color: var(--mahadani-navy-dark);
}
.btn-mahadani-gold {
    background-color: var(--mahadani-gold);
    color: #071530;
    border: 1px solid var(--mahadani-gold);
    font-weight: 700;
    transition: all 0.2s ease-in-out;
}
.btn-mahadani-gold:hover {
    background-color: var(--mahadani-gold-hover);
    color: #071530;
    border-color: var(--mahadani-gold-hover);
}
.btn-outline-mahadani {
    background-color: transparent;
    color: var(--mahadani-navy);
    border: 1.5px solid var(--mahadani-navy);
    font-weight: 600;
    transition: all 0.2s ease-in-out;
}
.btn-outline-mahadani:hover {
    background-color: var(--mahadani-navy);
    color: #ffffff;
}

.btn-outline-primary {
    color: var(--pigmy-primary);
    border-color: var(--pigmy-primary);
}

.btn-outline-primary:hover, .btn-outline-primary:focus {
    background-color: var(--pigmy-primary);
    border-color: var(--pigmy-primary);
    color: #ffffff;
}

.btn-check:checked + .btn-outline-primary {
    background-color: var(--pigmy-primary) !important;
    border-color: var(--pigmy-primary) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(30, 64, 175, 0.25);
}

/* Agent Mobile Shell - 360px, 390px, 430px Optimized */
.agent-mobile-container {
    max-width: 440px;
    margin: 1.5rem auto;
    min-height: calc(100vh - 3rem);
    background-color: #ffffff;
    border-radius: 28px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(226, 232, 240, 0.6);
    position: relative;
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 12px)); /* Clean safe clearance above bottom nav & FAB */
    overflow-x: hidden;
}

.agent-bottom-spacer {
    height: calc(16px + env(safe-area-inset-bottom, 0px));
    width: 100%;
}

@media (max-width: 576px) {
    .agent-mobile-container {
        max-width: 100%;
        margin: 0;
        min-height: 100vh;
        border-radius: 0;
        border: none;
        box-shadow: none;
    }
}

.agent-top-header {
    position: sticky;
    top: 0;
    z-index: 1020;
    background-color: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--pigmy-border);
    padding: 0.75rem 1rem;
}

/* Agent Hero Balance Card */
.agent-hero-card {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #2563eb 100%);
    color: #ffffff;
    border-radius: 20px;
    padding: 1.25rem 1.25rem 1rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(30, 64, 175, 0.35);
    margin-bottom: 1rem;
}

.agent-hero-card::after {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-chip {
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(4px);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.28rem 0.65rem;
    border-radius: 9999px;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
}

.hero-amount-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.25rem;
}

.hero-amount {
    font-size: 2.15rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: #ffffff;
}

@media (max-width: 375px) {
    .hero-amount {
        font-size: 1.85rem;
    }
}

.hero-footer {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hero-badge {
    background: #ffffff;
    color: #1e40af;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
}

.hero-badge-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.hero-area {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.85);
}

/* Primary Collect Action Hero Button */
.btn-collect-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
    color: #ffffff !important;
    text-decoration: none;
    padding: 0.9rem 1.15rem;
    border-radius: 16px;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.32);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    min-height: 58px;
}

.btn-collect-hero:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.btn-collect-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-collect-title {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.btn-collect-subtitle {
    display: block;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.2;
}

/* Compact Stat Cards Grid */
.agent-stat-card {
    background: #ffffff;
    border: 1px solid var(--pigmy-border);
    border-radius: 14px;
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 84px;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--pigmy-shadow-sm);
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.agent-stat-card:active {
    transform: scale(0.98);
    border-color: #cbd5e1;
}

/* ==========================================================================
   Icon Standardization & Spacing System
   ========================================================================== */
.agent-icon,
.btn i,
.agent-nav-item i,
.stat-icon-wrapper i,
.tx-icon-circle i,
.agent-icon-box i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    vertical-align: middle;
    flex-shrink: 0;
}

.agent-icon::before,
.btn i::before,
.agent-nav-item i::before,
.stat-icon-wrapper i::before,
.tx-icon-circle i::before,
.agent-icon-box i::before {
    vertical-align: 0 !important;
    line-height: 1 !important;
}

/* Icon Box Containers */
.agent-icon-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
}
.agent-icon-box-sm {
    width: 34px;
    height: 34px;
    font-size: 16px;
}
.agent-icon-box-md {
    width: 40px;
    height: 40px;
    font-size: 18px;
}

.icon-box-warning {
    background-color: #fffbeb !important;
    color: #d97706 !important;
}
.icon-box-primary {
    background-color: #eff6ff !important;
    color: #1e40af !important;
}
.icon-box-success {
    background-color: #ecfdf5 !important;
    color: #059669 !important;
}
.icon-box-indigo {
    background-color: #eef2ff !important;
    color: #4f46e5 !important;
}

/* Custom Spacing & Utility Extensions */
.gap-1\.5 { gap: 0.375rem !important; }
.gap-2\.5 { gap: 0.625rem !important; }
.me-1\.5 { margin-right: 0.375rem !important; }
.ms-1\.5 { margin-left: 0.375rem !important; }
.mb-1\.5 { margin-bottom: 0.375rem !important; }
.mb-2\.5 { margin-bottom: 0.625rem !important; }
.mt-1\.5 { margin-top: 0.375rem !important; }
.mt-2\.5 { margin-top: 0.625rem !important; }
.py-2\.5 { padding-top: 0.625rem !important; padding-bottom: 0.625rem !important; }
.px-2\.5 { padding-left: 0.625rem !important; padding-right: 0.625rem !important; }
.p-2\.5 { padding: 0.625rem !important; }
.px-3\.5 { padding-left: 0.875rem !important; padding-right: 0.875rem !important; }

.stat-icon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 0.5rem;
}

.stat-icon-wrapper i {
    font-size: 18px;
}

.stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--pigmy-text-primary);
    line-height: 1.2;
    margin-bottom: 0.1rem;
}

@media (max-width: 375px) {
    .stat-value {
        font-size: 1.05rem;
    }
}

.stat-label {
    font-size: 0.7rem;
    color: var(--pigmy-text-muted);
    font-weight: 500;
    line-height: 1.2;
}

/* Transactions Feed Item */
.agent-tx-card {
    background: #ffffff;
    border: 1px solid var(--pigmy-border);
    border-radius: 14px;
    padding: 0.75rem 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    color: var(--pigmy-text-primary);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    transition: all 0.15s ease;
    min-height: 58px;
}

.agent-tx-card:active {
    transform: scale(0.99);
    background-color: #f8fafc;
}

.tx-icon-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.tx-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--pigmy-text-primary);
    line-height: 1.2;
    display: block;
}

.tx-subtitle {
    font-size: 0.72rem;
    color: var(--pigmy-text-muted);
    line-height: 1.2;
    display: block;
    margin-top: 2px;
}

.tx-amount {
    font-size: 0.95rem;
    font-weight: 700;
    text-align: right;
    line-height: 1.2;
    display: block;
}

.tx-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.03em;
    margin-top: 2px;
    display: inline-block;
}

/* Agent Bottom Navigation Bar */
.agent-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 440px;
    height: calc(64px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--pigmy-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1030;
    box-shadow: 0 -4px 18px rgba(15, 23, 42, 0.06);
}

@media (max-width: 576px) {
    .agent-bottom-nav {
        max-width: 100%;
    }
}

.agent-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--pigmy-text-muted);
    text-decoration: none;
    font-size: 0.68rem;
    font-weight: 500;
    transition: color 0.15s ease;
    padding: 4px 4px;
    min-width: 0;
    min-height: 44px; /* Touch target */
    flex: 1 1 0;
}

.agent-nav-item i {
    font-size: 1.25rem;
    margin-bottom: 2px;
    line-height: 1;
}

.agent-nav-item.active {
    color: var(--pigmy-primary);
    font-weight: 700;
}

.agent-nav-item.collect-fab {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    color: #ffffff !important;
    width: 64px !important;
    height: 64px !important;
    min-width: 64px !important;
    min-height: 64px !important;
    max-width: 64px !important;
    max-height: 64px !important;
    border-radius: 50% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    flex: 0 0 64px !important;
    flex-shrink: 0 !important;
    margin-top: -26px;
    box-shadow: 0 8px 20px -2px rgba(37, 99, 235, 0.45), 0 3px 8px -1px rgba(15, 23, 42, 0.1);
    border: 4px solid #ffffff !important;
    padding: 0 !important;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    z-index: 1035;
}

.agent-nav-item.collect-fab:active {
    transform: scale(0.92);
}

.agent-nav-item.collect-fab i {
    font-size: 1.75rem;
    line-height: 1;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 360px Extra-Compact Screen Adaptation */
@media (max-width: 375px) {
    .agent-nav-item {
        font-size: 0.62rem;
        padding: 2px 2px;
    }
    .agent-nav-item i {
        font-size: 1.15rem;
    }
}

/* Collection History Filter Grid (Daily & All-Time) */
.history-filter-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: 100%;
}

.history-filter-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    border-radius: 10px;
    background-color: #ffffff;
    color: #475569;
    border: 1px solid #e2e8f0;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.history-filter-btn:hover {
    background-color: #f8fafc;
    color: #0f172a;
    border-color: #cbd5e1;
}

.history-filter-btn.active {
    background-color: #172554 !important;
    border-color: #172554 !important;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 3px 8px -1px rgba(23, 37, 84, 0.25);
}

.history-filter-btn.active:hover {
    background-color: #1e3a8a !important;
    border-color: #1e3a8a !important;
    color: #ffffff !important;
}

.history-filter-btn i {
    font-size: 0.95rem;
    margin-right: 6px;
    line-height: 1;
}

/* Admin Desktop Shell */
.admin-shell-container {
    display: flex;
    position: relative;
    width: 100%;
    min-width: 0;
    max-width: 100vw;
}

.admin-sidebar {
    width: 260px;
    min-height: 100vh;
    background-color: #ffffff;
    border-right: 1px solid var(--pigmy-border);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    overflow-y: auto;
}

.admin-sidebar-brand {
    padding: 1rem 1.25rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--pigmy-primary);
    border-bottom: 1px solid var(--pigmy-border-subtle);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Mobile Sidebar Close Button with >= 44x44px Touch Target */
.admin-sidebar-close-btn {
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    padding: 0;
    border-radius: var(--pigmy-radius-sm);
    touch-action: manipulation;
}

.admin-sidebar-menu {
    padding: 1rem 0.75rem;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 1rem;
    color: #475569;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--pigmy-radius-sm);
    margin-bottom: 0.25rem;
    min-height: 40px;
    transition: all 0.15s ease;
}

.admin-nav-link i {
    font-size: 1.15rem;
    color: #94a3b8;
    transition: color 0.15s ease;
}

.admin-nav-link:hover {
    background-color: var(--pigmy-primary-light);
    color: var(--pigmy-primary);
}

.admin-nav-link:hover i {
    color: var(--pigmy-primary);
}

.admin-nav-link.active {
    background-color: var(--pigmy-primary);
    color: #ffffff;
    font-weight: 600;
}

.admin-nav-link.active i {
    color: #ffffff;
}

/* Admin Main Wrapper with Flexbox Shrink Containment */
.admin-main-wrapper {
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 0%;
    max-width: calc(100vw - 260px);
}

.admin-main-wrapper > main {
    min-width: 0;
    width: 100%;
}

.admin-main-wrapper .pigmy-card {
    min-width: 0;
    max-width: 100%;
}

/* Financial tables retain independent horizontal scrolling without pushing page */
.admin-main-wrapper .table-responsive {
    min-width: 0;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

/* Sidebar Backdrop on Mobile/Tablet */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.45);
    z-index: 1035;
    backdrop-filter: blur(2px);
}

@media (max-width: 991px) {
    .admin-sidebar {
        margin-left: -260px;
        transition: margin 0.25s ease-in-out;
    }
    .admin-sidebar.show {
        margin-left: 0;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    }
    .admin-sidebar.show ~ .sidebar-backdrop {
        display: block;
    }
    .admin-main-wrapper {
        margin-left: 0;
        width: 100%;
        max-width: 100vw;
        min-width: 0;
    }
}

.admin-topbar {
    height: 64px;
    background-color: #ffffff;
    border-bottom: 1px solid var(--pigmy-border);
    position: sticky;
    top: 0;
    z-index: 990;
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    width: 100%;
    min-width: 0;
}

@media (max-width: 575px) {
    .admin-topbar {
        padding: 0 0.85rem;
    }
}

.admin-topbar-toggler {
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    touch-action: manipulation;
}

/* ==========================================================================
   Phase 2: Banking Financial Identifiers & Table Usability
   ========================================================================== */

/* Monospace Banking & Transaction Identifiers */
.tabular-code {
    font-family: var(--bs-font-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    letter-spacing: -0.01em;
}

/* Table Column Width Utilities & Column Alignment */
.col-min-code { min-width: 140px; }
.col-min-receipt { min-width: 165px; }
.col-min-account { min-width: 140px; }
.col-min-customer { min-width: 160px; }
.col-min-agent { min-width: 140px; }
.col-min-datetime { min-width: 145px; }
.col-min-channel { min-width: 95px; }
.col-min-amount { min-width: 115px; }
.col-min-status { min-width: 110px; }
.col-min-actions { min-width: 115px; }

/* Table Action Buttons */
.btn-table-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-size: 0.8125rem;
    line-height: 1.25;
    padding: 0.25rem 0.65rem;
    min-height: 32px;
    border-radius: var(--pigmy-radius-sm);
    transition: all 0.15s ease-in-out;
    white-space: nowrap;
    text-decoration: none;
    vertical-align: middle;
}

.btn-table-action-icon {
    min-width: 32px;
    min-height: 32px;
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--pigmy-radius-sm);
    font-size: 0.95rem;
    transition: all 0.15s ease-in-out;
    white-space: nowrap;
    text-decoration: none;
    vertical-align: middle;
}

/* Touch targets on mobile / tablet (<992px) */
@media (max-width: 991.98px) {
    .btn-table-action {
        min-height: 40px;
        padding: 0.4rem 0.8rem;
        font-size: 0.875rem;
        touch-action: manipulation;
    }
    .btn-table-action-icon {
        min-width: 40px;
        min-height: 40px;
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
        touch-action: manipulation;
    }
}

/* Printable Thermal Receipt & Screen Card */
.premium-receipt-card,
.thermal-receipt {
    max-width: 480px;
    margin: 0 auto;
    background: #fff;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--pigmy-border);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 0.88rem;
    color: #1e293b;
    line-height: 1.45;
    transition: max-width 0.25s ease, padding 0.25s ease;
}

@media (max-width: 576px) {
    .premium-receipt-card,
    .thermal-receipt {
        padding: 1rem 0.875rem;
    }
}

.receipt-no-wrap {
    white-space: nowrap !important;
    word-break: keep-all !important;
    overflow-wrap: normal !important;
    hyphens: none !important;
    display: inline-block !important;
}

.receipt-hero-amount {
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
    border: 1px solid #bfdbfe;
    border-radius: var(--pigmy-radius-md);
}

.receipt-hero-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #475569;
}

.receipt-hero-value {
    font-size: 2.2rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-weight: 800;
    color: var(--pigmy-text-primary);
    font-family: var(--bs-font-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);
}

.qr-code-box svg {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.print-only {
    display: none;
}

/* Interactive 58mm Compact Screen Preview Simulation */
.premium-receipt-card.thermal-mode-58mm,
.thermal-receipt.thermal-mode-58mm {
    max-width: 320px !important;
    padding: 0.75rem 0.85rem !important;
    font-size: 0.8rem !important;
    font-family: 'Courier New', Courier, monospace !important;
}

.premium-receipt-card.thermal-mode-58mm .receipt-hero-value,
.thermal-receipt.thermal-mode-58mm .receipt-hero-value {
    font-size: 1.65rem !important;
}

.premium-receipt-card.thermal-mode-58mm .qr-code-box,
.thermal-receipt.thermal-mode-58mm .qr-code-box {
    width: 64px !important;
    height: 64px !important;
}

.premium-receipt-card.thermal-mode-58mm .receipt-detail-label,
.thermal-receipt.thermal-mode-58mm .receipt-detail-label {
    width: 85px !important;
}

/* ==========================================================================
   Fintech Collect Deposit Mobile Experience
   ========================================================================== */
.text-navy {
    color: #172554 !important;
}

.collect-header-badge {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.fintech-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.02);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.fintech-card:hover {
    box-shadow: 0 4px 14px -3px rgba(15, 23, 42, 0.08);
}

.fintech-section-title {
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #172554;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.65rem;
}

/* Unified Customer Search Box */
.customer-search-box {
    position: relative;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 0.65rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.15s ease;
}

.customer-search-box:focus-within {
    background: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.customer-search-input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    font-size: 0.88rem;
    color: #0f172a;
    font-weight: 500;
}

.customer-search-input::placeholder {
    color: #94a3b8;
    font-size: 0.82rem;
}

.customer-results-dropdown {
    max-height: 230px;
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.1);
    margin-top: 6px;
}

.customer-results-dropdown::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.customer-item-row {
    padding: 0.7rem 0.85rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.15s ease;
    min-height: 56px;
    width: 100%;
}

.customer-item-row:last-child {
    border-bottom: none;
}

.customer-item-row:active, .customer-item-row:hover {
    background-color: #f8fafc;
}

/* Selected Customer Profile Card */
.selected-customer-pill {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1.5px solid #cbd5e1;
    border-radius: 14px;
    padding: 0.75rem 0.9rem;
    display: block;
}

.selected-customer-name-text {
    font-size: 0.92rem;
    font-weight: 700;
    color: #172554;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

/* Selectable Account Cards */
.account-select-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.account-selectable-card {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 0.85rem 1rem;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    width: 100%;
    position: relative;
}

.account-selectable-card:active {
    transform: scale(0.99);
}

.account-selectable-card.selected {
    border-color: #2563eb;
    background-color: #eff6ff;
    box-shadow: 0 4px 12px -2px rgba(37, 99, 235, 0.15);
}

.account-radio-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s ease;
    font-size: 0.75rem;
}

.account-selectable-card.selected .account-radio-circle {
    border-color: #2563eb;
    background-color: #2563eb;
    color: #ffffff;
}

/* Hero Collection Amount Display */
.amount-hero-box {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    padding: 0.95rem 0.85rem 0.8rem;
    text-align: center;
    box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.04);
}

.amount-hero-box:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.amount-input-wrapper {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    margin: 0.15rem auto 0.45rem;
    text-align: center;
}

.amount-currency-symbol {
    font-size: 2rem;
    font-weight: 800;
    color: #172554;
    line-height: 1;
    margin-right: 4px;
    flex-shrink: 0;
    user-select: none;
}

.amount-hero-input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 2.2rem;
    font-weight: 800;
    color: #172554;
    width: 3.5ch;
    min-width: 2ch;
    max-width: 7ch;
    text-align: center;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    padding: 0;
    line-height: 1;
    -moz-appearance: textfield;
}

.amount-hero-input::-webkit-outer-spin-button,
.amount-hero-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

@media (max-width: 375px) {
    .amount-currency-symbol {
        font-size: 1.8rem;
    }
    .amount-hero-input {
        font-size: 1.95rem;
    }
}

/* Quick Amount Chips Row */
.quick-amount-chips-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    margin-top: 0.65rem;
}

.quick-amount-chip {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.45rem 1px;
    border-radius: 10px;
    width: 100%;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: -0.01em;
}

.quick-amount-chip:active, .quick-amount-chip:hover {
    border-color: #2563eb;
    color: #2563eb;
    background-color: #eff6ff;
}

.quick-amount-chip.active {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.28);
}

/* Modern Payment Method Selectors */
.payment-methods-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.payment-method-card {
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    padding: 0.65rem 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
    width: 100%;
    height: 100%;
    min-height: 54px;
}

.payment-method-card:hover {
    border-color: #93c5fd;
}

.payment-method-card.selected {
    border-color: #2563eb;
    background-color: #eff6ff;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.12);
}

.payment-method-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
    background-color: #f1f5f9;
    color: #475569;
    transition: all 0.15s ease;
}

.payment-method-card.selected .payment-method-icon {
    background-color: #2563eb;
    color: #ffffff;
}

/* Live Collection Summary Card */
.collection-summary-box {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    padding: 0.85rem 1rem;
    font-size: 0.82rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.summary-row:last-child {
    margin-bottom: 0;
}

@media print {
    @page {
        size: auto;
        margin: 3mm;
    }

    /* Hide all non-printable chrome and actions */
    .no-print,
    .agent-top-header,
    .agent-bottom-nav,
    .agent-bottom-spacer,
    .admin-shell-container > aside,
    .admin-sidebar,
    .admin-topbar,
    .admin-topbar-toggler,
    .sidebar-backdrop,
    .receipt-actions,
    .alert,
    .btn,
    .btn-group,
    .navbar,
    footer,
    header,
    nav {
        display: none !important;
        visibility: hidden !important;
    }

    html, body {
        background: #ffffff !important;
        color: #000000 !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    .admin-shell-container,
    .admin-main-wrapper,
    .admin-main-wrapper > main,
    .agent-mobile-container,
    .agent-content,
    .receipt-screen-wrapper {
        margin: 0 !important;
        padding: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
        border: none !important;
        box-shadow: none !important;
        background: #ffffff !important;
        visibility: visible !important;
    }

    /* 80mm Standard Thermal Layout (Default for POS & centered on A4) */
    .premium-receipt-card,
    .thermal-receipt {
        display: block !important;
        visibility: visible !important;
        position: relative !important;
        margin: 0 auto !important;
        width: 100% !important;
        max-width: 80mm !important;
        box-shadow: none !important;
        border: 1px solid #94a3b8 !important;
        border-radius: 6px !important;
        padding: 10px 12px !important;
        background: #ffffff !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        color: #000000 !important;
    }

    .premium-receipt-card *,
    .thermal-receipt * {
        visibility: visible !important;
        color: #000000 !important;
        box-shadow: none !important;
    }

    .receipt-hero-amount {
        background: #f8fafc !important;
        border: 1px solid #cbd5e1 !important;
        padding: 8px !important;
    }

    .receipt-hero-value {
        font-size: 1.8rem !important;
        color: #000000 !important;
    }

    .receipt-balance-card,
    .receipt-verification-card {
        background: #f8fafc !important;
        border: 1px solid #cbd5e1 !important;
        padding: 8px !important;
    }

    .print-only {
        display: block !important;
        visibility: visible !important;
    }

    /* 58mm Compact Thermal POS Printer Mode */
    body[data-print-mode="58mm"] .premium-receipt-card,
    body[data-print-mode="58mm"] .thermal-receipt,
    .premium-receipt-card.thermal-mode-58mm,
    .thermal-receipt.thermal-mode-58mm {
        max-width: 58mm !important;
        padding: 6px 8px !important;
        font-size: 7.5pt !important;
        border: 1px solid #000000 !important;
    }

    body[data-print-mode="58mm"] .receipt-hero-value,
    .premium-receipt-card.thermal-mode-58mm .receipt-hero-value,
    .thermal-receipt.thermal-mode-58mm .receipt-hero-value {
        font-size: 1.45rem !important;
    }

    body[data-print-mode="58mm"] .receipt-hero-label,
    .premium-receipt-card.thermal-mode-58mm .receipt-hero-label,
    .thermal-receipt.thermal-mode-58mm .receipt-hero-label {
        font-size: 6.5pt !important;
    }

    body[data-print-mode="58mm"] .qr-code-box,
    .premium-receipt-card.thermal-mode-58mm .qr-code-box,
    .thermal-receipt.thermal-mode-58mm .qr-code-box {
        width: 58px !important;
        height: 58px !important;
        padding: 2px !important;
    }

    body[data-print-mode="58mm"] .receipt-detail-label,
    .premium-receipt-card.thermal-mode-58mm .receipt-detail-label,
    .thermal-receipt.thermal-mode-58mm .receipt-detail-label {
        font-size: 7pt !important;
        width: 72px !important;
    }

    body[data-print-mode="58mm"] .receipt-detail-value,
    .premium-receipt-card.thermal-mode-58mm .receipt-detail-value,
    .thermal-receipt.thermal-mode-58mm .receipt-detail-value {
        font-size: 7.5pt !important;
    }

    body[data-print-mode="58mm"] .receipt-balance-card,
    .premium-receipt-card.thermal-mode-58mm .receipt-balance-card,
    .thermal-receipt.thermal-mode-58mm .receipt-balance-card {
        padding: 6px !important;
        font-size: 7.5pt !important;
    }

    body[data-print-mode="58mm"] .receipt-verification-card,
    .premium-receipt-card.thermal-mode-58mm .receipt-verification-card,
    .thermal-receipt.thermal-mode-58mm .receipt-verification-card {
        padding: 6px !important;
    }
}

/* ==========================================================================
   PHASE 4: ADMIN USABILITY, FILTERS, MODALS & AUDIT JSON VIEWER
   ========================================================================== */

/* Universal Confirmation Modal */
.admin-confirm-icon-box {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}
.admin-confirm-details-table {
    width: 100%;
    margin-bottom: 0;
    font-size: 0.82rem;
}
.admin-confirm-details-table td {
    padding: 4px 6px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.admin-confirm-details-table tr:last-child td {
    border-bottom: none;
}

/* Filter Active Indicator Bar */
.filter-active-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background-color: #f1f5f9;
    border-radius: 8px;
    font-size: 0.8rem;
    margin-top: 10px;
    border: 1px solid #e2e8f0;
}
.filter-active-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    padding: 2px 10px;
    font-weight: 500;
    color: #334155;
    font-size: 0.75rem;
}

/* Empty State Card */
.pigmy-empty-state {
    padding: 48px 24px;
    text-align: center;
}
.pigmy-empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background-color: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 1.75rem;
}
.pigmy-empty-state-title {
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 6px;
    font-size: 1.05rem;
}
.pigmy-empty-state-desc {
    color: #64748b;
    font-size: 0.875rem;
    max-width: 440px;
    margin: 0 auto 16px;
}

/* Audit Log JSON Viewer */
.btn-payload-viewer {
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
}
.btn-payload-viewer:hover {
    background-color: #f1f5f9;
    color: var(--pigmy-primary);
    border-color: var(--pigmy-primary);
}
.json-viewer-container {
    background-color: #0f172a;
    color: #f8fafc;
    border-radius: 8px;
    padding: 16px;
    max-height: 480px;
    overflow-y: auto;
    overflow-x: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.82rem;
    line-height: 1.5;
    border: 1px solid #1e293b;
}
.json-viewer-container pre {
    margin: 0;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    white-space: pre;
    word-wrap: normal;
}
.json-syntax-key {
    color: #38bdf8;
    font-weight: 600;
}
.json-syntax-string {
    color: #4ade80;
}
.json-syntax-number {
    color: #facc15;
}
.json-syntax-boolean {
    color: #f472b6;
    font-weight: bold;
}
.json-syntax-null {
    color: #94a3b8;
    font-style: italic;
}
