:root {
    --bg: #0F172A;
    --card: #1E293B;
    --border: #334155;
    --primary: #3B82F6;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --text: #F8FAFC;
    --text-secondary: #94A3B8;
    --radius: 16px;
    --radius-sm: 8px;
    --radius-lg: 24px;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -2px rgba(0,0,0,0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -4px rgba(0,0,0,0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.5), 0 8px 10px -6px rgba(0,0,0,0.3);
    --transition: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Inter', 'Poppins', sans-serif;
}

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

*:focus { outline: none !important; }
*:focus-visible { outline: none !important; }
button:focus { outline: none !important; box-shadow: none !important; }
a:focus { outline: none !important; }
input:focus { outline: none !important; }
textarea:focus { outline: none !important; }
select:focus { outline: none !important; }

a, button, .btn, [role="button"], input[type="submit"], input[type="button"] {
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    transition: transform 120ms ease, box-shadow 120ms ease;
}

a:active, button:active, .btn:active, [role="button"]:active {
    transform: scale(0.96);
}

a:hover, button:hover, .btn:hover, [role="button"]:hover {
    transform: translateY(-1px);
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
    background-color: var(--bg);
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #2563EB; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #DC2626; }
.btn-warning { background: var(--warning); color: #000; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; box-shadow: none; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text); }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 16px 32px; font-size: 17px; }
.btn-block { width: 100%; }
.btn-icon { padding: 10px; border-radius: 50%; min-width: unset; }
.btn-icon svg { width: 22px; height: 22px; }

.btn .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: none;
}

.btn.loading .spinner { display: block; }
.btn.loading .btn-text { display: none; }
.btn.loading { pointer-events: none; }

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== INPUTS ========== */
.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    pointer-events: none;
    z-index: 1;
}

.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    transition: all var(--transition);
    outline: none;
}

/* Only add extra left padding when an icon is present */
.input-group:has(.input-icon) input,
.input-group:has(.input-icon) select,
.input-group:has(.input-icon) textarea {
    padding-left: 48px;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.input-group input::placeholder,
.input-group textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.input-group select {
    appearance: none;
    cursor: pointer;
}

.input-group select + .input-icon {
    right: 16px;
    left: auto;
}

.input-group .error-text {
    color: var(--danger);
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

.input-group.error input {
    border-color: var(--danger);
}

.input-group.error .error-text {
    display: block;
}

.input-group.success input {
    border-color: var(--success);
}

/* ========== CARDS ========== */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: all var(--transition);
}

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

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
}

.card-body {
    color: var(--text-secondary);
}

/* ========== BALANCE CARD ========== */
.balance-card {
    background: linear-gradient(135deg, var(--card) 0%, #1a2744 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.balance-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(59,130,246,0.05) 0%, transparent 70%);
    pointer-events: none;
}

.balance-label {
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.balance-amount {
    font-size: 34px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -1px;
}

.balance-sub {
    display: flex;
    gap: 24px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.balance-sub-item {
    font-size: 13px;
    color: var(--text-secondary);
}

.balance-sub-item strong {
    color: var(--text);
    font-weight: 600;
}

/* ========== STATS GRID ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: all var(--transition);
    box-shadow: var(--shadow);
}

.stat-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-icon.blue { background: rgba(59,130,246,0.15); color: var(--primary); }
.stat-icon.green { background: rgba(16,185,129,0.15); color: var(--success); }
.stat-icon.yellow { background: rgba(245,158,11,0.15); color: var(--warning); }
.stat-icon.red { background: rgba(239,68,68,0.15); color: var(--danger); }

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}

/* ========== HEADER ========== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
}

.header-logo .logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #2563EB, #1d4ed8);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

.header-center {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-clock {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-btn {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}
.header-btn svg {
    width: 22px;
    height: 22px;
}

.header-btn:hover {
    border-color: var(--primary);
    color: var(--text);
    background: rgba(59,130,246,0.1);
}

.header-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.header-profile:hover {
    background: rgba(255,255,255,0.05);
}

.header-profile-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}

.header-profile-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

/* ========== SIDEBAR ========== */
.sidebar {
    position: fixed;
    top: 64px;
    left: 0;
    bottom: 0;
    width: 240px;
    background: var(--card);
    border-right: 1px solid var(--border);
    padding: 16px 0;
    overflow-y: auto;
    z-index: 90;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav-item {
    margin-bottom: 2px;
}

.sidebar-nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
    border-right: 3px solid transparent;
}

.sidebar-nav-item a:hover {
    color: var(--text);
    background: rgba(255,255,255,0.03);
}

.sidebar-nav-item a.active {
    color: var(--primary);
    background: rgba(59,130,246,0.1);
    border-right-color: var(--primary);
}

.sidebar-nav-item a svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ========== BOTTOM NAV ========== */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--card);
    border-top: 1px solid var(--border);
    padding: 8px 0;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
}

.bottom-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-around;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    transition: all var(--transition);
    border: none;
    background: none;
    cursor: pointer;
    position: relative;
}

