/**
 * P&L Tracker Stylesheet
 * Contains styles for the Live P&L Tracker feature
 */

/* ============================================================================
   P&L TRACKER CONTAINER & SECTIONS
   ============================================================================ */
.pnl-tracker-container {
    max-width: 1200px;
    margin: 0 auto;
}

.pnl-section {
    background: white;
    border-radius: 8px;
    padding: 16px 20px;
    /* Reduced from 24px - REDESIGN */
    margin-bottom: 16px;
    /* Reduced from 20px - REDESIGN */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.pnl-section-title {
    font-size: 15px;
    /* Reduced from 16px - REDESIGN */
    font-weight: 600;
    color: #1a1d29;
    margin: 0 0 16px 0;
    /* Reduced from 20px - REDESIGN */
    display: flex;
    align-items: center;
    gap: 8px;
}

/* When used as h3 */
h3.pnl-section-title {
    margin: 0 0 16px 0;
    padding: 0;
}

/* Section Header with Inline Summary (REDESIGN Jan 2026) */
.pnl-section-header-with-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
}

.pnl-section-header-with-summary .pnl-section-title {
    margin-bottom: 0;
    flex-shrink: 0;
}

#pnl-portfolio-summary-inline {
    flex: 1;
}

#pnl-portfolio-summary-inline .pnl-portfolio-bar {
    margin-bottom: 0;
    position: static;
    font-size: 13px;
    padding: 8px 16px;
}

/* Responsive: Stack on mobile */
@media (max-width: 968px) {
    .pnl-section-header-with-summary {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    #pnl-portfolio-summary-inline .pnl-portfolio-bar {
        width: 100%;
    }
}

/* ============================================================================
   INDEX & EXPIRY SELECTORS - COMPACT HORIZONTAL (Jan 2026)
   ============================================================================ */
.pnl-index-selector {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

/* Combined Selectors Grid - Side by Side (REDESIGN Jan 2026) */
.pnl-selectors-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.pnl-selector-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pnl-selector-item label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #666;
}

