/* NOVA Portal 5.0 - Unified Design System & Mobile UX Optimization */

:root {
    --nova-canvas: #050a14;
    --nova-surface: #111622;
    --nova-surface-card: #171d2c;
    --nova-border: #1e2538;
    --nova-border-highlight: #2e384e;
    --nova-copy: #f8fafc;
    --nova-muted: #94a3b8;
    --nova-gold: #fbbf24;
    --nova-blue: #3b82f6;
    --nova-green: #10b981;
    --nova-red: #ef4444;
}

/* Force Dark Mode Globally */
html, body {
    background-color: var(--nova-canvas) !important;
    color: var(--nova-copy) !important;
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
}

/* Admin & User Layout Surfaces */
.dashboard-body, .admin-dashboard-body, .landing-body {
    background-color: var(--nova-canvas) !important;
    color: var(--nova-copy) !important;
}

.dashboard-sidebar {
    background-color: #111622 !important;
    border-right: 1px solid #1e2538 !important;
}

.dashboard-header {
    background-color: #111622 !important;
    border-bottom: 1px solid #1e2538 !important;
}

.metric-card-box, .deposit-step-box, .recent-deposits-section, .smtp-settings-card {
    background-color: #111622 !important;
    border: 1px solid #1e2538 !important;
    border-radius: 12px !important;
}

/* Table Responsive Mobile Box */
.table-responsive-box {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border: 1px solid #1e2538 !important;
    border-radius: 10px !important;
}

.deposits-table-list th {
    background-color: #171d2c !important;
    color: #94a3b8 !important;
    border-bottom: 1px solid #1e2538 !important;
}

.deposits-table-list td {
    border-bottom: 1px solid #1e2538 !important;
    color: #f8fafc !important;
}

/* Mobile Sidebar Drawer Navigation */
@media (max-width: 768px) {
    .dashboard-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: -280px !important;
        width: 260px !important;
        height: 100vh !important;
        z-index: 9999 !important;
        transition: left 0.3s ease-in-out !important;
        box-shadow: 4px 0 25px rgba(0,0,0,0.5) !important;
    }

    .dashboard-sidebar.active,
    .dashboard-sidebar.mobile-open {
        left: 0 !important;
    }

    .dashboard-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .header-left-toggle {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.6);
        backdrop-filter: blur(4px);
        z-index: 9998;
    }

    .sidebar-overlay.active {
        display: block !important;
    }
}

