/* Import Google Font 'Inter' */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&display=swap');

/* --- Global & Layout --- */
body {
    font-family: 'Inter', 'Roboto', sans-serif;
    background-color: #FFFFFF;
    color: #2C3E50;
    margin: 0;
    padding: 0;
    padding-top: 70px;
}

/*
========================================
NAVBAR (HEADER)
========================================
.navbar {
  background-color: #2c3e50;
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.navbar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.2rem;
  max-width: 1200px;
  margin: auto;
}

/* ========== Logo ========== */
.nav-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}

/* ========== Hamburger Button ========== */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1100;
}

.nav-toggle .bar {
  height: 3px;
  width: 100%;
  background-color: #fff;
  border-radius: 3px;
  transition: all 0.3s ease;
}

/* Animate hamburger → X */
.nav-toggle.is-active .bar:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.nav-toggle.is-active .bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle.is-active .bar:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ========== Nav Menu (shared) ========== */
.nav-menu {
  transition: all 0.4s ease;
}

/* Desktop layout */
@media (min-width: 768px) {
  .nav-menu {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 2rem;
    background: none;
    position: static;
    height: auto;
    width: auto;
  }

  .nav-links {
    display: flex;
    gap: 2rem;
  }

  .nav-group {
    display: flex;
    flex-direction: column;
    text-align: left;
  }

  .nav-group h3 {
    font-size: 0.9rem;
    color: #ddd;
    margin-bottom: 0.3rem;
  }

  .nav-group ul {
    list-style: none;
  }

  .nav-group li {
    margin-bottom: 0.2rem;
  }

  .nav-group a {
    text-decoration: none;
    color: #fff;
    font-size: 0.9rem;
  }

  .portfolio-switcher {
    display: flex;
    align-items: center;
    color: #fff;
    gap: 0.5rem;
  }

  .portfolio-switcher label {
    font-size: 0.9rem;
  }

  .portfolio-switcher select {
    padding: 0.3rem;
    border-radius: 4px;
    border: none;
    outline: none;
  }
}

/*
========================================
MAIN CONTENT & SUMMARY (NEW THEME)
========================================
*/
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px;
}

.portfolio-summary h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0 0 5px 0;
    color: #2C3E50;
}

.portfolio-summary p {
    font-size: 1.1rem;
    color: #7F8C8D;
    margin-bottom: 30px;
}

