/**
 * KalpVruksh - Custom Theme Styles
 * Include this file in ALL pages for consistent styling
 * 
 * File: styles/kalpvruksh.css
 */

/* ========== Green Highlight Override ========== */

/* Page content padding for footer */
.pb-footer {
    padding-bottom: 80px !important;
}

.color-highlight {
    color: #8CC152 !important;
}

.bg-highlight {
    background-color: #8CC152 !important;
    color: #FFF !important;
}

.border-highlight {
    border-color: #8CC152 !important;
}

.gradient-highlight {
    background-image: linear-gradient(to bottom, #A0D468, #8CC152) !important;
    color: #FFF !important;
}

#header-deco-1, #header-deco-2, #header-deco-3, #header-deco-4 {
    fill: #8CC152 !important;
}

#footer-bar .circle-nav-2::before,
#footer-bar .circle-nav-2::after {
    background-image: linear-gradient(to bottom, #A0D468, #8CC152) !important;
}

.footer-bar-1 .active-nav i,
.footer-bar-1 .active-nav span {
    color: #8CC152 !important;
}

.tabs-pill a[aria-expanded=true] {
    background-color: #8CC152 !important;
    border-color: #8CC152 !important;
    color: #FFF !important;
}

.spinner-border.color-highlight {
    color: #8CC152 !important;
}

/* ========== CSS Variables ========== */
:root {
    --kv-primary: #1B5E20;
    --kv-primary-light: #43A047;
    --kv-primary-dark: #0D3D11;
    --kv-success: #4CAF50;
    --kv-danger: #EF5350;
    --kv-warning: #FF9800;
    
    /* Light Mode Colors */
    --kv-bg: #EFEEF3;
    --kv-card-bg: #FFFFFF;
    --kv-text: #1a1a1a;
    --kv-text-muted: #666666;
    --kv-text-light: #999999;
    --kv-border: #e0e0e0;
    --kv-input-bg: #f5f5f5;
}

.theme-dark {
    --kv-bg: #0f1117;
    --kv-card-bg: #1a1a2e;
    --kv-text: #ffffff;
    --kv-text-muted: #b0b0b0;
    --kv-text-light: #888888;
    --kv-border: #333333;
    --kv-input-bg: #252535;
}

/* ========== Global Overrides ========== */
.theme-dark .card {
    background: var(--kv-card-bg) !important;
    border-color: var(--kv-border) !important;
}

.theme-dark .page-content {
    background: var(--kv-bg);
}

/* ========== Typography ========== */
.theme-dark h1, .theme-dark h2, .theme-dark h3, 
.theme-dark h4, .theme-dark h5, .theme-dark h6 {
    color: var(--kv-text) !important;
}

.theme-dark p, .theme-dark span, .theme-dark div {
    color: var(--kv-text-muted);
}

.theme-dark .text-muted {
    color: var(--kv-text-light) !important;
}

/* ========== Positive/Negative Values ========== */
.positive { color: var(--kv-success) !important; }
.negative { color: var(--kv-danger) !important; }

/* ========== Header Styles ========== */
.dash-header {
    background: linear-gradient(135deg, var(--kv-primary) 0%, var(--kv-primary-light) 100%);
    padding: 15px 20px 100px;
    position: relative;
    overflow: hidden;
}

