@font-face {
    font-family: 'SolaimanLipi';
    src: url('/static/fonts/SolaimanLipi.woff2') format('woff2'),
         url('/static/fonts/SolaimanLipi.woff') format('woff'),
         url('/static/fonts/SolaimanLipi.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'SolaimanLipi';
    src: url('/static/fonts/SolaimanLipi-Bold.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary: #1e40af;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --accent: #e2136e; /* bKash pink */
    --accent-hover: #b80d57;
    --accent-light: #fdf2f8;
    --success: #16a34a;
    --success-light: #f0fdf4;
    --warning: #d97706;
    --warning-light: #fefce8;
    --danger: #dc2626;
    --danger-light: #fef2f2;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --border-subtle: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.07);
    --shadow-lg: 0 12px 28px rgba(15, 23, 42, 0.12);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

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

body {
    font-family: 'SolaimanLipi', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

/* Typography & Links */
a {
    color: var(--primary);
    text-decoration: none;
    transition: 0.2s;
}
a:hover {
    color: var(--primary-hover);
}

/* Base Buttons with Touch Feedback */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    padding: 10px 18px;
    min-height: 42px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    user-select: none;
}
.btn:active {
    transform: scale(0.97);
}
.btn-primary {
    background: var(--primary);
    color: #ffffff;
}
.btn-primary:hover {
    background: var(--primary-hover);
    color: #ffffff;
}
.btn-accent {
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(226, 19, 110, 0.3);
}
.btn-accent:hover {
    background: var(--accent-hover);
    color: #ffffff;
}
.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text-primary);
}
.btn-outline:hover {
    background: #f1f5f9;
}
.btn-success {
    background: var(--success);
    color: #ffffff;
}
.btn-danger {
    background: var(--danger);
    color: #ffffff;
}
.btn-sm {
    padding: 6px 12px;
    min-height: 34px;
    font-size: 13px;
}
.btn-block {
    width: 100%;
}

/* Responsive Navbar */
.navbar {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}
.nav-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
}
.logo-badge {
    background: #e0e7ff;
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 16px;
}
.nav-link {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 15px;
}

/* Mobile Nav Toggle Button */
.mobile-nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-primary);
}

/* Mobile Nav Drawer / Dropdown */
.mobile-nav-drawer {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    background: #ffffff;
    border-bottom: 2px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: 16px 20px 24px;
    flex-direction: column;
    gap: 12px;
    z-index: 999;
}
.mobile-nav-drawer.active {
    display: flex;
}

/* Layout Container */
.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 24px 16px;
}

/* Cards & Panels */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    margin-bottom: 20px;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 10px;
}
.card-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Responsive Stat Grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.stat-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
}
.stat-card.stat-accent::before { background: var(--accent); }
.stat-card.stat-success::before { background: var(--success); }
.stat-card.stat-warning::before { background: var(--warning); }
.stat-title {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
}
.stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    word-break: break-word;
}

/* Responsive Tables */
.table-responsive {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
table.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
    min-width: 600px;
}
table.data-table th, table.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}
table.data-table th {
    background: #f8fafc;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
}
table.data-table tr:hover {
    background: #f1f5f9;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-info { background: #e0e7ff; color: #4338ca; }

/* Forms */
.form-group {
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-group label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
}
.form-control {
    width: 100%;
    font-family: inherit;
    font-size: 15px;
    padding: 11px 14px;
    min-height: 44px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: #ffffff;
    color: var(--text-primary);
    transition: 0.2s;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.15);
}

/* Responsive Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 16px;
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.modal-content {
    background: #ffffff;
    border-radius: var(--radius-md);
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    padding: 22px;
    position: relative;
    -webkit-overflow-scrolling: touch;
}

/* Desktop & Mobile Admin Dashboard Shell */
.dashboard-wrapper {
    display: flex;
    min-height: calc(100vh - 65px);
    width: 100%;
}
.sidebar {
    width: 260px;
    background: #ffffff;
    border-right: 1px solid var(--border);
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all 0.3s ease;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    min-height: 44px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
    user-select: none;
}
.sidebar-link:hover, .sidebar-link.active {
    background: var(--primary-light);
    color: var(--primary);
}
.main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    width: 100%;
}

/* Mobile Sidebar Drawer */
.sidebar-mobile-toggle {
    display: none;
    background: var(--primary-light);
    color: var(--primary);
    border: none;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

/* ======================================================== */
/* NATIVE MOBILE APP PWA SHELL STYLES                       */
/* ======================================================== */
.pwa-app-shell {
    max-width: 460px;
    margin: 0 auto;
    background: #ffffff;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.08);
    position: relative;
    padding-bottom: calc(75px + var(--safe-bottom));
}

.pwa-top-bar {
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: white;
    padding: calc(14px + var(--safe-top)) 16px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}
.pwa-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* Native App Bottom Bar */
.pwa-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    max-width: 460px;
    width: 100%;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 8px 0 calc(8px + var(--safe-bottom));
    z-index: 1000;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.04);
}
.pwa-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 14px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}
.pwa-nav-btn.active {
    color: var(--primary);
}
.pwa-nav-btn.active .pwa-icon-pill {
    background: var(--primary-light);
    color: var(--primary);
    transform: scale(1.05);
}
.pwa-icon-pill {
    width: 38px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    border-radius: 14px;
    transition: all 0.2s;
}