.current-portfolio-name {
    font-weight: bold;
    color: #2C3E50;
    font-size: 1.3rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.summary-card {
    background-color: #FFFFFF;
    border: none;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(44, 62, 80, 0.08);
}

.summary-card h3 {
    font-size: 14px;
    font-weight: 600;
    color: #2C3E50;
    margin: 0 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-card .value {
    font-size: 28px;
    font-weight: 800;
    color: #2C3E50;
    margin-bottom: 8px;
    line-height: 1.2;
}

.summary-card .subtitle {
    font-size: 12px;
    color: #7F8C8D;
    margin: 0;
}

.summary-card .value.positive {
    color: #2ECC71;
}

.summary-card .value.negative {
    color: #E74C3C;
}

/*
========================================
RESPONSIVENESS (NEW THEME)
========================================
*/

@media (max-width: 1024px) {
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }
    .portfolio-summary h2 {
        font-size: 1.8rem;
    }
    .summary-card .value {
        font-size: 24px;
    }
}

/*
========================================
FILTER BAR STYLING
========================================
*/
.filter-bar {
    background-color: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(44, 62, 80, 0.08);
    padding: 20px;
    margin-bottom: 24px;
}

.filter-form {
    display: flex;
    flex-wrap: wrap; /* Allows filters to wrap on smaller screens */
    align-items: center;
    gap: 15px; /* Spacing between all items */
}

.filter-form label {
    font-size: 14px;
    font-weight: 600;
    color: #7F8C8D;
    margin-left: 5px; /* Space before a label */
}
.filter-form label:first-of-type {
    margin-left: 0;
}


/* Shared styles for select and date inputs */
.filter-form select,
.filter-form input[type="date"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: #f8f9fa;
    color: #2C3E50;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid #ecf0f1;
    border-radius: 8px;
    cursor: pointer;
}

/* Specific style for SELECT to add dropdown arrow */
.filter-form select {
    padding-right: 30px; /* Make space for arrow */
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%237F8C8D%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 8px 8px;
}

/* Specific style for date input */
.filter-form input[type="date"] {
    /* Most browsers style date inputs well, but this ensures consistency */
    padding: 8px 10px; /* Date inputs have internal padding */
    line-height: 1.5; /* Fix for potential height mismatch */
}

/*
========================================
FILTER BAR BUTTON
========================================
*/
.filter-button {
    background-color: #2C3E50;
    color: #FFFFFF;
    border: none;
    padding: 10px 15px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-left: 10px; /* Push button to the end */
}

.filter-button:hover {
    background-color: #34495e;
}

/*
========================================
REPORT TABLE STYLING
========================================
*/
.report-container {
    background-color: #FFFFFF;
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(44, 62, 80, 0.08);
    overflow: hidden;
}

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

.report-table th,
.report-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.report-table th {
    background-color: #f8f9fa;
    color: #7F8C8D;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.report-table td {
    color: #2C3E50;
    font-size: 14px;
    font-weight: 600;
}

.report-table tr:last-child td {
    border-bottom: none;
}

.report-table .text-right {
    text-align: right;
}
.report-table .text-center {
    text-align: center;
}

/* P/L COLOR STYLING */
.report-table td.positive {
    color: #2ECC71 !important;
}
.report-table td.negative {
    color: #E74C3C !important;
}

/* TXN TYPE BADGES */
.tx-type {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tx-type-buy {
    color: #2ECC71;
    background-color: #eaf7f0;
}

.tx-type-sell {
    color: #E74C3C;
    background-color: #fbedeb;
}

.tx-type-cash {
    color: #1e88e5; /* Blue for cash */
    background-color: #e3f2fd;
}

.tx-type-stock {
    color: #8e44ad; /* Purple for stock */
    background-color: #f3e5f5;
}


/* SORTING LINKS */
.report-table th a {
    text-decoration: none;
    color: inherit;
    display: block;
    white-space: nowrap;
}

.report-table th a:hover {
    color: #2C3E50;
}

/*
========================================
TABLE: RUNNING TOTAL & FOOTER LABELS
========================================
*/
.report-table .running-total {
    color: #7F8C8D; /* Softer color for running total */
    font-style: italic;
    font-weight: 400;
}

.report-table tfoot .footer-label {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: #7F8C8D;
}

/*
========================================
TABLE FOOTER STYLING
========================================
*/
.report-table tfoot td {
    background-color: #f8f9fa;
    border-top: 2px solid #ecf0f1;
    color: #2C3E50;
    font-size: 14px;
    font-weight: 800;
    padding: 16px;
}





/*
========================================
TRADE GROUP STYLING (UPDATED)
========================================
*/
.report-table tbody.trade-group {
    border-top: 3px solid #bdc3c7; /* Heavy border to separate groups */
}

.report-table tbody.trade-group:first-of-type {
    border-top: 1px solid #ecf0f1; /* Normal border for the first one */
}

/* NEW: Alternate background color for groups */
.report-table tbody.trade-group:nth-child(even) {
    background-color: #f8f9fa;
}

.report-table tr.trade-group-total td {
    /* Updated: Made background slightly darker to stand out on even rows */
    background-color: #f0f2f5; 
    border-top: 2px solid #ecf0f1; /* Separator line */
    font-weight: 800; /* Bold */
}

/* Ensure even-row total still has the darker background */
.report-table tbody.trade-group:nth-child(even) tr.trade-group-total td {
    background-color: #f0f2f5;
}


.report-table .faded-text {
    color: #7F8C8D;
    font-weight: 400;
}



/*
========================================
EXPORT BUTTON STYLING
========================================
*/
.export-button {
    display: inline-block;
    background-color: #f8f9fa; /* Light gray */
    color: #2C3E50; /* Dark text */
    border: 1px solid #ecf0f1; /* Light border */
    padding: 10px 15px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
    margin-left: 10px;
}

.export-button:hover {
    background-color: #ecf0f1; /* Darken slightly on hover */
    color: #2C3E50;
}



/*
========================================
CASH LEDGER BADGES
========================================
*/
.tx-type-deposit {
    color: #2ECC71; /* Green */
    background-color: #eaf7f0;
}
.tx-type-withdrawal {
    color: #E74C3C; /* Red */
    background-color: #fbedeb;
}
/* We re-use .tx-type-cash (Blue) for Dividend */


/*
========================================
FIFO LEDGER STYLES
========================================
*/
.tx-type-acquisition {
    color: #007bFF; /* Bootstrap Primary Blue */
    background-color: #e6f2ff;
}

/* This adds a thick border when the Lot ID changes */
.report-table tr.lot-group-start td {
    border-top: 3px solid #bdc3c7;
}

.report-table tbody:first-of-type tr.lot-group-start td {
    border-top: 1px solid #ecf0f1; /* Normal border for the very first row */
}


/*
========================================
HOLDINGS REPORT - TICKER STYLING
========================================
*/
.report-table .ticker-name {
    /* User Request: Smaller */
    font-size: 12px;
    
    /* User Request: Lighter */
    color: #7F8C8D;
    
    font-weight: 400;
    margin-left: 2px; /* Space for the dash */
}


/*
========================================
HOLDINGS REPORT - SUMMARY BAR
========================================
*/
.holdings-summary-bar {
    display: flex;
    justify-content: space-between;
    background-color: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(44, 62, 80, 0.08);
    padding: 20px 25px;
    margin-bottom: 24px;
}
.holdings-summary-bar div {
    flex: 1;
    text-align: center;
}
.holdings-summary-bar .summary-title {
    font-size: 14px;
    font-weight: 600;
    color: #7F8C8D;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.holdings-summary-bar .summary-value {
    font-size: 24px;
    font-weight: 800;
    color: #2C3E50;
}
/* Add a vertical separator */
.holdings-summary-bar div:first-child {
    border-right: 1px solid #ecf0f1;
    text-align: left;
    padding-left: 10px;
}
.holdings-summary-bar div:last-child {
    text-align: right;
    padding-right: 10px;
}





/*
========================================
HOLDINGS REPORT - TICKER STYLING
========================================
*/
.report-table .ticker-name {
    /* User Request: Smaller */
    font-size: 12px;
    
    /* User Request: Lighter */
    color: #7F8C8D;
    
    font-weight: 400;
    margin-left: 2px; /* Space for the dash */
}





/*
========================================
CLICKABLE TABLE CELL LINKS
========================================
*/
.report-table td a {
    text-decoration: none; /* Remove underline */
    color: inherit; /* Inherit the cell's color (e.g., green for positive) */
    display: block; /* Make the whole cell area clickable */
    height: 100%;
    width: 100%;
}
.report-table td a:hover {
    text-decoration: underline; /* Add underline on hover */
    /* Use the primary link color on hover */
    color: #0056b3; 
}

/* Keep the P/L color on hover */
.report-table td.positive a:hover {
    color: #2ECC71;
}
.report-table td.negative a:hover {
    color: #E74C3C;
}






/*
========================================
DASHBOARD CARD - SUBTITLE VALUE
========================================
*/
.summary-card .subtitle-value {
    font-size: 12px; /* Same size as subtitle */
    font-weight: 600; /* Bold */
    margin: 4px 0 0 0; /* Spacing */
    /* Color is applied by the .positive or .negative class */
}

.summary-card .subtitle-value.positive {
    color: #2ECC71;
}

.summary-card .subtitle-value.negative {
    color: #E74C3C;
}

/* Adjust main subtitle spacing */
.summary-card .subtitle-value + .subtitle {
    margin-top: 4px; /* Add a little space if the value is above it */
}




/*
========================================
ALLOCATION REPORT STYLES
========================================
*/
.allocation-container {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 50/50 split */
    gap: 24px;
    align-items: flex-start;
}

.chart-wrapper {
    position: relative;
    height: 450px;
    background-color: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(44, 62, 80, 0.08);
    padding: 20px;
}

/* Responsive: Stack chart and table on mobile */
@media (max-width: 900px) {
    .allocation-container {
        grid-template-columns: 1fr; /* 100% width */
    }
    .chart-wrapper {
        height: 350px; /* Adjust height for mobile */
    }
}


/*
========================================
TOP MOVERS REPORT STYLES
========================================
*/
.movers-container {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 50/50 split */
    gap: 24px;
    align-items: flex-start;
}

/* Responsive: Stack columns on mobile */
@media (max-width: 900px) {
    .movers-container {
        grid-template-columns: 1fr; /* 100% width */
    }
}


/*
========================================
COMBO CHART (LINE) STYLING
========================================
*/
.chart-total-line {
    border-width: 3px !important;
    border-dash: [5, 5]; /* Dotted line */
    fill: false !important;
    tension: 0.1;
}


/*
========================================
CHECKBOX FILTER BAR
========================================
*/
.checkbox-filter-bar {
    background-color: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(44, 62, 80, 0.08);
    padding: 20px;
    margin-bottom: 24px;
}

.checkbox-filter-bar .filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
}

.checkbox-filter-bar .checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    flex-grow: 1;
}