.pnl-selector-item select {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.pnl-selector-item select:focus {
    outline: none;
    border-color: #1976d2;
}

.pnl-selector-info {
    font-size: 11px;
    color: #999;
}

/* Responsive: Stack on mobile */
@media (max-width: 768px) {
    .pnl-selectors-grid {
        grid-template-columns: 1fr;
    }
}

.pnl-radio-group {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.pnl-radio-group input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.pnl-radio-group label {
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.pnl-strike-selector {
    margin-bottom: 24px;
}

.pnl-strike-selector label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
}

.pnl-strike-selector select {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.pnl-strike-selector select:focus {
    outline: none;
    border-color: #1976d2;
}

.pnl-strike-info {
    font-size: 12px;
    color: #999;
    margin-top: 6px;
}

/* ============================================================================
   POSITION FORM - COMPACT DESIGN (REDESIGN Jan 2026)
   Reduced padding and gaps while maintaining usability
   ============================================================================ */
.pnl-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    /* Reduced from 24px - REDESIGN */
    margin-bottom: 16px;
    /* Reduced from 24px - REDESIGN */
}

.pnl-option-card {
    border: 1px solid #e0e0e0;
    /* Reduced from 2px - REDESIGN */
    border-radius: 6px;
    /* Reduced from 8px - REDESIGN */
    padding: 12px;
    /* Reduced from 20px - REDESIGN */
}

.pnl-option-card.ce {
    border-color: #1976d2;
    background: #f3f8ff;
}

.pnl-option-card.pe {
    border-color: #e65100;
    background: #fff8f3;
}

.pnl-option-header {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pnl-option-header.ce {
    color: #1976d2;
}

.pnl-option-header.pe {
    color: #e65100;
}

.pnl-form-group {
    margin-bottom: 16px;
}

.pnl-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    margin-bottom: 6px;
}

.pnl-form-group input {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    transition: border-color 0.2s, background-color 0.6s ease;
}

.pnl-form-group input:focus {
    outline: none;
    border-color: #1976d2;
}

.pnl-form-group input[id*="entry"] {
    font-weight: 600;
    color: #2e7d32;
}

.pnl-type-selector {
    display: flex;
    gap: 16px;
}

.pnl-type-option {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pnl-type-option input[type="radio"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.pnl-type-option label {
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 0;
}

.pnl-add-btn {
    width: 100%;
    padding: 14px 24px;
    background: #1976d2;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.pnl-add-btn:hover {
    background: #1565c0;
}

.pnl-add-btn:active {
    transform: scale(0.98);
}

/* ============================================================================
   PORTFOLIO OVERVIEW HEADER - COMPACT REDESIGN (Jan 2026)
   Redesigned for 70% space reduction while maintaining all functionality
   ============================================================================ */
.pnl-portfolio-overview-header {
    background: linear-gradient(135deg, #1a1d29 0%, #252837 100%);
    border-radius: 8px;
    padding: 12px 20px;
    /* Reduced from 20px 24px - REDESIGN */
    margin-bottom: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    border: 1px solid #2a5298;
    position: sticky;
    top: 20px;
    z-index: 100;
}

.pnl-overview-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    /* Reduced from 24px - REDESIGN */
    margin-bottom: 8px;
    /* Reduced from 12px - REDESIGN */
}

.pnl-overview-row:last-child {
    margin-bottom: 0;
}

.pnl-overview-main-pnl {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pnl-overview-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
}

.pnl-overview-value {
    font-size: 24px;
    /* Reduced from 32px for compact design - REDESIGN */
    font-weight: 700;
    color: white;
    letter-spacing: -0.5px;
}

.pnl-overview-value.positive {
    color: #4caf50;
    text-shadow: 0 0 20px rgba(76, 175, 80, 0.3);
}

.pnl-overview-value.negative {
    color: #f44336;
    text-shadow: 0 0 20px rgba(244, 67, 54, 0.3);
}

.pnl-overview-percentage {
    font-size: 18px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-left: 8px;
}

.pnl-overview-stats {
    display: flex;
    gap: 24px;
    align-items: center;
}

.pnl-overview-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.pnl-overview-stat-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pnl-overview-stat-value {
    font-size: 16px;
    font-weight: 700;
    color: white;
}

.pnl-overview-breakdown {
    display: flex;
    gap: 20px;
    align-items: center;
}

.pnl-overview-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    border-left: 3px solid;
}

.pnl-overview-item.winners {
    border-left-color: #4caf50;
}

.pnl-overview-item.losers {
    border-left-color: #f44336;
}

.pnl-overview-item-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.pnl-overview-item-value {
    font-size: 15px;
    font-weight: 700;
}

.pnl-overview-item.winners .pnl-overview-item-value {
    color: #4caf50;
}

.pnl-overview-item.losers .pnl-overview-item-value {
    color: #f44336;
}

.pnl-overview-winrate {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.pnl-overview-winrate-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.pnl-overview-winrate-value {
    font-size: 15px;
    font-weight: 700;
    color: #42a5f5;
}

/* ============================================================================
   POSITION CARDS - COMPACT INLINE DESIGN (Jan 2026 Redesign)
   New: Single-row design with collapsible details (70% space reduction)
   Old 3-column layout classes preserved below for backward compatibility
   ============================================================================ */
.pnl-positions-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* Reduced from 20px - REDESIGN */
}

.pnl-position-card {
    background: white;
    border-radius: 6px;
    /* Reduced from 10px - REDESIGN */
    border: 1px solid #e0e0e0;
    /* Reduced from 2px - REDESIGN */
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    /* Faster transition - REDESIGN */
}

.pnl-position-card:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    /* Reduced hover effect - REDESIGN */
    transform: translateY(-1px);
    /* Subtle lift - REDESIGN */
}

/* COMPACT POSITION MAIN ROW - New single-line design (REDESIGN Jan 2026) */
.pnl-position-main {
    padding: 12px 16px;
    /* Compact padding */
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
}

.pnl-pos-number {
    background: linear-gradient(135deg, #1976d2 0%, #2196f3 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 12px;
    min-width: 32px;
    text-align: center;
}

.pnl-pos-info {
    font-weight: 600;
    color: #333;
    min-width: 180px;
}

.pnl-pos-expiry {
    font-size: 11px;
    color: #666;
    font-weight: normal;
    display: block;
    margin-top: 2px;
}

.pnl-pos-leg {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #f9f9f9;
    border-radius: 4px;
    border-left: 3px solid;
    font-size: 13px;
}

.pnl-pos-leg.ce {
    border-left-color: #1976d2;
}

.pnl-pos-leg.pe {
    border-left-color: #e65100;
}

.pnl-pos-arrow {
    color: #999;
    font-size: 11px;
}

.pnl-pos-price {
    font-weight: 600;
    color: #333;
}

.pnl-pos-total {
    flex: 1;
    text-align: right;
    font-weight: 600;
    min-width: 120px;
}

.pnl-pos-total-label {
    font-size: 11px;
    color: #666;
    font-weight: normal;
    display: block;
    margin-bottom: 2px;
}

.pnl-pos-total-value {
    font-size: 16px;
    font-weight: 700;
}

.pnl-pos-actions {
    display: flex;
    gap: 6px;
}

.pnl-action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.pnl-action-btn.settings {
    background: #f0f0f0;
    color: #666;
}

.pnl-action-btn.settings:hover {
    background: #e0e0e0;
}

.pnl-action-btn.details {
    background: #f0f0f0;
    color: #666;
}

.pnl-action-btn.details:hover {
    background: #e0e0e0;
}

/* POSITION DETAILS ACCORDION - Collapsible section (REDESIGN Jan 2026) */
.pnl-position-details {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background: #f9f9f9;
}

.pnl-position-details.expanded {
    padding: 12px 16px;
    max-height: 500px;
    border-top: 1px solid #e0e0e0;
}

.pnl-details-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    font-size: 12px;
}

.pnl-detail-item {
    padding: 8px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.pnl-detail-label {
    color: #666;
    margin-bottom: 4px;
    font-size: 11px;
}

.pnl-detail-value {
    font-weight: 600;
    color: #333;
}

.pnl-alert-info {
    grid-column: 1 / -1;
    padding: 8px 12px;
    background: white;
    border-left: 3px solid #ff9800;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

/* ============================================================================
   THRESHOLD VISUAL BAR - REDESIGNED (Jan 2026)
   Simple, robust design with no overflow issues
   ============================================================================ */
.pnl-threshold-visual-bar {
    padding: 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.pnl-threshold-bar-label {
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    text-align: center;
}

/* Container: the main bar, fixed dimensions, overflow hidden */
.pnl-threshold-bar-container {
    position: relative;
    height: 28px;
    background: linear-gradient(90deg,
            rgba(244, 67, 54, 0.15) 0%,
            rgba(244, 67, 54, 0.05) 25%,
            rgba(200, 200, 200, 0.1) 50%,
            rgba(76, 175, 80, 0.05) 75%,
            rgba(76, 175, 80, 0.15) 100%);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #dee2e6;
}

/* Threshold marker lines - simple vertical lines */
.pnl-threshold-line {
    position: absolute;
    top: 0;
    width: 2px;
    height: 100%;
    transform: translateX(-50%);
}

.pnl-threshold-line.loss {
    background: rgba(244, 67, 54, 0.6);
}

.pnl-threshold-line.center {
    left: 50%;
    background: rgba(108, 117, 125, 0.5);
}

.pnl-threshold-line.profit {
    background: rgba(76, 175, 80, 0.6);
}

/* Indicator pill - the moving current P&L indicator */
.pnl-threshold-pill {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    z-index: 5;
    transition: left 0.3s ease;
}

.pnl-threshold-pill.positive {
    background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
    color: white;
}

.pnl-threshold-pill.negative {
    background: linear-gradient(135deg, #f44336 0%, #c62828 100%);
    color: white;
}

/* Labels below the bar */
.pnl-threshold-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    margin-top: 6px;
    padding: 0 4px;
}

.pnl-threshold-bar-labels span.loss {
    color: #c62828;
    font-weight: 600;
}

.pnl-threshold-bar-labels span.center {
    color: #6c757d;
}

.pnl-threshold-bar-labels span.profit {
    color: #2e7d32;
    font-weight: 600;
}

/* OLD POSITION HEADER - Kept for backward compatibility during transition */
.pnl-position-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #dee2e6;
}

.pnl-position-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1d29;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pnl-position-number {
    display: inline-block;
    background: linear-gradient(135deg, #1976d2 0%, #2196f3 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
}

.pnl-position-info {
    font-size: 15px;
    color: #495057;
}

.pnl-position-expiry {
    font-size: 12px;
    color: #6c757d;
    margin-left: 8px;
}

.pnl-position-actions {
    display: flex;
    gap: 8px;
}

/* ============================================================================
   THRESHOLD BAR (Per-Position Alert Settings)
   ============================================================================ */
.pnl-threshold-bar {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    padding: 12px 20px;
    border-bottom: 2px solid #0d47a1;
}

.pnl-threshold-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
}

.pnl-threshold-label {
    font-size: 13px;
    font-weight: 600;
    margin-right: 12px;
}

.pnl-threshold-values {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 600;
    flex: 1;
}

.pnl-threshold-loss {
    color: #ffcccc;
}

.pnl-threshold-profit {
    color: #ccffcc;
}

.pnl-threshold-separator {
    color: rgba(255, 255, 255, 0.5);
}

.pnl-threshold-sound {
    font-size: 14px;
}

.pnl-threshold-sound.muted {
    opacity: 0.5;
}

.pnl-threshold-edit-btn {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.pnl-threshold-edit-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
}

.pnl-threshold-edit {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideDown 0.2s ease;
}

.pnl-threshold-edit-form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.pnl-threshold-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.pnl-threshold-input-group.pnl-threshold-checkbox {
    flex: 0 0 100%;
}

.pnl-threshold-input-group.pnl-threshold-checkbox label {
    cursor: pointer;
}

.pnl-threshold-input-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.pnl-threshold-input-group label {
    font-size: 11px;
    font-weight: 600;
    color: white;
    opacity: 0.9;
}

.pnl-threshold-input-group input {
    padding: 8px 10px;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transition: all 0.2s;
}

.pnl-threshold-input-group input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.25);
}

.pnl-threshold-input-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.pnl-threshold-edit-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
    flex: 1 0 100%;
    margin-top: 8px;
}

.pnl-threshold-save-btn,
.pnl-threshold-reset-btn,
.pnl-threshold-cancel-btn {
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 600;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    min-width: auto;
}

.pnl-threshold-save-btn {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.pnl-threshold-save-btn:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.pnl-threshold-reset-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.pnl-threshold-reset-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.pnl-threshold-cancel-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.pnl-threshold-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================================================
   ACTION BUTTONS
   ============================================================================ */
.pnl-exit-btn {
    padding: 8px 16px;
    background: #1976d2;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.pnl-exit-btn:hover {
    background: #1565c0;
}

.pnl-remove-btn {
    padding: 6px 12px;
    background: #ffebee;
    color: #c62828;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.pnl-remove-btn:hover {
    background: #ffcdd2;
}

.pnl-position-body {
    padding: 16px;
    /* Reduced from 24px - REDESIGN */
}

/* ============================================================================
   3-COLUMN LAYOUT: CE | PE | SUMMARY
   ============================================================================ */
.pnl-position-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

/* CE and PE Option Columns */
.pnl-option-column {
    padding: 20px;
    border-radius: 8px;
    border: 2px solid;
    background: white;
}

.pnl-option-column.ce {
    background: linear-gradient(135deg, #f3f8ff 0%, #e3f2fd 100%);
    border-color: #1976d2;
}

.pnl-option-column.pe {
    background: linear-gradient(135deg, #fff8f3 0%, #ffe0b2 100%);
    border-color: #e65100;
}

.pnl-option-column-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid;
    font-size: 15px;
    font-weight: 700;
}

.pnl-option-column.ce .pnl-option-column-header {
    color: #1976d2;
    border-bottom-color: rgba(25, 118, 210, 0.2);
}

.pnl-option-column.pe .pnl-option-column-header {
    color: #e65100;
    border-bottom-color: rgba(230, 81, 0, 0.2);
}

.pnl-option-type-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pnl-option-column.ce .pnl-option-type-badge {
    background: #1976d2;
    color: white;
}

.pnl-option-column.pe .pnl-option-type-badge {
    background: #e65100;
    color: white;
}

/* Position Summary Column (3rd column) - SIMPLIFIED */
.pnl-position-summary-column {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    border-radius: 8px;
    padding: 24px 20px;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3);
    gap: 20px;
}

.pnl-summary-header {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.85;
    text-align: center;
}

.pnl-summary-main {
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.pnl-summary-label {
    font-size: 11px;
    opacity: 0.8;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pnl-summary-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 8px;
}

.pnl-summary-value.positive {
    color: #4caf50;
    text-shadow: 0 0 20px rgba(76, 175, 80, 0.5);
}

.pnl-summary-value.negative {
    color: #f44336;
    text-shadow: 0 0 20px rgba(244, 67, 54, 0.5);
}

.pnl-summary-points {
    font-size: 15px;
    opacity: 0.95;
    font-weight: 600;
}

.pnl-summary-stats {
    width: 100%;
}

.pnl-summary-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    font-size: 14px;
}

.pnl-summary-stat-label {
    opacity: 0.9;
    font-weight: 500;
}

.pnl-summary-stat-value {
    font-weight: 700;
    font-size: 16px;
}

/* Option Details Rows */
.pnl-option-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 8px 10px;
    background: white;
    border-radius: 6px;
    font-size: 13px;
}

.pnl-option-detail-label {
    color: #666;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.pnl-option-detail-value {
    font-weight: 700;
    color: #333;
}

.pnl-option-detail-value.live {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pnl-live-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulseLive 2s infinite;
}

.pnl-live-indicator.up {
    background: #4caf50;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
}

.pnl-live-indicator.down {
    background: #f44336;
    box-shadow: 0 0 8px rgba(244, 67, 54, 0.6);
}

@keyframes pulseLive {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.2);
    }
}

