.financial-industry .item {
    font-weight: 500;
}

.financial-industry .item .title {
    color: #666;
}

#financial-reports-detail-tab {
    white-space: nowrap;
    overflow-x: scroll;
    scrollbar-width: none;
}

#financial-reports-detail-tab .nav-link {
    padding: 6px 10px;
    font-weight: 500;
    background-color: var(--bg-thead);
    color: var(--text-main);
    transition: color ease-in-out 0.3s;
    border: none;
    border-radius: 4px;
}

#financial-reports-detail-tab .nav-link.active {
    background-color: #f5a504;
    color: #ffffff;
}

#financial-reports-detail-tab {
    padding-top: 12px;
    padding-right: 12px;
}

.tab-content {
    margin-top: 1rem;
}

.financial-reports-detail .btn-group .btn-outline-secondary:hover,
.btn-group[aria-label="View mode selection"] .btn-outline-secondary:hover {
    background-color: var(--bg-thead);
}

.financial-reports-detail .btn-group .btn-outline-secondary.active,
.financial-reports-detail .btn-group .btn-outline-secondary:active,
.btn-group[aria-label="View mode selection"] .btn-outline-secondary.active,
.btn-group[aria-label="View mode selection"] .btn-outline-secondary:active {
    background-color: #f5a504;
    border-color: #f5a504;
    color: #ffffff;
}

.financial-reports-detail .btn-group .btn-outline-secondary:disabled,
.financial-reports-detail .btn-group .btn-outline-secondary.disabled,
.btn-group[aria-label="View mode selection"] .btn-outline-secondary:disabled,
.btn-group[aria-label="View mode selection"] .btn-outline-secondary.disabled {
    background-color: transparent;
    border-color: #f5a504;
    opacity: 0.65;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.text-center.text-muted.py-4 {
    font-style: italic;
    color: #6c757d;
}

.text-center.text-muted.py-4 i {
    color: #007bff;
}

.container-fluid.main {
    overflow: visible;
}

.box-content.market-table {
    overflow: visible;
}

#income-statement .unified-metrics-table thead,
#balance-sheet .unified-metrics-table thead,
#cash-flow .unified-metrics-table thead {
    position: sticky;
    top: 0px;
    z-index: 10;
}

#income-statement .unified-metrics-table thead tr td,
#balance-sheet .unified-metrics-table thead tr td,
#cash-flow .unified-metrics-table thead tr td {
    font-weight: 600;
    padding: 12px 8px;
    position: sticky;
    top: 0;
    z-index: 10;
}

#income-statement .unified-metrics-table td,
#balance-sheet .unified-metrics-table td,
#cash-flow .unified-metrics-table td {
    min-width: 125px;
    text-align: center;
    padding: 15px 8px;
}

#income-statement .unified-metrics-table td.metric-name-cell,
#balance-sheet .unified-metrics-table td.metric-name-cell,
#cash-flow .unified-metrics-table td.metric-name-cell,
#income-statement .unified-metrics-table td.metric-name-col,
#balance-sheet .unified-metrics-table td.metric-name-col,
#cash-flow .unified-metrics-table td.metric-name-col {
    position: sticky;
    left: 0px;
    min-width: 180px;
    max-width: 250px;
    font-weight: 500;
    text-align: left;
    z-index: 5;
}

#income-statement .unified-metrics-table thead td.metric-name-col,
#balance-sheet .unified-metrics-table thead td.metric-name-col,
#cash-flow .unified-metrics-table thead td.metric-name-col {
    z-index: 10;
}

#indicators .unified-metrics-table thead td:first-child,
#indicators .unified-metrics-table thead td.metric-name-col {
    position: sticky;
    left: 0px;
    min-width: 180px;
    font-weight: 600;
    text-align: left;
    z-index: 10;
}

.financial-table {
    width: 100%;
    overflow: auto;
    max-height: 686px;
}

