/* =========================================
    CSS STYLES
/* ========================================= */
:root {
    --bg-dark: #0f111a;
    --card-dark: #1a1d2d;
    --gold: #d4af37;
    --gold-light: #f9d976;
    --text-main: #ffffff;
    --text-muted: #8b92a5;
    --accent: #2962ff;
    --green: #00c853;
    --red: #ff3d00;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
}

/* =========================================
           COMPACT PREMIUM AUTHENTICATION UI
           ========================================= */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    width: 100vw;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1000;
    background: radial-gradient(circle at center, #1a1d2d 0%, #0f111a 100%);
    padding: 20px;
}

.auth-card {
    background: linear-gradient(145deg, #1a1d2d 0%, #11131c 100%);
    padding: 26px 28px;
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(212, 175, 55, 0.25);
    width: 100%;
    max-width: 440px;
    text-align: center;
}

.auth-card .logo {
    width: 56px;
    margin-bottom: 6px;
    filter: drop-shadow(0 0 12px rgba(212, 175, 55, 0.4));
}

.auth-card h2 {
    color: var(--gold);
    margin-bottom: 2px;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.auth-card p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 16px;
}

/* =========================================
           COMPACT INPUT GROUPS
           ========================================= */
.input-group {
    position: relative;
    margin-bottom: 10px;
}

/* Left Icon (Envelope & Lock) */
.input-group i:not(.toggle-password) {
    position: absolute !important;
    left: 15px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: var(--text-muted) !important;
    font-size: 0.95rem !important;
    transition: 0.3s !important;
    pointer-events: none !important;
}

/* Right Eye Icon */
.input-group .toggle-password {
    position: absolute;
    right: 15px;
    left: auto !important;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.95rem;
    z-index: 10;
    transition: color 0.3s;
}

.input-group .toggle-password:hover {
    color: var(--gold);
}

.input-group input {
    width: 100%;
    padding: 12px 14px 12px 44px !important;
    background: rgba(0, 0, 0, 0.5) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    border-radius: 10px;
    outline: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.input-group input:focus {
    border-color: var(--gold) !important;
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.15);
}

.input-group input:focus+i {
    color: var(--gold);
}

.input-group input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px #11131c inset !important;
    -webkit-text-fill-color: white !important;
}

/* =========================================
           COMPACT FORM & BUTTONS
           ========================================= */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    align-items: stretch;
    text-align: left;
}

.auth-form .btn.primary {
    width: 100% !important;
    padding: 12px !important;
    border-radius: 10px !important;
    font-size: 0.95rem !important;
    margin-top: 4px !important;
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%) !important;
    border: none !important;
    color: #0c0e15 !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px !important;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.25) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
}

.auth-form .btn.primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.45) !important;
    filter: brightness(1.05);
}

.auth-form .btn.primary:active {
    transform: translateY(1px) !important;
}

.btn-google {
    background: white !important;
    color: #444 !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    transition: 0.3s !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 14px !important;
    width: 100%;
}

.btn-google:hover {
    background: #f8f9fa !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
    transform: translateY(-2px);
}

.google-icon {
    width: 18px;
    height: 18px;
}

.auth-switch {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-top: 14px;
    text-align: center;
}

.auth-switch span {
    color: var(--gold);
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}

.auth-switch span:hover {
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin: 12px 0;
    letter-spacing: 0.5px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.divider:not(:empty)::before {
    margin-right: .5em;
}

.divider:not(:empty)::after {
    margin-left: .5em;
}

/* =========================================
           GOLD PREMIUM AUTH BUTTONS (STRETCHED)
           ========================================= */

/* Fixes the horizontal squeezing of inputs */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    align-items: stretch;
    text-align: left;
}

.auth-form .btn.primary {
    width: 100% !important;
    /* Forces the button to stretch full width */
    padding: 16px !important;
    border-radius: 12px !important;
    font-size: 1.05rem !important;
    margin-top: 10px !important;
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%) !important;
    border: none !important;
    color: #0c0e15 !important;
    /* Dark blue-black for high contrast and luxury feel */
    font-weight: 700 !important;
    letter-spacing: 0.5px !important;
    box-shadow: 0 5px 20px rgba(212, 175, 55, 0.25) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
}

.auth-form .btn.primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.5) !important;
    filter: brightness(1.05);
    /* Slight bright glow on hover */
}

.auth-form .btn.primary:active {
    transform: translateY(1px) !important;
    /* Click down animation */
}

.btn-google {
    background: white !important;
    color: #444 !important;
    border: none !important;
    border-radius: 12px !important;
    font-size: 1.05rem !important;
    font-weight: 600 !important;
    transition: 0.3s !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px !important;
    width: 100%;
}

.btn-google:hover {
    background: #f8f9fa !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2) !important;
    transform: translateY(-2px);
}

.google-icon {
    width: 22px;
    height: 22px;
}

.auth-switch {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 25px;
}

.auth-switch span {
    color: var(--gold);
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}

.auth-switch span:hover {
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 20px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.divider:not(:empty)::before {
    margin-right: .5em;
}

.divider:not(:empty)::after {
    margin-left: .5em;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar & Navigation */
.sidebar {
    width: 260px;
    background-color: var(--card-dark);
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(212, 175, 55, 0.2);
    overflow-y: auto;
}

.logo-container {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    width: 70px;
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.5));
}

.logo-container h2 {
    color: var(--gold);
    margin-top: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    font-size: 1.2rem;
}

.nav-links {
    list-style: none;
    width: 100%;
}

.nav-links li {
    padding: 12px 15px;
    margin-bottom: 5px;
    cursor: pointer;
    border-radius: 8px;
    color: var(--text-muted);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 500;
}

.nav-links li .icon-text {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-links li:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-links li.active-tab {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.15) 0%, transparent 100%);
    color: var(--gold);
    border-left: 3px solid var(--gold);
}

/* Sub-directories (Dropdowns) */
.sub-menu {
    display: none;
    list-style: none;
    padding-left: 15px;
    margin-bottom: 5px;
    animation: slideDown 0.3s ease;
}

.sub-menu.open {
    display: block;
}

.sub-menu li {
    display: flex !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    align-items: center !important;
    padding: 10px 15px;
    font-size: 0.9rem;
    color: var(--text-muted);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    margin-bottom: 2px;
}

.sub-menu li:hover {
    color: var(--gold);
    border-left: 1px solid var(--gold);
    background: transparent;
}

.sub-menu li.active-tab {
    color: var(--gold);
    border-left: 2px solid var(--gold);
    background: transparent;
}

.chevron {
    transition: transform 0.3s;
    font-size: 0.8rem;
}

.chevron.rotate {
    transform: rotate(180deg);
    color: var(--gold);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 20px 40px;
    overflow-y: auto;
    scrollbar-gutter: stable;
    /* Keeps the workspace perfectly stable during transitions */
    background: var(--bg-dark);
}

header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 20px;
    position: sticky;
    top: 0;
    z-index: 999;
    padding: 10px 0;
    margin-top: -10px;
    pointer-events: none;
    /* Allows clicks to pass through the empty transparent space */
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--card-dark);
    padding: 8px 20px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    pointer-events: auto;
    /* Reactivates clicking for your profile, bell, and logout button */
}

.user-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    object-fit: cover;
}

.badge {
    background: rgba(212, 175, 55, 0.2);
    color: var(--gold-light);
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: bold;
}

/* View Switching */
.view {
    display: none;
    animation: fadeIn 0.4s ease;
}