.checkbox-filter-bar .checkbox-item {
    display: flex;
    align-items: center;
}

.checkbox-filter-bar .checkbox-item input {
    margin-right: 5px;
    /* Simple custom checkbox */
    width: 1.1em;
    height: 1.1em;
    accent-color: #2C3E50;
}

.checkbox-filter-bar .checkbox-item label {
    font-size: 14px;
    font-weight: 600;
    color: #2C3E50;
}




/*
========================================
CHECKBOX FILTER BAR (CONSOLIDATED)
========================================
*/
.checkbox-filter-bar .filter-form {
    display: flex;
    flex-direction: column; /* Stack sections vertically */
    align-items: stretch;
    gap: 15px;
}

.checkbox-filter-bar .filter-links {
    display: flex;
    gap: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ecf0f1;
}

.checkbox-filter-bar .filter-links a {
    font-size: 12px;
    font-weight: 600;
    color: #0056b3;
    text-decoration: none;
    cursor: pointer;
}
.checkbox-filter-bar .filter-links a:hover {
    text-decoration: underline;
}

.checkbox-filter-bar .checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    max-height: 120px; /* Make list scrollable */
    overflow-y: auto;
    padding: 5px;
}

/* Custom Checkbox Styles */
.styled-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #2C3E50;
    position: relative;
    padding-left: 28px; /* Space for custom box */
    min-height: 20px;  
}