.pnl-option-detail-value.positive {
    color: #2e7d32;
    font-weight: 700;
}

.pnl-option-detail-value.negative {
    color: #c62828;
    font-weight: 700;
}

/* Individual P&L Display */
.pnl-option-pnl-display {
    margin-top: 12px;
    padding: 12px;
    background: white;
    border-radius: 6px;
    text-align: center;
    border: 2px solid;
}

.pnl-option-column.ce .pnl-option-pnl-display {
    border-color: rgba(25, 118, 210, 0.3);
}

.pnl-option-column.pe .pnl-option-pnl-display {
    border-color: rgba(230, 81, 0, 0.3);
}

.pnl-option-pnl-label {
    font-size: 11px;
    color: #666;
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pnl-option-pnl-value {
    font-size: 20px;
    font-weight: 700;
}

.pnl-option-pnl-value.positive {
    color: #2e7d32;
}

.pnl-option-pnl-value.negative {
    color: #c62828;
}

.pnl-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
}

.pnl-detail-label {
    color: #666;
    font-weight: 500;
}

.pnl-detail-value {
    font-weight: 600;
    color: #333;
}

.pnl-detail-value.positive {
    color: #2e7d32;
}

.pnl-detail-value.negative {
    color: #c62828;
}

.pnl-individual-pnl {
    margin-top: 12px;
    padding: 12px;
    background: white;
    border-radius: 4px;
    text-align: center;
    border: 2px solid #e0e0e0;
}