.view.active-view {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cards & Buttons */
.card {
    background: var(--card-dark);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 20px;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.btn.primary {
    background: linear-gradient(45deg, var(--gold), #b8860b);
    color: #000;
}

.btn.primary:hover {
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
    transform: translateY(-2px);
}

.btn.secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* =========================================
           FORMS & INPUTS (UPDATED)
           ========================================= */
.main-content input[type="text"],
.main-content input[type="email"],
.main-content input[type="password"],
.main-content input[type="date"],
.main-content input[type="number"],
.main-content select {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    background: #0f111a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 10px;
    outline: none;
    box-sizing: border-box;
    /* Ensures standard padding sizing */
}

input:focus,
select:focus {
    border-color: var(--gold);
}

/* Style the live verification badges inside status containers */
#contact-verify-status .badge,
#send-verify-status .badge {
    padding: 4px 10px !important;
    font-size: 11px !important;
    border-radius: 6px !important;
    font-weight: 700 !important;
    margin-left: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    vertical-align: middle !important;
}

/* GLOBAL DASHBOARD STYLES */
.stats-grid {
    display: grid;
    /* Forces exactly 4 equal-width columns */
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

/* Prevents the cards from squishing on smaller laptop or tablet screens */
@media (max-width: 1300px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-box {
    background: linear-gradient(145deg, #1a1d2d 0%, #11131c 100%);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    text-align: center;
}

.stat-box h4 {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-box h2 {
    color: var(--gold);
    font-size: 1.8rem;
}

/* Prevent table column drift on zoom */
table {
    table-layout: fixed !important;
    width: 100% !important;
}

/* Layout for Charts */
.charts-grid {
    display: grid;
    grid-template-columns: minmax(250px, 1fr) minmax(400px, 2fr);
    gap: 20px;
    margin-bottom: 20px;
    min-height: 260px;
}

.chart-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    height: 100%;
}

.mock-chart {
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at bottom left, rgba(212, 175, 55, 0.1) 0%, transparent 70%);
    border-bottom: 2px solid var(--gold);
    position: absolute;
    bottom: 0;
    clip-path: polygon(0% 100%, 0% 80%, 10% 85%, 20% 60%, 30% 70%, 40% 40%, 50% 50%, 60% 20%, 70% 30%, 80% 10%, 90% 15%, 100% 0%, 100% 100%);
    opacity: 0.5;
}

.ad-space {
    width: 100%;
    height: 90px;
    background: linear-gradient(45deg, #2a0845, #6441A5);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
    border: 1px dashed rgba(255, 255, 255, 0.3);
    cursor: pointer;
}

/* MY WALLET STYLES */
.wallet-header {
    text-align: center;
    background: linear-gradient(145deg, #1a1d2d 0%, #11131c 100%);
    border: 1px solid rgba(212, 175, 55, 0.3);
    position: relative;
    overflow: hidden;
    padding: 40px 40px 60px 40px;
    border-radius: 20px;
    margin-bottom: 20px;
}

.gold-text {
    font-size: 3.5rem;
    margin: 10px 0;
    background: linear-gradient(to right, var(--gold), var(--gold-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.wallet-address-box {
    background: rgba(0, 0, 0, 0.4);
    padding: 15px 25px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 15px;
}

.address-text {
    font-family: monospace;
    font-size: 1.2rem;
    color: var(--text-muted);
    letter-spacing: 2px;
}

.transfer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Profile Layout */
.profile-upload-section {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 15px;
}

.profile-upload-section img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--gold);
}

/* Chat Layout */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 65vh;
}

.chat-box {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-message {
    max-width: 100%;
    padding: 12px 18px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.95rem;
}

.chat-message.self {
    align-self: flex-end;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-bottom-right-radius: 2px;
}

.chat-message.other {
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.chat-input {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.chat-input input {
    flex: 1;
    margin: 0;
}

/* Exchange Layout */
.exchange-rates {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.rate-box {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.rate-box h3 {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 10px;
}

.rate-box .price {
    font-size: 1.8rem;
    color: var(--gold);
    font-weight: bold;
}

/* =========================================
           QR SCANNER UI FIX
           ========================================= */
#reader {
    border: none !important;
    background: transparent !important;
}

#reader button {
    background: linear-gradient(45deg, var(--gold), #b8860b) !important;
    color: #000 !important;
    padding: 10px 20px !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    margin-bottom: 10px !important;
}

#reader a {
    color: var(--text-muted) !important;
    text-decoration: none !important;
    font-size: 0.9rem !important;
}

#reader a:hover {
    color: var(--gold) !important;
}

#reader span {
    color: var(--text-main) !important;
}

/* =========================================
        AT COIN PREMIUM CUSTOM MODAL
        ========================================= */
.alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 17, 26, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000000;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.alert-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.alert-box {
    background: linear-gradient(145deg, #1a1d2d 0%, #11131c 100%);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 20px;
    padding: 35px 25px;
    width: 90%;
    max-width: 380px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85);
    transform: scale(0.85);
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.2);
}

.alert-overlay.show .alert-box {
    transform: scale(1);
}

.alert-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 12px rgba(212, 175, 55, 0.2));
}

.alert-title {
    color: var(--text-main);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.alert-message {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 25px;
}

.alert-btn {
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
    border: none;
    color: #0c0e15;
    padding: 14px 28px;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    box-shadow: 0 5px 20px rgba(212, 175, 55, 0.2);
    transition: all 0.3s ease;
    width: 100%;
    letter-spacing: 0.5px;
}

.alert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
}

.alert-btn:active {
    transform: translateY(1px);
}

/* Keep main directory headers gold when hovered or open */
.nav-item.has-submenu:hover {
    color: var(--gold) !important;
}

.nav-item.has-submenu.menu-open {
    color: var(--gold) !important;
    background: rgba(255, 255, 255, 0.02);
}

/* =========================================
           PREMIUM ORBITAL LOADER STYLES
           ========================================= */
.loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, #1a1d2d 0%, #0f111a 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 15000;
    /* Overlays authentication screen on initial load */
    opacity: 1;
    transition: opacity 0.6s cubic-bezier(0.25, 1, 0.5, 1), transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Smooth fade-out once Firebase state is determined */
.loader-wrapper.fade-out {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.05);
}

/* 1. Scale up the orbital path ring */
.orbit-ring {
    position: absolute;
    width: 300px;
    /* Increased from 220px */
    height: 300px;
    /* Increased from 220px */
    border: 1.5px dashed rgba(212, 175, 55, 0.2);
    /* Thicker line */
    border-radius: 50%;
    z-index: 1;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.03) inset;
}

/* 2. Scale up the rotating container */
.orbit-container {
    position: absolute;
    width: 300px;
    /* Increased from 220px */
    height: 300px;
    /* Increased from 220px */
    z-index: 2;
    animation: orbit-spin 22s linear infinite;
}

/* 3. Scale up individual icons and adjust their orbit distance */
.orbit-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 52px;
    /* Increased from 38px */
    height: 52px;
    /* Increased from 38px */
    margin-top: -26px;
    /* Centered accurately on the ring (half of 52px) */
    margin-left: -26px;
    /* Centered accurately on the ring (half of 52px) */
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 17, 26, 0.95);
    border: 1.5px solid rgba(212, 175, 55, 0.4);
    color: var(--gold-light);
    border-radius: 50%;
    font-size: 1.35rem;
    /* Larger icon icon size (from 1rem) */
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.6), 0 0 15px rgba(212, 175, 55, 0.15);

    /* Orbit translation radius expanded to -150px (half of the 300px ring) */
    transform: rotate(calc(360deg / 7 * var(--i))) translateY(-150px) rotate(calc(-360deg / 7 * var(--i)));
}

/* Upright counter-rotation to keep the icons always facing up */
.orbit-icon i {
    animation: icon-upright-counter 22s linear infinite;
}

/* Centered floating AT Coin logo */
.loader-center {
    position: absolute;
    width: 125px;
    /* Increased from 85px */
    height: 125px;
    /* Increased from 85px */
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-coin {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 18px rgba(212, 175, 55, 0.5));
    animation: coin-pulse 2s ease-in-out infinite alternate;
}

/* Soft gold pulse on status text */
.loader-text {
    margin-top: 35px;
    color: var(--text-muted);
    font-size: 1rem;
    letter-spacing: 2px;
    font-weight: 500;
    text-transform: uppercase;
    text-align: center;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
}

