/* 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: native mobile cards instead of a clipped horizontal table */
.transactions-empty-row td { padding: 2.5rem 1rem !important; text-align: center !important; color: #76859a !important; }
.transactions-empty-row td > span, .transactions-empty-row td > strong, .transactions-empty-row td > small { display: block; margin-inline: auto; }
.transactions-empty-row td > span { margin-bottom: .6rem; color: #5279bd; font-size: 2rem; }
.transactions-empty-row td > strong { color: #dce6f5; font-size: .95rem; }
.transactions-empty-row td > small { max-width: 320px; margin-top: .35rem; font-size: .74rem; line-height: 1.45; }

@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; }
    .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-table-wrap .transactions-empty-row { display: block; padding: 0; }
    .transactions-table-wrap .transactions-empty-row td { display: block; width: 100%; }
    .transactions-table-wrap .transactions-empty-row td::before { content: none; }
    .table-scroll-hint { display: none !important; }
}

@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; }
}