/* Hide the default checkbox */
.styled-checkbox-label input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

/* Create the custom box */
.styled-checkbox-label span {
    position: absolute;
    top: 0;
    left: 0;
    height: 18px;
    width: 18px;
    background-color: #f8f9fa;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    transition: all 0.2s;
}

.styled-checkbox-label:hover span {
    background-color: #ecf0f1;
}

/* Style the checkmark */
.styled-checkbox-label span:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

/* Show the checkmark when checked */
.styled-checkbox-label input[type="checkbox"]:checked ~ span {
    background-color: #2C3E50;
    border-color: #2C3E50;
}

.styled-checkbox-label input[type="checkbox"]:checked ~ span:after {
    display: block;
}

/* Center the button */
.checkbox-filter-bar .filter-button {
    /* margin-left: auto; Push button to the right */
}







/* --- Mobile Styles (e.g., 768px and down) --- */
/* =======================
   Modern Mobile Navigation
   ======================= */
/* Import Google Font 'Inter' */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&display=swap');

/* --- Global & Layout --- */
body {
    font-family: 'Inter', 'Roboto', sans-serif;
    background-color: #FFFFFF;
    color: #2C3E50;
    margin: 0;
    padding: 0;
    padding-top: 70px;
}

/*
========================================
NAVBAR (HEADER)
========================================
*/
.navbar {
    background-color: #2C3E50;
    color: #FFFFFF;
    padding: 0 20px;
    height: 70px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.nav-brand {
    display: flex;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #FFFFFF;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    flex-grow: 1;
    justify-content: center;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-group {
    position: relative;
}

.nav-group h3 {
    color: #e0eaff;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 10px 15px;
    margin: 0;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.2s;
    
}

.nav-group a {
    color: #e0eaff;
    text-decoration: none;
    font-weight: 1000;
    font-size: 1rem;
}

.nav-group:hover h3 {
    background-color: #3a5a84;

}

.nav-group ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    list-style: none;
    padding: 10px 0;
    margin: 0;
    min-width: 200px;
    z-index: 1001;
}

.nav-group:hover ul {
    display: block;
}

.nav-group ul li a {
    display: block;
    padding: 10px 20px;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    white-space: nowrap;
}

.nav-group ul li a:hover {
    background-color: #f4f7f6;
}

.portfolio-switcher form {
    display: flex;
    align-items: center;
    position: relative;
}

.portfolio-switcher label {
    margin-right: 10px;
    font-weight: 500;
    font-size: 0.9rem;
    color: #bdc3c7;
}

.portfolio-switcher select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: #34495e;
    color: #FFFFFF;
    padding: 8px 30px 8px 12px;
    font-size: 0.9rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.portfolio-switcher select:hover {
    background-color: #4a6a94;
}

.portfolio-switcher form::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #FFFFFF;
    pointer-events: none;
}