.loader-text span {
    color: var(--gold);
    font-weight: bold;
    animation: dot-blink 1.4s infinite both;
}

.loader-text span:nth-child(2) {
    animation-delay: .2s;
}

.loader-text span:nth-child(3) {
    animation-delay: .4s;
}

/* =========================================
           KEYFRAME ANIMATIONS
           ========================================= */
@keyframes orbit-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes icon-upright-counter {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(-360deg);
    }
}

@keyframes coin-pulse {
    0% {
        transform: scale(0.96);
        filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.45));
    }

    100% {
        transform: scale(1.04);
        filter: drop-shadow(0 0 30px rgba(212, 175, 55, 0.8));
    }
}

@keyframes dot-blink {
    0% {
        opacity: .2;
    }

    20% {
        opacity: 1;
    }

    100% {
        opacity: .2;
    }
}

/* =========================================
           DASHBOARD STANDING & STATUS DOTS
           ========================================= */
.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
    background-color: var(--green);
    box-shadow: 0 0 8px var(--green);
    margin-left: 8px;
    animation: pulse-dot 1.5s infinite alternate;
    transition: all 0.3s ease;
}

.status-dot.offline {
    background-color: var(--red);
    box-shadow: 0 0 8px var(--red);
}

@keyframes pulse-dot {
    0% {
        transform: scale(0.85);
        opacity: 0.65;
    }

    100% {
        transform: scale(1.1);
        opacity: 1;
    }
}

.status-btn {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--green);
    color: var(--green);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 0 10px rgba(0, 200, 83, 0.08);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.status-btn:hover {
    transform: translateY(-2px);
    background: rgba(0, 200, 83, 0.12);
    box-shadow: 0 0 15px rgba(0, 200, 83, 0.25);
}

.status-btn.warning {
    border-color: #ffa000;
    color: #ffa000;
    box-shadow: 0 0 10px rgba(255, 160, 0, 0.08);
}

.status-btn.warning:hover {
    background: rgba(255, 160, 0, 0.12);
    box-shadow: 0 0 15px rgba(255, 160, 0, 0.25);
}

.status-btn.banned {
    border-color: var(--red);
    color: var(--red);
    box-shadow: 0 0 10px rgba(255, 61, 0, 0.08);
}

.status-btn.banned:hover {
    background: rgba(255, 61, 0, 0.12);
    box-shadow: 0 0 15px rgba(255, 61, 0, 0.25);
}

/* Dynamic Payment Instruction box */
.payment-instructions {
    background: rgba(0, 0, 0, 0.25);
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 15px;
    border-left: 3px solid var(--gold);
    line-height: 1.45;
}

/* Premium dropdown for years */
.year-filter-select {
    background: rgba(0, 0, 0, 0.3) !important;
    color: var(--gold) !important;
    border: 1px solid var(--gold) !important;
    border-radius: 6px !important;
    padding: 4px 10px !important;
    font-size: 0.75rem !important;
    cursor: pointer;
    outline: none;
}

.year-filter-select option {
    background: var(--card-dark) !important;
    color: var(--text-main) !important;
}

.live-badge {
    background: rgba(0, 200, 83, 0.15) !important;
    color: var(--green) !important;
    padding: 5px 15px !important;
    border-radius: 20px !important;
    font-size: 0.75rem !important;
    font-weight: bold !important;
    min-width: 120px !important;
    /* Forces it to stretch */
    text-align: center !important;
    display: inline-block !important;
    margin-bottom: 15px;
}


.live-data {
    background: rgba(212, 175, 55, 0.15) !important;
    color: var(--gold) !important;
    padding: 5px 15px !important;
    border-radius: 20px !important;
    font-size: 0.75rem !important;
    font-weight: bold !important;
    min-width: 120px !important;
    /* Forces it to stretch */
    text-align: center !important;
    display: inline-block !important;
    margin-bottom: 15px;
}

/* Crop only the TradingView link/logo off the right edge of the ticker tape */
#dashboard .tradingview-widget-container {
    position: relative;
    overflow: hidden;
    width: 100%;
}

#dashboard .tradingview-widget-container iframe {
    width: calc(100% + 112px) !important;
}

/* Force the select box to match your input fields */
#noti-user-select {
    width: 100% !important;
    padding: 15px !important;
    background: #0f111a !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    border-radius: 10px !important;
    outline: none !important;
    cursor: pointer !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

/* Style the dropdown options themselves */
#noti-user-select option {
    background-color: #1a1d2d !important;
    color: white !important;
    padding: 10px !important;
}

/* Updated Modal Container */
#liveness-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 20000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.camera-frame {
    width: 300px;
    height: 300px;
    border: 4px solid var(--gold);
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    background: #000;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================
           PREMIUM VIRTUAL CREDIT CARD
           ========================================= */
.at-virtual-card {
    width: 400px;
    /* Slightly wider to fit the numbers */
    height: 240px;
    /* Slightly taller to give breathing room */
    background: linear-gradient(135deg, #1a1d2d 0%, #0a0c13 100%);
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(212, 175, 55, 0.05);
    position: relative;
    overflow: hidden;
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex-shrink: 0;
    margin: 0 auto;
}

.at-virtual-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 60px rgba(212, 175, 55, 0.15), inset 0 0 30px rgba(212, 175, 55, 0.1);
}

/* Large Faint Watermark Logo on the Right */
.card-watermark {
    position: absolute;
    right: -40px;
    bottom: -40px;
    width: 220px !important;
    opacity: 0.06;
    pointer-events: none;
    filter: grayscale(100%);
    z-index: 1;
}

/* Scattered Small Watermark Coins */
.small-watermark {
    position: absolute;
    opacity: 0.18;
    /* High enough to be visible, low enough to blend in */
    filter: grayscale(100%);
    /* This matches the exact color of the big logo! */
    pointer-events: none;
    z-index: 1;
}

.sw-1 {
    width: 35px !important;
    top: 25%;
    left: 35%;
}

.sw-2 {
    width: 25px !important;
    top: 46%;
    left: 33%;
}

.sw-3 {
    width: 40px !important;
    top: 15%;
    left: 55%;
}

.sw-4 {
    width: 30px !important;
    top: 45%;
    left: 50%;
}

.sw-5 {
    width: 45px !important;
    top: 70%;
    left: 45%;
}

.sw-6 {
    width: 24px !important;
    top: 38%;
    left: 22%;
}

/* Top Row: Small Logo + Brand */
.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 2;
}

.card-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-brand img {
    width: 45px !important;
    height: auto !important;
}

.card-brand span {
    color: #ffffff !important;
    font-weight: 800 !important;
    letter-spacing: 2px !important;
    font-size: 1.1rem !important;
}

.card-type {
    color: #d4af37 !important;
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    letter-spacing: 2px !important;
    font-weight: bold !important;
}

/* EMV Gold Chip */
.card-chip {
    width: 45px;
    height: 35px;
    min-height: 35px;
    /* Forces browser to NEVER squash it */
    flex-shrink: 0;
    /* Prevents flexbox from flattening it */
    background: linear-gradient(135deg, #f9d976 0%, #b8860b 100%);
    border-radius: 6px;
    position: relative;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.2);
    margin-top: 15px;
}

.card-chip::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    background: rgba(0, 0, 0, 0.3);
    top: 30%;
}

.card-chip::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    background: rgba(0, 0, 0, 0.3);
    top: 70%;
}

/* Card Numbers */
.card-number {
    font-family: 'Courier New', Courier, monospace !important;
    font-size: 1.45rem !important;
    /* Scaled down slightly to fit */
    color: #ffffff !important;
    letter-spacing: 3px !important;
    /* Tightened spacing slightly */
    font-weight: 700 !important;
    /* <-- ADDED: Makes the numbers bold & embossed */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8) !important;
    z-index: 2;
    margin-top: 15px;
    text-align: left !important;
    white-space: nowrap !important;
    /* Forces the numbers to stay on ONE line */
}

