/*
# ==============================================================
# Script: style.css
# Purpose: Global stylesheet for NiveshX – WealthX platform.
#          Defines CSS variables for theming, layout structures,
#          and responsive design rules.
# Author: Praful Kumar
# Created On: 01/12/2024
#
# Modification History:
# - 01/12/2024 : Initial creation
# - 02/01/2026 : Updated header height, logo sizing, and mobile rules.
#
# Reload / Change Triggers:
# - Reload Triggered 1 : 02/01/2026
#
# Notes:
# - Supports Light/Dark mode via data-theme attribute.
# ==============================================================
*/

:root {
    /* Light Mode (Default) */
    --bg-body: #ffffff;
    --bg-header: #1976d2;
    /* Dark Sky Blue */
    --bg-sidebar: #f1f8ff;
    /* Very Light Sky Blue */
    --bg-footer: #121212;

    --bg-card: #ffffff;
    --bg-card-header: #f8fafc;
    --bg-hover: rgba(25, 118, 210, 0.05);
    --bg-highlight: rgba(226, 232, 240, 0.5);

    --text-primary: #333333;
    --text-secondary: #64748b;
    --text-header: #ffffff;
    --text-header-muted: rgba(255, 255, 255, 0.85);
    --text-sidebar: #374151;
    --text-label: #64748b;
    --text-gold: #b45309;
    /* Darker gold for readability on white */

    --border-color: #e2e8f0;
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.1);

    --accent-primary: #1976d2;
    --accent-gold: #b45309;
    --accent-green: #059669;
    --accent-red: #dc2626;

    --scrollbar-track: #f1f5f9;
    --scrollbar-thumb: #cbd5e1;
}

[data-theme="dark"] {
    --bg-body: #0f172a;
    --bg-header: #1e293b;
    --bg-sidebar: #1e293b;
    --bg-footer: #0f172a;

    --bg-card: #1e293b;
    --bg-card-header: rgba(0, 0, 0, 0.2);
    --bg-hover: rgba(255, 255, 255, 0.05);
    --bg-highlight: rgba(51, 65, 85, 0.4);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-header: #ffffff;
    --text-header-muted: rgba(255, 255, 255, 0.7);
    --text-sidebar: #94a3b8;
    --text-label: #94a3b8;
    --text-gold: #fbbf24;

    --border-color: #334155;
    --shadow-card: none;

    --accent-primary: #3b82f6;
    --accent-gold: #fbbf24;
    --accent-green: #10b981;
    --accent-red: #ef4444;

    --scrollbar-track: #0f172a;
    --scrollbar-thumb: #334155;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    font-size: 15px;
    transition: background 0.3s, color 0.3s;
}

.main-header {
    height: 88px;
    /* Increased again by 5% */
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    position: relative;
    overflow: visible;
    z-index: 1000;
}

.main-header .light-logo,
.main-header .dark-logo {
    position: absolute;
    top: -5px;
    left: 10px;
    height: 100px !important;
    width: auto !important;
    z-index: 2000;
    transition: all 0.3s ease;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.main-header .header-title {
    margin-left: 130px;
    transition: margin-left 0.3s;
}

.main-header a {
    color: var(--text-header) !important;
}

.main-header div {
    color: var(--text-header);
}

/* PDA / Mobile Rules */
@media (max-width: 768px) {
    .main-header {
        justify-content: space-between;
    }

    .main-header .header-title {
        display: none;
        /* Hide text title on mobile to favor logo */
    }

    .hidden-mobile {
        display: none;
    }

    /* Show logo on mobile */
    .main-header .light-logo,
    .main-header .dark-logo {
        height: 63px !important;
        top: 5px;
        left: 50%;
        transform: translateX(-50%);
        display: block !important;
    }

    .sidebar {
        display: none;
        position: absolute;
        top: 88px;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100% !important;
        z-index: 999;
        overflow-y: auto;
    }

    .sidebar.active {
        display: block;
    }

    .menu-toggle {
        display: block !important;
    }
}

.main-header .muted {
    color: var(--text-header-muted) !important;
}

.main-footer {
    height: 40px;
    background: var(--bg-footer);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #94a3b8;
    /* Always light grey as per req */
}

.layout-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
}

* {
    box-sizing: border-box;
}

.sidebar {
    width: 240px;
    background: var(--bg-sidebar);
    height: 100%;
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
    overflow-y: auto;
    transition: background 0.3s;
}

.brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-gold);
    padding: 2rem;
    letter-spacing: 1px;
}

.nav-link {
    padding: 0.65rem 2rem;
    cursor: pointer;
    color: var(--text-sidebar);
    font-weight: 500;
    transition: 0.2s;
    display: block;
    text-decoration: none;
}

.nav-link:hover {
    color: var(--accent-primary);
    background: var(--bg-hover);
}

.nav-link.active {
    width: 100%;
    border-right: 4px solid var(--accent-primary);
    background: var(--bg-hover);
    color: var(--accent-primary);
    font-weight: 700;
}

.main {
    flex: 1;
    padding: 1rem 1%;
    height: 100%;
    overflow-y: auto;
    background: var(--bg-body);
}

h1 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

h3,
h4 {
    color: var(--text-primary);
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    transition: background 0.3s;
}

.card.bg-blue {
    background: linear-gradient(135deg, var(--accent-primary), #1e40af);
    border: none;
    color: white;
}

.card.bg-blue .lbl,
.card.bg-blue .val,
.card.bg-blue .sub {
    color: white !important;
}

.lbl {
    font-size: 0.8rem;
    text-transform: uppercase;
    opacity: 0.7;
    margin-bottom: 0.5rem;
    color: var(--text-label);
}

.val {
    font-size: 1.6rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.sub {
    font-size: 0.75rem;
    opacity: 0.6;
    color: var(--text-secondary);
}

.text-gold {
    color: var(--accent-gold) !important;
}

.table-wrap {
    background: var(--bg-card);
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-card);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 0.85rem 1rem;
    background: var(--bg-card-header);
    color: var(--text-label);
    font-size: 13px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-primary);
}

tr:hover td {
    background-color: var(--bg-hover);
}

.r {
    text-align: right;
    font-family: 'JetBrains Mono', monospace;
}

.bold {
    font-weight: bold;
    color: var(--text-primary);
}

.pos {
    color: var(--accent-green);
}

.neg {
    color: var(--accent-red);
}

.section-group {
    margin-bottom: 2rem;
}

.group-head {
    font-size: 1.2rem;
    color: var(--accent-primary);
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.group-head span {
    font-family: monospace;
    color: var(--text-primary);
    font-weight: bold;
}

.show {
    display: block !important;
}

.highlight-row {
    background: var(--bg-highlight);
    font-weight: 500;
}

.loan-row {
    background: rgba(99, 102, 241, 0.15) !important;
}

/* Password Blur */
.blur-pwd {
    filter: blur(5px);
    transition: 0.2s;
    cursor: pointer;
    user-select: none;
}

.blur-pwd:hover {
    filter: blur(0);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Theme Toggle Slider */
.theme-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-switch:hover {
    background: rgba(255, 255, 255, 0.3);
}

.theme-icon {
    font-size: 1.2rem;
    line-height: 1;
}