.financial-table::-webkit-scrollbar {
    width: 3px;
    height: 3px;
}

.financial-table table thead {
    position: sticky;
    top: 0px;
    z-index: 10;
    background-color: #eaeff9;
}

.financial-table table thead tr td {
    font-weight: 600;
    padding: 12px 8px;
    min-width: 125px;
}

.financial-table table tr td {
    min-width: 125px;
    text-align: center;
    padding: 15px 8px;
}

.financial-table table tr td:first-child {
    position: sticky;
    left: 0;
    min-width: 200px;
    font-weight: 500;
    text-align: left;
    z-index: 5;
}

.financial-table table tr td .text-muted {
    color: var(--text-main) !important;
}

.financial-table table thead tr td:first-child,
#financial-reports-detail .unified-metrics-table thead td:first-child {
    font-weight: 600;
}

td.metric-name-cell > span.primary_metric {
    font-weight: 600;
}

#notes {
    background-color: var(--bg-box-white);
}

#notes tr.metric-row:has(span.primary_metric) {
    background-color: #f5f8fc;
    font-weight: 500;
}

#notes .financial-table table tr td:has(span.primary_metric), #notes .financial-table table tr td:has(span.primary-value) {
    background-color: var(--box-search);
}

#financial-reports-detail table thead td {
    border-bottom-color: var(--bg-header);
}

#financial-reports-detail table td {
    padding: 15px 8px;
}

#financial-reports-detail #indicators .metric-name-cell {
    padding-left: 28px!important; 
}

#financial-reports-detail table thead,
.tab-pane table thead {
    position: sticky;
    top: 0px;
    z-index: 10;
    background-color: #eaeff9;
}

#financial-reports-detail table td.sort-col {
    color: #666;
}

.increase {
    color: #28a745;
    font-weight: 600;
}

.decrease {
    color: #dc3545;
    font-weight: 600;
}

.normal {
    color: #6c757d;
}

.breadcrumbs-link {
    color: #6c757d;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumbs-link:hover {
    color: #495057;
}

.breadcrumbs-link.active {
    color: #495057;
    font-weight: 500;
}

@media print {    
    .table-scrollable {
        overflow: visible;
        box-shadow: none;
    }
    
    .breadcrumbs {
        display: none;
    }
}

.btn-group .btn {
    border-color: var(--border-main);
    color: var(--text-button-chart);
    font-weight: 500;
}

.btn-group .btn:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
    color: #495057;
}

.btn-group .btn.active {
    background-color: #007bff;
    border-color: #007bff;
    color: #ffffff;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 0.375rem;
}

.tab-content {
    position: relative;
}

.loading-spinner {
    width: 2rem;
    height: 2rem;
    border: 0.25em solid #f3f3f3;
    border-top: 0.25em solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    margin-left: 0.75rem;
    color: #6c757d;
    font-size: 0.9rem;
}

.btn.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.btn.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1rem;
    height: 1rem;
    border: 0.125rem solid transparent;
    border-top: 0.125rem solid currentColor;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

.fade-in {
    animation: fadeIn 0.6s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.error-state {
    text-align: center;
    padding: 2rem;
    color: #dc3545;
}

.error-state .fa-exclamation-triangle {
    font-size: 2rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.view-mode-transition {
    transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-group {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 0.375rem;
    overflow: hidden;
}

.btn-group .btn:first-child {
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
}

.btn-group .btn:last-child {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

@media (max-width: 480px) {
    .financial-industry .item, #financial-reports-detail-tab .nav-link {
        font-size: 15px;
    }
}

@media (max-width: 360px) {
    .financial-industry .item .title {
        font-size: 14px;
    }
}

#financial-reports-detail {
    min-height: 60dvh;
}

#financial-reports-detail table td:first-child {
    min-width: 180px;
    text-align: left;
    font-weight: 500;
    position: sticky;
    left: 0;
    z-index: 5;
}

#financial-reports-detail table thead td:first-child {
    font-weight: 600;
    z-index: 11;
}