.pnl-individual-pnl-label {
    font-size: 11px;
    color: #666;
    margin-bottom: 4px;
}

.pnl-individual-pnl-value {
    font-size: 16px;
    font-weight: 700;
}

/* ============================================================================
   COMBINED SUMMARY (OLD - Kept for backward compatibility)
   ============================================================================ */
.pnl-combined-summary {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    padding: 20px;
    border-radius: 8px;
    color: white;
}

.pnl-combined-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    opacity: 0.9;
}

.pnl-combined-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.pnl-combined-item {
    text-align: center;
}

.pnl-combined-label {
    font-size: 11px;
    opacity: 0.8;
    margin-bottom: 6px;
}

.pnl-combined-value {
    font-size: 20px;
    font-weight: 700;
}

/* ============================================================================
   PORTFOLIO SUMMARY - ULTRA-COMPACT BAR (REDESIGN Jan 2026)
   Removed blue background - cleaner look with border
   Now includes Auto-Close inline to save space
   ============================================================================ */
.pnl-portfolio-bar {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    color: #333;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 2px solid #e0e0e0;
    margin-bottom: 20px;
    position: sticky;
    bottom: 20px;
    z-index: 50;

    /* Flexbox layout for stats and auto-close */
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.pnl-portfolio-stats {
    flex: 1;
}

.pnl-portfolio-bar strong {
    font-weight: 700;
    color: #1a1d29;
}

.pnl-portfolio-bar .profit {
    color: #2e7d32;
    font-weight: 700;
    padding: 2px 6px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 4px;
}

.pnl-portfolio-bar .loss {
    color: #c62828;
    font-weight: 700;
    padding: 2px 6px;
    background: rgba(244, 67, 54, 0.1);
    border-radius: 4px;
}

/* Auto-Close Inline Display (NEW - merged into portfolio bar) */
.pnl-autoclose-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    white-space: nowrap;
    padding: 6px 12px;
    background: rgba(25, 118, 210, 0.08);
    border-radius: 6px;
    border: 1px solid rgba(25, 118, 210, 0.2);
}