/* Bottom Row: Name and Expiry */
.card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    z-index: 2;
}

.card-holder {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.card-label {
    color: #8b92a5 !important;
    font-size: 0.6rem !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    margin-bottom: 3px !important;
}

.card-name {
    color: #ffffff !important;
    font-size: 1.1rem !important;
    text-transform: uppercase !important;
    letter-spacing: 2px !important;
    font-weight: 600 !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8) !important;
}

.card-expiry {
    color: #ffffff !important;
    font-size: 0.9rem !important;
    font-family: 'Courier New', Courier, monospace !important;
    font-weight: bold !important;
}

/* Frosted Glass Lock Overlay for Level 1 */
.card-lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 17, 26, 0.85);
    /* Dark translucent background */
    backdrop-filter: blur(6px);
    /* Frosted glass effect */
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
}

.card-lock-overlay:hover {
    background: rgba(15, 17, 26, 0.7);
    color: var(--gold);
}

.card-lock-overlay i {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.card-lock-overlay span {
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Constrain high-res QR codes on screen to keep them sharp and properly sized */
#qrcode-container img,
#qrcode-container canvas {
    width: 130px !important;
    height: 130px !important;
    display: block;
}

#card-back-qr img,
#card-back-qr canvas {
    width: 65px !important;
    /* Increased from 50px to match the new 75px box with padding */
    height: 65px !important;
    /* Increased from 50px to match the new 75px box with padding */
    display: block;
}


/* VIP / Business Level 3 Card - Updated with Custom Background */
.at-virtual-card.vip {
    background-image: url('https://firebasestorage.googleapis.com/v0/b/at-coin-bdc49.firebasestorage.app/o/cardlogo%2Fbusiness-card-back.webp?alt=media&token=08fdb7df-3108-40d8-a91d-b98056da2b30') !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5) !important;
}

.at-virtual-card.vip .card-brand span,
.at-virtual-card.vip .card-number,
.at-virtual-card.vip .card-name,
.at-virtual-card.vip .card-expiry {
    color: #0f111a !important;
    /* Dark blue/black text */
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5) !important;
    /* White glowing shadow instead of black */
}

.at-virtual-card.vip .card-label {
    color: #333333 !important;
    font-weight: 800 !important;
}

.at-virtual-card.vip .card-type {
    color: #0f111a !important;
    font-weight: 900 !important;
    letter-spacing: 3px !important;
    /* Matches the clean, subtle embossed edge of the AT COIN logo and numbers */
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5) !important;
}

/* Make watermarks crisp and etched into the gold */
.at-virtual-card.vip .small-watermark,
.at-virtual-card.vip .card-watermark {
    filter: grayscale(100%) contrast(150%) !important;
    /* Removes color but keeps the sharp details */
    mix-blend-mode: multiply !important;
    /* Burns the coin's details naturally into the gold */
    opacity: 0.12 !important;
    /* Perfect etching transparency */
}

/* Platinum/Silver EMV chip for the Gold card */
.at-virtual-card.vip .card-chip {
    background: linear-gradient(135deg, #ffffff 0%, #b0bec5 100%) !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3) !important;
}

/* Premium / Silver Level 2 Card - Updated with Custom Background */
.at-virtual-card.premium {
    background-image: url('https://firebasestorage.googleapis.com/v0/b/at-coin-bdc49.firebasestorage.app/o/cardlogo%2Fpremiumsilvercard.jpg?alt=media&token=ce1fb338-1691-4dbb-aef1-f9f6e3d99f40') !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6) !important;
}

/* Style text/details beautifully to ensure high readability on the silver card */
.at-virtual-card.premium .card-brand span,
.at-virtual-card.premium .card-number,
.at-virtual-card.premium .card-name,
.at-virtual-card.premium .card-expiry {
    color: #11131c !important;
    /* Elegant slate dark text */
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6) !important;
}

.at-virtual-card.premium .card-label {
    color: #4a4a4a !important;
    font-weight: 800 !important;
}

.at-virtual-card.premium .card-type {
    color: #1a237e !important;
    /* Deep royal blue for PREMIUM type contrast */
    font-weight: 900 !important;
    letter-spacing: 3px !important;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5) !important;
}

.at-virtual-card.premium .support-text {
    color: #333333 !important;
    font-weight: 600;
}

.at-virtual-card.premium .small-watermark,
.at-virtual-card.premium .card-watermark {
    filter: grayscale(100%) contrast(120%) !important;
    mix-blend-mode: multiply !important;
    opacity: 0.15 !important;
}

/* Gold EMV chip for a luxurious contrast on the silver background */
.at-virtual-card.premium .card-chip {
    background: linear-gradient(135deg, #f9d976 0%, #b8860b 100%) !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4) !important;
}

/* 3D FLIP CONTAINER */
.flip-card-container {
    width: 400px;
    height: 240px;
    perspective: 1000px;
    margin: 0 auto;
    flex-shrink: 0;
    cursor: pointer;
    /* Tells the user they can click it */
}

.flip-card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Bouncy smooth flip */
    transform-style: preserve-3d;
}

/* When we add the 'is-flipped' class, it rotates */
.flip-card-container.is-flipped .flip-card-inner {
    transform: rotateY(180deg);
}

/* Position both sides */
.at-virtual-card.front,
.at-virtual-card.back {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    backface-visibility: hidden;
    /* Hides the back when looking at the front */
    margin: 0 !important;
}

/* BACK OF CARD STYLES */
.at-virtual-card.back {
    transform: rotateY(180deg);
    padding: 0 !important;
    /* Edge to edge for the mag stripe */
    display: flex;
    flex-direction: column;
}

.mag-stripe {
    width: 100%;
    height: 45px;
    background: #000;
    margin-top: 25px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.back-content {
    padding: 15px 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1;
}

.signature-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.signature-strip {
    background-color: #e0e0e0;
    /* Replace failing gradient with a 100% canvas-supported SVG stripe pattern */
    background-image: url("data:image/svg+xml,%3Csvg width='8' height='8' viewBox='0 0 8 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M-2 10L10 -2M-2 2L2 -2M6 10L10 6' stroke='%23cccccc' stroke-width='2'/%3E%3C/svg%3E");
    height: 35px;
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0 10px;
    font-family: 'Brush Script MT', 'Segoe Print', cursive;
    /* Looks like handwriting */
    font-size: 1.2rem;
    color: #333;
    border-radius: 4px;
}

.cvv-box {
    background-color: #ffffff !important;
    /* Force pure white for canvas */
    height: 35px;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: #000000 !important;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    font-size: 1rem;
    /* Replace failing inset shadow with a solid inner border */
    border: 1px solid #b0bec5;
    box-shadow: none !important;
    position: relative;
    z-index: 2;
}

.back-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: auto;
    margin-bottom: 10px;
}

.support-text {
    color: #8b92a5;
    font-size: 0.65rem;
    max-width: 65%;
    line-height: 1.5;
}

.at-virtual-card.vip .support-text {
    color: #333 !important;
    font-weight: 600;
}

.small-qr-box {
    width: 75px;
    /* Increased from 60px */
    height: 75px;
    /* Increased from 60px */
    background: #fff;
    padding: 5px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================
           FAQ ACCORDION STYLES
           ========================================= */
.faq-item {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: rgba(212, 175, 55, 0.3);
}

.faq-question {
    padding: 18px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
}

.faq-question i {
    transition: transform 0.3s ease;
    color: var(--gold);
}

.faq-answer {
    display: none;
    padding: 0 20px 20px 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.6;
    border-top: 1px dashed rgba(255, 255, 255, 0.05);
    margin-top: 5px;
    padding-top: 15px;
}

.faq-item.active .faq-answer {
    display: block;
    animation: fadeIn 0.4s ease;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

/* =========================================
           RICH TEXT LEGAL EDITOR STYLES
           ========================================= */
.editor-toolbar {
    display: flex;
    gap: 8px;
    background: #1a1d2d;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px 12px 0 0;
    border-bottom: none;
    flex-wrap: wrap;
    align-items: center;
}

.editor-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Segoe UI', Tahoma, sans-serif;
}

.editor-btn:hover {
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold);
    border-color: var(--gold);
}

