/* --- Interest Summary View --- */
#interest-summary-container thead th {
    position: sticky;
    top: 0;
    z-index: 20;
}

#interest-summary-container .sticky-col {
    position: sticky;
    left: 0;
}

#interest-summary-container thead th.sticky-col {
    background-color: #f9fafb;
    z-index: 30;
}

#interest-summary-container tbody td.sticky-col {
    background-color: white;
    z-index: 10;
}

/* --- Interest Summary Popover --- */
#interest-popover {
    background-color: #2d3748;
    color: #edf2f7;
    border: 1px solid #4a5568;
    transition: opacity 0.2s ease-in-out;
}

#interest-popover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 20px;
    border-width: 8px;
    border-style: solid;
    border-color: transparent transparent #2d3748 transparent;
}

#interest-popover-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #4a5568;
    font-weight: 600;
}

#interest-popover-table {
    width: 100%;
    font-size: 0.875rem;
}

#interest-popover-table th,
#interest-popover-table td {
    padding: 0.5rem 1rem;
    text-align: left;
}

#interest-popover-table th:last-child,
#interest-popover-table td:last-child {
    text-align: right;
}

#interest-popover-table tbody tr {
    border-top: 1px solid #4a5568;
}

#interest-popover-table tfoot {
    font-weight: bold;
}

/* --- Dividends Summary Sticky Columns --- */
#dividends-summary-container .sticky-col {
    position: sticky;
    left: 0;
    z-index: 10;
}

#dividends-summary-container thead th.sticky-col {
    background-color: #f9fafb;
    z-index: 20;
}

#dividends-summary-container tbody td.sticky-col {
    background-color: white;
}

#dividends-summary-container tbody tr.bg-gray-100 td.sticky-col {
    background-color: #f3f4f6;
}

/* --- Fund Expenses View --- */
#view-fund-expenses .expense-subsection {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
}

#view-fund-expenses .subsection-header {
    font-size: 0.875rem;
    font-weight: 600;
    color: #4b5563;
    padding: 0.25rem 0.5rem;
}

#view-fund-expenses .subsection-table th,
#view-fund-expenses .subsection-table td {
    font-size: 0.8rem;
    padding: 0.35rem 0.5rem;
}

#add-expense-modal label {
    font-size: 0.8rem;
}

/* --- Dividends Details View --- */
#view-dividends-details .dividends-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: center;
}

#view-dividends-details .header-left,
#view-dividends-details .header-right {
    width: 200px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

#view-dividends-details .header-center {
    flex-grow: 1;
}

#view-dividends-details table {
    font-size: 10px;
    width: 100%;
    border-collapse: collapse;
}

#view-dividends-details thead th {
    padding: 6px 4px;
    text-align: left;
    font-weight: bold;
    border-bottom: 2px solid black;
}

#view-dividends-details tbody td {
    padding: 4px;
    border-bottom: none;
}

#view-dividends-details thead {
    display: table-header-group;
}

@media print {
    body,
    #app-view,
    .content-view.active {
        background-color: white !important;
    }

    body > *:not(#app-view),
    #app-view > *:not(.flex),
    .flex > *:not(main),
    main > *:not(#view-dividends-details),
    #view-dividends-details > *:not(#dividends-details-printable-area) {
        display: none;
    }

    #view-dividends-details .header-right {
        display: none !important;
    }

    #print-footer-logo {
        display: block !important;
        position: fixed;
        bottom: 20px;
        left: 20px;
    }

    #dividends-details-printable-area .dividends-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background: white;
        padding: 1rem;
        z-index: 100;
    }

    #dividends-details-printable-area .dividends-table-container {
        padding-top: 100px;
    }
}

/* --- Interest Details View --- */
#view-interest-details .interest-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: center;
}

#view-interest-details .header-left,
#view-interest-details .header-right {
    width: 200px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

#view-interest-details .header-center {
    flex-grow: 1;
}

#view-interest-details table {
    font-size: 10px;
    width: 100%;
    border-collapse: collapse;
}

#view-interest-details thead th {
    padding: 6px 4px;
    text-align: left;
    font-weight: bold;
    border-bottom: 2px solid black;
    position: sticky;
    top: 0;
    background-color: white;
    z-index: 10;
}

#view-interest-details tbody td {
    padding: 4px;
    border-bottom: none;
}

#view-interest-details tbody tr.total-row td {
    font-weight: bold;
    padding-top: 8px;
    border-top: 1px solid #ccc;
}

#view-interest-details tbody tr.group-header td {
    font-weight: bold;
    background-color: #f3f4f6;
    padding-top: 10px;
}

#view-interest-details .interest-table-container {
    max-height: 75vh;
    overflow-y: auto;
}

@media print {
    body > *:not(#app-view),
    #app-view > *:not(.flex),
    .flex > *:not(main),
    main > *:not(#view-interest-details),
    #view-interest-details > *:not(#interest-details-printable-area) {
        display: none;
    }

    #view-interest-details .header-right {
        display: none !important;
    }

    #print-footer-logo-interest {
        display: block !important;
        position: fixed;
        bottom: 20px;
        left: 20px;
    }

    #view-interest-details thead {
        display: table-header-group;
    }
}