.dash-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.header-content {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.greeting p { color: rgba(255,255,255,0.7); font-size: 13px; margin: 0; }
.greeting h1 { color: #fff; font-size: 22px; font-weight: 700; margin: 3px 0 0; }

.header-actions { display: flex; gap: 10px; }

.header-btn {
    width: 40px; height: 40px;
    border-radius: 12px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
}

.header-btn:hover { background: rgba(255,255,255,0.25); }

/* Theme icon visibility */
.theme-light .show-on-theme-dark { display: none !important; }
.theme-dark .show-on-theme-light { display: none !important; }
.header-btn i.show-on-theme-dark { color: #FFD54F; }

.header-wave {
    position: absolute;
    bottom: 0; left: 0;
    width: 100%;
}

.header-wave svg { display: block; width: 100%; height: 60px; }
.header-wave path { fill: #EFEEF3; }
.theme-dark .header-wave path { fill: #0f1117; }

/* ========== Balance Card ========== */
.balance-card {
    margin: -70px 15px 15px !important;
    border-radius: 20px !important;
    overflow: hidden;
    position: relative;
    z-index: 10;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15) !important;
}

.balance-card-inner {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 20px;
    position: relative;
    min-height: 170px;
}

.balance-card-inner::after {
    content: '';
    position: absolute;
    top: -50%; right: -30%;
    width: 80%; height: 150%;
    background: radial-gradient(circle, rgba(67,160,71,0.2) 0%, transparent 60%);
}

.balance-card .card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    position: relative;
    z-index: 2;
}

.balance-card .card-title {
    color: rgba(255,255,255,0.6);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.balance-card .card-menu {
    width: 30px; height: 30px;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
}

.balance-card .main-balance {
    position: relative;
    z-index: 2;
    margin-bottom: 20px;
}

.balance-card .balance-label {
    color: rgba(255,255,255,0.5);
    font-size: 11px;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.balance-card .balance-value {
    color: #fff;
    font-size: 26px;
    font-weight: 700;
}

.balance-card .balance-value.positive { color: var(--kv-success); }
.balance-card .balance-value.negative { color: var(--kv-danger); }

.balance-card .bottom-row {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 2;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.balance-card .bottom-item label {
    color: rgba(255,255,255,0.4);
    font-size: 10px;
    text-transform: uppercase;
    display: block;
    margin-bottom: 3px;
}

.balance-card .bottom-item span { color: #fff; font-size: 14px; font-weight: 600; }

/* ========== Quick Actions ========== */
.quick-actions {
    display: flex;
    justify-content: space-between;
    padding: 20px 15px;
    gap: 10px;
}

.quick-action { flex: 1; text-align: center; text-decoration: none; }

.quick-action .icon-wrap {
    width: 54px; height: 54px;
    border-radius: 16px;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.quick-action .icon-wrap i { font-size: 22px; color: #fff; }

.quick-action:nth-child(1) .icon-wrap { background: linear-gradient(135deg, #1B5E20, #43A047); }
.quick-action:nth-child(2) .icon-wrap { background: linear-gradient(135deg, #1565C0, #42A5F5); }
.quick-action:nth-child(3) .icon-wrap { background: linear-gradient(135deg, #F57C00, #FFB74D); }
.quick-action:nth-child(4) .icon-wrap { background: linear-gradient(135deg, #7B1FA2, #BA68C8); }

.quick-action:hover .icon-wrap { transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.quick-action span { font-size: 12px; color: #666; font-weight: 500; }
.theme-dark .quick-action span { color: #aaa; }

/* ========== Section Title ========== */
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
}

.section-title h3 { 
    font-size: 17px; 
    font-weight: 700; 
    color: var(--kv-text); 
    margin: 0; 
}

.section-title a { 
    font-size: 13px; 
    color: var(--kv-primary); 
    text-decoration: none; 
    font-weight: 500; 
}

.section-title select { 
    font-size: 13px; 
    color: var(--kv-primary); 
    font-weight: 500;
    border: 1px solid var(--kv-border); 
    border-radius: 8px; 
    padding: 5px 10px; 
    background: var(--kv-card-bg); 
}

.theme-dark .section-title select {
    background: var(--kv-input-bg);
    color: var(--kv-text);
    border-color: var(--kv-border);
}

/* ========== Expiry Card ========== */
.expiry-card {
    margin: 0 15px 15px !important;
    border-radius: 16px !important;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05) !important;
}

.expiry-card .content { padding: 18px !important; }

.expiry-card h4 { 
    font-size: 15px; 
    font-weight: 600; 
    margin-bottom: 12px; 
    color: var(--kv-text); 
    display: flex; 
    align-items: center; 
    gap: 8px; 
}

.expiry-card h4 i { color: var(--kv-primary); }

.expiry-progress {
    height: 32px;
    border-radius: 16px;
    background: #e9ecef;
    overflow: hidden;
}

.theme-dark .expiry-progress {
    background: #2a2a3a;
}

.expiry-progress .bar {
    height: 100%;
    border-radius: 16px;
    display: flex;
    align-items: center;
    padding: 0 15px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    transition: width 0.8s ease;
}

.expiry-progress .bar.green { background: linear-gradient(90deg, #43A047, #66BB6A); }
.expiry-progress .bar.orange { background: linear-gradient(90deg, #FF9800, #FFB74D); }
.expiry-progress .bar.red { background: linear-gradient(90deg, #E53935, #EF5350); }

/* ========== P&L Card ========== */
.pnl-card {
    margin: 0 15px 15px !important;
    border-radius: 16px !important;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05) !important;
}

.pnl-card .content { padding: 18px !important; }

.pnl-months {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    text-align: center;
    border-bottom: 1px solid var(--kv-border);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.pnl-month-tab {
    font-size: 14px;
    font-weight: 600;
    color: var(--kv-text-light);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s;
}

.pnl-month-tab.active { 
    color: var(--kv-primary); 
    background: rgba(67,160,71,0.1); 
}

.theme-dark .pnl-month-tab.active {
    background: rgba(67,160,71,0.2);
    color: var(--kv-success);
}

.pnl-data-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    text-align: center;
    margin-bottom: 15px;
}

.pnl-data-item { 
    padding: 12px 8px; 
    background: var(--kv-input-bg); 
    border-radius: 12px; 
}

.pnl-data-item label { 
    font-size: 10px; 
    color: var(--kv-text-light); 
    text-transform: uppercase; 
    display: block; 
    margin-bottom: 5px; 
}

.pnl-data-item span { 
    font-size: 13px; 
    font-weight: 700; 
    color: var(--kv-text);
}

.pnl-net-row {
    background: linear-gradient(135deg, rgba(27,94,32,0.05), rgba(67,160,71,0.1));
    border-radius: 12px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.theme-dark .pnl-net-row {
    background: linear-gradient(135deg, rgba(27,94,32,0.2), rgba(67,160,71,0.15));
}

.pnl-net-row .net-label { 
    font-size: 14px; 
    font-weight: 600; 
    color: var(--kv-text); 
}

.pnl-net-row .net-value { font-size: 18px; font-weight: 700; }

.pnl-view-btn { 
    display: block; 
    text-align: center; 
    margin-top: 15px; 
    color: var(--kv-primary); 
    font-size: 13px; 
    font-weight: 600; 
    text-decoration: none; 
}

.theme-dark .pnl-view-btn {
    color: var(--kv-success);
}

/* ========== Heatmap / P&L Map ========== */
.heatmap-card {
    margin: 0 15px 15px !important;
    border-radius: 16px !important;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05) !important;
}

.heatmap-card .content { padding: 18px !important; }

.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    text-align: center;
}

.heatmap-header { 
    font-size: 11px; 
    font-weight: 600; 
    color: var(--kv-text-light); 
    padding: 5px 0; 
}

.heatmap-cell {
    aspect-ratio: 1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--kv-text-muted);
    background: var(--kv-input-bg);
    cursor: pointer;
    transition: all 0.2s;
}

.heatmap-cell:hover { transform: scale(1.1); }
.heatmap-cell.empty { background: transparent; cursor: default; }
.heatmap-cell.empty:hover { transform: none; }

/* Profit colors (green shades) - Light Mode */
.heatmap-cell.profit-2 { background: #C8E6C9; color: #1B5E20; }
.heatmap-cell.profit-3 { background: #81C784; color: #fff; }
.heatmap-cell.profit-4 { background: #2E7D32; color: #fff; }

/* Loss colors (red shades) - Light Mode */
.heatmap-cell.loss-1 { background: #FFCDD2; color: #B71C1C; }
.heatmap-cell.loss-2 { background: #EF9A9A; color: #fff; }
.heatmap-cell.loss-3 { background: #C62828; color: #fff; }

/* Dark Mode - Brighter colors for visibility */
.theme-dark .heatmap-cell {
    background: #2a2a3a;
    color: #ccc;
}

.theme-dark .heatmap-cell.profit-2 { background: #2E7D32; color: #fff; }
.theme-dark .heatmap-cell.profit-3 { background: #43A047; color: #fff; }
.theme-dark .heatmap-cell.profit-4 { background: #66BB6A; color: #1B5E20; }

.theme-dark .heatmap-cell.loss-1 { background: #C62828; color: #fff; }
.theme-dark .heatmap-cell.loss-2 { background: #E53935; color: #fff; }
.theme-dark .heatmap-cell.loss-3 { background: #EF5350; color: #fff; }

.heatmap-tooltip { 
    text-align: center; 
    padding: 12px; 
    margin-top: 10px; 
    background: var(--kv-input-bg); 
    border-radius: 10px; 
    font-size: 13px; 
    min-height: 50px;
    color: var(--kv-text);
}

/* ========== Recent P&L ========== */
.recent-pnl-card {
    margin: 0 15px 15px !important;
    border-radius: 16px !important;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05) !important;
}

.recent-pnl-card .content { padding: 15px !important; }

.recent-pnl-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--kv-border);
}

.recent-pnl-item:last-child { border-bottom: none; }

.recent-pnl-item .pnl-icon {
    width: 42px; height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 18px;
}

.recent-pnl-item .pnl-icon.profit { background: rgba(76,175,80,0.15); color: var(--kv-success); }
.recent-pnl-item .pnl-icon.loss { background: rgba(239,83,80,0.15); color: var(--kv-danger); }

.recent-pnl-item .pnl-info { flex: 1; }
.recent-pnl-item .pnl-info h6 { 
    font-size: 14px; 
    font-weight: 600; 
    color: var(--kv-text); 
    margin: 0 0 2px; 
}
.recent-pnl-item .pnl-info p { 
    font-size: 11px; 
    color: var(--kv-text-light); 
    margin: 0; 
}

.recent-pnl-item .pnl-amount { font-size: 14px; font-weight: 700; }

/* ========== Toast Notifications ========== */
.toast-container { 
    position: fixed; 
    top: 20px; 
    left: 50%; 
    transform: translateX(-50%); 
    z-index: 9999; 
}

.toast-msg { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    padding: 14px 20px; 
    border-radius: 14px; 
    color: #fff; 
    font-size: 14px; 
    font-weight: 500; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.2); 
    animation: toastIn 0.3s ease; 
    margin-bottom: 10px; 
}

.toast-msg.success { background: linear-gradient(135deg, #1B5E20, #43A047); }
.toast-msg.error { background: linear-gradient(135deg, #C62828, #E53935); }

@keyframes toastIn { 
    from { opacity: 0; transform: translateY(-20px); } 
    to { opacity: 1; transform: translateY(0); } 
}

/* ========== Footer Bar Overrides ========== */
#footer-bar .circle-nav-2::after,
#footer-bar .circle-nav-2::before {
    background-image: linear-gradient(to bottom, #43A047, #1B5E20) !important;
}

#footer-bar a.active-nav i,
#footer-bar a.active-nav span {
    color: var(--kv-primary) !important;
}

.theme-dark #footer-bar {
    background: #1a1a2e !important;
    border-color: #333 !important;
}

.theme-dark #footer-bar a i,
.theme-dark #footer-bar a span {
    color: #888 !important;
}

.theme-dark #footer-bar a.active-nav i,
.theme-dark #footer-bar a.active-nav span {
    color: var(--kv-success) !important;
}

/* ========== Sidebar Styles ========== */
.sidebar-avatar {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--kv-primary), var(--kv-primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    box-shadow: 0 5px 15px rgba(27,94,32,0.3);
}

.sidebar-balance-card {
    background: linear-gradient(135deg, var(--kv-primary) 0%, var(--kv-primary-light) 100%);
    border-radius: 16px;
    padding: 18px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.sidebar-balance-card::before {
    content: '';
    position: absolute;
    top: -50%; right: -30%;
    width: 100px; height: 100px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.sidebar-balance-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.sidebar-quick-btn {
    width: 45px;
    height: 45px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff !important;
    font-size: 18px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    transition: all 0.3s;
}

.sidebar-quick-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

#menu-sidebar .list-group-item {
    padding: 14px 15px;
    border: none;
    background: transparent;
}

#menu-sidebar .list-group-item i:first-child {
    width: 38px;
    height: 38px;
    line-height: 38px;
    text-align: center;
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    margin-right: 12px;
}

#menu-sidebar .list-group-item div {
    font-weight: 500;
    font-size: 14px;
    color: var(--kv-text);
}

#menu-sidebar .list-menu-large {
    background: rgba(0,0,0,0.03);
}

.theme-dark #menu-sidebar {
    background: #1a1a2e !important;
}

.theme-dark #menu-sidebar .list-menu-large {
    background: rgba(255,255,255,0.05);
}

.theme-dark .sidebar-balance-card {
    background: linear-gradient(135deg, #1a3a1a 0%, #2d5a2d 100%);
}

/* ========== Animations ========== */
.fade-in-up {
    animation: fadeInUp 0.5s ease;
}

.fade-in-up-1 { animation: fadeInUp 0.5s ease 0.1s both; }
.fade-in-up-2 { animation: fadeInUp 0.5s ease 0.2s both; }
.fade-in-up-3 { animation: fadeInUp 0.5s ease 0.3s both; }
.fade-in-up-4 { animation: fadeInUp 0.5s ease 0.4s both; }
.fade-in-up-5 { animation: fadeInUp 0.5s ease 0.5s both; }

@keyframes fadeInUp { 
    from { opacity: 0; transform: translateY(20px); } 
    to { opacity: 1; transform: translateY(0); } 
}

/* ========== Page Header Bar (for inner pages) ========== */
.page-header-bar {
    background: linear-gradient(135deg, var(--kv-primary) 0%, var(--kv-primary-light) 100%);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.page-header-bar .back-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
}

.page-header-bar .page-title {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.page-header-bar .header-actions {
    display: flex;
    gap: 10px;
}

/* ========== List/Table Styles ========== */
.data-list-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: var(--kv-card-bg);
    border-radius: 12px;
    margin-bottom: 10px;
}

.theme-dark .data-list-item {
    background: var(--kv-card-bg);
}

/* ========== Form Elements ========== */
.theme-dark input[type="text"],
.theme-dark input[type="password"],
.theme-dark input[type="email"],
.theme-dark input[type="date"],
.theme-dark select,
.theme-dark textarea {
    background: var(--kv-input-bg) !important;
    border-color: var(--kv-border) !important;
    color: var(--kv-text) !important;
}

.theme-dark input::placeholder {
    color: var(--kv-text-light) !important;
}

/* ========== Reusable List Item Components ========== */
/* Use these classes for consistent list items across all pages */

.kv-list-item {
    display: flex;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    transition: background 0.2s;
}

.kv-list-item:last-child {
    border-bottom: none;
}

.kv-list-item:active {
    background: rgba(0,0,0,0.02);
}

.theme-dark .kv-list-item {
    border-bottom-color: rgba(255,255,255,0.06);
}

.theme-dark .kv-list-item:active {
    background: rgba(255,255,255,0.02);
}

/* Left icon/avatar */
.kv-list-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-right: 12px;
    flex-shrink: 0;
}

.kv-list-icon.buy {
    background: linear-gradient(135deg, rgba(76,175,80,0.15), rgba(76,175,80,0.25));
    color: #2E7D32;
}

.kv-list-icon.sell {
    background: linear-gradient(135deg, rgba(239,83,80,0.15), rgba(239,83,80,0.25));
    color: #C62828;
}

.kv-list-icon.neutral {
    background: linear-gradient(135deg, rgba(100,100,100,0.1), rgba(100,100,100,0.15));
    color: #666;
}

.theme-dark .kv-list-icon.buy {
    background: linear-gradient(135deg, rgba(76,175,80,0.2), rgba(76,175,80,0.3));
    color: #66BB6A;
}

.theme-dark .kv-list-icon.sell {
    background: linear-gradient(135deg, rgba(239,83,80,0.2), rgba(239,83,80,0.3));
    color: #EF5350;
}

.theme-dark .kv-list-icon.neutral {
    background: rgba(255,255,255,0.1);
    color: #aaa;
}

/* Content area */
.kv-list-content {
    flex: 1;
    min-width: 0;
}

.kv-list-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--kv-text);
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.kv-list-subtitle {
    font-size: 12px;
    color: var(--kv-text-light);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* Right side values */
.kv-list-value {
    text-align: right;
    flex-shrink: 0;
    margin-left: 10px;
}

.kv-list-amount {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 2px;
}

.kv-list-amount.positive { color: var(--kv-success); }
.kv-list-amount.negative { color: var(--kv-danger); }

.kv-list-meta {
    font-size: 11px;
    color: var(--kv-text-light);
    margin: 0;
}

/* ========== Badges ========== */
.kv-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.kv-badge-buy {
    background: linear-gradient(135deg, #C8E6C9, #A5D6A7);
    color: #1B5E20;
}

.kv-badge-sell {
    background: linear-gradient(135deg, #FFCDD2, #EF9A9A);
    color: #B71C1C;
}

.kv-badge-ban {
    background: linear-gradient(135deg, #EF5350, #E53935);
    color: #fff;
}

.kv-badge-ce {
    background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
    color: #1565C0;
}

.kv-badge-pe {
    background: linear-gradient(135deg, #FCE4EC, #F8BBD9);
    color: #AD1457;
}

.kv-badge-fut {
    background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
    color: #E65100;
}

.kv-badge-eq {
    background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
    color: #2E7D32;
}

.theme-dark .kv-badge-buy {
    background: rgba(76,175,80,0.25);
    color: #81C784;
}

.theme-dark .kv-badge-sell {
    background: rgba(239,83,80,0.25);
    color: #EF5350;
}

.theme-dark .kv-badge-ce {
    background: rgba(33,150,243,0.2);
    color: #64B5F6;
}

.theme-dark .kv-badge-pe {
    background: rgba(233,30,99,0.2);
    color: #F48FB1;
}

.theme-dark .kv-badge-fut {
    background: rgba(255,152,0,0.2);
    color: #FFB74D;
}

.theme-dark .kv-badge-eq {
    background: rgba(76,175,80,0.2);
    color: #81C784;
}

/* Badge with dot indicator */
.kv-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
}

.kv-dot.green { background: var(--kv-success); }
.kv-dot.red { background: var(--kv-danger); }
.kv-dot.orange { background: #FF9800; }
.kv-dot.blue { background: #2196F3; }

/* ========== Change Indicator ========== */
.kv-change {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}

.kv-change.up {
    background: rgba(76,175,80,0.1);
    color: var(--kv-success);
}

.kv-change.down {
    background: rgba(239,83,80,0.1);
    color: var(--kv-danger);
}

.kv-change i {
    font-size: 10px;
    margin-right: 2px;
}

/* ========== Summary Stats Row ========== */
.kv-stats-row {
    display: flex;
    background: var(--kv-input-bg);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 15px;
}

.kv-stat-item {
    flex: 1;
    text-align: center;
    position: relative;
}

.kv-stat-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 30px;
    width: 1px;
    background: var(--kv-border);
}

.kv-stat-label {
    font-size: 10px;
    color: var(--kv-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.kv-stat-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--kv-text);
}

.kv-stat-value.positive { color: var(--kv-success); }
.kv-stat-value.negative { color: var(--kv-danger); }

/* ========== Total Value Card ========== */
.kv-total-card {
    background: linear-gradient(135deg, var(--kv-primary), var(--kv-primary-light));
    border-radius: 14px;
    padding: 16px;
    color: #fff;
    margin-bottom: 15px;
    position: relative;
    overflow: hidden;
}

.kv-total-card::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -20%;
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.kv-total-card .label {
    font-size: 11px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.kv-total-card .value {
    font-size: 24px;
    font-weight: 700;
}

.kv-total-card .icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 40px;
    opacity: 0.2;
}

/* ========== Empty State ========== */
.kv-empty-state {
    text-align: center;
    padding: 40px 20px;
}

.kv-empty-state i {
    font-size: 50px;
    color: var(--kv-text-light);
    opacity: 0.3;
    margin-bottom: 15px;
    display: block;
}

.kv-empty-state h6 {
    font-size: 16px;
    font-weight: 600;
    color: var(--kv-text);
    margin-bottom: 6px;
}

.kv-empty-state p {
    font-size: 13px;
    color: var(--kv-text-light);
    margin: 0;
}

/* ========== Search Box ========== */
.kv-search-box {
    position: relative;
    margin-bottom: 15px;
}

.kv-search-box input {
    width: 100%;
    height: 46px;
    padding: 0 45px 0 45px;
    border: 1.5px solid var(--kv-border);
    border-radius: 12px;
    background: var(--kv-card-bg);
    font-size: 14px;
    color: var(--kv-text);
    transition: all 0.3s;
}

.kv-search-box input:focus {
    outline: none;
    border-color: var(--kv-primary);
    box-shadow: 0 0 0 3px rgba(27,94,32,0.1);
}

.kv-search-box input::placeholder {
    color: var(--kv-text-light);
}

.kv-search-box .search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--kv-text-light);
    font-size: 18px;
    pointer-events: none;
}

.kv-search-box .clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: none;
    background: var(--kv-input-bg);
    border-radius: 50%;
    color: var(--kv-text-light);
    font-size: 14px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.kv-search-box .clear-btn:hover {
    background: var(--kv-danger);
    color: #fff;
}

.kv-search-box.has-value .clear-btn {
    display: flex;
}

.theme-dark .kv-search-box input {
    background: var(--kv-input-bg);
    border-color: var(--kv-border);
}

.theme-dark .kv-search-box input:focus {
    border-color: var(--kv-primary-light);
    box-shadow: 0 0 0 3px rgba(67,160,71,0.15);
}

/* Search Result Count */
.kv-search-result {
    font-size: 12px;
    color: var(--kv-text-light);
    margin-bottom: 10px;
    padding: 0 5px;
}

.kv-search-result strong {
    color: var(--kv-primary);
}

.theme-dark .kv-search-result strong {
    color: var(--kv-primary-light);
}

/* No Search Results */
.kv-no-results {
    text-align: center;
    padding: 30px 20px;
}

.kv-no-results i {
    font-size: 40px;
    color: var(--kv-text-light);
    opacity: 0.3;
    margin-bottom: 10px;
    display: block;
}

.kv-no-results p {
    font-size: 14px;
    color: var(--kv-text-light);
    margin: 0;
}

/* ========== Filter Pills ========== */
.kv-filter-pills {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    overflow-x: auto;
    padding-bottom: 5px;
    -webkit-overflow-scrolling: touch;
}

.kv-filter-pills::-webkit-scrollbar {
    display: none;
}

.kv-filter-pill {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
    border: 1.5px solid var(--kv-border);
    background: var(--kv-card-bg);
    color: var(--kv-text-muted);
}

.kv-filter-pill:hover {
    border-color: var(--kv-primary);
    color: var(--kv-primary);
}

.kv-filter-pill.active {
    background: var(--kv-primary);
    border-color: var(--kv-primary);
    color: #fff;
}

.theme-dark .kv-filter-pill {
    background: var(--kv-input-bg);
    border-color: var(--kv-border);
}

.theme-dark .kv-filter-pill.active {
    background: var(--kv-primary-light);
    border-color: var(--kv-primary-light);
}

/* ========== P&L Popup Elegant Styles ========== */

/* Popup container fix */
#pnlPopupContainer .offcanvas {
    overflow: visible !important;
}

#pnlPopupContainer .menu-size {
    overflow: visible !important;
}

/* Popup Header */
.pnl-popup-header {
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

.pnl-popup-header.profit {
    background: linear-gradient(135deg, #1B5E20 0%, #43A047 100%);
}

.pnl-popup-header.loss {
    background: linear-gradient(135deg, #C62828 0%, #EF5350 100%);
}

.pnl-popup-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.pnl-popup-date {
    font-size: 11px;
    color: rgba(255,255,255,0.8);
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pnl-popup-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.pnl-popup-total {
    text-align: right;
}

.pnl-popup-amount {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}

.pnl-popup-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 60px;
    color: rgba(255,255,255,0.15);
    z-index: 0;
}

/* Segment List */
.pnl-popup-segments {
    background: var(--kv-card-bg);
    border-radius: 12px;
    overflow: hidden;
}

.pnl-segment-item {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid var(--kv-border);
}

.pnl-segment-item:last-child {
    border-bottom: none;
}

.pnl-segment-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 16px;
    color: #fff;
}

.pnl-segment-icon.eq {
    background: linear-gradient(135deg, #1565C0, #42A5F5);
}

.pnl-segment-icon.fo {
    background: linear-gradient(135deg, #7B1FA2, #BA68C8);
}

.pnl-segment-icon.com {
    background: linear-gradient(135deg, #F57C00, #FFB74D);
}

.pnl-segment-icon.expense {
    background: linear-gradient(135deg, #455A64, #90A4AE);
}

.pnl-segment-icon.lpc {
    background: linear-gradient(135deg, #D32F2F, #EF5350);
}

.pnl-segment-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.pnl-segment-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--kv-text);
}

.pnl-segment-label {
    font-size: 11px;
    color: var(--kv-text-muted);
}

.pnl-segment-value {
    font-size: 14px;
    font-weight: 700;
}

.pnl-segment-value.positive {
    color: #43A047;
}

.pnl-segment-value.negative {
    color: #EF5350;
}

.pnl-segment-divider {
    height: 1px;
    background: var(--kv-border);
    margin: 4px 14px;
}

/* Dark mode adjustments */
.theme-dark .pnl-popup-segments {
    background: var(--kv-input-bg);
}

.theme-dark .pnl-segment-item {
    border-color: var(--kv-border);
}

.theme-dark .pnl-segment-divider {
    background: var(--kv-border);
}

/* ========== P&L Details Page Styles ========== */

/* Segment Summary */
.pnl-segment-summary {
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pnl-segment-summary.profit {
    background: linear-gradient(135deg, rgba(67, 160, 71, 0.15), rgba(27, 94, 32, 0.1));
    border: 1px solid rgba(67, 160, 71, 0.3);
}

.pnl-segment-summary.loss {
    background: linear-gradient(135deg, rgba(239, 83, 80, 0.15), rgba(198, 40, 40, 0.1));
    border: 1px solid rgba(239, 83, 80, 0.3);
}

.pnl-segment-summary-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--kv-text);
}

.pnl-segment-summary-value {
    font-size: 18px;
    font-weight: 700;
}

.pnl-segment-summary.profit .pnl-segment-summary-value {
    color: #43A047;
}

.pnl-segment-summary.loss .pnl-segment-summary-value {
    color: #EF5350;
}

/* Scrip Divider (centered header) */
.pnl-scrip-divider {
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--kv-primary);
    padding: 14px 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Trade Card */
.pnl-trade-card {
    background: var(--kv-card-bg);
    border: 1px solid var(--kv-border);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
}

.pnl-trade-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.pnl-trade-symbol {
    font-size: 14px;
    font-weight: 700;
    color: var(--kv-text);
    flex: 1;
    padding-right: 10px;
}

.pnl-trade-pnl {
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
}

.pnl-trade-pnl.profit {
    color: #2E7D32;
}

.pnl-trade-pnl.loss {
    color: #D32F2F;
}

/* Quantity Grid */
.pnl-trade-grid {
    background: var(--kv-input-bg);
    border-radius: 10px;
    padding: 10px;
}

.pnl-grid-row {
    display: flex;
    gap: 8px;
}

.pnl-grid-row + .pnl-grid-row {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--kv-border);
}

.pnl-grid-cell {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 6px 4px;
    background: var(--kv-card-bg);
    border-radius: 8px;
}

.pnl-cell-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--kv-text-light);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.pnl-cell-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--kv-text);
    margin-bottom: 2px;
}

.pnl-cell-value.positive {
    color: #2E7D32;
}

.pnl-cell-value.negative {
    color: #D32F2F;
}

.pnl-cell-price {
    font-size: 11px;
    color: var(--kv-text-muted);
}

/* Tabs */
.kv-tabs {
    display: flex;
    background: var(--kv-input-bg);
    border-radius: 10px;
    padding: 4px;
}

.kv-tab {
    flex: 1;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--kv-text-muted);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kv-tab.active {
    background: var(--kv-card-bg);
    color: var(--kv-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tab-content {
    min-height: 200px;
}

/* Dark mode */
.theme-dark .pnl-scrip-divider {
    color: var(--kv-primary-light);
}

.theme-dark .pnl-trade-card {
    background: var(--kv-card-bg);
    border-color: var(--kv-border);
}

.theme-dark .pnl-trade-grid {
    background: rgba(255,255,255,0.03);
}

.theme-dark .pnl-grid-cell {
    background: var(--kv-card-bg);
}

.theme-dark .pnl-grid-row + .pnl-grid-row {
    border-color: var(--kv-border);
}

.theme-dark .kv-tabs {
    background: var(--kv-input-bg);
}

.theme-dark .kv-tab.active {
    background: var(--kv-card-bg);
}

/* ========== Admin Dashboard Styles ========== */

.admin-header {
    background: linear-gradient(135deg, #1B5E20 0%, #43A047 100%);
    padding: 20px 15px 60px 15px;
    position: relative;
}

.admin-header .header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.admin-header .greeting p {
    color: rgba(255,255,255,0.8);
    font-size: 12px;
    margin-bottom: 2px;
}

.admin-header .greeting h1 {
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.admin-header .header-actions {
    display: flex;
    gap: 8px;
}

.admin-header .header-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    border: none;
    font-size: 18px;
}

.admin-header .header-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
}

.admin-header .header-wave svg {
    width: 100%;
    height: 100%;
}

.admin-header .header-wave path {
    fill: var(--kv-bg);
}

/* Admin Info Card */
.admin-info-card {
    margin: -40px 15px 20px 15px;
    border-radius: 16px;
    background: var(--kv-card-bg);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 20px;
}

.admin-info-card .card-inner {
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-avatar {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, #1B5E20, #43A047);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
}

.admin-details h4 {
    font-size: 18px;
    font-weight: 700;
    color: var(--kv-text);
    margin: 0 0 2px 0;
}

.admin-details p {
    font-size: 13px;
    color: var(--kv-text-muted);
    margin: 0;
}

.admin-badge {
    margin-left: auto;
}

.admin-badge span {
    background: linear-gradient(135deg, #1B5E20, #43A047);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

/* Section Title */
.section-title {
    padding: 0 15px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title h6 {
    font-size: 14px;
    font-weight: 700;
    color: var(--kv-text);
    margin: 0;
}

.section-title .view-all {
    font-size: 12px;
    color: var(--kv-primary);
    text-decoration: none;
    font-weight: 600;
}

/* Recent JV List */
.recent-jv-list {
    display: flex;
    flex-direction: column;
}

.recent-jv-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--kv-border);
}

.recent-jv-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.recent-jv-item:first-child {
    padding-top: 0;
}

.recent-jv-item .jv-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.recent-jv-item .jv-icon.credit {
    background: rgba(46, 125, 50, 0.1);
    color: #2E7D32;
}

.recent-jv-item .jv-icon.debit {
    background: rgba(198, 40, 40, 0.1);
    color: #C62828;
}

.recent-jv-item .jv-info {
    flex: 1;
}

.recent-jv-item .jv-info h6 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    color: var(--kv-text);
}

.recent-jv-item .jv-info p {
    font-size: 11px;
    margin: 0;
    color: var(--kv-text-muted);
}

.recent-jv-item .jv-amount {
    font-size: 14px;
    font-weight: 700;
}

.recent-jv-item .jv-amount.credit {
    color: #2E7D32;
}

.recent-jv-item .jv-amount.debit {
    color: #C62828;
}

.no-entries {
    text-align: center;
    padding: 20px;
    color: var(--kv-text-muted);
    font-size: 13px;
}

/* Admin Menu Grid */
.admin-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 15px;
    margin-bottom: 20px;
}

.admin-menu-item {
    background: var(--kv-card-bg);
    border-radius: 16px;
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
    position: relative;
}

.admin-menu-item:active {
    transform: scale(0.97);
}

.admin-menu-item.disabled {
    opacity: 0.6;
    pointer-events: none;
}

.admin-menu-item small {
    position: absolute;
    bottom: 8px;
    font-size: 9px;
    color: var(--kv-text-muted);
}

.menu-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    margin-bottom: 10px;
}

.menu-icon.jv { background: linear-gradient(135deg, #1B5E20, #43A047); }
.menu-icon.reports { background: linear-gradient(135deg, #1565C0, #42A5F5); }
.menu-icon.clients { background: linear-gradient(135deg, #F57C00, #FFB74D); }
.menu-icon.settings { background: linear-gradient(135deg, #5E35B1, #9575CD); }

.admin-menu-item span {
    font-size: 13px;
    font-weight: 600;
    color: var(--kv-text);
}

/* Admin Summary Grid */
.admin-summary-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.summary-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
}

.summary-icon.blue { background: linear-gradient(135deg, #1565C0, #42A5F5); }
.summary-icon.green { background: linear-gradient(135deg, #1B5E20, #43A047); }
.summary-icon.red { background: linear-gradient(135deg, #C62828, #EF5350); }

.summary-info h5 {
    font-size: 18px;
    font-weight: 700;
    color: var(--kv-text);
    margin: 0;
}

.summary-info p {
    font-size: 12px;
    color: var(--kv-text-muted);
    margin: 0;
}

/* Admin Sidebar Avatar */
.admin-sidebar-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1B5E20, #43A047);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
}

/* Dark Mode Admin */
.theme-dark .admin-info-card {
    background: var(--kv-card-bg);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.theme-dark .admin-menu-item {
    background: var(--kv-card-bg);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* ========== JV Entry Page Styles ========== */

.jv-header {
    background: linear-gradient(135deg, #1B5E20 0%, #43A047 100%);
    padding: 15px 15px 50px 15px;
    position: relative;
}

.jv-header .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.jv-header .header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.jv-header .back-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
}

.jv-header .header-title h1 {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.jv-header .header-title p {
    color: rgba(255,255,255,0.8);
    font-size: 11px;
    margin: 0;
}

.jv-header .header-actions {
    display: flex;
    gap: 8px;
}

.jv-header .header-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    border: none;
    font-size: 18px;
}

.jv-header .header-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
}

.jv-header .header-wave svg {
    width: 100%;
    height: 100%;
}

.jv-header .header-wave path {
    fill: var(--kv-bg);
}

/* JV Filter Card */
.jv-filter-card {
    margin: -15px 15px 15px 15px;
    background: var(--kv-card-bg);
    border-radius: 14px;
    padding: 20px 14px 14px 14px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.filter-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.filter-item {
    flex: 1;
}

.filter-item label {
    font-size: 10px;
    font-weight: 600;
    color: var(--kv-text-muted);
    text-transform: uppercase;
    margin-bottom: 6px;
    display: block;
    letter-spacing: 0.5px;
}

.filter-item .form-control {
    padding: 10px 10px;
    font-size: 13px;
    border-radius: 8px;
    border: 1px solid var(--kv-border);
    background: var(--kv-input-bg);
    color: var(--kv-text);
}

.filter-btn {
    width: 44px;
    min-width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1B5E20, #43A047);
    border: none;
    color: #fff;
    font-size: 18px;
    align-self: flex-end;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-quick {
    display: flex;
    gap: 8px;
}

.quick-filter {
    flex: 1;
    padding: 8px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--kv-border);
    background: transparent;
    border-radius: 8px;
    color: var(--kv-text-muted);
    transition: all 0.2s ease;
}

.quick-filter.active {
    background: linear-gradient(135deg, #1B5E20, #43A047);
    border-color: transparent;
    color: #fff;
}

/* JV Summary - Updated for 4 cards */
.jv-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 0 15px;
    margin-bottom: 12px;
}

.summary-card {
    background: var(--kv-card-bg);
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: all 0.2s ease;
}

.summary-card:active {
    transform: scale(0.97);
}

.summary-card .summary-value {
    font-size: 18px;
    font-weight: 700;
}

.summary-card .summary-label {
    font-size: 9px;
    color: var(--kv-text-muted);
    text-transform: uppercase;
    margin-top: 2px;
}

.summary-card.total .summary-value { color: #1565C0; }
.summary-card.matched .summary-value { color: #2E7D32; }
.summary-card.pending .summary-value { color: #F57C00; }
.summary-card.korponly .summary-value { color: #7B1FA2; }

/* Status Filter Tabs */
.status-filter {
    display: flex;
    gap: 8px;
    padding: 0 15px;
    margin-bottom: 12px;
    overflow-x: auto;
}

.status-tab {
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--kv-border);
    background: transparent;
    border-radius: 20px;
    color: var(--kv-text-muted);
    white-space: nowrap;
    transition: all 0.2s ease;
}

.status-tab.active {
    background: linear-gradient(135deg, #1B5E20, #43A047);
    border-color: transparent;
    color: #fff;
}

/* JV Search Box */
.jv-search-box {
    display: flex;
    align-items: center;
    background: var(--kv-card-bg);
    border: 1px solid var(--kv-border);
    border-radius: 12px;
    padding: 10px 14px;
    margin: 0 15px 15px 15px;
    gap: 10px;
}

.jv-search-box i.bi-search {
    color: var(--kv-text-muted);
    font-size: 16px;
}

.jv-search-box input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    color: var(--kv-text);
    outline: none;
}

.jv-search-box input::placeholder {
    color: var(--kv-text-muted);
}

.jv-search-box .clear-search {
    background: none;
    border: none;
    padding: 0;
    color: var(--kv-text-muted);
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
}

.jv-search-box .clear-search:hover {
    color: var(--kv-text);
}

/* Dark mode search */
.theme-dark .jv-search-box {
    background: var(--kv-card-bg);
    border-color: var(--kv-border);
}

/* ========== Balance Book Styles ========== */

/* Balance Summary */
.balance-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 0 15px;
    margin: 0 0 15px 0;
}

.balance-summary .summary-card {
    background: var(--kv-card-bg);
    border-radius: 12px;
    padding: 14px 6px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.balance-summary .summary-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--kv-text);
    line-height: 1.2;
}

.balance-summary .summary-label {
    font-size: 8px;
    color: var(--kv-text-muted);
    text-transform: uppercase;
    margin-top: 4px;
    letter-spacing: 0.3px;
}

/* Balance Search Box */
.balance-search-box {
    display: flex;
    align-items: center;
    background: var(--kv-card-bg);
    border: 1px solid var(--kv-border);
    border-radius: 12px;
    padding: 10px 14px;
    margin: 0 15px 15px 15px;
    gap: 10px;
}

.balance-search-box i.bi-search {
    color: var(--kv-text-muted);
    font-size: 16px;
}

.balance-search-box input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    color: var(--kv-text);
    outline: none;
}

.balance-search-box input::placeholder {
    color: var(--kv-text-muted);
}

.balance-search-box .clear-search {
    background: none;
    border: none;
    padding: 0;
    color: var(--kv-text-muted);
    font-size: 16px;
    cursor: pointer;
}

/* Balance List */
.balance-list {
    display: flex;
    flex-direction: column;
}

.balance-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--kv-border);
    cursor: pointer;
    transition: background 0.15s ease;
}

.balance-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.balance-item:first-child {
    padding-top: 0;
}

.balance-item:active {
    background: var(--kv-input-bg);
    margin: 0 -16px;
    padding-left: 16px;
    padding-right: 16px;
}

.balance-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.balance-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.balance-avatar.positive {
    background: rgba(46, 125, 50, 0.12);
    color: #2E7D32;
}

.balance-avatar.negative {
    background: rgba(198, 40, 40, 0.12);
    color: #C62828;
}

.balance-item-info {
    flex: 1;
    min-width: 0;
}

.balance-item-info h6 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    color: var(--kv-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.balance-item-info p {
    font-size: 11px;
    color: var(--kv-text-muted);
    margin: 2px 0 0 0;
}

.balance-item-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.balance-amount {
    font-size: 14px;
    font-weight: 700;
    text-align: right;
}

.balance-amount.positive {
    color: #2E7D32;
}

.balance-amount.negative {
    color: #C62828;
}

.balance-item-right .bi-chevron-right {
    color: var(--kv-text-muted);
    font-size: 14px;
}

/* Balance Detail Popup */
#balanceDetailPopup .offcanvas-content {
    padding: 20px;
}

.popup-header {
    text-align: center;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--kv-border);
    margin-bottom: 16px;
}

.popup-header h5 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: var(--kv-text);
}

.popup-header p {
    font-size: 12px;
    color: var(--kv-text-muted);
    margin: 4px 0 0 0;
}

.popup-body {
    margin-bottom: 16px;
}

.detail-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-label {
    font-size: 13px;
    color: var(--kv-text-muted);
}

.detail-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--kv-text);
}

.detail-value.positive {
    color: #2E7D32;
}

.detail-value.negative {
    color: #C62828;
}

.popup-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px;
    background: var(--kv-input-bg);
    border-radius: 12px;
    margin-top: 16px;
}

.popup-total span:first-child {
    font-size: 14px;
    font-weight: 600;
    color: var(--kv-text);
}

.popup-total span:last-child {
    font-size: 18px;
    font-weight: 700;
}

.popup-total .positive {
    color: #2E7D32;
}

.popup-total .negative {
    color: #C62828;
}

.popup-footer {
    padding-top: 16px;
    border-top: 1px solid var(--kv-border);
}

.btn-view-details {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #1B5E20, #43A047);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-view-details:active {
    transform: scale(0.98);
}

/* Dark mode balance */
.theme-dark .balance-summary .summary-card {
    background: var(--kv-card-bg);
}

.theme-dark .balance-search-box {
    background: var(--kv-card-bg);
    border-color: var(--kv-border);
}

.theme-dark .balance-avatar.positive {
    background: rgba(46, 125, 50, 0.2);
}

.theme-dark .balance-avatar.negative {
    background: rgba(198, 40, 40, 0.2);
}

/* ========== Gross P&L Styles ========== */

/* Gross P&L Filter */
.grosspnl-filter {
    background: var(--kv-card-bg);
    border-radius: 14px;
    padding: 14px;
    margin: 0 15px 15px 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.filter-toggle {
    display: flex;
    background: var(--kv-input-bg);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 12px;
}

.toggle-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--kv-text-muted);
    transition: all 0.2s ease;
}

.toggle-btn.active {
    background: linear-gradient(135deg, #1B5E20, #43A047);
    color: #fff;
}

.filter-select {
    display: flex;
}

.month-select,
.date-select {
    flex: 1;
}

.filter-select .form-control {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    border-radius: 10px;
    border: 1px solid var(--kv-border);
    background: var(--kv-input-bg);
    color: var(--kv-text);
}

/* Gross P&L Summary */
.grosspnl-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 0 15px;
    margin-bottom: 15px;
}

.grosspnl-summary .summary-card {
    background: var(--kv-card-bg);
    border-radius: 12px;
    padding: 14px 6px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.grosspnl-summary .summary-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--kv-text);
    line-height: 1.2;
}

.grosspnl-summary .summary-label {
    font-size: 8px;
    color: var(--kv-text-muted);
    text-transform: uppercase;
    margin-top: 4px;
    letter-spacing: 0.3px;
}

/* Gross P&L Search Box */
.grosspnl-search-box {
    display: flex;
    align-items: center;
    background: var(--kv-card-bg);
    border: 1px solid var(--kv-border);
    border-radius: 12px;
    padding: 10px 14px;
    margin: 0 15px 15px 15px;
    gap: 10px;
}

.grosspnl-search-box i.bi-search {
    color: var(--kv-text-muted);
    font-size: 16px;
}

.grosspnl-search-box input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    color: var(--kv-text);
    outline: none;
}

.grosspnl-search-box input::placeholder {
    color: var(--kv-text-muted);
}

.grosspnl-search-box .clear-search {
    background: none;
    border: none;
    padding: 0;
    color: var(--kv-text-muted);
    font-size: 16px;
    cursor: pointer;
}

/* Gross P&L List */
.grosspnl-list {
    display: flex;
    flex-direction: column;
}

.grosspnl-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--kv-border);
    cursor: pointer;
    transition: background 0.15s ease;
}

.grosspnl-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.grosspnl-item:first-child {
    padding-top: 0;
}

.grosspnl-item:active {
    background: var(--kv-input-bg);
    margin: 0 -16px;
    padding-left: 16px;
    padding-right: 16px;
}

.grosspnl-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.grosspnl-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.grosspnl-avatar.positive {
    background: rgba(46, 125, 50, 0.12);
    color: #2E7D32;
}

.grosspnl-avatar.negative {
    background: rgba(198, 40, 40, 0.12);
    color: #C62828;
}

.grosspnl-item-info {
    flex: 1;
    min-width: 0;
}

.grosspnl-item-info h6 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    color: var(--kv-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.grosspnl-item-info p {
    font-size: 10px;
    color: var(--kv-text-muted);
    margin: 2px 0 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.grosspnl-item-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.grosspnl-amount {
    font-size: 14px;
    font-weight: 700;
    text-align: right;
}

.grosspnl-amount.positive {
    color: #2E7D32;
}

.grosspnl-amount.negative {
    color: #C62828;
}

.grosspnl-item-right .bi-chevron-right {
    color: var(--kv-text-muted);
    font-size: 14px;
}

/* Gross P&L Detail Popup */
#grosspnlDetailPopup {
    background: var(--kv-card-bg);
}

#grosspnlDetailPopup .offcanvas-content {
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.popup-drag-handle {
    width: 40px;
    height: 4px;
    background: var(--kv-border);
    border-radius: 2px;
    margin: 12px auto;
}

#grosspnlDetailPopup .popup-header {
    text-align: center;
    padding: 5px 20px 20px;
    border-bottom: 1px solid var(--kv-border);
    background: var(--kv-card-bg);
}

#grosspnlDetailPopup .popup-header h5 {
    font-size: 17px;
    font-weight: 700;
    margin: 0;
    color: var(--kv-text);
}

#grosspnlDetailPopup .popup-header p {
    font-size: 12px;
    color: var(--kv-text-muted);
    margin: 6px 0 0 0;
}

.popup-scrollable {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--kv-bg);
}

.popup-section {
    background: var(--kv-card-bg);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.popup-section .section-title {
    font-size: 12px;
    font-weight: 700;
    color: #1B5E20;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--kv-border);
}

.popup-section .detail-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.popup-section .detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-section .detail-label {
    font-size: 14px;
    color: var(--kv-text-muted);
}

.popup-section .detail-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--kv-text);
}

.popup-section .detail-value.positive {
    color: #2E7D32;
}

.popup-section .detail-value.negative {
    color: #C62828;
}

#grosspnlDetailPopup .popup-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px;
    background: var(--kv-card-bg);
    border-radius: 14px;
    margin-top: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

#grosspnlDetailPopup .popup-total span:first-child {
    font-size: 15px;
    font-weight: 700;
    color: var(--kv-text);
}

#grosspnlDetailPopup .popup-total span:last-child {
    font-size: 22px;
    font-weight: 700;
}

#grosspnlDetailPopup .popup-total .positive {
    color: #2E7D32;
}

#grosspnlDetailPopup .popup-total .negative {
    color: #C62828;
}

#grosspnlDetailPopup .popup-footer {
    padding: 16px 20px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--kv-border);
    background: var(--kv-card-bg);
}

#grosspnlDetailPopup .btn-view-details {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #1B5E20, #43A047);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(27, 94, 32, 0.3);
}

#grosspnlDetailPopup .btn-view-details:active {
    transform: scale(0.98);
}

/* Dark mode Gross P&L */
.theme-dark .grosspnl-filter {
    background: var(--kv-card-bg);
}

.theme-dark .filter-toggle {
    background: var(--kv-input-bg);
}

.theme-dark .grosspnl-summary .summary-card {
    background: var(--kv-card-bg);
}

.theme-dark .grosspnl-search-box {
    background: var(--kv-card-bg);
    border-color: var(--kv-border);
}

.theme-dark .grosspnl-avatar.positive {
    background: rgba(46, 125, 50, 0.2);
}

.theme-dark .grosspnl-avatar.negative {
    background: rgba(198, 40, 40, 0.2);
}

/* ========== P&L Detail Page Styles ========== */

/* P&L Detail Header */
.pnldetail-header {
    background: linear-gradient(135deg, #1B5E20 0%, #43A047 100%);
    padding: 15px 15px 20px;
    margin-bottom: 15px;
}

.pnldetail-header .header-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pnldetail-header .back-btn {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
}

.pnldetail-header .header-info {
    flex: 1;
}

.pnldetail-header .header-info h1 {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.pnldetail-header .header-info p {
    font-size: 12px;
    color: rgba(255,255,255,0.8);
    margin: 4px 0 0 0;
}

.pnldetail-header .header-btn {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
}

/* P&L Detail Summary */
.pnldetail-summary {
    display: flex;
    gap: 10px;
    padding: 0 15px;
    margin-bottom: 15px;
}

.pnldetail-summary .summary-card {
    flex: 1;
    background: var(--kv-card-bg);
    border-radius: 14px;
    padding: 14px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: transform 0.15s ease;
}

.pnldetail-summary .summary-card:active {
    transform: scale(0.97);
}

.pnldetail-summary .summary-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.pnldetail-summary .summary-icon.all {
    background: rgba(21, 101, 192, 0.12);
    color: #1565C0;
}

.pnldetail-summary .summary-icon.fo {
    background: rgba(46, 125, 50, 0.12);
    color: #2E7D32;
}

.pnldetail-summary .summary-icon.eq {
    background: rgba(245, 124, 0, 0.12);
    color: #F57C00;
}

.pnldetail-summary .summary-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pnldetail-summary .summary-label {
    font-size: 10px;
    color: var(--kv-text-muted);
    text-transform: uppercase;
}

.pnldetail-summary .summary-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--kv-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pnldetail-summary .summary-value.positive {
    color: #2E7D32;
}

.pnldetail-summary .summary-value.negative {
    color: #C62828;
}

/* P&L Detail Search */
.pnldetail-search-box {
    display: flex;
    align-items: center;
    background: var(--kv-card-bg);
    border: 1px solid var(--kv-border);
    border-radius: 12px;
    padding: 10px 14px;
    margin: 0 15px 12px 15px;
    gap: 10px;
}

.pnldetail-search-box i.bi-search {
    color: var(--kv-text-muted);
    font-size: 16px;
}

.pnldetail-search-box input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    color: var(--kv-text);
    outline: none;
}

.pnldetail-search-box input::placeholder {
    color: var(--kv-text-muted);
}

.pnldetail-search-box .clear-search {
    background: none;
    border: none;
    padding: 0;
    color: var(--kv-text-muted);
    font-size: 16px;
    cursor: pointer;
}

/* Segment Filter */
.segment-filter {
    display: flex;
    gap: 8px;
    padding: 0 15px;
    margin-bottom: 15px;
}

.segment-btn {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--kv-border);
    background: transparent;
    border-radius: 20px;
    color: var(--kv-text-muted);
    transition: all 0.2s ease;
}

.segment-btn.active {
    background: linear-gradient(135deg, #1B5E20, #43A047);
    border-color: transparent;
    color: #fff;
}

/* Trade List - Grouped by Scrip */
.trade-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.scrip-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.scrip-header {
    font-size: 12px;
    font-weight: 700;
    color: #1B5E20;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trade-card {
    background: var(--kv-card-bg);
    border-radius: 12px;
    border: 1px solid var(--kv-border);
    overflow: hidden;
}

.trade-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid var(--kv-border);
}

.trade-card-symbol {
    font-size: 12px;
    font-weight: 700;
    color: var(--kv-text);
}

.trade-card-pnl {
    font-size: 14px;
    font-weight: 700;
}

.trade-card-pnl.positive {
    color: #2E7D32;
}

.trade-card-pnl.negative {
    color: #C62828;
}

.trade-card-body {
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.trade-box-row {
    display: flex;
    gap: 4px;
}

.trade-box {
    flex: 1;
    background: var(--kv-input-bg);
    border-radius: 6px;
    padding: 6px 4px;
    text-align: center;
}

.trade-box .box-label {
    display: block;
    font-size: 8px;
    color: var(--kv-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 1px;
}

.trade-box .box-value {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--kv-text);
    line-height: 1.2;
}

.trade-box .box-value.positive {
    color: #2E7D32;
}

.trade-box .box-value.negative {
    color: #C62828;
}

.trade-box .box-price {
    display: block;
    font-size: 9px;
    color: var(--kv-text-muted);
    margin-top: 0;
}

/* Expense Divider */
.expense-divider {
    display: flex;
    align-items: center;
    margin: 20px 0 16px 0;
}

.expense-divider::before,
.expense-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--kv-border);
}

.expense-divider span {
    padding: 0 12px;
    font-size: 11px;
    font-weight: 700;
    color: #C62828;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Expense Group */
.expense-group .scrip-header.expense {
    color: #C62828;
}

/* Expense Card - Simple */
.expense-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--kv-card-bg);
    border-radius: 10px;
    border: 1px solid var(--kv-border);
    padding: 12px 14px;
}

.expense-symbol {
    font-size: 13px;
    font-weight: 600;
    color: var(--kv-text);
}

.expense-amount {
    font-size: 14px;
    font-weight: 700;
}

.expense-amount.positive {
    color: #2E7D32;
}

.expense-amount.negative {
    color: #C62828;
}

/* P&L Detail Footer */
.pnldetail-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--kv-card-bg);
    border-top: 1px solid var(--kv-border);
    padding: 12px 20px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 100;
}

.pnldetail-footer .footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pnldetail-footer .footer-info {
    display: flex;
    flex-direction: column;
}

.pnldetail-footer .footer-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--kv-text);
}

.pnldetail-footer .footer-sublabel {
    font-size: 10px;
    color: var(--kv-text-muted);
}

.pnldetail-footer .footer-total {
    text-align: right;
}

.pnldetail-footer .footer-total-label {
    font-size: 10px;
    color: var(--kv-text-muted);
    display: block;
}

.pnldetail-footer .footer-total-value {
    font-size: 20px;
    font-weight: 700;
}

.pnldetail-footer .footer-total-value.positive {
    color: #2E7D32;
}

.pnldetail-footer .footer-total-value.negative {
    color: #C62828;
}

/* Add padding to content for footer */
.pnldetail-footer ~ .page-content,
body:has(.pnldetail-footer) .page-content {
    padding-bottom: 100px !important;
}

/* Dark mode */
.theme-dark .pnldetail-summary .summary-icon.all {
    background: rgba(21, 101, 192, 0.2);
}

.theme-dark .pnldetail-summary .summary-icon.fo {
    background: rgba(46, 125, 50, 0.2);
}

.theme-dark .pnldetail-summary .summary-icon.eq {
    background: rgba(245, 124, 0, 0.2);
}

.theme-dark .trade-segment.fo {
    background: rgba(46, 125, 50, 0.2);
}

.theme-dark .trade-segment.eq,
.theme-dark .trade-segment.cash {
    background: rgba(245, 124, 0, 0.2);
}

/* Status Badge on JV Items */
.jv-status-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 6px;
}

.jv-status-badge.matched {
    background: rgba(46, 125, 50, 0.15);
    color: #2E7D32;
}

.jv-status-badge.pending {
    background: rgba(245, 124, 0, 0.15);
    color: #F57C00;
}

.jv-status-badge.korponly {
    background: rgba(123, 31, 162, 0.15);
    color: #7B1FA2;
}

/* Dark mode status */
.theme-dark .summary-card {
    background: var(--kv-card-bg);
}

.theme-dark .status-tab {
    border-color: var(--kv-border);
}

.theme-dark .jv-status-badge.matched {
    background: rgba(46, 125, 50, 0.25);
}

.theme-dark .jv-status-badge.pending {
    background: rgba(245, 124, 0, 0.25);
}

.theme-dark .jv-status-badge.korponly {
    background: rgba(123, 31, 162, 0.25);
}

/* JV List Items */
.jv-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 14px 0;
    border-bottom: 1px solid var(--kv-border);
}

.jv-item:last-child {
    border-bottom: none;
}

.jv-item-left {
    display: flex;
    gap: 12px;
    flex: 1;
}

.jv-type-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.jv-item.credit .jv-type-icon {
    background: rgba(46, 125, 50, 0.1);
    color: #2E7D32;
}

.jv-item.debit .jv-type-icon {
    background: rgba(198, 40, 40, 0.1);
    color: #C62828;
}

.jv-item-info h6 {
    font-size: 14px;
    font-weight: 600;
    color: var(--kv-text);
    margin: 0 0 2px 0;
}

.jv-item-info p {
    font-size: 11px;
    color: var(--kv-text-muted);
    margin: 0;
}

.jv-narration {
    display: block;
    font-size: 11px;
    color: var(--kv-text-light);
    margin-top: 4px;
    font-style: italic;
}

.jv-item-right {
    text-align: right;
}

.jv-amount {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 6px;
}

.jv-amount.credit { color: #2E7D32; }
.jv-amount.debit { color: #C62828; }

.jv-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.jv-edit-btn, .jv-delete-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.jv-edit-btn {
    background: rgba(21, 101, 192, 0.1);
    color: #1565C0;
}

.jv-delete-btn {
    background: rgba(198, 40, 40, 0.1);
    color: #C62828;
}

.jv-readonly {
    font-size: 12px;
    color: var(--kv-text-light);
}

/* JV Form Popup */
.jv-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--kv-border);
}

.jv-form-header h5 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: var(--kv-text);
}

.jv-form-header a {
    font-size: 20px;
    color: var(--kv-text-muted);
}

.jv-form-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--kv-text);
    margin-bottom: 6px;
    display: block;
}

.form-group .form-control {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    border-radius: 10px;
    border: 1px solid var(--kv-border);
    background: var(--kv-input-bg);
    color: var(--kv-text);
}

.form-group select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.entry-type-toggle {
    display: flex;
    gap: 10px;
}

.type-btn {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    border: 2px solid var(--kv-border);
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.type-btn.credit {
    color: #2E7D32;
}

.type-btn.debit {
    color: #C62828;
}

.type-btn.credit.active {
    background: rgba(46, 125, 50, 0.1);
    border-color: #2E7D32;
}

.type-btn.debit.active {
    background: rgba(198, 40, 40, 0.1);
    border-color: #C62828;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-cancel {
    flex: 1;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--kv-border);
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: var(--kv-text-muted);
}

.btn-save {
    flex: 2;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #1B5E20, #43A047);
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Delete Confirmation */
.delete-confirm-content {
    padding: 30px 20px;
    text-align: center;
}

.delete-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(198, 40, 40, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px auto;
    font-size: 28px;
    color: #C62828;
}

.delete-confirm-content h5 {
    font-size: 18px;
    font-weight: 700;
    color: var(--kv-text);
    margin-bottom: 8px;
}

.delete-confirm-content p {
    font-size: 13px;
    color: var(--kv-text-muted);
    margin-bottom: 24px;
}

.delete-actions {
    display: flex;
    gap: 12px;
}

.btn-delete {
    flex: 1;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #C62828, #EF5350);
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Dark mode JV */
.theme-dark .jv-filter-card {
    background: var(--kv-card-bg);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.theme-dark .summary-card {
    background: var(--kv-card-bg);
}

.theme-dark .jv-item.credit .jv-type-icon {
    background: rgba(46, 125, 50, 0.2);
}

.theme-dark .jv-item.debit .jv-type-icon {
    background: rgba(198, 40, 40, 0.2);
}

/* Searchable Client Dropdown */
.client-search-wrapper {
    position: relative;
}

.client-search-wrapper input {
    padding-right: 36px;
}

.client-search-wrapper::after {
    content: '\F282';
    font-family: 'bootstrap-icons';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--kv-text-muted);
    font-size: 14px;
    pointer-events: none;
}

.client-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--kv-card-bg);
    border: 1px solid var(--kv-border);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    margin-top: 4px;
}

.client-dropdown.show {
    display: block;
}

.client-option {
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--kv-border);
    transition: background 0.15s ease;
}

.client-option:last-child {
    border-bottom: none;
}

.client-option:hover {
    background: var(--kv-input-bg);
}

.client-option .client-code {
    font-weight: 700;
    color: var(--kv-primary);
    font-size: 13px;
    display: block;
}

.client-option .client-name {
    font-size: 12px;
    color: var(--kv-text-muted);
    display: block;
    margin-top: 2px;
}

.client-no-result {
    padding: 16px;
    text-align: center;
    color: var(--kv-text-muted);
    font-size: 13px;
}

/* Dark mode client dropdown */
.theme-dark .client-dropdown {
    background: var(--kv-card-bg);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.theme-dark .client-option:hover {
    background: rgba(255,255,255,0.05);
}