.editor-content {
    background: #0f111a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0 0 12px 12px;
    min-height: 450px;
    padding: 30px;
    color: var(--text-main);
    outline: none;
    overflow-y: auto;
    line-height: 1.7;
    font-size: 0.95rem;
}

.editor-content:focus {
    border-color: var(--gold);
    box-shadow: inset 0 0 15px rgba(212, 175, 55, 0.05);
}

/* Ensure the editor font size dropdown options match the dark theme */
.custom-font-size option {
    background-color: #1a1d2d;
    color: white;
    font-size: 0.9rem;
}

/* Render styles for both the Editor AND User Views */
.legal-dynamic-content h2,
.editor-content h2 {
    color: var(--gold);
    margin: 25px 0 15px 0;
    font-size: 1.4rem;
    font-weight: 800;
}

.legal-dynamic-content h3,
.editor-content h3 {
    color: var(--gold-light);
    margin: 20px 0 10px 0;
    font-size: 1.15rem;
    font-weight: 700;
}

.legal-dynamic-content p,
.editor-content p {
    margin-bottom: 15px;
}

.legal-dynamic-content ul,
.editor-content ul {
    padding-left: 25px;
    margin-bottom: 15px;
    list-style-type: disc;
}

.legal-dynamic-content ol,
.editor-content ol {
    padding-left: 25px;
    margin-bottom: 15px;
    list-style-type: decimal;
}

.legal-dynamic-content a,
.editor-content a {
    color: #2962ff;
    text-decoration: underline;
    font-weight: bold;
    cursor: pointer;
}

.card-locked-ui {
    filter: grayscale(1) brightness(0.7);
    pointer-events: none;
    transition: all 0.3s ease;
}

/* Completely hide all default Google Translate widgets, frames, and bars */
iframe.goog-te-banner-frame,
.goog-te-banner-frame,
.goog-te-balloon-frame,
.skiptranslate,
.goog-te-gadget,
.goog-logo-link,
#google_translate_element,
[class*="VIpgJd"],
[id*="VIpgJd"],
iframe[class*="goog"],
iframe[id*="goog"],
iframe[class*="translate"],
iframe[id*="translate"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0px !important;
    height: 0px !important;
    position: absolute !important;
    top: -9999px !important;
    left: -9999px !important;
}

body {
    top: 0px !important;
    position: static !important;
}

/* Completely hide Google's floating hover bubbles, tooltips, and loading spinners */
#goog-gt-tt,
.goog-te-balloon-frame,
.goog-tooltip,
.goog-tooltip:hover,
.goog-te-spinner-pos,
.goog-te-gadget-icon,
.goog-te-spinner,
.goog-te-spinner-frame {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0px !important;
    height: 0px !important;
}

/* Prevent Google Translate from triggering hover scripts that cause flickering/disappearing text */
font {
    pointer-events: none !important;
}

/* Ensure Google's highlight class never overrides your text color */
.goog-text-highlight {
    background-color: transparent !important;
    box-shadow: none !important;
    color: inherit !important;
}

/* Completely block the Google Translate Chrome Extension icon from showing on your site */
#gtx-trans,
.gtx-trans,
[id*="gtx-trans"],
[class*="gtx-trans"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* =========================================
           CUSTOM SELECT DROPDOWN OPTION STYLES
           ========================================= */
#custom-language-select {
    color: var(--text-muted) !important;
    font-family: 'Segoe UI', sans-serif !important;
    font-weight: 500 !important;
}

#custom-language-select:hover {
    border-color: var(--gold) !important;
    color: var(--gold) !important;
}

#custom-language-select option {
    background-color: #1a1d2d !important;
    color: var(--text-main) !important;
    font-family: 'Segoe UI', sans-serif !important;
    font-size: 0.85rem !important;
    padding: 10px !important;
}

/* =========================================
   DYNAMIC PROMOTION SLIDER & BANNER STYLES
   ========================================= */
.promo-slider-container {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 20px;
    overflow: hidden;
}

.promo-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
    display: block;
    text-decoration: none;
}

.promo-slide.active {
    opacity: 1;
    z-index: 2;
}

.promo-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Dots Indicator (Larger & Glassmorphism) */
.promo-dots-container {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    padding: 6px 14px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.promo-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transition: all 0.3s ease;
    cursor: pointer;
    /* Hand pointer */
}

.promo-dot:hover {
    background: rgba(255, 255, 255, 0.85);
    transform: scale(1.2);
}

.promo-dot.active {
    background: var(--gold);
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.7);
}

/* Dashboard Banner Styling when Active */
.ad-space.active-promo {
    background: linear-gradient(135deg, #1f1b2e 0%, #0d0f18 100%) !important;
    border: 1px solid rgba(212, 175, 55, 0.3) !important;
    padding: 0 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    cursor: pointer;
}

.ad-thumb-item {
    position: relative;
    width: 65px;
    height: 55px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.3);
    flex-shrink: 0;
}

.ad-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ad-thumb-delete {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(255, 61, 0, 0.85);
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* =========================================
   UNIVERSAL DROPDOWN STYLING (BLACK BG & WHITE TEXT)
   ========================================= */
:root,
html,
body,
select,
option,
input,
textarea {
    color-scheme: dark !important;
}

select {
    background-color: #0f111a !important;
    /* Closed input stays dark black */
    color: #ffffff !important;
    /* Closed text stays pure white */
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 8px !important;
    padding: 10px 14px !important;
    outline: none !important;
    cursor: pointer !important;
}

/* Native dropdown list popup items */
select option {
    background-color: #000000 !important;
    color: #f9f9f9 !important;
    /* 100% visible, crisp dark text */
    padding: 10px 14px !important;
}

select option:hover,
select option:focus,
select option:checked {
    background-color: #1a1d2d !important;
    color: var(--gold-light, #f9d976) !important;
}

select option:disabled {
    color: #888888 !important;
}

/* Custom Dark Ticket Dropdown Items */
.custom-ticket-opt {
    padding: 10px 14px;
    color: #ffffff;
    font-size: 0.85rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s, color 0.2s;
}

.custom-ticket-opt:hover {
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold-light);
}

.custom-ticket-opt:last-child {
    border-bottom: none;
}

/* =========================================
   CUSTOM LUXURY MACRO DROPDOWN STYLING
   ========================================= */
.custom-macro-group {
    padding: 8px 14px 4px 14px;
    font-size: 0.72rem;
    font-weight: bold;
    color: var(--gold-light);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    user-select: none;
}

.custom-macro-opt {
    padding: 10px 14px;
    color: #ffffff !important;
    font-size: 0.82rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
}

.custom-macro-opt:hover {
    background: rgba(212, 175, 55, 0.15) !important;
    color: var(--gold-light) !important;
    padding-left: 18px;
}

.custom-macro-opt:last-child {
    border-bottom: none;
}

/* =========================================
   LUXURY PIN LOCKSCREEN STYLES & ANIMATIONS
   ========================================= */
.pin-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(212, 175, 55, 0.4);
    background: transparent;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pin-dot.filled {
    background: var(--gold);
    border-color: var(--gold);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.6);
    transform: scale(1.15);
}

.pin-dot.error {
    background: var(--red) !important;
    border-color: var(--red) !important;
    box-shadow: 0 0 12px rgba(255, 61, 0, 0.8) !important;
}

/* Shake Animation on Wrong PIN */
@keyframes pin-shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-12px);
    }

    40%,
    80% {
        transform: translateX(12px);
    }
}

.pin-shake-anim {
    animation: pin-shake 0.4s ease-in-out;
}

/* Numeric Keypad Buttons */
.pin-key-btn {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 1.4rem;
    font-weight: 700;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    user-select: none;
    outline: none;
}