.pnl-autoclose-toggle-compact {
    padding: 4px 10px;
    background: white;
    border: 1.5px solid #1976d2;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    line-height: 1;
}

.pnl-autoclose-toggle-compact:hover {
    background: #e3f2fd;
    border-color: #0d47a1;
    /* Removed transform to fix blinking issue */
}

.pnl-autoclose-toggle-compact:active {
    background: #1976d2;
    transform: scale(0.95);
}

/* ============================================================================
   PORTFOLIO SUMMARY - OLD COMPACT DESIGN (Kept for backward compatibility)
   ============================================================================ */
.pnl-portfolio-compact {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    display: none;
    /* Hidden, using new bar design */
}

.pnl-portfolio-header {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    color: white;
}

.pnl-portfolio-title {
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
}

.pnl-portfolio-stats-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    flex: 1;
    justify-content: center;
    flex-wrap: wrap;
}

.pnl-stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pnl-stat-item strong {
    font-weight: 600;
    opacity: 0.9;
}

.pnl-stat-item.profit {
    color: #00ff88;
    font-weight: 700;
}

.pnl-stat-item.loss {
    color: #ff5252;
    font-weight: 700;
}

.pnl-stat-divider {
    opacity: 0.5;
}

.pnl-portfolio-total {
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 14px;
    white-space: nowrap;
}

.pnl-portfolio-total.profit {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
}

.pnl-portfolio-total.loss {
    background: rgba(255, 82, 82, 0.2);
    color: #ff5252;
}

.pnl-portfolio-footer-compact {
    padding: 10px 20px;
    background: #f9f9f9;
    font-size: 12px;
    color: #666;
    text-align: center;
    border-top: 1px solid #e0e0e0;
}

/* ============================================================================
   EMPTY STATE
   ============================================================================ */
.pnl-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.pnl-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.pnl-empty-title {
    font-size: 18px;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
}

.pnl-empty-text {
    font-size: 14px;
}

/* ============================================================================
   P&L FLASH ANIMATIONS
   ============================================================================ */
@keyframes pnl-flash-green {

    0%,
    100% {
        background-color: transparent;
    }

    50% {
        background-color: rgba(46, 125, 50, 0.2);
    }
}

@keyframes pnl-flash-red {

    0%,
    100% {
        background-color: transparent;
    }

    50% {
        background-color: rgba(198, 40, 40, 0.2);
    }
}

.pnl-flash-green {
    animation: pnl-flash-green 0.6s ease-in-out;
}

.pnl-flash-red {
    animation: pnl-flash-red 0.6s ease-in-out;
}

.pnl-expiry-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #1976d2;
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

/* ============================================================================
   EXIT MODAL
   ============================================================================ */
.pnl-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.pnl-modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.pnl-modal-header {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    color: white;
    padding: 20px 24px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pnl-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.pnl-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 28px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
}

.pnl-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.pnl-modal-body {
    padding: 24px;
}

.pnl-modal-info {
    font-size: 16px;
    margin-bottom: 24px;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 6px;
    text-align: center;
}

.pnl-exit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.pnl-exit-card {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
}

.pnl-exit-card.ce {
    background: #f3f8ff;
    border-color: #1976d2;
}

.pnl-exit-card.pe {
    background: #fff8f3;
    border-color: #e65100;
}

.pnl-exit-card-header {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    text-align: center;
}

.pnl-exit-card-header.ce {
    color: #1976d2;
}

.pnl-exit-card-header.pe {
    color: #e65100;
}

.pnl-exit-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pnl-exit-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pnl-exit-row label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
}

.pnl-exit-row input {
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-weight: 600;
}

.pnl-exit-row input:focus {
    outline: none;
    border-color: #1976d2;
}

.pnl-exit-hint {
    font-size: 11px;
    color: #999;
}

.pnl-exit-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border-radius: 4px;
    font-size: 13px;
}

.pnl-exit-label {
    color: #666;
    font-weight: 500;
}

.pnl-exit-value {
    font-weight: 600;
    color: #333;
}

.pnl-exit-total {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    padding: 20px;
    border-radius: 8px;
    color: white;
}

.pnl-exit-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 15px;
}

.pnl-exit-total-row:last-child {
    margin-bottom: 0;
}

.pnl-exit-total-row span:first-child {
    font-weight: 500;
}

.pnl-exit-total-row span:last-child {
    font-size: 18px;
    font-weight: 700;
}

.pnl-modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.pnl-modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.pnl-modal-btn.cancel {
    background: #f5f5f5;
    color: #666;
}