.portfolio-switcher select option {
    background-color: #fff;
    color: #2C3E50;
}


/*
========================================
MAIN CONTENT & SUMMARY (NEW THEME)
========================================
*/
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px;
}

.portfolio-summary h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0 0 5px 0;
    color: #2C3E50;
}

.portfolio-summary p {
    font-size: 1.1rem;
    color: #7F8C8D;
    margin-bottom: 30px;
}

.current-portfolio-name {
    font-weight: bold;
    color: #2C3E50;
    font-size: 1.3rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.summary-card {
    background-color: #FFFFFF;
    border: none;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(44, 62, 80, 0.08);
}

.summary-card h3 {
    font-size: 14px;
    font-weight: 600;
    color: #2C3E50;
    margin: 0 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-card .value {
    font-size: 28px;
    font-weight: 800;
    color: #2C3E50;
    margin-bottom: 8px;
    line-height: 1.2;
}

.summary-card .subtitle {
    font-size: 12px;
    color: #7F8C8D;
    margin: 0;
}

.summary-card .value.positive {
    color: #2ECC71;
}

.summary-card .value.negative {
    color: #E74C3C;
}

/*
========================================
RESPONSIVENESS (NEW THEME)
========================================
*/

@media (max-width: 1024px) {
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }
    .portfolio-summary h2 {
        font-size: 1.8rem;
    }
    .summary-card .value {
        font-size: 24px;
    }
}

/*
========================================
FILTER BAR STYLING
========================================
*/
.filter-bar {
    background-color: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(44, 62, 80, 0.08);
    padding: 20px;
    margin-bottom: 24px;
}

.filter-form {
    display: flex;
    flex-wrap: wrap; /* Allows filters to wrap on smaller screens */
    align-items: center;
    gap: 15px; /* Spacing between all items */
}

.filter-form label {
    font-size: 14px;
    font-weight: 600;
    color: #7F8C8D;
    margin-left: 5px; /* Space before a label */
}
.filter-form label:first-of-type {
    margin-left: 0;
}


/* Shared styles for select and date inputs */
.filter-form select,
.filter-form input[type="date"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: #f8f9fa;
    color: #2C3E50;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid #ecf0f1;
    border-radius: 8px;
    cursor: pointer;
}

/* Specific style for SELECT to add dropdown arrow */
.filter-form select {
    padding-right: 30px; /* Make space for arrow */
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%237F8C8D%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 8px 8px;
}

/* Specific style for date input */
.filter-form input[type="date"] {
    /* Most browsers style date inputs well, but this ensures consistency */
    padding: 8px 10px; /* Date inputs have internal padding */
    line-height: 1.5; /* Fix for potential height mismatch */
}

/*
========================================
FILTER BAR BUTTON
========================================
*/
.filter-button {
    background-color: #2C3E50;
    color: #FFFFFF;
    border: none;
    padding: 5px 15px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-left: 10px; /* Push button to the end */
    height : 40px;
}

.filter-button:hover {
    background-color: #34495e;
}

/*
========================================
REPORT TABLE STYLING
========================================
*/
.report-container {
    background-color: #FFFFFF;
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(44, 62, 80, 0.08);
    overflow: hidden;
}

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

.report-table th,
.report-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.report-table th {
    background-color: #f8f9fa;
    color: #7F8C8D;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.report-table td {
    color: #2C3E50;
    font-size: 14px;
    font-weight: 600;
}

.report-table tr:last-child td {
    border-bottom: none;
}

.report-table .text-right {
    text-align: right;
}
.report-table .text-center {
    text-align: center;
}

/* P/L COLOR STYLING */
.report-table td.positive {
    color: #2ECC71 !important;
}
.report-table td.negative {
    color: #E74C3C !important;
}

/* TXN TYPE BADGES */
.tx-type {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tx-type-buy {
    color: #2ECC71;
    background-color: #eaf7f0;
}

.tx-type-sell {
    color: #E74C3C;
    background-color: #fbedeb;
}

.tx-type-cash {
    color: #1e88e5; /* Blue for cash */
    background-color: #e3f2fd;
}

.tx-type-stock {
    color: #8e44ad; /* Purple for stock */
    background-color: #f3e5f5;
}


/* SORTING LINKS */
.report-table th a {
    text-decoration: none;
    color: inherit;
    display: block;
    white-space: nowrap;
}

.report-table th a:hover {
    color: #2C3E50;
}

/*
========================================
TABLE: RUNNING TOTAL & FOOTER LABELS
========================================
*/
.report-table .running-total {
    color: #7F8C8D; /* Softer color for running total */
    font-style: italic;
    font-weight: 400;
}

.report-table tfoot .footer-label {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: #7F8C8D;
}

/*
========================================
TABLE FOOTER STYLING
========================================
*/
.report-table tfoot td {
    background-color: #f8f9fa;
    border-top: 2px solid #ecf0f1;
    color: #2C3E50;
    font-size: 14px;
    font-weight: 800;
    padding: 16px;
}





/*
========================================
TRADE GROUP STYLING (UPDATED)
========================================
*/
.report-table tbody.trade-group {
    border-top: 3px solid #bdc3c7; /* Heavy border to separate groups */
}

.report-table tbody.trade-group:first-of-type {
    border-top: 1px solid #ecf0f1; /* Normal border for the first one */
}

/* NEW: Alternate background color for groups */
.report-table tbody.trade-group:nth-child(even) {
    background-color: #f8f9fa;
}

.report-table tr.trade-group-total td {
    /* Updated: Made background slightly darker to stand out on even rows */
    background-color: #f0f2f5; 
    border-top: 2px solid #ecf0f1; /* Separator line */
    font-weight: 800; /* Bold */
}

/* Ensure even-row total still has the darker background */
.report-table tbody.trade-group:nth-child(even) tr.trade-group-total td {
    background-color: #f0f2f5;
}


.report-table .faded-text {
    color: #7F8C8D;
    font-weight: 400;
}



/*
========================================
EXPORT BUTTON STYLING
========================================
*/
.export-button {
    display: inline-block;
    background-color: #f8f9fa; /* Light gray */
    color: #2C3E50; /* Dark text */
    border: 1px solid #ecf0f1; /* Light border */
    padding: 10px 15px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
    margin-left: 10px;
}

.export-button:hover {
    background-color: #ecf0f1; /* Darken slightly on hover */
    color: #2C3E50;
}



/*
========================================
CASH LEDGER BADGES
========================================
*/
.tx-type-deposit {
    color: #2ECC71; /* Green */
    background-color: #eaf7f0;
}
.tx-type-withdrawal {
    color: #E74C3C; /* Red */
    background-color: #fbedeb;
}
/* We re-use .tx-type-cash (Blue) for Dividend */


/*
========================================
FIFO LEDGER STYLES
========================================
*/
.tx-type-acquisition {
    color: #007bFF; /* Bootstrap Primary Blue */
    background-color: #e6f2ff;
}

/* This adds a thick border when the Lot ID changes */
.report-table tr.lot-group-start td {
    border-top: 3px solid #bdc3c7;
}

.report-table tbody:first-of-type tr.lot-group-start td {
    border-top: 1px solid #ecf0f1; /* Normal border for the very first row */
}


/*
========================================
HOLDINGS REPORT - TICKER STYLING
========================================
*/
.report-table .ticker-name {
    /* User Request: Smaller */
    font-size: 12px;
    
    /* User Request: Lighter */
    color: #7F8C8D;
    
    font-weight: 400;
    margin-left: 2px; /* Space for the dash */
}


/*
========================================
HOLDINGS REPORT - SUMMARY BAR
========================================
*/
.holdings-summary-bar {
    display: flex;
    justify-content: space-between;
    background-color: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(44, 62, 80, 0.08);
    padding: 20px 25px;
    margin-bottom: 24px;
}
.holdings-summary-bar div {
    flex: 1;
    text-align: center;
}
.holdings-summary-bar .summary-title {
    font-size: 14px;
    font-weight: 600;
    color: #7F8C8D;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.holdings-summary-bar .summary-value {
    font-size: 24px;
    font-weight: 800;
    color: #2C3E50;
}
/* Add a vertical separator */
.holdings-summary-bar div:first-child {
    border-right: 1px solid #ecf0f1;
    text-align: left;
    padding-left: 10px;
}
.holdings-summary-bar div:last-child {
    text-align: right;
    padding-right: 10px;
}





/*
========================================
HOLDINGS REPORT - TICKER STYLING
========================================
*/
.report-table .ticker-name {
    /* User Request: Smaller */
    font-size: 12px;
    
    /* User Request: Lighter */
    color: #7F8C8D;
    
    font-weight: 400;
    margin-left: 2px; /* Space for the dash */
}





/*
========================================
CLICKABLE TABLE CELL LINKS
========================================
*/
.report-table td a {
    text-decoration: none; /* Remove underline */
    color: inherit; /* Inherit the cell's color (e.g., green for positive) */
    display: block; /* Make the whole cell area clickable */
    height: 100%;
    width: 100%;
}
.report-table td a:hover {
    text-decoration: underline; /* Add underline on hover */
    /* Use the primary link color on hover */
    color: #0056b3; 
}

/* Keep the P/L color on hover */
.report-table td.positive a:hover {
    color: #2ECC71;
}
.report-table td.negative a:hover {
    color: #E74C3C;
}






/*
========================================
DASHBOARD CARD - SUBTITLE VALUE
========================================
*/
.summary-card .subtitle-value {
    font-size: 12px; /* Same size as subtitle */
    font-weight: 600; /* Bold */
    margin: 4px 0 0 0; /* Spacing */
    /* Color is applied by the .positive or .negative class */
}

.summary-card .subtitle-value.positive {
    color: #2ECC71;
}

.summary-card .subtitle-value.negative {
    color: #E74C3C;
}

/* Adjust main subtitle spacing */
.summary-card .subtitle-value + .subtitle {
    margin-top: 4px; /* Add a little space if the value is above it */
}




/*
========================================
ALLOCATION REPORT STYLES
========================================
*/
.allocation-container {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 50/50 split */
    gap: 24px;
    align-items: flex-start;
}

.chart-wrapper {
    position: relative;
    height: 450px;
    background-color: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(44, 62, 80, 0.08);
    padding: 20px;
}

/* Responsive: Stack chart and table on mobile */
@media (max-width: 900px) {
    .allocation-container {
        grid-template-columns: 1fr; /* 100% width */
    }
    .chart-wrapper {
        height: 350px; /* Adjust height for mobile */
    }
}


/*
========================================
TOP MOVERS REPORT STYLES
========================================
*/
.movers-container {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 50/50 split */
    gap: 24px;
    align-items: flex-start;
}

/* Responsive: Stack columns on mobile */
@media (max-width: 900px) {
    .movers-container {
        grid-template-columns: 1fr; /* 100% width */
    }
}


/*
========================================
COMBO CHART (LINE) STYLING
========================================
*/
.chart-total-line {
    border-width: 3px !important;
    border-dash: [5, 5]; /* Dotted line */
    fill: false !important;
    tension: 0.1;
}




/*
========================================
CHECKBOX FILTER BAR (CONSOLIDATED)
========================================
*/
.checkbox-filter-bar .filter-form {
    display: flex;
    flex-direction: column; /* Stack sections vertically */
    align-items: stretch;
    gap: 15px;
}

.checkbox-filter-bar .filter-links {
    display: flex;
    gap: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ecf0f1;
}

.checkbox-filter-bar .filter-links a {
    font-size: 12px;
    font-weight: 600;
    color: #0056b3;
    text-decoration: none;
    cursor: pointer;
}
.checkbox-filter-bar .filter-links a:hover {
    text-decoration: underline;
}

.checkbox-filter-bar .checkbox-group {
    /*display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    max-height: 120px; /* Make list scrollable * /
    overflow-y: auto;
    padding: 5px;*/
}

/* Custom Checkbox Styles */
.styled-checkbox-label {
    /*display: flex;*/
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #2C3E50;
    position: relative;
    padding-left: 28px; /* Space for custom box */
    min-height: 20px;
     display: inline-block;
   
     /* Just to show the height * /
  
    /* You can also use padding, margins, etc. * /
    padding: 5px;
    margin-right: 10px;*/
}

/* Hide the default checkbox */
.styled-checkbox-label input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

/* Create the custom box */
.styled-checkbox-label span {
    position: absolute;
    top: 0;
    left: 0;
    height: 18px;
    width: 18px;
    background-color: #f8f9fa;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    transition: all 0.2s;
}

.styled-checkbox-label:hover span {
    background-color: #ecf0f1;
}

/* Style the checkmark */
.styled-checkbox-label span:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

/* Show the checkmark when checked */
.styled-checkbox-label input[type="checkbox"]:checked ~ span {
    background-color: #2C3E50;
    border-color: #2C3E50;
}

.styled-checkbox-label input[type="checkbox"]:checked ~ span:after {
    display: block;
}

/* Center the button */
.checkbox-filter-bar .filter-button {
    margin-left: auto; /* Push button to the right */
}



/*=====================

   N E W    I T E M S

  =====================*/

/* ========== Base Reset ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Arial, sans-serif;
  background-color: #f5f6fa;
  color: #2c3e50;
}

/* ========== Navbar Container ========== */
.navbar {
  background-color: #2c3e50;
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.navbar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.2rem;
  max-width: 1200px;
  margin: auto;
}

/* ========== Logo ========== */
.nav-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}

/* ========== Hamburger Button ========== */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1100;
}