.pin-key-btn:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--gold);
    color: var(--gold-light);
    transform: scale(1.06);
}

.pin-key-btn:active {
    transform: scale(0.95);
    background: var(--gold);
    color: #0c0e15;
}

.pin-key-btn.secondary-key {
    font-size: 1.1rem;
    color: var(--text-muted);
}

/* =========================================
   PRO LIVE CRYPTO FEED STYLES
   ========================================= */
.crypto-cat-btn {
    background: transparent;
    color: var(--text-muted);
    border: none;
    padding: 5px 12px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.crypto-cat-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.crypto-cat-btn.active {
    background: var(--gold) !important;
    color: #0c0e15 !important;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

/* Pulsing Green Dot */
.crypto-pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #00e676;
    box-shadow: 0 0 8px #00e676;
    animation: pulse-dot 1.5s infinite alternate;
}

/* Micro Live Price Tick Animation (Only flashes text color smoothly) */
.tick-flash-up {
    color: #00e676 !important;
    text-shadow: 0 0 8px rgba(0, 230, 118, 0.4);
    transition: color 0.15s ease;
}

.tick-flash-down {
    color: #ff5252 !important;
    text-shadow: 0 0 8px rgba(255, 82, 82, 0.4);
    transition: color 0.15s ease;
}

/* =========================================
   COLLAPSIBLE SIDEBAR (CLEAN TOGGLE)
   ========================================= */

.sidebar {
    transition: opacity 0.2s ease !important;
    z-index: 1000;
}

/* 1. Hide Sidebar completely when collapsed */
.sidebar.collapsed {
    display: none !important;
}

/* 2. Hide top header hamburger button when sidebar is OPEN */
#sidebar-toggle-btn {
    display: none !important;
    pointer-events: auto !important;
}

/* 3. Show top header hamburger button ONLY when sidebar is COLLAPSED */
.sidebar.collapsed~.main-content #sidebar-toggle-btn {
    display: inline-flex !important;
}

/* =========================================
   LUXURY FILE UPLOAD BUTTON STYLING
   ========================================= */
input[type="file"] {
    background: #0f111a !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 10px !important;
    padding: 8px 10px !important;
    color: var(--text-muted) !important;
    cursor: pointer !important;
    outline: none !important;
    font-size: 0.85rem !important;
}

/* Style the inner "Choose File" button */
input[type="file"]::file-selector-button {
    background: rgba(212, 175, 55, 0.12) !important;
    border: 1px solid rgba(212, 175, 55, 0.35) !important;
    color: var(--gold-light) !important;
    padding: 6px 14px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-size: 0.8rem !important;
    font-weight: bold !important;
    margin-right: 12px !important;
    transition: all 0.25s ease !important;
}

/* Glow effect on hover */
input[type="file"]::file-selector-button:hover {
    background: rgba(212, 175, 55, 0.25) !important;
    border-color: var(--gold) !important;
    color: #ffffff !important;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3) !important;
}

/* =========================================
   MOBILE & TABLET RESPONSIVE ENGINE
   ========================================= */

@media (max-width: 992px) {

    /* Switch 2-column cards to 1 column on tablets */
    .transfer-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 768px) {

    /* 1. Reduce main padding on mobile screens */
    .main-content {
        padding: 15px 12px !important;
    }

    /* 2. Admin Notification Bar: Switch 5 columns to 2 responsive columns */
    #admin-notification-bar {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    /* 3. Charts Grid: Stack vertically instead of forcing 2 wide side-by-side columns */
    .charts-grid {
        grid-template-columns: 1fr !important;
        min-height: auto !important;
    }

    /* 4. Statistics Grid: Switch to 2 columns on mobile */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    /* 5. Header User Info: Compact spacing for mobile header */
    header {
        padding: 5px 0 !important;
        margin-bottom: 15px !important;
    }

    .user-info {
        padding: 6px 12px !important;
        gap: 8px !important;
    }

    .user-info img {
        width: 32px !important;
        height: 32px !important;
    }

    .user-info h4 {
        font-size: 0.8rem !important;
    }

    /* 6. Virtual Card Responsive Scaling */
    .flip-card-container,
    .at-virtual-card {
        max-width: 100% !important;
        width: 100% !important;
    }

    /* 7. Ad Banner Mobile Height */
    .ad-space.full-image-banner {
        height: 220px !important;
    }
}

@media (max-width: 480px) {

    /* Admin Notification Bar: 1 column on small phones */
    #admin-notification-bar {
        grid-template-columns: 1fr !important;
    }

    /* Stats Grid: 1 column for easy reading on small phones */
    .stats-grid {
        grid-template-columns: 1fr !important;
    }
}

/* =========================================
   PRO MOBILE RESPONSIVE & TABLE FIXES
   ========================================= */