.bottom-nav-item svg {
    width: 24px;
    height: 24px;
}

.bottom-nav-item.active {
    color: var(--primary);
}

.bottom-nav-item.center-btn {
    margin-top: -24px;
    -webkit-tap-highlight-color: transparent;
}
.bottom-nav-item.center-btn:hover {
    transform: none;
}
.bottom-nav-item.center-btn:active {
    transform: none;
}

.bottom-nav-item .center-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563EB 0%, #1d4ed8 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255,255,255,0.15);
    box-shadow: 0 6px 24px rgba(0,0,0,0.3);
    transition: all 0.25s;
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
}

.bottom-nav-item .center-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0,0,0,0.35);
}

.bottom-nav-item .center-icon:active {
    transform: scale(0.96);
    transition-duration: 120ms;
}

.bottom-nav-item .center-icon:active::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    animation: rippleFade 0.4s ease-out forwards;
}

.bottom-nav-item .center-icon:focus,
.bottom-nav-item .center-icon:focus-visible,
.bottom-nav-item .center-icon:focus-within {
    outline: none !important;
    box-shadow: 0 6px 24px rgba(0,0,0,0.3) !important;
}

@keyframes rippleFade {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

.bottom-nav-item .center-icon svg {
    width: 30px;
    height: 30px;
}

/* ========== MAIN CONTENT ========== */
.main-content {
    margin-left: 240px;
    margin-top: 64px;
    padding: 32px;
    min-height: calc(100vh - 64px);
}

.main-content.no-sidebar {
    margin-left: 0;
}

.page-header {
    margin-bottom: 32px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ========== AUTH PAGES ========== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--bg);
}

.auth-container {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-xl);
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo .logo-text {
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
}