/* Final responsive shell — shared by user and admin dashboards */
.dashboard-sidebar {
    width: 240px !important;
    height: 100vh !important;
    height: 100dvh !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.dashboard-wrapper {
    width: calc(100% - 240px) !important;
    min-width: 0 !important;
    margin-left: 240px !important;
}

.sidebar-logo {
    min-height: 88px;
    padding: 1.25rem 1.25rem 1rem !important;
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.sidebar-logo img { display: block; max-width: 145px; height: auto !important; }
.sidebar-product-label { flex: 0 0 auto; padding: .2rem 1.25rem .65rem; color: #dbe5f4; font-size: .73rem; font-weight: 750; letter-spacing: .025em; text-transform: uppercase; }
.admin-dashboard-body .sidebar-logo { display: none !important; }
.admin-dashboard-body .sidebar-product-label { padding-top: 1.25rem; }
.user-dashboard-body .sidebar-logo { display: none !important; }
.user-dashboard-body .sidebar-product-label { padding-top: 1.25rem; }
.sidebar-menu { flex: 1 1 auto !important; min-height: 0; margin: 0 !important; padding: .25rem .7rem !important; overflow-x: hidden !important; overflow-y: auto !important; scrollbar-width: thin; }
.sidebar-menu li { width: 100%; }
.sidebar-item-link { width: 100%; min-height: 44px; padding: .68rem .85rem !important; gap: .75rem !important; white-space: nowrap; }
.sidebar-item-link > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.sidebar-icon { width: 22px; flex: 0 0 22px; text-align: center; }

.sidebar-system-card {
    flex: 0 0 auto;
    margin: .75rem;
    padding: .8rem;
    display: grid;
    grid-template-columns: 9px minmax(0, 1fr);
    align-items: center;
    gap: .65rem;
    background: rgba(8,16,29,.72);
    border: 1px solid rgba(126,156,205,.16);
    border-radius: 12px;
}
.system-status-dot { width: 8px; height: 8px; border-radius: 50%; background: #29c97d; box-shadow: 0 0 0 4px rgba(41,201,125,.1), 0 0 12px rgba(41,201,125,.45); }
.sidebar-system-card > div { min-width: 0; display: flex; flex-direction: column; gap: .12rem; }
.sidebar-system-card strong, .sidebar-system-card span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-system-card strong { color: #d9e3f1; font-size: .72rem; line-height: 1.3; }
.sidebar-system-card > div > span { color: #718096; font-size: .64rem; line-height: 1.3; }

.dashboard-header { min-width: 0; gap: 1rem; }
.dashboard-header-context { min-width: 0; display: flex; align-items: center; gap: .65rem; }
.dashboard-header-context > .material-symbols-outlined { flex: 0 0 auto; color: #89a9df; font-size: 1.2rem; }
.dashboard-header-context > div { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.dashboard-header-context strong, .dashboard-header-context span { display: block; white-space: nowrap; }
.dashboard-header-context strong { color: #edf3fb; font-size: .8rem; }
.dashboard-header-context > div > span { margin-top: .14rem; color: #78869a; font-size: .65rem; }
.header-right-user { min-width: 0; }
.dashboard-footer { margin-top: auto; min-height: 58px; display: flex; align-items: center; padding: 0 1.5rem; }

@media (max-width: 900px) {
    .dashboard-sidebar {
        position: fixed !important;
        inset: 0 auto 0 0 !important;
        width: min(82vw, 280px) !important;
        transform: translateX(-105%);
        transition: transform .25s cubic-bezier(.2,.8,.2,1) !important;
        z-index: 9999 !important;
        box-shadow: 16px 0 42px rgba(0,0,0,.48) !important;
    }
    .dashboard-sidebar.active, .dashboard-sidebar.mobile-open { left: 0 !important; transform: translateX(0); }
    .dashboard-wrapper { width: 100% !important; margin-left: 0 !important; }
    .header-left-toggle { display: flex !important; width: 44px; height: 44px; flex: 0 0 44px; align-items: center; justify-content: center; border-radius: 10px; }
    .sidebar-overlay { position: fixed; inset: 0; z-index: 9998; background: rgba(1,5,12,.7); backdrop-filter: blur(4px); }
    .sidebar-overlay.active { display: block !important; }
}

@media (max-width: 520px) {
    .dashboard-header { height: 60px !important; padding: 0 .65rem !important; gap: .45rem; }
    .dashboard-header-context { display: none; }
    .header-right-user { margin-left: auto; }
    .user-card-info { max-width: 132px; padding: .4rem .55rem !important; }
    .user-name-label { max-width: 75px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .dashboard-main-content { width: 100%; min-width: 0; padding-inline: .75rem !important; }
    .dashboard-footer { min-height: 50px; padding: 0 .8rem; font-size: .68rem; }
}

/* Dashboard polish — clear hierarchy, touch-friendly controls and mobile rhythm */
#panel-notifications, #panel-smtp { width: 100%; max-width: 900px; margin-inline: auto; }
.dashboard-panel-view > .panel-title { margin-bottom: .4rem; letter-spacing: -.025em; }
.dashboard-panel-view > .panel-desc { max-width: 720px; line-height: 1.55; }
.notification-settings-grid { gap: .8rem !important; }
.notification-setting {
    min-height: 82px;
    padding: 1rem 1.05rem !important;
    border-color: rgba(126,156,205,.18) !important;
    background: linear-gradient(145deg, rgba(15,25,43,.92), rgba(8,16,29,.96)) !important;
    transition: border-color .18s ease, transform .18s ease, background .18s ease;
}
.notification-setting:hover { border-color: rgba(85,139,226,.48) !important; transform: translateY(-1px); }
.notification-setting strong { font-size: .9rem; line-height: 1.25; }
.notification-setting small { font-size: .73rem; }
.notification-setting:focus-within { outline: 3px solid rgba(59,130,246,.22); outline-offset: 2px; }
.notification-setting i { box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.notification-setting input:checked + i { background: linear-gradient(135deg,#3b82f6,#2563eb); box-shadow: 0 4px 14px rgba(37,99,235,.28); }
.form-btn-db, .smtp-test-btn, .chat-send-btn { touch-action: manipulation; }
.form-input-db, .modal-text-input, .chat-input { max-width: 100%; }

@media (max-width: 900px) {
    .dashboard-header { position: sticky !important; top: 0; z-index: 900; backdrop-filter: blur(18px); }
    .dashboard-main-content { min-height: calc(100dvh - 110px); }
    .sidebar-product-label { padding-top: 1rem !important; }
    .sidebar-item-link { min-height: 48px; border-radius: 10px !important; }
}

@media (max-width: 600px) {
    .dashboard-main-content { padding: 1rem .75rem 2rem !important; }
    .dashboard-panel-view > .panel-title { font-size: clamp(1.45rem, 7vw, 1.8rem) !important; line-height: 1.15; }
    .dashboard-panel-view > .panel-desc { margin-bottom: 1.15rem; font-size: .84rem; }
    .smtp-settings-card { padding: .9rem !important; border-radius: 16px !important; box-shadow: 0 14px 35px rgba(0,0,0,.2); }
    .smtp-card-heading { gap: .7rem; margin-bottom: 1rem; }
    .smtp-heading-icon { width: 40px; height: 40px; border-radius: 11px; }
    .smtp-card-heading h2 { font-size: 1rem; }
    .smtp-card-heading p { font-size: .72rem; line-height: 1.4; }
    .notification-settings-grid { grid-template-columns: 1fr !important; gap: .65rem !important; margin: .85rem 0 !important; }
    .notification-setting { min-height: 72px; padding: .85rem .9rem !important; gap: .7rem !important; }
    .notification-setting strong { font-size: .84rem; }
    .notification-setting small { font-size: .68rem; }
    .notification-setting i { width: 44px; height: 26px; flex-basis: 44px; }
    .notification-privacy-note, .smtp-security-note { font-size: .7rem !important; line-height: 1.45; }
    .smtp-actions { margin-top: .85rem !important; }
    .smtp-actions button { width: 100%; min-height: 48px !important; }
    .table-responsive-box { margin-inline: 0 !important; border-radius: 12px !important; scrollbar-color: #334a72 transparent; }
    .profile-dropdown-menu { max-width: calc(100vw - 1.5rem); }
}

/* Transactions: independent empty state and native mobile cards */
.transactions-table-wrap[hidden], .transactions-empty-state[hidden] { display: none !important; }
.transactions-table-wrap::after { content: none !important; display: none !important; }
.transactions-empty-state { min-height: 170px; padding: 1.5rem; display: grid; place-content: center; justify-items: center; text-align: center; color: #76859a; border: 1px dashed rgba(126,156,205,.18); border-radius: 14px; background: rgba(5,12,24,.42); }
.transactions-empty-state > span { margin-bottom: .65rem; color: #5279bd; font-size: 2.1rem; }
.transactions-empty-state > strong { color: #dce6f5; font-size: 1rem; }
.transactions-empty-state > small { max-width: 340px; margin-top: .4rem; font-size: .76rem; line-height: 1.5; }
.table-scroll-hint { display: none !important; }

/* User-dashboard-only PWA install prompt */
.dashboard-pwa-banner { display: none; }
@media (max-width: 768px) {
    .dashboard-pwa-banner.show { position: fixed; left: 50%; bottom: calc(1rem + env(safe-area-inset-bottom)); z-index: 2500; width: calc(100% - 1.5rem); max-width: 390px; padding: .85rem; display: grid; grid-template-columns: 44px minmax(0,1fr); gap: .7rem; color: #eaf1fb; background: linear-gradient(145deg,rgba(14,25,44,.98),rgba(8,15,29,.99)); border: 1px solid rgba(83,132,224,.38); border-radius: 16px; box-shadow: 0 18px 50px rgba(0,0,0,.56); transform: translateX(-50%); animation: dashboardPwaIn .35s ease both; }
    .dashboard-pwa-icon { width: 44px; height: 44px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg,#3b82f6,#7c3aed); border-radius: 12px; }
    .dashboard-pwa-icon .material-symbols-outlined { font-size: 1.35rem; }
    .dashboard-pwa-copy { min-width: 0; align-self: center; }
    .dashboard-pwa-copy strong, .dashboard-pwa-copy small { display: block; }
    .dashboard-pwa-copy strong { font-size: .86rem; }
    .dashboard-pwa-copy small { margin-top: .15rem; color: #8fa0b8; font-size: .68rem; line-height: 1.35; }
    .dashboard-pwa-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
    .dashboard-pwa-actions button { min-height: 42px; border-radius: 9px; font: 700 .78rem/1 'Inter',sans-serif; cursor: pointer; }
    #dashboard-pwa-install { color: #fff; background: linear-gradient(135deg,#3b82f6,#7c3aed); border: 0; }
    #dashboard-pwa-later { color: #9fadc0; background: rgba(255,255,255,.055); border: 1px solid rgba(126,156,205,.15); }
    @keyframes dashboardPwaIn { from { opacity: 0; transform: translate(-50%,24px); } to { opacity: 1; transform: translate(-50%,0); } }
}

@media (max-width: 700px) {
    .mobile-header-logo { display: block !important; position: absolute !important; left: 50% !important; top: 50% !important; transform: translate(-50%,-50%) !important; z-index: 2; }
    .mobile-header-logo img { display: block; width: 78px !important; height: auto; }
    .dashboard-header > .header-left-toggle, .dashboard-header > .header-right-user { position: relative; z-index: 3; }
    .reference-panel-heading { align-items: flex-start !important; gap: .8rem !important; }
    .reference-panel-heading > div { min-width: 0; }
    .reference-panel-heading .panel-title { font-size: clamp(2rem, 10vw, 2.65rem) !important; line-height: 1.05; }
    .reference-panel-heading .panel-desc { max-width: 100%; font-size: .84rem !important; line-height: 1.55; }
    .statement-download-btn { align-self: flex-end; min-height: 44px; padding: .65rem .9rem !important; white-space: nowrap; }
    .transactions-card { padding: .8rem !important; border-radius: 16px !important; }
    .transactions-table-wrap { overflow: visible !important; border: 0 !important; background: transparent !important; }
    .transactions-table-wrap .deposits-table-list { display: block; width: 100%; min-width: 0 !important; }
    .transactions-table-wrap thead { display: none; }
    .transactions-table-wrap tbody { display: grid; gap: .75rem; width: 100%; }
    .transactions-table-wrap tr { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem 1rem; width: 100%; padding: .9rem; background: rgba(5,12,24,.72); border: 1px solid rgba(126,156,205,.16); border-radius: 13px; }
    .transactions-table-wrap td { display: flex; min-width: 0; padding: 0 !important; border: 0 !important; flex-direction: column; align-items: flex-start; gap: .22rem; overflow-wrap: anywhere; }
    .transactions-table-wrap td::before { content: attr(data-label); color: #6f7e94; font: 650 .62rem/1.2 'Inter',sans-serif; letter-spacing: .045em; text-transform: uppercase; }
    .transactions-table-wrap td:nth-child(4) { grid-column: 1 / -1; padding-top: .65rem !important; border-top: 1px solid rgba(126,156,205,.11) !important; }
    .transactions-table-wrap td:nth-child(5) { position: absolute; top: .8rem; right: .8rem; align-self: start; justify-self: end; }
    .transactions-table-wrap td:nth-child(5)::before { content: none; }
    .transactions-table-wrap tr { position: relative; }
    .transactions-table-wrap td:nth-child(2) { padding-right: 5rem !important; }
    .transactions-table-wrap .deposit-tx-hash { white-space: normal !important; width: 100%; }
    .transactions-table-wrap .deposit-tx-hash > span { max-width: calc(100% - 32px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .transactions-empty-state { min-height: 150px; padding: 1.25rem .9rem; }
}

@media (max-width: 380px) {
    .mobile-header-logo img { width: 66px !important; }
    .transactions-table-wrap tr { padding: .8rem; gap: .65rem .75rem; }
}

/* In-app notification center and investment-cycle visibility */
.header-notification-btn { position:relative; width:42px; height:42px; display:grid; place-items:center; flex:0 0 42px; color:#9db1cd; background:rgba(12,20,35,.8); border:1px solid rgba(126,156,205,.22); border-radius:12px; cursor:pointer; }
.header-notification-btn b { position:absolute; top:-5px; right:-5px; min-width:18px; height:18px; padding:0 4px; display:grid; place-items:center; color:#fff; background:#ef4444; border:2px solid #111622; border-radius:99px; font-size:.58rem; }
.notification-inbox-card { margin-bottom:1rem; padding:1rem; background:linear-gradient(145deg,rgba(14,24,43,.96),rgba(8,16,30,.98)); border:1px solid rgba(126,156,205,.2); border-radius:16px; }
.notification-inbox-heading { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin-bottom:.8rem; }
.notification-inbox-heading h2 { margin:0;color:#f5f8fd;font-size:1rem; }
.notification-inbox-heading p { margin:.2rem 0 0;color:#8391a6;font-size:.72rem; }
.notification-inbox-heading button { color:#80a8ef;background:transparent;border:0;font-size:.72rem;font-weight:700;cursor:pointer; }
.notification-inbox-list { display:grid; gap:.55rem; max-height:420px; overflow:auto; }
.notification-inbox-item { width:100%; padding:.8rem; display:grid; grid-template-columns:38px minmax(0,1fr); gap:.7rem; text-align:left; color:#cbd5e1; background:rgba(3,9,18,.35); border:1px solid rgba(126,156,205,.1); border-radius:11px; cursor:pointer; }
.notification-inbox-item.unread { background:rgba(37,99,235,.1); border-color:rgba(77,127,222,.3); }
.notification-category-icon { width:38px;height:38px;display:grid!important;place-items:center;color:#75a3f7;background:rgba(43,83,157,.24);border-radius:10px; }
.notification-inbox-item strong,.notification-inbox-item small,.notification-inbox-item time { display:block; }
.notification-inbox-item strong { color:#edf3fb;font-size:.8rem; }.notification-inbox-item small{margin-top:.2rem;color:#8d9bb0;font-size:.7rem;line-height:1.4}.notification-inbox-item time{margin-top:.3rem;color:#59677c;font-size:.62rem}
.notification-inbox-empty { padding:2rem 1rem;text-align:center;color:#718096 }.notification-inbox-empty span,.notification-inbox-empty strong,.notification-inbox-empty small{display:block;margin-inline:auto}.notification-inbox-empty strong{margin-top:.4rem;color:#dce6f5}.notification-inbox-empty small{margin-top:.25rem;font-size:.7rem}
.investment-cycle { min-width:130px;color:#8fa0b8;font-size:.7rem }.investment-cycle b{color:#68a0ff}.investment-cycle i{display:block;height:6px;margin-top:.4rem;overflow:hidden;background:#1e293b;border-radius:99px}.investment-cycle em{display:block;height:100%;background:linear-gradient(90deg,#3b82f6,#22c55e);border-radius:99px}
.statement-download-btn { position:relative; z-index:2; margin-left:auto; padding:.65rem .85rem; display:inline-flex; align-items:center; gap:.4rem; color:#dce9ff; background:rgba(30,64,125,.6); border:1px solid rgba(95,140,225,.4); border-radius:10px; font-weight:700; cursor:pointer }.statement-download-btn .material-symbols-outlined{font-size:1.05rem}
.audit-toolbar{display:flex;gap:.7rem;margin-bottom:1rem}.audit-toolbar input{flex:1}.audit-toolbar button{padding:.65rem .9rem;display:flex;align-items:center;gap:.35rem;color:#dce9ff;background:#17243a;border:1px solid #2b3c58;border-radius:10px}.audit-log-list{display:grid;gap:.65rem}.audit-log-item{padding:.9rem;display:grid;grid-template-columns:38px minmax(0,1fr);gap:.75rem;background:rgba(12,20,35,.75);border:1px solid rgba(126,156,205,.16);border-radius:12px}.audit-log-item>.material-symbols-outlined{width:38px;height:38px;display:grid;place-items:center;color:#79a6fa;background:rgba(45,81,151,.25);border-radius:10px}.audit-log-item strong,.audit-log-item small,.audit-log-item time{display:block}.audit-log-item strong{color:#eef4fd;font-size:.82rem}.audit-log-item small{margin-top:.25rem;color:#91a0b5;font-size:.72rem}.audit-log-item time{margin-top:.35rem;color:#59677c;font-size:.64rem}
.security-summary-card{margin-bottom:1rem;padding:1rem;display:grid;grid-template-columns:44px minmax(0,1fr);gap:.8rem;align-items:center;color:#b9c9df;background:rgba(16,185,129,.07);border:1px solid rgba(16,185,129,.22);border-radius:14px}.security-summary-card>.material-symbols-outlined{width:44px;height:44px;display:grid;place-items:center;color:#42cf8b;background:rgba(16,185,129,.12);border-radius:12px}.security-summary-card strong,.security-summary-card small{display:block}.security-summary-card strong{color:#eaf7f0}.security-summary-card small{margin-top:.25rem;color:#88a397;font-size:.72rem;line-height:1.4}

@media (max-width:600px) {
    .header-notification-btn { width:38px;height:38px;flex-basis:38px;border-radius:10px; }
    .notification-inbox-heading { align-items:flex-start; }.notification-inbox-heading p{max-width:190px}.notification-inbox-card{padding:.8rem;border-radius:14px}.notification-inbox-item{padding:.7rem;grid-template-columns:34px minmax(0,1fr)}.notification-category-icon{width:34px;height:34px}
    .statement-download-btn { position:absolute; right:0; bottom:.65rem; padding:.55rem .7rem; font-size:.7rem; }
    .audit-toolbar{flex-direction:column}.audit-toolbar button{justify-content:center;min-height:44px}.audit-log-item{padding:.75rem;grid-template-columns:34px minmax(0,1fr)}
}
@media (max-width:430px) { .user-dashboard-body .user-text-details { display:none !important; } .user-dashboard-body .user-card-info { max-width:48px !important; } }

/* Deposit history: compact, complete and swipe-free on phones */
.recent-deposits-empty-row td { padding: 2.25rem 1rem !important; text-align: center !important; color: #718096 !important; }
.recent-deposits-empty-row span, .recent-deposits-empty-row strong, .recent-deposits-empty-row small { display: block; margin-inline: auto; }
.recent-deposits-empty-row span { margin-bottom: .55rem; color: #5685d6; font-size: 1.9rem; }
.recent-deposits-empty-row strong { color: #dce6f5; font-size: .92rem; }
.recent-deposits-empty-row small { margin-top: .3rem; font-size: .72rem; }

@media (max-width: 700px) {
    .recent-deposits-card { padding: .9rem !important; border-radius: 16px !important; }
    .recent-deposits-heading { margin-bottom: .8rem !important; }
    .recent-deposits-heading .recent-deposits-title { font-size: 1.05rem !important; }
    .recent-deposits-heading button { min-height: 42px; padding: .55rem .75rem !important; border-radius: 9px !important; }
    .recent-deposits-table-wrap { overflow: visible !important; border: 0 !important; background: transparent !important; }
    .recent-deposits-table-wrap .deposits-table-list { display: block; width: 100%; min-width: 0 !important; }
    .recent-deposits-table-wrap thead { display: none; }
    .recent-deposits-table-wrap tbody { display: grid; gap: .7rem; width: 100%; }
    .recent-deposits-table-wrap tr { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: .7rem 1rem; width: 100%; padding: .9rem; background: rgba(5,12,24,.72); border: 1px solid rgba(126,156,205,.16) !important; border-radius: 13px; }
    .recent-deposits-table-wrap td { display: flex; min-width: 0; padding: 0 !important; border: 0 !important; flex-direction: column; align-items: flex-start; gap: .22rem; }
    .recent-deposits-table-wrap td::before { content: attr(data-label); color: #6f7e94; font: 650 .62rem/1.2 'Inter',sans-serif; letter-spacing: .045em; text-transform: uppercase; }
    .recent-deposits-table-wrap td:nth-child(3) { grid-column: 1 / -1; padding-top: .65rem !important; border-top: 1px solid rgba(126,156,205,.11) !important; }
    .recent-deposits-table-wrap td:nth-child(4) { position: absolute; top: .8rem; right: .8rem; }
    .recent-deposits-table-wrap td:nth-child(4)::before { content: none; }
    .recent-deposits-table-wrap td:nth-child(2) { padding-right: 5rem !important; }
    .recent-deposits-table-wrap .deposit-tx-hash { width: 100%; white-space: normal !important; }
    .recent-deposits-table-wrap .deposit-tx-hash > span { max-width: calc(100% - 32px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .recent-deposits-table-wrap .recent-deposits-empty-row { display: block; padding: 0; }
    .recent-deposits-table-wrap .recent-deposits-empty-row td { display: block; width: 100%; }
    .recent-deposits-table-wrap .recent-deposits-empty-row td::before { content: none; }
}

@media (max-width: 380px) {
    .dashboard-main-content { padding-inline: .6rem !important; }
    .user-card-info { max-width: 118px !important; }
    .notification-setting { padding-inline: .75rem !important; }
}

/* Final small-screen hardening across the full user/admin application */
img, svg, video, canvas { max-width:100%; }
.dashboard-panel-view, .recent-deposits-section, .deposit-step-box, .metric-card-box { min-width:0; }
.admin-support-layout { min-width:0; }

@media (max-width:700px) {
    .admin-support-layout { height:auto !important; min-height:620px; grid-template-columns:1fr !important; grid-template-rows:auto minmax(430px,62vh); gap:0 !important; overflow:hidden; }
    .admin-support-users { max-height:190px; border-right:0 !important; border-bottom:1px solid #1e2538; }
    .admin-support-chat { min-height:430px; height:62vh !important; }
    #admin-chat-users-list { max-height:145px; }
    #admin-chat-messages-container { padding:.85rem !important; }
    #admin-chat-header { padding:.7rem .8rem !important; gap:.5rem; }
    #admin-chat-user-email { max-width:190px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
    #admin-chat-status-toggle-container { flex-wrap:wrap; justify-content:flex-end; }
    .admin-dashboard-body .table-responsive-box { max-width:100%; overflow-x:auto !important; }
    .admin-dashboard-body .deposits-table-list { min-width:680px; }
    .admin-dashboard-body .dashboard-footer, .user-dashboard-body .dashboard-footer { text-align:center; justify-content:center; padding-block:.7rem; line-height:1.45; }
    .modal-overlay { padding:.65rem !important; }
    .modal-content-box, .modal-content { width:100% !important; max-width:calc(100vw - 1.3rem) !important; max-height:calc(100dvh - 1.3rem); overflow-y:auto; padding:1rem !important; border-radius:14px !important; }
    .modal-footer { position:sticky; bottom:0; padding-top:.75rem; background:inherit; }
}

@media (max-width:430px) {
    html, body { max-width:100%; overflow-x:hidden; }
    .admin-dashboard-body .dashboard-metrics-row { grid-template-columns:1fr !important; }
    .admin-dashboard-body .metric-card-box { min-height:96px; }
    .db-search-filters-bar { padding:.75rem !important; gap:.65rem !important; }
    .db-search-filters-bar > div, .db-search-filters-bar select { width:100% !important; min-width:0 !important; }
    .dashboard-footer p { margin:0; font-size:.65rem; }
    .profile-dropdown-menu { right:0 !important; left:auto !important; }
    .panel-title { overflow-wrap:anywhere; }
    .statement-download-btn { max-width:110px; }
}

/* Nova 7.0 — calm, layered workspace inspired by modern editorial SaaS UI */
:root {
    --nova-canvas: #121923;
    --nova-canvas-soft: #17212e;
    --nova-surface: #1c2735;
    --nova-surface-raised: #222f3f;
    --nova-surface-soft: #263547;
    --nova-border: rgba(173, 190, 211, .14);
    --nova-border-highlight: rgba(188, 204, 224, .24);
    --nova-copy: #f3f0e9;
    --nova-muted: #a7b0bd;
    --nova-gold: #d6a85f;
    --nova-blue: #6d9ce8;
    --nova-green: #51bd91;
}

html, body,
.dashboard-body, .admin-dashboard-body {
    color: var(--nova-copy) !important;
    background:
        radial-gradient(circle at 82% 4%, rgba(80,116,160,.18), transparent 30rem),
        radial-gradient(circle at 18% 90%, rgba(174,126,76,.09), transparent 32rem),
        linear-gradient(145deg, #151e29 0%, #111923 52%, #17212d 100%) fixed !important;
}

.dashboard-wrapper {
    background: transparent !important;
}

.dashboard-sidebar {
    background: linear-gradient(180deg, rgba(29,40,54,.98), rgba(22,31,43,.99)) !important;
    border-right: 1px solid var(--nova-border) !important;
    box-shadow: 12px 0 40px rgba(4,10,18,.18) !important;
}

.sidebar-product-label { color: #d8cfbf !important; letter-spacing: .075em !important; }
.sidebar-item-link { color: #aab5c4 !important; border: 1px solid transparent; transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease; }
.sidebar-item-link:hover { color: #eef1f5 !important; background: rgba(255,255,255,.055) !important; border-color: rgba(255,255,255,.055); transform: translateX(2px); }
.sidebar-item-link.active { color: #f5ead8 !important; background: linear-gradient(90deg, rgba(196,145,75,.2), rgba(109,156,232,.11)) !important; border-color: rgba(212,169,101,.18); border-left: 3px solid #d6a85f !important; box-shadow: inset 0 1px rgba(255,255,255,.035); }
.sidebar-item-link.active .sidebar-icon { color: #e0b56d !important; }
.sidebar-system-card { background: rgba(10,17,26,.28) !important; border-color: var(--nova-border) !important; }

.dashboard-header {
    background: rgba(28,39,53,.82) !important;
    border-color: var(--nova-border) !important;
    box-shadow: 0 8px 28px rgba(4,10,18,.12) !important;
    backdrop-filter: blur(20px) saturate(120%) !important;
}
.dashboard-header-context strong { color: #f2eee7 !important; }
.header-notification-btn, .user-card-info {
    background: rgba(255,255,255,.035) !important;
    border-color: var(--nova-border-highlight) !important;
}
.user-avatar-circle { background: linear-gradient(145deg,#779fdf,#4f78bb) !important; box-shadow: 0 5px 16px rgba(49,93,164,.25); }
.profile-dropdown-menu { background: #263445 !important; border-color: var(--nova-border-highlight) !important; border-radius: 13px !important; box-shadow: 0 20px 45px rgba(3,8,14,.38) !important; }

.dashboard-main-content { width: 100%; }
.panel-title, .profile-welcome-title { color: #f4f1eb !important; letter-spacing: -.035em !important; }
.panel-desc, .profile-account-line { color: #aab4c1 !important; }

.metric-card-box,
.deposit-step-box,
.recent-deposits-section,
.smtp-settings-card,
.notification-inbox-card,
.referral-share-card,
.security-summary-card,
.admin-support-layout,
.chat-container {
    background: linear-gradient(145deg, rgba(35,48,64,.94), rgba(27,38,52,.96)) !important;
    border: 1px solid var(--nova-border) !important;
    border-radius: 18px !important;
    box-shadow: 0 16px 38px rgba(4,10,18,.15), inset 0 1px rgba(255,255,255,.035) !important;
}

.metric-card-box { transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.metric-card-box:hover { transform: translateY(-2px); border-color: var(--nova-border-highlight) !important; box-shadow: 0 20px 44px rgba(4,10,18,.22) !important; }
.metric-card-label { color: #9faaba !important; }
.metric-card-value-txt { color: #f5f1e9 !important; }
.metric-card-icon-box { border: 1px solid rgba(255,255,255,.06); border-radius: 12px !important; }

.profile-balance-card {
    background:
        radial-gradient(circle at 92% 5%, rgba(109,156,232,.18), transparent 14rem),
        linear-gradient(145deg, #29394b, #1d2a39) !important;
    border: 1px solid rgba(180,198,220,.2) !important;
    border-radius: 22px !important;
    box-shadow: 0 22px 54px rgba(4,10,18,.24), inset 0 1px rgba(255,255,255,.05) !important;
}
.balance-eyebrow, .stat-label, .balance-secondary-grid span, .referral-card-label { color: #acb6c4 !important; }
.balance-value { color: #faf6ee !important; text-shadow: 0 2px 16px rgba(255,255,255,.06); }
.balance-wallet-icon { background: rgba(109,156,232,.15) !important; border-color: rgba(127,169,234,.24) !important; }
.balance-stats-grid, .balance-secondary-grid { border-color: var(--nova-border) !important; }
.dashboard-refresh-btn, .referral-share-btn, .statement-download-btn, .section-link-btn {
    color: #edf3fc !important;
    background: rgba(96,137,201,.18) !important;
    border-color: rgba(119,159,220,.3) !important;
    border-radius: 11px !important;
}
.dashboard-refresh-btn:hover, .referral-share-btn:hover, .statement-download-btn:hover { background: rgba(104,149,218,.28) !important; }

.table-responsive-box { background: rgba(12,20,30,.22) !important; border-color: var(--nova-border) !important; border-radius: 14px !important; }
.deposits-table-list th { color: #aeb7c3 !important; background: rgba(255,255,255,.035) !important; border-color: var(--nova-border) !important; }
.deposits-table-list td { color: #e6e9ed !important; border-color: rgba(173,190,211,.1) !important; }
.deposits-table-list tbody tr:hover { background: rgba(255,255,255,.025) !important; }

.form-input-db, .modal-text-input, .chat-input,
.admin-dashboard-body input, .admin-dashboard-body select, .admin-dashboard-body textarea,
.user-dashboard-body input, .user-dashboard-body select, .user-dashboard-body textarea {
    color: #eef1f5 !important;
    background: rgba(11,18,27,.34) !important;
    border-color: rgba(173,190,211,.2) !important;
    border-radius: 11px !important;
}
.form-input-db:focus, .modal-text-input:focus, .chat-input:focus,
.admin-dashboard-body input:focus, .admin-dashboard-body select:focus, .admin-dashboard-body textarea:focus,
.user-dashboard-body input:focus, .user-dashboard-body select:focus, .user-dashboard-body textarea:focus {
    border-color: rgba(109,156,232,.62) !important;
    box-shadow: 0 0 0 3px rgba(109,156,232,.13) !important;
}
.form-btn-db, .smtp-test-btn, .chat-send-btn {
    border-radius: 11px !important;
    box-shadow: 0 8px 22px rgba(30,75,145,.18);
}
.modal-overlay { background: rgba(8,13,20,.64) !important; backdrop-filter: blur(8px); }
.modal-overlay:target { display: flex !important; align-items: center; justify-content: center; opacity: 1 !important; visibility: visible !important; z-index: 999999 !important; }
.modal-content-box, .modal-content { background: linear-gradient(145deg,#263445,#1c2837) !important; border-color: var(--nova-border-highlight) !important; box-shadow: 0 28px 70px rgba(3,8,14,.48) !important; }
.dashboard-footer { color: #7f8d9f !important; background: rgba(24,34,47,.58) !important; border-color: var(--nova-border) !important; }

@media (min-width: 901px) {
    .dashboard-main-content { padding-top: 2rem !important; }
    .dashboard-panel-view { animation: novaPanelIn .3s ease both; }
    @keyframes novaPanelIn { from { opacity: .25; transform: translateY(5px); } to { opacity: 1; transform: none; } }
}

@media (max-width: 900px) {
    .dashboard-sidebar { box-shadow: 18px 0 55px rgba(2,7,12,.42) !important; }
    .sidebar-overlay { background: rgba(8,13,20,.6) !important; backdrop-filter: blur(7px) !important; }
}

@media (max-width: 600px) {
    html, body, .dashboard-body, .admin-dashboard-body {
        background: linear-gradient(155deg,#17212d 0%,#111923 52%,#182330 100%) fixed !important;
    }
    .dashboard-header { background: rgba(27,38,52,.91) !important; }
    .dashboard-main-content { padding: 1.1rem .8rem 2.25rem !important; }
    .profile-welcome-title { font-size: clamp(1.42rem,7vw,1.75rem) !important; line-height: 1.15; }
    .profile-balance-card { padding: 1.15rem !important; border-radius: 18px !important; }
    .balance-value { font-size: clamp(2.25rem,13vw,3.15rem) !important; }
    .balance-stats-grid { gap: .5rem !important; }
    .balance-stat { min-width: 0; }
    .stat-label { font-size: .67rem !important; }
    .stat-value { font-size: .86rem !important; overflow-wrap: anywhere; }
    .metric-card-box, .deposit-step-box, .recent-deposits-section, .smtp-settings-card, .notification-inbox-card, .referral-share-card { border-radius: 15px !important; box-shadow: 0 12px 28px rgba(4,10,18,.14) !important; }
    .transactions-table-wrap tr, .recent-deposits-table-wrap tr { background: rgba(13,22,33,.34) !important; border-color: var(--nova-border) !important; }
}

/* Public pages — Help and Investment catalogue */
.landing-body, .investments-body {
    color: var(--nova-copy) !important;
    background:
        radial-gradient(circle at 82% 6%, rgba(80,116,160,.18), transparent 30rem),
        radial-gradient(circle at 12% 82%, rgba(174,126,76,.08), transparent 30rem),
        linear-gradient(145deg,#182330,#111923 58%,#192431) fixed !important;
}
.landing-header {
    background: rgba(28,39,53,.84) !important;
    border-color: var(--nova-border) !important;
    box-shadow: 0 8px 28px rgba(4,10,18,.12) !important;
    backdrop-filter: blur(20px) saturate(120%) !important;
}
.landing-header .nav-link { color: #b5bfcc !important; border-radius: 9px; }
.landing-header .nav-link:hover { color: #f4f0e9 !important; background: rgba(255,255,255,.04); }
.landing-header .profile-dropdown-btn { color: #eef1f5 !important; background: rgba(255,255,255,.035) !important; border: 1px solid var(--nova-border) !important; border-radius: 11px !important; }
.landing-header .nav-toggle-btn { color: #e7ebf0 !important; background: rgba(255,255,255,.04) !important; border-color: var(--nova-border) !important; border-radius: 10px !important; }
.landing-footer { color: #8794a5 !important; background: rgba(24,34,47,.62) !important; border-color: var(--nova-border) !important; }

.help-main { width: min(900px,100%); }
.help-main > h1 { color: #f5f1e9 !important; letter-spacing: -.04em; line-height: 1.1; }
.help-main > p { color: #aab4c1 !important; }
.help-card {
    background: linear-gradient(145deg,rgba(35,48,64,.95),rgba(27,38,52,.97)) !important;
    border: 1px solid var(--nova-border) !important;
    border-radius: 17px !important;
    box-shadow: 0 15px 36px rgba(4,10,18,.13), inset 0 1px rgba(255,255,255,.035);
    transition: transform .18s ease, border-color .18s ease;
}
.help-card:hover { transform: translateY(-2px); border-color: var(--nova-border-highlight) !important; }
.help-card h3 { color: #f1eee8 !important; }
.help-card p { color: #aab4c1 !important; }
.help-support-btn { background: linear-gradient(135deg,#648fd3,#7563bd) !important; border-radius: 11px !important; box-shadow: 0 9px 24px rgba(63,100,170,.24); }

.browse-hero { margin-top: 64px; background: linear-gradient(180deg,rgba(45,62,81,.42),rgba(22,31,43,.12)) !important; border-color: var(--nova-border) !important; }
.browse-hero h1, .section-title { color: #f5f1e9 !important; }
.browse-hero p { color: #acb6c4 !important; }
.gradient-text { color: #dfb56f !important; background: none !important; -webkit-text-fill-color: currentColor !important; }
.pop-cat-card, .investment-card {
    background: linear-gradient(145deg,rgba(36,50,67,.96),rgba(27,38,52,.98)) !important;
    border: 1px solid var(--nova-border) !important;
    border-radius: 17px !important;
    box-shadow: 0 15px 36px rgba(4,10,18,.14), inset 0 1px rgba(255,255,255,.035) !important;
}
.pop-cat-card:hover, .investment-card:hover { transform: translateY(-4px) !important; border-color: rgba(214,168,95,.34) !important; box-shadow: 0 22px 48px rgba(4,10,18,.23) !important; }
.pop-cat-icon-circle { background: rgba(214,168,95,.13) !important; border: 1px solid rgba(214,168,95,.2); }
.pop-cat-icon { color: #dfb56f !important; }
.pop-cat-title, .investment-title { color: #f2eee7 !important; }
.pop-cat-desc, .investment-card p { color: #a7b0bd !important; }
.investment-img-container { background: rgba(10,17,26,.26) !important; }
.investment-card .invest-btn { background: linear-gradient(135deg,#648fd3,#7563bd) !important; border-radius: 10px !important; box-shadow: 0 8px 22px rgba(58,94,159,.22); }
#pagination-controls button { min-width: 42px; min-height: 42px; color: #dce4ef !important; background: rgba(35,48,64,.95) !important; border: 1px solid var(--nova-border) !important; border-radius: 10px !important; }

@media (max-width: 768px) {
    .landing-header .container-header { min-height: 60px; padding-inline: .8rem !important; }
    .landing-header .logo-container img { width: 82px !important; }
    .landing-header .nav-links.active { top: calc(100% + 8px); left: .75rem; right: .75rem; width: auto; padding: .65rem; background: rgba(35,48,64,.98) !important; border: 1px solid var(--nova-border-highlight); border-radius: 14px; box-shadow: 0 20px 45px rgba(3,8,14,.38); }
    .landing-header .nav-links.active .nav-link { min-height: 44px; display: flex; align-items: center; padding-inline: .85rem; }
    .help-main { margin: 5.5rem auto 2.5rem !important; padding: 1rem .8rem !important; }
    .help-main > h1 { font-size: clamp(2rem,10vw,2.6rem) !important; }
    .help-main > p { margin-bottom: 1.75rem !important; font-size: .92rem !important; }
    .help-main > div { gap: .8rem !important; }
    .help-card { padding: 1.05rem !important; border-radius: 14px !important; }
    .help-card h3 { font-size: 1rem !important; }
    .help-card p { font-size: .82rem; }
    .browse-hero { margin-top: 60px; padding: 2.1rem .8rem 1.35rem !important; }
    .section-container { padding-inline: .8rem !important; }
    .popular-categories-grid { gap: .7rem !important; }
    .pop-cat-card { min-width: 0; padding: .9rem !important; }
    .investment-grid { gap: .85rem !important; }
    .investment-card { border-radius: 15px !important; }
}

@media (max-width: 420px) {
    .popular-categories-grid { grid-template-columns: 1fr 1fr !important; }
    .pop-cat-card { text-align: left !important; }
    .pop-cat-desc { font-size: .7rem !important; line-height: 1.4; }
}

/* Exact viewport-centred mobile brand, independent of side controls */
@media (max-width: 900px) {
    .dashboard-header .mobile-header-logo {
        position: absolute !important;
        inset-inline-start: 50% !important;
        inset-inline-end: auto !important;
        top: 50% !important;
        margin: 0 !important;
        transform: translate(-50%,-50%) !important;
        z-index: 2 !important;
        pointer-events: auto;
    }
    .dashboard-header .mobile-header-logo img { width: 86px !important; max-width: 22vw; }
}

.smtp-provider-tools { margin: 0 0 1rem; padding: .8rem; display: flex; align-items: center; justify-content: space-between; gap: .8rem; color: #aab4c1; background: rgba(214,168,95,.065); border: 1px solid rgba(214,168,95,.16); border-radius: 12px; }
.smtp-provider-tools span { font-size: .75rem; line-height: 1.4; }
.smtp-provider-tools button { flex: 0 0 auto; min-height: 40px; padding: .55rem .75rem; display: inline-flex; align-items: center; gap: .35rem; color: #f4e8d5; background: rgba(214,168,95,.14); border: 1px solid rgba(214,168,95,.25); border-radius: 9px; font-weight: 700; cursor: pointer; }
.smtp-provider-tools button .material-symbols-outlined { font-size: 1rem; }
@media (max-width: 520px) { .smtp-provider-tools { align-items: stretch; flex-direction: column; } .smtp-provider-tools button { justify-content: center; width: 100%; } }

/* ==========================================================================
   Nova 8.0 — Premium Mobile-First Navigation, Modals & UI/UX
   ========================================================================== */

/* ── Mobile Bottom Navigation ──────────────────────────────── */
.mobile-bottom-nav {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0;
}

@media (max-width: 900px) {
    /* Show bottom nav on tablet and mobile */
    .mobile-bottom-nav {
        display: flex !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        height: 62px !important;
        background: rgba(17, 24, 36, 0.97) !important;
        backdrop-filter: blur(22px) saturate(160%) !important;
        -webkit-backdrop-filter: blur(22px) saturate(160%) !important;
        border-top: 1px solid rgba(173, 190, 211, 0.15) !important;
        z-index: 9990 !important;
        align-items: stretch !important;
        justify-content: space-around !important;
        padding-bottom: env(safe-area-inset-bottom, 0px) !important;
        box-shadow: 0 -6px 28px rgba(0, 0, 0, 0.45), 0 -1px 0 rgba(255,255,255,0.04) inset !important;
    }

    /* Extra padding so content clears bottom nav */
    .dashboard-main-content {
        padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
    }
    .dashboard-footer {
        margin-bottom: calc(62px + env(safe-area-inset-bottom, 0px)) !important;
    }

    /* Nav items */
    .mobile-nav-item {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        flex: 1 !important;
        height: 100% !important;
        color: #7a8fa8 !important;
        text-decoration: none !important;
        background: none !important;
        border: none !important;
        padding: 6px 2px 4px !important;
        gap: 2px !important;
        font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
        font-size: 0.62rem !important;
        font-weight: 600 !important;
        letter-spacing: 0.02em !important;
        cursor: pointer !important;
        transition: color 0.2s ease, transform 0.15s ease !important;
        -webkit-tap-highlight-color: transparent !important;
        position: relative !important;
        outline: none !important;
    }

    .mobile-nav-item .material-symbols-outlined {
        font-size: 1.4rem !important;
        transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s ease !important;
        line-height: 1 !important;
    }

    .mobile-nav-item:active {
        transform: scale(0.88) !important;
    }

    /* Active state — gold accent */
    .mobile-nav-item.active {
        color: #d6a85f !important;
    }
    .mobile-nav-item.active .material-symbols-outlined {
        color: #d6a85f !important;
        transform: translateY(-3px) scale(1.08) !important;
    }

    /* Active dot indicator below icon */
    .mobile-nav-item.active::after {
        content: '' !important;
        position: absolute !important;
        bottom: 5px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 4px !important;
        height: 4px !important;
        border-radius: 50% !important;
        background: #d6a85f !important;
        box-shadow: 0 0 6px rgba(214, 168, 95, 0.7) !important;
    }

    /* Active background glow pill */
    .mobile-nav-item.active::before {
        content: '' !important;
        position: absolute !important;
        top: 6px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 44px !important;
        height: 32px !important;
        border-radius: 10px !important;
        background: rgba(214, 168, 95, 0.1) !important;
        z-index: -1 !important;
    }
}

/* ── Touch Targets & iOS Auto-Zoom Fix ─────────────────────── */
@media (max-width: 768px) {
    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    input[type="tel"],
    select,
    textarea {
        font-size: 16px !important;
        min-height: 48px !important;
    }

    button,
    .form-btn-db,
    .statement-download-btn,
    .dashboard-refresh-btn,
    .referral-share-btn {
        min-height: 44px !important;
        touch-action: manipulation !important;
    }

    /* Referral link copy button full-width on tiny screens */
    #panel-referrals .deposit-step-box [style*="display: flex"] {
        flex-direction: column !important;
    }
    #panel-referrals #copy-ref-btn {
        width: 100% !important;
        justify-content: center !important;
    }

    /* Withdraw row stack on mobile */
    .withdraw-action-row {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .withdraw-action-row .form-btn-db {
        width: 100% !important;
        justify-content: center !important;
    }
}

/* ── Mobile Bottom-Sheet Modals ────────────────────────────── */
/* Two patterns exist:
   1. Admin modals: .modal-overlay + .active class (display controlled by CSS rule)
   2. User dashboard modals: inline style="display:none" or [hidden] attribute
   We must NOT touch closed modals regardless of pattern. */
@media (max-width: 768px) {

    /* Pattern 1: .active class opens the modal */
    .modal-overlay.active {
        align-items: flex-end !important;
        justify-content: center !important;
        padding: 0 !important;
    }



    /* Always hide modals that are explicitly marked hidden */
    .modal-overlay[hidden] {
        display: none !important;
    }
    .modal-overlay[style*="display: none"] {
        display: none !important;
    }

    /* Bottom-sheet content for OPEN modals (.active pattern) */
    .modal-overlay.active .modal-content-box,
    .modal-overlay.active .modal-content {
        width: 100% !important;
        max-width: 100vw !important;
        max-height: 90dvh !important;
        border-radius: 24px 24px 0 0 !important;
        margin: 0 !important;
        padding: 1.5rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0px)) !important;
        box-shadow: 0 -14px 50px rgba(0, 0, 0, 0.65) !important;
        animation: novaModalUp 0.32s cubic-bezier(0.16, 1, 0.3, 1) both !important;
        overflow-y: auto !important;
    }

    /* Bottom-sheet content for OPEN modals (inline display:flex / display:block pattern) */
    .modal-overlay[style*="display: flex"] .modal-content-box,
    .modal-overlay[style*="display: flex"] .modal-content,
    .modal-overlay[style*="display: block"] .modal-content-box,
    .modal-overlay[style*="display: block"] .modal-content {
        width: 100% !important;
        max-width: 100vw !important;
        max-height: 90dvh !important;
        border-radius: 24px 24px 0 0 !important;
        margin: 0 !important;
        padding: 1.5rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0px)) !important;
        box-shadow: 0 -14px 50px rgba(0, 0, 0, 0.65) !important;
        animation: novaModalUp 0.32s cubic-bezier(0.16, 1, 0.3, 1) both !important;
        overflow-y: auto !important;
    }

    /* Overlay alignment for inline-style opened modals */
    .modal-overlay[style*="display: flex"],
    .modal-overlay[style*="display: block"] {
        align-items: flex-end !important;
        justify-content: center !important;
        padding: 0 !important;
    }

    @keyframes novaModalUp {
        from { transform: translateY(100%); opacity: 0.6; }
        to   { transform: translateY(0);    opacity: 1; }
    }

    /* Drag handle visual hint */
    .modal-overlay.active .modal-content-box::before,
    .modal-overlay.active .modal-content::before,
    .modal-overlay[style*="display: flex"] .modal-content-box::before,
    .modal-overlay[style*="display: flex"] .modal-content::before {
        content: '' !important;
        display: block !important;
        width: 36px !important;
        height: 4px !important;
        border-radius: 99px !important;
        background: rgba(173, 190, 211, 0.3) !important;
        margin: 0 auto 1rem !important;
    }

    /* Modal footer buttons full-width on mobile */
    .modal-footer {
        flex-direction: column-reverse !important;
        gap: 0.6rem !important;
    }
    .modal-footer button,
    .modal-footer .modal-cancel-btn,
    .modal-footer .modal-submit-btn {
        width: 100% !important;
        justify-content: center !important;
        min-height: 48px !important;
    }
}

/* ── Tablet & Desktop Grid Harmony ─────────────────────────── */
@media (min-width: 901px) and (max-width: 1100px) {
    .dashboard-metrics-row {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ── Panel Transitions ─────────────────────────────────────── */
@media (max-width: 900px) {
    .dashboard-panel-view.active {
        animation: novaPanelFadeIn 0.22s ease both;
    }
    @keyframes novaPanelFadeIn {
        from { opacity: 0; transform: translateY(6px); }
        to   { opacity: 1; transform: none; }
    }
}

/* ── Referral Copy Box Mobile ──────────────────────────────── */
@media (max-width: 500px) {
    #referral-link-input {
        font-size: 0.75rem !important;
    }
}

/* ── Active Investments Card Mobile Table ──────────────────── */
@media (max-width: 700px) {
    .active-investments-table-wrap { overflow: visible !important; border: 0 !important; background: transparent !important; }
    .active-investments-table-wrap .deposits-table-list { display: block; width: 100%; min-width: 0 !important; }
    .active-investments-table-wrap thead { display: none; }
    .active-investments-table-wrap tbody { display: grid; gap: 0.7rem; width: 100%; }
    .active-investments-table-wrap tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.6rem 0.9rem;
        width: 100%;
        padding: 0.9rem;
        background: rgba(13, 22, 38, 0.72);
        border: 1px solid rgba(173, 190, 211, 0.15) !important;
        border-radius: 13px;
    }
    .active-investments-table-wrap td {
        display: flex;
        flex-direction: column;
        padding: 0 !important;
        border: 0 !important;
        font-size: 0.82rem !important;
        gap: 0.18rem;
    }
    .active-investments-table-wrap td::before {
        content: attr(data-label);
        color: #6f7e94;
        font: 650 0.6rem/1.2 'Inter', sans-serif;
        letter-spacing: 0.045em;
        text-transform: uppercase;
    }
    .active-investments-table-wrap td:last-child { grid-column: 1 / -1; }
}
/* end Nova 8.0 */