@media (max-width: 768px) {

    /* 1. Stop entire screen from shaking or drifting horizontally */
    body,
    .app-container,
    .main-content {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    /* 2. Compact workspace padding for mobile viewports */
    .main-content {
        padding: 12px 8px !important;
    }

    /* 3. Compact card containers */
    .card {
        padding: 15px 12px !important;
        border-radius: 12px !important;
        margin-bottom: 15px !important;
    }

    /* 4. Fix Admin Floating Bar: Stack as 1 clean full-width column */
    #admin-notification-bar {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    /* 5. FIX TABLES: Force min-width so text NEVER squishes or overlaps! */
    table {
        table-layout: auto !important;
        min-width: 680px !important;
        /* Enables smooth horizontal swipe instead of text wrapping */
    }

    th,
    td {
        font-size: 0.75rem !important;
        padding: 10px 8px !important;
        white-space: nowrap !important;
    }

    /* 6. FIX CARDS & KPI GRIDS: Stack 3-column & 4-column cards into 1 column on mobile */
    div[style*="grid-template-columns: 1fr 1fr 1fr"],
    div[style*="grid-template-columns: repeat(3, 1fr)"],
    div[style*="grid-template-columns: repeat(4, 1fr)"] {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    /* 7. Filter Buttons Bar: Smooth finger swipe on mobile */
    div[style*="filter-standing-all"] {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        padding-bottom: 8px !important;
        -webkit-overflow-scrolling: touch;
    }

    /* 8. Full-screen Modal Fit on Mobile */
    #admin-profile-modal>div,
    #ghost-manager-modal>div,
    #modal-create-ticket>div,
    #modal-ticket-thread>div,
    #kyc-canvas-modal>div {
        width: 98% !important;
        padding: 15px !important;
        max-height: 95vh !important;
    }

    /* 📈 Fix Chart.js Canvas Height Loop on Mobile */
    .charts-grid .card {
        height: auto !important;
    }

    .charts-grid div[style*="position: relative"] {
        height: 240px !important;
        min-height: 240px !important;
    }

    /* 📊 Responsive Chart Card Headers (Title top, Badges/Filters below) */
    .card>div[style*="justify-content: space-between"][style*="align-items: center"] {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }

    /* Stretch the badge + year filter container to 100% width */
    .card>div[style*="justify-content: space-between"]>div[style*="display: flex"] {
        width: 100% !important;
        justify-content: space-between !important;
    }

    /* Fix dropdown sizing on mobile */
    .year-filter-select {
        padding: 6px 12px !important;
        font-size: 0.78rem !important;
        min-width: 100px !important;
    }

    /* 💰 ATC Price Box Spacing & Side-by-Side Rates on Mobile */
    .chart-container {
        padding: 20px 15px !important;
        gap: 15px !important;
    }

    .chart-container p {
        margin-bottom: 15px !important;
        line-height: 1.5 !important;
    }

    /* Force "We Buy At" and "We Sell At" boxes to stay side-by-side in 2 columns */
    .chart-container div[style*="grid-template-columns"] {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    /* 📢 Prevent Text Wrapping on Promo Banner Headline Badge */
    .promo-slider-container div[style*="top:"] {
        max-width: 85% !important;
        padding: 5px 10px !important;
        top: 10px !important;
        left: 10px !important;
    }

    .promo-slider-container div[style*="top:"] span {
        white-space: nowrap !important;
        /* Forces text to stay on 1 single line */
        font-size: 0.72rem !important;
    }

    /* 💳 Wallet Adjuster: Split 3 inputs into 2 spacious rows */
    div[style*="grid-template-columns: 1.2fr 1fr 1.5fr"] {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        /* Row 1: Amount & Currency */
        gap: 10px !important;
    }

    /* Row 2: Transaction Type spans 100% full width */
    div[style*="grid-template-columns: 1.2fr 1fr 1.5fr"]>div:nth-child(3) {
        grid-column: 1 / -1 !important;
    }

    /* =========================================
       ADMIN PROFILE INSPECTOR MODAL (MOBILE FIXES)
       ========================================= */

    /* 1. Modal Shell Fit */
    #admin-profile-modal>div {
        width: 98% !important;
        padding: 15px 10px !important;
    }

    /* 2. Stack 2-column grids (Personal/Address, PIN/Role, ID Front/Back) */
    #admin-profile-modal div[style*="grid-template-columns: 1fr 1fr"],
    #admin-profile-modal div[style*="grid-template-columns: 1.25fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* 3. 3D Liveness Photos: 2 x 2 Grid (Front/Left on Row 1, Right/Up on Row 2) */
    #admin-profile-modal div[style*="grid-template-columns: repeat(4, 1fr)"] {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    /* 4. Standing Action Buttons (Active, Warning, Suspend, Banned): 2 x 2 Grid */
    #admin-profile-modal div[style*="Change Account Standing"] {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }

    #admin-profile-modal div[style*="Change Account Standing"]>div:last-child {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        width: 100% !important;
        gap: 8px !important;
    }

    #admin-profile-modal div[style*="Change Account Standing"]>div:last-child .btn {
        width: 100% !important;
        justify-content: center !important;
        padding: 8px 4px !important;
        font-size: 0.75rem !important;
    }

    /* 5. Header Bars with buttons: Title top, Action Buttons below */
    #admin-profile-modal h4[style*="justify-content: space-between"],
    #admin-profile-modal div[style*="Financial & Capital Inspector"] {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }

    #admin-profile-modal h4[style*="justify-content: space-between"]>span:last-child {
        font-size: 0.7rem !important;
    }

    /* =========================================
       KYC CANVAS INSPECTOR (MOBILE FIXES)
       ========================================= */

    /* 1. Top Toolbar: Stack vertically & allow button wrapping */
    #kyc-canvas-modal>div:first-child {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
        padding: 15px !important;
    }

    #kyc-canvas-modal>div:first-child>div:last-child {
        flex-wrap: wrap !important;
        width: 100% !important;
    }

    #canvas-liveness-tabs {
        flex-wrap: wrap !important;
        width: 100% !important;
        justify-content: flex-start !important;
    }

    /* 2. Hide the long desktop "Scroll wheel... Drag/Pan" instructions to save space */
    #kyc-canvas-modal>div:first-child>div:first-child>span {
        display: none !important;
    }

    /* 3. Quad View (All 4 Angles): Convert 4-columns into a 2x2 Grid */
    #canvas-quad-view {
        grid-template-columns: 1fr 1fr !important;
        /* 2 Columns */
        gap: 10px !important;
        width: 95vw !important;
        /* Fit within mobile screen width */
        margin-top: 10px !important;
    }

    /* 4. Scale down image heights from 420px desktop size to fit mobile screens */
    #canvas-quad-view img {
        height: 160px !important;
    }

    /* =========================================
   STRICT 2-COLUMN FILTER GRID
   ========================================= */

    #user-dir-filter-bar {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        /* 2 equal columns */
        gap: 8px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* "FILTERS:" header label spans across both columns at top */
    #user-dir-filter-bar>span:first-child {
        grid-column: 1 / -1 !important;
        margin-bottom: 2px !important;
    }

    /* Hide the thin vertical divider line on mobile grid */
    #user-dir-filter-bar>.filter-divider {
        display: none !important;
    }

    /* Force all 8 buttons to be 100% equal width in 2 columns */
    #user-dir-filter-bar .standing-filter-btn,
    #user-dir-filter-bar .platform-filter-btn {
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        padding: 8px 4px !important;
        font-size: 0.72rem !important;
        white-space: nowrap !important;
    }
}

/* =========================================
   2-COLUMN ADMIN NOTIFICATION BAR (MOBILE)
   ========================================= */
@media (max-width: 768px) {

    /* Force 2 equal columns on mobile */
    #admin-notification-bar {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
        width: 100% !important;
    }

    /* Compact padding for 2-column cards */
    #admin-notification-bar .stat-box {
        padding: 8px 10px !important;
        border-radius: 10px !important;
    }

    #admin-notification-bar .stat-box h4 {
        font-size: 0.62rem !important;
    }

    #admin-notification-bar .stat-box h2 {
        font-size: 0.85rem !important;
    }

    /* Make the 5th card (Open Demand) span full width at the bottom */
    #admin-notification-bar .stat-box:nth-child(5) {
        grid-column: 1 / -1 !important;
    }
}

@media (max-width: 480px) {

    /* 2-column small grids stack into 1 column on small phones */
    div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
}

/* =========================================
   MY WALLET MOBILE LAYOUT FIXES
   ========================================= */
@media (max-width: 768px) {

    /* 1. Compact Wallet Header & Balance */
    #my-wallet .wallet-header {
        padding: 20px 14px 25px 14px !important;
        gap: 22px !important;
    }

    #my-wallet .gold-text {
        font-size: 2.4rem !important;
    }

    #my-wallet .wallet-address-box {
        width: 100% !important;
        padding: 12px 14px !important;
        justify-content: space-between !important;
        gap: 10px !important;
    }

    #my-wallet .address-text {
        font-size: 0.85rem !important;
        letter-spacing: 1px !important;
        word-break: break-all !important;
    }

    /* 2. Fix Virtual Card Height & Stop QR Code from Overlapping Buttons */
    #my-wallet .wallet-header > div:nth-child(2) {
        width: 100% !important;
    }

    #my-wallet .wallet-header > div:nth-child(2) > div {
        width: 100% !important;
        max-width: 360px !important;
        height: auto !important; /* Allows buttons to stay inside normal flow */
    }

    #my-wallet .flip-card-container {
        width: 100% !important;
        height: 210px !important;
    }

    #my-wallet #card-privacy-overlay {
        height: 210px !important; /* Match mobile card height so buttons stay clickable */
    }

    #my-wallet .at-virtual-card {
        padding: 18px !important;
    }

    #my-wallet .card-number {
        font-size: 1.15rem !important;
        letter-spacing: 2px !important;
    }

    #my-wallet .card-name {
        font-size: 0.95rem !important;
    }

    /* Keep all 4 card action buttons neat on one row */
    #my-wallet .wallet-header > div:nth-child(2) > div > div:last-child {
        gap: 6px !important;
        margin-top: 12px !important;
    }

    #my-wallet .wallet-header > div:nth-child(2) > div > div:last-child .btn {
        padding: 6px 10px !important;
        font-size: 0.72rem !important;
    }

    /* 3. Center the QR Code Column cleanly below the buttons */
    #my-wallet .wallet-header > div:nth-child(3) {
        width: 100% !important;
        align-items: center !important;
        margin-top: 5px !important;
    }

    /* 4. Fix Send / Request Pill Switcher Header */
    #my-wallet .transfer-grid .card > div:first-child {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 10px !important;
    }

    #my-wallet .transfer-grid .card > div:first-child > div {
        width: auto !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
    }
}

/* =========================================
   PROFILE & KYC MOBILE LAYOUT FIXES
   ========================================= */