.auth-logo .logo-sub {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    text-align: center;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    text-align: center;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ========== LOADING OVERLAY ========== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0F172A;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ========== NOTIFICATION POPUP ========== */
.notification-popup {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.notification-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 320px;
    animation: slideInRight 0.3s ease;
    pointer-events: auto;
}

.notification-item.success { border-left: 4px solid var(--success); }
.notification-item.error { border-left: 4px solid var(--danger); }
.notification-item.warning { border-left: 4px solid var(--warning); }
.notification-item.info { border-left: 4px solid var(--primary); }

.notification-item .notif-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.notification-item .notif-content {
    flex: 1;
}

.notification-item .notif-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.notification-item .notif-message {
    font-size: 13px;
    color: var(--text-secondary);
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ========== MODAL ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 9997;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    animation: modalIn 0.25s ease;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.modal-close:hover {
    color: var(--text);
    border-color: var(--text-secondary);
}

/* ========== TABLES ========== */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead {
    background: rgba(255,255,255,0.03);
}

th {
    text-align: left;
    padding: 14px 16px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 14px 16px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(255,255,255,0.02);
}

/* ========== BADGES ========== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-warning { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-danger { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-info { background: rgba(59,130,246,0.15); color: var(--primary); }
.badge-neutral { background: rgba(148,163,184,0.15); color: var(--text-secondary); }

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    color: var(--text);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ========== SEARCH BAR ========== */
.search-bar {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.search-bar input {
    width: 100%;
    padding: 10px 16px 10px 44px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    outline: none;
    transition: all var(--transition);
}

.search-bar input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.search-bar .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

/* ========== FILTERS ========== */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-bar select,
.filter-bar input {
    padding: 10px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    outline: none;
    transition: all var(--transition);
}

.filter-bar select:focus,
.filter-bar input:focus {
    border-color: var(--primary);
}

/* ========== ACCOUNT CARD ========== */
.account-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: all var(--transition);
}

.account-card:hover {
    box-shadow: var(--shadow-lg);
}

.account-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.account-type-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(59,130,246,0.1);
    color: var(--primary);
}

.account-card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.account-info-item label {
    font-size: 12px;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 2px;
}

.account-info-item span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.account-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ========== SELECTABLE CARDS ========== */
.selectable-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.selectable-card {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
}

.selectable-card:hover {
    border-color: var(--primary);
    background: rgba(59,130,246,0.05);
}

.selectable-card.selected {
    border-color: var(--primary);
    background: rgba(59,130,246,0.1);
}

.selectable-card svg {
    width: 40px;
    height: 40px;
    color: var(--primary);
    margin-bottom: 12px;
}

.selectable-card h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.selectable-card p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ========== QR SECTION ========== */
.qr-section {
    text-align: center;
    padding: 24px;
}

.qr-section img {
    width: 200px;
    height: 200px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    background: #fff;
    padding: 8px;
}

/* QR canvas generated by qrcodejs also needs white background */
.qr-section canvas {
    border-radius: var(--radius-sm);
    background: #fff;
    padding: 8px;
    display: block;
}

.qr-section .upi-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.qr-section .upi-display span {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.qr-section .upi-display .copy-btn {
    padding: 6px 12px;
    font-size: 12px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }
    .main-content {
        margin-left: 200px;
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        padding: 16px;
        padding-bottom: 80px;
    }
    
    .bottom-nav {
        display: block;
    }
    
    .header {
        padding: 12px 16px;
    }
    
    .header-center {
        display: none;
    }
    
    .header-profile-name {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .balance-card {
        padding: 24px;
    }
    
    .balance-amount {
        font-size: 28px;
    }
    
    .auth-card {
        padding: 24px;
    }
    
    .account-card-body {
        grid-template-columns: 1fr;
    }
    
    .notification-popup {
        right: 16px;
        left: 16px;
    }
    
    .notification-item {
        min-width: unset;
    }
    
    .selectable-cards {
        grid-template-columns: 1fr 1fr;
    }

    .page-title {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .selectable-cards {
        grid-template-columns: 1fr;
    }
    
    .header {
        padding: 10px 12px;
    }
    
    .main-content {
        padding: 12px;
        padding-bottom: 80px;
    }
    
    .balance-amount {
        font-size: 24px;
    }
}

#creditToastContainer {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 360px;
    width: calc(100% - 32px);
    pointer-events: none;
}
#creditToastContainer > * {
    pointer-events: auto;
}

.ct-toast {
    width: 100%;
    max-width: 360px;
    background: #111827;
    border: 1px solid rgba(255,255,255,0.1);
    border-left: 4px solid #2563EB;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    display: flex;
    align-items: flex-start;
    gap: 0;
    overflow: hidden;
    transform: translateY(-20px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16,1,0.3,1);
    position: relative;
    padding: 14px 14px 14px 12px;
}
.ct-type {
    font-size: 13px;
    font-weight: 600;
    color: #CBD5E1;
    margin-top: 5px;
}
.ct-toast.ct-toast-success {
    border-left-color: #10B981;
}
.ct-toast.ct-toast-error {
    border-left-color: #EF4444;
}
.ct-toast.ct-open {
    transform: translateY(0);
    opacity: 1;
}
.ct-toast.ct-closing {
    transform: translateY(-20px);
    opacity: 0;
}
.ct-body {
    flex: 1;
    min-width: 0;
}
.ct-heading {
    font-size: 15px;
    font-weight: 700;
    color: #F8FAFC;
    line-height: 1.3;
}
.ct-sub {
    font-size: 13px;
    color: #94A3B8;
    font-weight: 400;
    margin-top: 4px;
    line-height: 1.3;
}
.ct-sub strong {
    color: #10B981;
    font-weight: 600;
}
.ct-time {
    font-size: 11px;
    color: #475569;
    margin-top: 6px;
}
.ct-close {
    width: 28px;
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: color 0.2s;
    padding: 0;
    margin: -2px -2px 0 8px;
    border-radius: 6px;
    line-height: 1;
    transform: none !important;
}
.ct-close:hover {
    color: #F8FAFC;
    transform: none !important;
}
.ct-close:active {
    transform: none !important;
}

@media (max-width: 480px) {
    #creditToastContainer { max-width: 320px; }
}

/* ========== ADMIN DRAWER (mobile) ========== */
.hamburger-btn {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    transition: all 0.2s;
}
.hamburger-btn:hover { border-color: var(--primary); color: var(--primary); }
.hamburger-btn svg { width: 20px; height: 20px; }

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(2,6,23,0.6);
    z-index: 91;
    opacity: 0;
    transition: opacity 0.3s;
}
.sidebar-backdrop.active { opacity: 1; }