#financial-reports-detail .unified-metrics-table td:first-child {
    min-width: 450px;
    text-align: left;
    font-weight: 400;
    position: sticky;
    left: 0;
    z-index: 5;
}

#financial-reports-detail .unified-metrics-table thead td:first-child {
    font-weight: 600;
    z-index: 11;
}

#financial-reports-detail .category-header-row {
    background-color: #f5f8fc; 
}

#financial-reports-detail .category-header-row td {
    font-weight: 600;
    padding: 10px 8px;
}

#financial-reports-detail .category-header-row td.category-header-cell {
    position: sticky;
    left: 0;
    z-index: 7;
    min-width: 180px;
    text-align: left;
    font-weight: 600;
}

#financial-reports-detail .category-header-row td.category-header-period-cell {
    padding: 10px 8px;
    min-width: 125px;
}

#financial-reports-detail .category-header-row td:first-child {
    min-width: 180px;
    text-align: left;
    font-weight: 600;
    position: sticky;
    left: 0;
    z-index: 7;
}

#financial-reports-detail .metric-row:hover {
    background-color: #fafbfc;
}

#financial-reports-detail .metric-name-col {
    min-width: 180px;
    text-align: left;
    font-weight: 600;
    position: sticky;
    left: 0;
    z-index: 10;
}

#financial-reports-detail table thead td:first-child,
.financial-table table thead td:first-child {
    min-width: 180px;
    text-align: left;
    font-weight: 600;
    position: sticky;
    left: 0;
    z-index: 10;
}

.market-table .ty-ajax-loading-box {
    position: absolute !important;
    top: 29vh;
}

td.metric-name-cell span {
    display: block;
}

.market-table table thead tr td h2 {
    font-weight: 600;
    font-size: 17px;
    text-transform: uppercase;
    margin-bottom: 0px;
}

.table-scroll-container {
    position: relative;
    width: 100%;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    max-height: 686px;
    scroll-behavior: smooth;
}

.scroll-buttons-container {
    display: inline-flex;
    gap: 4px;
    margin-left: 12px;
}

.scroll-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #f5a504;
    border-radius: 4px;
    color: #f5a504;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
    user-select: none;
    padding: 0;
    flex-shrink: 0;
}

.scroll-btn:active {
    transform: scale(0.95);
}

.scroll-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background-color: rgba(200, 200, 200, 0.5);
    color: #999;
    border-color: #ccc;
}

@media (max-width: 768px) {
    .financial-industry {
        justify-content: stretch;
    }
    
    .btn-group .btn, .loading-text {
        font-size: 0.8rem;
    }
    
    .loading-spinner {
        width: 1.5rem;
        height: 1.5rem;
    }

    #financial-reports-detail table td:first-child {
        min-width: 160px;
    }
    
    #financial-reports-detail .unified-metrics-table td:first-child {
        min-width: 260px;
    }
    
    #financial-reports-detail .metric-name-cell {
        min-width: 160px;
    }
    
    #financial-reports-detail .metric-name-col {
        min-width: 160px;
    }
    .scroll-btn {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 576px) {
    #financial-reports-detail table td.market-industry {
        min-width: 140px;
    }

    .market-table table thead tr td h2 {
        font-size: 15px;
    }

    #indicators .unified-metrics-table thead td:first-child, 
    #indicators .unified-metrics-table thead td.metric-name-col,
    #financial-reports-detail table td:first-child,
    #financial-reports-detail .unified-metrics-table td:first-child,
    #financial-reports-detail .metric-name-cell,
    #financial-reports-detail .metric-name-col {
        min-width: 180px !important;
    }

    .financial-table table tr td {
        min-width: 90px !important;
    }

    .scroll-btn {
        width: 22px;
        height: 22px;
    }
}