@media (max-width: 768px) {

    /* 1. Stack Profile Picture Card & Promo Ad Banner vertically */
    #profile > div:first-child {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
        margin-bottom: 15px !important;
    }

    /* 2. Keep "Profile Picture" title & "Terms Accepted" badge on one row */
    #profile > div:first-child > .card:first-child > div:first-child {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        margin-bottom: 15px !important;
    }

    #profile > div:first-child > .card:first-child h2 {
        font-size: 1.15rem !important;
    }

    /* 3. Keep Avatar, Account Status & ACTIVE Button cleanly on ONE row */
    #profile .profile-upload-section {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        flex-wrap: nowrap !important;
        padding: 14px 12px !important;
        gap: 10px !important;
    }

    #profile .profile-upload-section > div:first-child {
        width: auto !important;
        justify-content: flex-start !important;
        gap: 12px !important;
        min-width: 0 !important;
    }

    #profile #profile-preview {
        width: 60px !important;
        height: 60px !important;
    }

    #profile .profile-upload-section > div:first-child > div:last-child > span {
        font-size: 0.65rem !important;
        white-space: nowrap !important;
    }

    #profile #profile-role-badge,
    #profile #profile-level-badge {
        font-size: 0.7rem !important;
        padding: 3px 8px !important;
    }

    #profile #account-standing-btn {
        padding: 6px 10px !important;
        font-size: 0.7rem !important;
        flex-shrink: 0 !important;
    }

    /* 4. Give Promo Ad Card a clean widescreen banner height */
    #profile #profile-ad-card {
        min-height: 200px !important;
        height: 200px !important;
    }

    /* 5. Make Country & Zip stack cleanly and stretch Save button */
    #profile div[style*="grid-template-columns: 2fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    #profile #btn-save-profile {
        width: 100% !important;
        min-width: 0 !important;
    }
}

/* =========================================
   MOBILE & TABLET POP-UP OVERLAY SIDEBAR
   ========================================= */
@media (max-width: 992px) {
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        height: 100vh !important;
        width: 270px !important;
        max-width: 82vw !important;
        z-index: 5000 !important;
        box-shadow: 12px 0 40px rgba(0, 0, 0, 0.85) !important;
        display: flex !important;
        transform: translateX(0);
        opacity: 1;
        transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.2s ease !important;
    }

    /* Smoothly hide off-screen when collapsed */
    .sidebar.collapsed {
        display: flex !important;
        transform: translateX(-110%) !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    /* Keep main content full-width behind the sidebar */
    .main-content {
        width: 100% !important;
        flex: 1 0 100% !important;
    }
}

/* =========================================
   MOBILE HORIZONTAL BREATHING ROOM
   ========================================= */
@media (max-width: 768px) {
    .main-content {
        padding: 16px 18px !important;
        scrollbar-gutter: auto !important; /* Keeps left & right spacing perfectly even */
    }
}

/* =========================================
   ADMIN FIREWALL & IP BLOCKER (MOBILE FIXES)
   ========================================= */
@media (max-width: 768px) {

    /* 1. Stack Blocked IPs & Blocked Domains cards vertically */
    #admin-firewall > div[style*="grid-template-columns: 1.1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    #admin-firewall .card {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    /* 2. Make the top IP Filter & Disposable Filter toggles 2 equal buttons */
    #admin-firewall > div:first-child > div:last-child {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }

    #admin-firewall > div:first-child > div:last-child .btn {
        width: 100% !important;
        justify-content: center !important;
        font-size: 0.72rem !important;
        padding: 8px 6px !important;
    }

    /* 3. Stack Add IP, Test IP, and Add Domain forms cleanly */
    #admin-firewall .card > div[style*="display: flex"][style*="gap: 8px"] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    #admin-firewall .card > div[style*="display: flex"][style*="gap: 8px"] .btn {
        width: 100% !important;
        justify-content: center !important;
    }

    /* 4. Fit Firewall tables cleanly without right-edge clipping */
    #admin-firewall div[style*="max-height: 280px"] {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    #admin-firewall table {
        min-width: 100% !important;
    }

    #admin-firewall #firewall-ips-tbody td,
    #admin-firewall #firewall-domains-tbody td {
        white-space: normal !important;
        word-break: break-word !important;
    }
}

/* =========================================
   PIN LOCKSCREEN KEYPAD (KEEP 3x4 GRID ON MOBILE)
   ========================================= */
@media (max-width: 768px) {
    #pin-lockscreen-overlay {
        overflow-y: auto !important;
        padding: 20px 0 !important;
    }

    #pin-lockscreen-overlay div[style*="grid-template-columns: repeat(3, 1fr)"] {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 12px !important;
    }
}

/* =========================================
   DASHBOARD CHARTS & PRICE CARD (MOBILE FIXES)
   ========================================= */
@media (max-width: 768px) {

    /* 1. Lock charts-grid strictly to screen width (stops Chart.js from stretching it) */
    #dashboard .charts-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100% !important;
        max-width: 100% !important;
        gap: 15px !important;
    }

    #dashboard .charts-grid > *,
    #dashboard .chart-container,
    #dashboard .card {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }

    /* 2. Constrain Chart.js canvases inside their cards */
    #dashboard canvas {
        max-width: 100% !important;
    }

    /* 3. Keep "We Buy At" & "We Sell At" side-by-side even on <= 480px phones */
    #dashboard .chart-container div[style*="grid-template-columns"] {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
        width: 100% !important;
    }

    /* 4. Fix "All Years" dropdown width & align it cleanly with Live Data badge */
    #dashboard .year-filter-select {
        width: auto !important;
        min-width: 95px !important;
        margin-bottom: 0 !important;
    }

    #dashboard .live-data,
    #dashboard .live-badge {
        margin-bottom: 0 !important;
        min-width: auto !important;
    }
}

/* =========================================
   SECURITY & 2FA SETTINGS (MOBILE FIXES)
   ========================================= */
@media (max-width: 768px) {

    /* 1. Stack 2FA and Change Password cards vertically into 1 column */
    #security-settings > div[style*="grid-template-columns: repeat(2, 1fr)"] {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    #security-settings .card {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* 2. Compact inner padding and QR box for mobile */
    #security-settings .card div[style*="padding: 25px"] {
        padding: 16px 14px !important;
        min-height: auto !important;
    }

    #security-settings #2fa-status-title {
        font-size: 0.95rem !important;
    }

    /* 3. Stack PIN setup & PIN change input boxes into 1 column */
    #security-settings #pin-setup-container div[style*="grid-template-columns: 1fr 1fr"],
    #security-settings #pin-change-form-wrapper div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* 4. Stretch buttons to full width on mobile */
    #security-settings #btn-save-wallet-pin {
        width: 100% !important;
        min-width: 0 !important;
    }

    /* 5. Clean layout for PIN management container */
    #security-settings #pin-manage-container > div {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 15px !important;
    }

    #security-settings #pin-manage-container > div > div:last-child {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    #security-settings #pin-manage-container > div > div:last-child .btn {
        width: 100% !important;
        justify-content: center !important;
    }
}

/* =========================================
   SYSTEM INTEGRITY & REPAIR (MOBILE FIXES)
   ========================================= */
@media (max-width: 768px) {

    /* 1. Stack all 3 action buttons full-width */
    #admin-integrity .card > div[style*="display: flex"][style*="gap: 10px"] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        margin-bottom: 20px !important;
    }

    /* 2. Remove the left push on the Deep Clean button & center text */
    #admin-integrity .card > div[style*="display: flex"][style*="gap: 10px"] .btn {
        width: 100% !important;
        margin-left: 0 !important;
        justify-content: center !important;
        padding: 12px 14px !important;
        font-size: 0.85rem !important;
    }

    /* 3. Give the warning box full width & centered text */
    #admin-integrity #integrity-results-container > div:first-child {
        text-align: center !important;
        font-size: 0.85rem !important;
        padding: 12px 14px !important;
    }

    /* 4. Allow smooth horizontal scrolling for the results table */
    #admin-integrity div[style*="max-height: 300px"] {
        max-height: 340px !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    #admin-integrity table {
        min-width: 580px !important; /* Prevents text from being squished */
    }
}