.nav-toggle .bar {
  height: 3px;
  width: 100%;
  background-color: #fff;
  border-radius: 3px;
  transition: all 0.3s ease;
}

/* Animate hamburger → X */
.nav-toggle.is-active .bar:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.nav-toggle.is-active .bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle.is-active .bar:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ========== Nav Menu (shared) ========== */
.nav-menu {
  transition: all 0.4s ease;
}

/* Desktop layout */
@media (min-width: 768px) {
  .nav-menu {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 2rem;
    background: none;
    position: static;
    height: auto;
    width: auto;
  }

  .nav-links {
    display: flex;
    gap: 2rem;
  }

  .nav-group {
    display: flex;
    flex-direction: column;
    text-align: left;
  }

  .nav-group h3 {
    font-size: 0.9rem;
    color: #ddd;
    margin-bottom: 0.3rem;
  }

  .nav-group ul {
    list-style: none;
  }

  .nav-group li {
    margin-bottom: 0.2rem;
  }

  .nav-group a {
    text-decoration: none;
    color: #fff;
    font-size: 0.9rem;
  }

  .portfolio-switcher {
    display: flex;
    align-items: center;
    color: #fff;
    gap: 0.5rem;
  }

  .portfolio-switcher label {
    font-size: 0.9rem;
  }

  .portfolio-switcher select {
    padding: 0.3rem;
    border-radius: 4px;
    border: none;
    outline: none;
  }
}