.pnl-modal-btn.cancel:hover {
    background: #e0e0e0;
}

.pnl-modal-btn.confirm {
    background: #2e7d32;
    color: white;
}

.pnl-modal-btn.confirm:hover {
    background: #1b5e20;
}

/* Old portfolio summary styles removed - using compact design now */

/* ============================================================================
   TODAY'S EXITS - COMPACT TRANSACTION LOG
   ============================================================================ */
.pnl-exits-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* Compact Header Section */
.pnl-exits-header {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    gap: 20px;
}

.pnl-exits-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
}

.pnl-exits-icon {
    font-size: 16px;
}

.pnl-exits-title-text {
    font-weight: 700;
}

.pnl-exits-count {
    font-size: 14px;
    opacity: 0.9;
}

/* Inline Stats */
.pnl-exits-stats-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    flex: 1;
    justify-content: center;
}

.pnl-exits-stat-inline {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pnl-exits-stat-inline strong {
    font-weight: 600;
    opacity: 0.9;
}

.pnl-exits-stat-inline.positive {
    color: #00ff88;
    font-weight: 700;
}

.pnl-exits-stat-inline.negative {
    color: #ff5252;
    font-weight: 700;
}

.pnl-exits-stat-divider {
    opacity: 0.5;
}

/* Compact Action Buttons */
.pnl-exits-actions {
    display: flex;
    gap: 6px;
}

.pnl-exits-btn-small {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pnl-exits-btn-small.save {
    background: #4caf50;
    color: white;
}

.pnl-exits-btn-small.save:hover {
    background: #388e3c;
    transform: scale(1.1);
}

.pnl-exits-btn-small.toggle {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.pnl-exits-btn-small.toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.pnl-exits-btn-small.clear {
    background: rgba(255, 82, 82, 0.3);
    color: white;
    border: 2px solid rgba(255, 82, 82, 0.5);
}

.pnl-exits-btn-small.clear:hover {
    background: rgba(255, 82, 82, 0.5);
}

/* Details Section - Removed large stats cards, now inline in header */

/* Compact Details Section */
.pnl-exits-details {
    padding: 0;
    background: #f9f9f9;
    animation: slideDown 0.2s ease;
    max-height: 500px;
    overflow-y: auto;
}

@keyframes slideDown {
    from {
        max-height: 0;
        opacity: 0;
    }

    to {
        max-height: 500px;
        opacity: 1;
    }
}

/* Compact Exit Grid - Row-based design */
.pnl-exits-grid {
    display: flex;
    flex-direction: column;
}

/* Compact Exit Row */
.pnl-exit-row {
    background: white;
    border-bottom: 1px solid #e0e0e0;
    padding: 10px 16px;
    transition: background 0.2s;
    border-left: 3px solid transparent;
}

.pnl-exit-row:hover {
    background: #f5f7fa;
}

.pnl-exit-row.profit {
    border-left-color: #4caf50;
}

.pnl-exit-row.loss {
    border-left-color: #f44336;
}

.pnl-exit-row:last-child {
    border-bottom: none;
}

/* Row Header */
.pnl-exit-row-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.pnl-exit-num {
    display: inline-block;
    padding: 2px 8px;
    background: #1976d2;
    color: white;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}

.pnl-exit-info {
    font-size: 13px;
    color: #333;
}

.pnl-exit-meta {
    font-size: 11px;
    color: #666;
    margin-left: 8px;
}

/* Row Body - Compact Legs */
.pnl-exit-row-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pnl-exit-row-legs {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pnl-exit-row-leg {
    display: grid;
    grid-template-columns: 120px 1fr 80px 100px;
    align-items: center;
    gap: 12px;
    padding: 6px 10px;
    background: #fafafa;
    border-radius: 4px;
    font-size: 12px;
}

.pnl-exit-row-leg-label {
    font-weight: 600;
}

.pnl-exit-row-leg-label.ce {
    color: #1976d2;
}

.pnl-exit-row-leg-label.pe {
    color: #e65100;
}

.pnl-exit-row-leg-price {
    color: #666;
}

.pnl-exit-row-leg-qty {
    color: #666;
    text-align: right;
}

.pnl-exit-row-leg-pnl {
    font-weight: 700;
    text-align: right;
}

.pnl-exit-row-leg-pnl.positive {
    color: #2e7d32;
}

.pnl-exit-row-leg-pnl.negative {
    color: #c62828;
}

/* Row Total */
.pnl-exit-row-total {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 6px;
    padding: 6px 10px;
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    border-radius: 4px;
    color: white;
    font-size: 13px;
}

.pnl-exit-row-total-label {
    font-weight: 600;
    opacity: 0.9;
}

.pnl-exit-row-total-value {
    font-weight: 700;
    font-size: 14px;
}

.pnl-exit-row-total-value.positive {
    color: #00ff88;
}

.pnl-exit-row-total-value.negative {
    color: #ff5252;
}

.pnl-exit-row-roi {
    opacity: 0.9;
    font-size: 12px;
}

/* ============================================================================
   ALERT STATUS BAR - COMPACT INLINE WITH AUTO-DISMISS (REDESIGN Jan 2026)
   ============================================================================ */
.pnl-alert-status-bar {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    border-radius: 6px;
    /* Reduced from 8px - REDESIGN */
    padding: 10px 20px;
    /* Reduced from 16px 20px - REDESIGN */
    margin-bottom: 12px;
    /* Reduced from 20px - REDESIGN */
    color: white;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
    animation: alertPulse 2s ease-in-out infinite;
    transition: opacity 0.5s ease, max-height 0.5s ease;
    /* For auto-dismiss - REDESIGN */
}

.pnl-alert-status-bar.dismissing {
    opacity: 0;
    max-height: 0;
    padding: 0 20px;
    margin-bottom: 0;
    overflow: hidden;
}

@keyframes alertPulse {

    0%,
    100% {
        box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
    }

    50% {
        box-shadow: 0 4px 20px rgba(255, 107, 107, 0.6);
    }
}

.pnl-alert-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.pnl-alert-title {
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pnl-alert-view-all {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.pnl-alert-view-all:hover {
    background: rgba(255, 255, 255, 0.3);
}

.pnl-alert-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pnl-alert-item {
    background: rgba(255, 255, 255, 0.15);
    padding: 10px 14px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 4px solid rgba(255, 255, 255, 0.5);
}

.pnl-alert-item.profit {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.3), rgba(56, 142, 60, 0.3));
    border-left-color: #4caf50;
}

.pnl-alert-icon {
    font-size: 20px;
}

.pnl-alert-label {
    font-weight: 700;
    font-size: 13px;
}

.pnl-alert-points {
    font-weight: 700;
    font-size: 14px;
    color: #00ff88;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
}

.pnl-alert-position {
    flex: 1;
    font-size: 13px;
    opacity: 0.95;
}

.pnl-alert-dismiss {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pnl-alert-dismiss:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* ============================================================================
   POSITION CARD ALERTS
   ============================================================================ */
.pnl-position-card.alert-active {
    border: 3px solid #ff6b6b;
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.5);
    animation: alertBorder 2s ease-in-out infinite;
}

.pnl-position-card.alert-active.alert-profit {
    border-color: #4caf50;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.5);
    animation: alertBorderProfit 2s ease-in-out infinite;
}

@keyframes alertBorder {

    0%,
    100% {
        border-color: #ff6b6b;
        box-shadow: 0 0 20px rgba(255, 107, 107, 0.5);
    }

    50% {
        border-color: #ff5252;
        box-shadow: 0 0 30px rgba(255, 82, 82, 0.7);
    }
}

@keyframes alertBorderProfit {

    0%,
    100% {
        border-color: #4caf50;
        box-shadow: 0 0 20px rgba(76, 175, 80, 0.5);
    }

    50% {
        border-color: #66bb6a;
        box-shadow: 0 0 30px rgba(102, 187, 106, 0.7);
    }
}

.pnl-position-alert {
    margin: 0 0 12px 0;
    padding: 0;
    border-radius: 6px 6px 0 0;
    overflow: hidden;
}

.pnl-position-alert-content {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    border-radius: 6px;
    flex-wrap: nowrap;
    min-width: 0;
}

.pnl-position-alert-content.profit {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
}

.pnl-position-alert-icon {
    font-size: 24px;
}

.pnl-position-alert-text {
    flex: 1;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.pnl-position-alert-dismiss {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    white-space: nowrap;
}

.pnl-position-alert-dismiss:hover {
    background: rgba(255, 255, 255, 0.3);
}

.pnl-position-alert-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 8px;
}

.pnl-position-alert-badge.loss {
    background: #ff5252;
    color: white;
}

.pnl-position-alert-badge.profit {
    background: #4caf50;
    color: white;
}

/* ============================================================================
   POINTS MONITOR
   ============================================================================ */
.pnl-points-monitor {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    color: white;
}

.pnl-points-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
    opacity: 0.95;
}

.pnl-points-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.pnl-points-item {
    background: rgba(255, 255, 255, 0.15);
    padding: 10px;
    border-radius: 6px;
    text-align: center;
}

.pnl-points-item.total {
    grid-column: span 3;
    background: rgba(255, 255, 255, 0.25);
}

.pnl-points-label {
    display: block;
    font-size: 11px;
    opacity: 0.9;
    margin-bottom: 4px;
}

.pnl-points-value {
    font-size: 16px;
    font-weight: 700;
}

.pnl-points-value.positive {
    color: #00ff88;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
}

.pnl-points-value.negative {
    color: #ff5252;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
}

.pnl-points-value-total {
    font-size: 20px;
    font-weight: 700;
}

.pnl-points-value-total.positive {
    color: #00ff88;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.4);
}

.pnl-points-value-total.negative {
    color: #ff5252;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.4);
}

/* Points Progress Bar */
.pnl-points-bar {
    margin-top: 12px;
}

.pnl-points-bar-track {
    position: relative;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    overflow: visible;
}

.pnl-points-bar-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 100%;
    z-index: 2;
}

.pnl-points-bar-marker.loss {
    background: rgba(255, 82, 82, 0.5);
}

.pnl-points-bar-marker.profit {
    background: rgba(76, 175, 80, 0.5);
}

.pnl-points-bar-marker span {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
}

.pnl-points-bar-fill {
    position: absolute;
    top: 0;
    height: 100%;
    border-radius: 16px;
    transition: all 0.3s ease;
}

.pnl-points-bar-fill.positive {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.2), rgba(76, 175, 80, 0.6));
}