@media (max-width: 768px) {
    .hamburger-btn { display: flex; }
    .sidebar-backdrop { display: block; pointer-events: none; }
    .sidebar-backdrop.active { pointer-events: auto; }
    .sidebar {
        display: block;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.16,1,0.3,1);
        top: 64px;
        bottom: 0;
        width: 264px;
        z-index: 92;
        box-shadow: 8px 0 32px rgba(0,0,0,0.35);
    }
    .sidebar.open { transform: translateX(0); }
}

/* ========== BROADCAST MODAL ========== */
.broadcast-overlay {
    position: fixed;
    inset: 0;
    z-index: 99990;
    background: rgba(2,6,23,0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: bcFadeIn 0.25s ease;
}
@keyframes bcFadeIn { from { opacity: 0; } to { opacity: 1; } }
.broadcast-modal {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: 85vh;
    overflow-y: auto;
    background: var(--card);
    border: 1px solid rgba(59,130,246,0.25);
    border-radius: 18px;
    padding: 28px 24px 24px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.5);
    animation: bcPop 0.35s cubic-bezier(0.16,1,0.3,1);
    text-align: center;
}
@keyframes bcPop { from { opacity: 0; transform: translateY(24px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
.broadcast-modal.bc-hiding { animation: bcHide 0.3s ease forwards; }
@keyframes bcHide { to { opacity: 0; transform: translateY(12px) scale(0.97); } }
.bc-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(51,65,85,0.5);
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.2s;
    padding: 0;
}
.bc-close:hover { background: rgba(239,68,68,0.2); color: #EF4444; }
.bc-poster-wrap { margin: -28px -24px 18px; border-radius: 18px 18px 0 0; overflow: hidden; }
.bc-poster { width: 100%; max-height: 220px; object-fit: cover; display: block; }
.bc-title { font-size: 19px; font-weight: 800; color: var(--text); margin-bottom: 10px; }
.bc-message { font-size: 14px; color: var(--text-secondary); line-height: 1.55; white-space: pre-line; }

/* ========== CHECKBOX PERMISSION CARDS ========== */
.perm-grid { grid-template-columns: repeat(4, 1fr); }
.checkbox-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all 0.2s;
    background: transparent;
    user-select: none;
}
.checkbox-card:hover { border-color: var(--primary); color: var(--text); }
.checkbox-card:has(input:checked) {
    border-color: var(--primary);
    background: rgba(59,130,246,0.1);
    color: var(--text);
}
.checkbox-card input { accent-color: var(--primary); }
@media (max-width: 768px) {
    .perm-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
 * GLOBAL RESPONSIVE HARDENING + TEXT SELECTION (ALL PANELS)
 * ============================================================ */

/* --- Overflow guards: page horizontal scroll kabhi nahi --- */
html, body { max-width: 100%; overflow-x: hidden; }

/* --- Responsive media (images/logos/avatars/banners) --- */
img, video, canvas, iframe { max-width: 100%; height: auto; }
svg { max-width: 100%; }

/* --- Smart wrapping: text/plates kabhi container se bahar na nikle --- */
p, h1, h2, h3, h4, h5, label, td, th, li, code, pre,
.stat-value, .stat-label, .card-title, .page-title, .page-subtitle,
.notif-title, .notif-message, .header-profile-name, .balance-amount {
    overflow-wrap: break-word;
}
code { white-space: normal; }
td, th { max-width: 260px; overflow-wrap: break-word; }

/* --- Tables: sirf container ke andar scroll, page nahi --- */
.table-container { max-width: 100%; -webkit-overflow-scrolling: touch; }

/* --- Text selection: UI text non-selectable; fields selectable --- */
body { user-select: none; -webkit-user-select: none; }
input, textarea, select, [contenteditable="true"] { user-select: text; -webkit-user-select: text; }

/* --- Responsive typography (no browser zoom needed) --- */
.page-title { font-size: clamp(21px, 3.5vw, 28px); }
.card-title { font-size: clamp(17px, 2.6vw, 20px); }
.balance-amount { font-size: clamp(24px, 4vw, 34px); }
.auth-title { font-size: clamp(20px, 4.5vw, 24px); }
.stat-value { font-size: clamp(19px, 3vw, 24px); }
.modal-title { font-size: clamp(17px, 3vw, 20px); }
.header-logo { font-size: clamp(16px, 3vw, 20px); }

/* --- Responsive form/info grids (replaces fixed inline grids) --- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2x { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-fees { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; align-items: end; }

/* --- Tablet (compact spacing) --- */
@media (max-width: 1024px) {
    .grid-2, .grid-3 { column-gap: 16px; row-gap: 16px; }
    .main-content { padding: 24px 20px; }
}

/* --- Small tablet / large phones --- */
@media (max-width: 820px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .page-header { margin-bottom: 20px; }
    .stats-grid { margin-bottom: 20px; gap: 14px; }
}

/* --- Mobile --- */
@media (max-width: 768px) {
    .card { padding: 20px; }
    .modal-content { padding: 24px; }
    .auth-card { padding: 24px 20px; }
    .main-content { padding: 16px 14px 84px; }
    .filter-bar select, .filter-bar input { flex: 1 1 100%; }
    .search-bar { max-width: none; }
}

@media (max-width: 480px) {
    body { font-size: 14px; }
    .card { padding: 16px; }
    .card-title { font-size: 17px; }
    .main-content { padding: 12px 10px 84px; }
    .stats-grid { gap: 10px; margin-bottom: 16px; }
    .page-header { margin-bottom: 16px; }
    .grid-2x { grid-template-columns: 1fr; }
    th, td { padding: 10px 12px; }
    table { font-size: 13px; }
    .btn { padding: 11px 16px; font-size: 14px; }
    .btn-sm { padding: 7px 12px; font-size: 12px; }
    .modal-overlay { padding: 10px; align-items: flex-start; padding-top: 24px; }
    .modal-content { padding: 18px 16px; max-height: 92vh; }
    .auth-page { padding: 12px; }
    .auth-card { padding: 22px 16px; }
    .auth-logo .logo-text { font-size: 24px; }
    .notification-popup { top: 68px; right: 10px; left: 10px; }
    .header { padding: 8px 10px; height: 60px; }
    .header-logo .logo-icon { width: 40px; height: 40px; font-size: 18px; border-radius: 12px; }
    .header-profile { padding: 4px 8px; }
    .header-profile-img { width: 34px; height: 34px; }
    .main-content { margin-top: 60px; }
    .sidebar { top: 60px; }
    .bottom-nav-item .center-icon { width: 56px; height: 56px; }
    .balance-card { padding: 20px; }
}

/* ============================================================
 * PAYMENT SCREENSHOT MODAL - Responsive
 * ============================================================ */
#screenshotModal .modal-content {
    max-width: 560px;
    width: 100%;
    padding: 16px;
}

#screenshotModal img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 8px;
    object-fit: contain;
}

@media (max-width: 480px) {
    #screenshotModal .modal-content {
        max-width: 100%;
        padding: 12px;
        margin: 8px;
    }
    #screenshotModal img {
        max-height: 60vh;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    #screenshotModal .modal-content {
        max-width: 500px;
    }
}