/* ========== Mobile Menu (slide down) ========== */
@media (max-width: 767px) {
  .nav-toggle {
    display: flex;
  }

  /* Overlay with blur */
  .nav-menu {
    position: fixed;
    top: -100%;
    left: 0;
    width: 100%;
    height: auto;
    background: rgba(44, 62, 80, 0.9);
    backdrop-filter: blur(8px);
    transition: top 0.4s ease;
    padding: 4rem 1.5rem 2rem;
    z-index: 1050;
  }

  .nav-menu.is-active {
    top: 0;
  }

  .nav-links {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .nav-group h3 {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
  }

  .nav-group ul {
    list-style: none;
  }

  .nav-group li {
    margin-bottom: 0.3rem;
  }

  .nav-group a {
    color: #ecf0f1;
    text-decoration: none;
    font-size: 1rem;
  }

  /* Portfolio switcher inside */
  .portfolio-switcher {
    margin-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 1rem;
  }

  .portfolio-switcher label {
    display: block;
    color: #fff;
    margin-bottom: 0.4rem;
    font-size: 1rem;
  }

  .portfolio-switcher select {
    width: 100%;
    padding: 0.6rem;
    border-radius: 6px;
    border: none;
    outline: none;
    font-size: 1rem;
  }
}

/* ========== Utility ========== */
.main-content {
  padding-top: 70px; /* account for fixed navbar */
}