.pnl-points-bar-fill.negative {
    background: linear-gradient(90deg, rgba(255, 82, 82, 0.6), rgba(255, 255, 255, 0.2));
}

.pnl-points-bar-indicator {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
}

.pnl-points-bar-indicator span {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.pnl-points-bar-indicator span.positive {
    color: #2e7d32;
}

.pnl-points-bar-indicator span.negative {
    color: #c62828;
}

.pnl-points-bar-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 10px;
    opacity: 0.8;
}

/* ============================================================================
   TOAST NOTIFICATIONS
   ============================================================================ */
.pnl-save-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
}

.pnl-save-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.pnl-save-toast.success {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
}

.pnl-save-toast.error {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}

.pnl-save-toast.info {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
}

/* ============================================================================
   AUTO-CLOSE STATUS BAR - DEPRECATED (Jan 2026)
   Auto-close is now merged into portfolio bar (.pnl-autoclose-inline)
   Keeping this for backward compatibility but no longer used
   ============================================================================ */
.pnl-autoclose-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    /* Reduced from 16px - REDESIGN */
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left: 4px solid #1976d2;
    border-radius: 6px;
    /* Reduced from 8px - REDESIGN */
    margin-bottom: 8px;
}

.pnl-autoclose-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.pnl-autoclose-label {
    font-weight: 600;
    color: #333;
}