/* Install PWA Prompt Card */
.pwa-install-banner {
    margin: 12px 14px;
    background: linear-gradient(135deg, #eff6ff 0%, #e0e7ff 100%);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.pwa-install-text h4 {
    font-size: 14px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 2px;
}
.pwa-install-text p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.3;
}

/* Native App Balance Card */
.pwa-balance-card {
    background: linear-gradient(135deg, #e2136e 0%, #be123c 100%);
    color: white;
    margin: 14px;
    padding: 22px 18px;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 24px rgba(226, 19, 110, 0.28);
    position: relative;
    overflow: hidden;
}
.pwa-balance-card::after {
    content: "";
    position: absolute;
    right: -20px;
    bottom: -20px;
    width: 110px;
    height: 110px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

/* Native Feed Card */
.pwa-card-item {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
    transition: 0.2s;
}
.pwa-card-item:active {
    background: #f8fafc;
}

/* Toast Alerts */
.toast-container {
    position: fixed;
    bottom: calc(85px + var(--safe-bottom));
    right: 16px;
    left: 16px;
    max-width: 420px;
    margin: 0 auto;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    background: #0f172a;
    color: #ffffff;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideUp 0.25s ease;
    pointer-events: auto;
}
.toast-success { background: #15803d; }
.toast-error { background: #b91c1c; }
@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ======================================================== */
/* MEDIA QUERIES FOR FULL RESPONSIVENESS (< 768px)          */
/* ======================================================== */
@media (max-width: 768px) {
    .nav-links {
        display: none; /* Hidden on mobile; toggled via drawer */
    }
    .mobile-nav-toggle {
        display: block;
    }
    
    .hero-title {
        font-size: 26px !important;
        line-height: 1.35 !important;
    }
    .hero-desc {
        font-size: 15px !important;
        margin-bottom: 20px !important;
    }
    
    .stat-grid {
        grid-template-columns: 1fr 1fr; /* 2 columns on mobile */
        gap: 10px;
    }
    .stat-card {
        padding: 12px;
    }
    .stat-value {
        font-size: 18px;
    }
    
    /* Responsive Dashboard Shell */
    .dashboard-wrapper {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 8px 12px;
        display: none; /* Mobile togglable */
    }
    .sidebar.mobile-open {
        display: flex;
    }
    .sidebar-mobile-toggle {
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }
    .main-content {
        padding: 14px 12px;
    }
    
    .modal-content {
        padding: 16px;
        max-height: 92vh;
        border-radius: var(--radius-sm);
    }
    
    .pricing-grid {
        grid-template-columns: 1fr !important;
    }
    .feature-grid {
        grid-template-columns: 1fr !important;
        gap: 14px;
    }
}

@media (max-width: 480px) {
    .stat-grid {
        grid-template-columns: 1fr; /* Single column on tiny screens */
    }
    .hero-section {
        padding: 40px 14px !important;
    }
}

/* ======================================================== */
/* SLIDE-OVER NAVIGATION DRAWER & 3-DOT MENU STYLES         */
/* ======================================================== */
.app-drawer-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(15, 23, 42, 0.75) !important;
    z-index: 9998 !important;
    display: none !important;
    opacity: 0 !important;
    transition: opacity 0.25s ease !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.app-drawer-overlay.active {
    display: block !important;
    opacity: 1 !important;
}

.app-drawer {
    position: fixed !important;
    top: 0 !important;
    left: -320px !important;
    width: 285px !important;
    max-width: 85vw !important;
    height: 100vh !important;
    background: #ffffff !important;
    z-index: 9999 !important;
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.35) !important;
    display: flex !important;
    flex-direction: column !important;
    transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1) !important;
    overflow-y: auto !important;
}
.app-drawer.active {
    left: 0 !important;
}

.drawer-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: white;
    padding: calc(20px + var(--safe-top)) 18px 18px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.drawer-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.drawer-menu-list {
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.drawer-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    min-height: 46px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: 0.15s;
    user-select: none;
}
.drawer-item:active, .drawer-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}
.drawer-item-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

/* 3-Dot Menu Popover */
.three-dot-menu {
    position: relative;
    display: inline-block;
}
.three-dot-btn {
    background: transparent;
    border: none;
    color: inherit;
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.three-dot-popover {
    display: none !important;
    position: absolute !important;
    right: 0 !important;
    top: calc(100% + 6px) !important;
    background: #ffffff !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2) !important;
    min-width: 200px !important;
    z-index: 10000 !important;
    padding: 6px 0 !important;
}
.three-dot-popover.active {
    display: block !important;
}
.popover-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
}
.popover-item:hover, .popover-item:active {
    background: var(--primary-light);
    color: var(--primary);
}

/* QR Code & Share Card */
.qr-share-card {
    background: #ffffff;
    border: 2px dashed #bfdbfe;
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    margin: 16px 0;
}