.pnl-autoclose-countdown {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    padding: 4px 12px;
    background: white;
    border-radius: 6px;
}

.pnl-autoclose-status {
    font-weight: 600;
    font-size: 13px;
}

.pnl-autoclose-toggle-btn {
    padding: 8px 16px;
    background: white;
    border: 2px solid #1976d2;
    border-radius: 6px;
    color: #1976d2;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.pnl-autoclose-toggle-btn:hover {
    background: #1976d2;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3);
}

/* ============================================================================
   COMPACT HEADER - Streamlined & Space-Efficient (REDESIGN Jan 2026)
   ============================================================================ */
.pnl-header-section {
    padding: 12px 20px !important;
    /* Reduced from default */
    margin-bottom: 12px !important;
}

.pnl-compact-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    /* Removed gap */
}

.pnl-main-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1d29;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pnl-settings-toggle-compact {
    background: transparent;
    color: #1976d2;
    border: 1px solid #e0e0e0;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

.pnl-settings-toggle-compact:hover {
    background: #f5f5f5;
    border-color: #1976d2;
    color: #0d47a1;
}

.pnl-settings-toggle-compact:active {
    background: #e3f2fd;
}

/* Old styles - keep for backward compatibility but deprecated */
.pnl-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.pnl-settings-toggle {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3);
}

.pnl-settings-toggle:hover {
    background: #1565c0;
    box-shadow: 0 2px 10px rgba(25, 118, 210, 0.4);
}

.pnl-settings-panel {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    padding: 20px;
    border-radius: 8px;
    margin-top: 16px;
    color: white;
    animation: slideDown 0.3s ease;
}

.pnl-settings-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pnl-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.pnl-settings-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pnl-settings-group.checkbox {
    grid-column: span 2;
}

.pnl-settings-group label {
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pnl-settings-group input[type="number"] {
    padding: 10px 12px;
    font-size: 15px;
    font-weight: 600;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transition: all 0.2s;
}

.pnl-settings-group input[type="number"]:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.25);
}

.pnl-settings-group input[type="number"]::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.pnl-settings-group select {
    padding: 10px 12px;
    font-size: 15px;
    font-weight: 600;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.pnl-settings-group select:hover {
    background: rgba(255, 255, 255, 0.2);
}

.pnl-settings-group select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.25);
}

.pnl-settings-group select option {
    background: #1565c0;
    color: white;
    padding: 8px;
}

.pnl-settings-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.pnl-settings-hint {
    font-size: 11px;
    opacity: 0.85;
    font-style: italic;
}

.pnl-settings-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.pnl-settings-save {
    flex: 1;
    background: #4caf50;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.pnl-settings-save:hover {
    background: #388e3c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.5);
}

.pnl-settings-reset {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.pnl-settings-reset:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.pnl-settings-info {
    background: rgba(255, 255, 255, 0.15);
    padding: 12px;
    border-radius: 6px;
    font-size: 12px;
    border-left: 4px solid rgba(255, 255, 255, 0.5);
}

/* ============================================================================
   RESPONSIVE DESIGN FOR 3-COLUMN LAYOUT
   ============================================================================ */

/* Tablet - Stack to 2 columns + summary below */
@media (max-width: 1024px) {
    .pnl-position-content-grid {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .pnl-position-summary-column {
        grid-column: 1 / -1;
    }

    .pnl-overview-row {
        flex-wrap: wrap;
    }

    .pnl-overview-stats {
        flex-wrap: wrap;
    }
}

/* Mobile - Full stack */
@media (max-width: 768px) {
    .pnl-position-content-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .pnl-position-summary-column {
        grid-column: 1;
    }

    .pnl-portfolio-overview-header {
        padding: 16px;
    }

    .pnl-overview-row {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .pnl-overview-stats {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }

    .pnl-overview-stat {
        flex: 1 1 45%;
        min-width: 140px;
    }

    .pnl-overview-breakdown {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }

    .pnl-overview-item {
        width: 100%;
    }
}