/* =====================================================
MONTHLY REPORTS
===================================================== */

body.page-monthly-reports {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.page-monthly-reports .page-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-width: none;
    margin: 0;
}

.filter-bar {
    background: rgba(255, 255, 255, 0.55);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1;
    min-width: 140px;
}

.filter-group label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    padding-right: 0.2rem;
    letter-spacing: 0.02em;
}

.filter-select,
.filter-input {
    font-family: 'Vazirmatn', system-ui, sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.8);
    border: 1.5px solid rgba(0, 0, 0, 0.07);
    border-radius: 12px;
    padding: 0.55rem 0.85rem;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
}

.filter-input {
    cursor: text;
}

.filter-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a7a7a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 0.75rem center;
    padding-left: 2rem;
}

.filter-select:focus,
.filter-input:focus {
    border-color: var(--brand-gold);
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.12);
}

.filter-search-wrap {
    flex: 1;
    min-width: 160px;
}

.filter-input-wrap {
    position: relative;
}

.filter-input-wrap .search-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    display: flex;
    align-items: center;
}

.filter-input-wrap .filter-input {
    padding-right: 2.2rem;
}

.filter-divider {
    width: 1px;
    height: 36px;
    background: rgba(0, 0, 0, 0.08);
    align-self: flex-end;
    margin: 0 0.1rem;
}

.filter-reset-btn {
    font-family: 'Vazirmatn', system-ui, sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: 1.5px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 0.55rem 1rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    align-self: flex-end;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.filter-reset-btn:hover {
    border-color: var(--brand-gold);
    color: var(--brand-gold-dark);
}

.mr-table-container {
    position: relative;
    background: rgba(255, 255, 255, 0.65);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.95);
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.mr-table-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem 1.25rem 0.85rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.mr-table-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.mr-action-btn {
    font-family: 'Vazirmatn', system-ui, sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.5rem 0.95rem;
    border-radius: 10px;
    border: 1.5px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.7);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.mr-action-btn:hover {
    border-color: var(--brand-gold);
    color: var(--brand-gold-dark);
}

.mr-table-scroll {
    flex: 1;
    min-height: 0;
    overflow-x: auto;
    background: rgba(255, 255, 255, 0.92);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(245, 166, 35, 0.3) transparent;
    display: flex;
    flex-direction: column;
}

.mr-table-scroll .mr-table {
    flex-shrink: 0;
}

.mr-table-scroll::-webkit-scrollbar {
    height: 5px;
}

.mr-table-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.mr-table-scroll::-webkit-scrollbar-thumb {
    background: rgba(245, 166, 35, 0.3);
    border-radius: 3px;
}

.mr-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1100px;
}

.mr-table thead tr {
    background: #fbfaf8;
}

.mr-table thead th {
    padding: 0.95rem 1rem;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 600;
    color: #8a8780;
    letter-spacing: 0.02em;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
    user-select: none;
    cursor: pointer;
    transition: color 0.2s;
    position: sticky;
    top: 0;
    background: #fbfaf8;
    z-index: 1;
}

.mr-table thead th:hover {
    color: var(--brand-gold-dark);
}

.mr-table thead th .th-inner {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    justify-content: center;
}

.mr-unit-note {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 6px 9px;
    font-size: 0.72rem;
    font-weight: 500;
    color: #9c988f;
}

.sort-icon {
    display: inline-flex;
    flex-direction: column;
    gap: 1px;
    opacity: 0.3;
    transition: opacity 0.2s;
}

.sort-icon svg {
    display: block;
}

th:hover .sort-icon,
th.sorted-asc .sort-icon,
th.sorted-desc .sort-icon {
    opacity: 1;
}

th.sorted-asc .sort-icon svg:first-child {
    opacity: 1;
}

th.sorted-asc .sort-icon svg:last-child {
    opacity: 0.25;
}

th.sorted-desc .sort-icon svg:first-child {
    opacity: 0.25;
}

th.sorted-desc .sort-icon svg:last-child {
    opacity: 1;
}

/* ── BODY ── */
.mr-table tbody tr {
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    transition: background 0.15s;
}

.mr-table tbody tr:last-child {
    border-bottom: none;
}

.mr-table tbody tr:hover {
    background: rgba(245, 166, 35, 0.05);
}

.mr-table tbody td {
    padding: 0.55rem 1rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap;
    vertical-align: middle;
    text-align: center;
}

.symbol-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.85rem;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.09);
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #2a2a2a;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.025);
}

.ig-cell {
    text-align: right !important;
    padding: 0.45rem 1.2rem !important;
    max-width: 280px;
    white-space: normal;
}

.ig-industry {
    font-size: 0.82rem;
    font-weight: 600;
    color: #3a3733;
    line-height: 1.3;
    letter-spacing: -0.005em;
}

.ig-sub {
    font-size: 0.72rem;
    font-weight: 500;
    color: #9c988f;
    line-height: 1.3;
    margin-top: 0.1rem;
}

.industry-badge {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b5a2a;
    padding: 0;
    background: none;
}

.subgroup-text {
    display: inline-block;
    font-size: 0.72rem;
    color: var(--text-muted);
    background: none;
    padding: 0;
}

.period-text {
    display: inline-block;
    font-size: 0.74rem;
    font-weight: 500;
    color: #9c988f;
    letter-spacing: 0.01em;
}

.rev-num {
    font-size: 0.85rem;
    font-weight: 700;
    color: #2a2a2a;
    font-variant-numeric: tabular-nums;
    direction: ltr;
    display: inline-block;
    letter-spacing: -0.01em;
}

.rev-unit {
    font-size: 0.68rem;
    font-weight: 500;
    color: #a8a49a;
    margin-right: 0.35rem;
    display: inline-block;
}

.rev-empty {
    font-size: 0.85rem;
    color: #d0ccc2;
    font-weight: 500;
}

.growth-cell {
    padding: 0.55rem 1rem !important;
    transition: background 0.15s;
}

.growth-value {
    display: inline-block;
    font-size: 0.80rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    direction: ltr;
    letter-spacing: -0.01em;
}

.growth-value.pos {
    color: #1a7f37;
}

.growth-value.neg {
    color: #b42318;
}

.growth-value.neu {
    color: #c0bcb2;
    font-weight: 500;
}

.mr-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    padding: 3rem;
}

.mr-empty-state svg {
    width: 44px;
    height: 44px;
    color: rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.mr-empty-state p {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    margin: 0;
}

.mr-table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.25rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    flex-wrap: wrap;
    gap: 0.75rem;
}

.mr-pagination {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.mr-page-btn {
    font-family: 'Vazirmatn', system-ui, sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1.5px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    padding: 0 0.4rem;
}

.mr-page-btn:hover {
    background: rgba(245, 166, 35, 0.08);
    color: var(--brand-gold-dark);
}

.mr-page-btn.active {
    background: var(--brand-gold);
    color: white;
    border-color: var(--brand-gold);
    box-shadow: 0 3px 10px rgba(245, 166, 35, 0.35);
}

.mr-page-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.mr-info-text {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

.mr-per-page {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.mr-per-page select {
    font-family: 'Vazirmatn', system-ui, sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    background: rgba(255, 255, 255, 0.8);
    border: 1.5px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    color: var(--text-primary);
    outline: none;
    cursor: pointer;
}

.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    padding: 0 1.25rem 0.75rem;
}

.active-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem 0.2rem 0.45rem;
    background: rgba(245, 166, 35, 0.1);
    border: 1px solid rgba(245, 166, 35, 0.25);
    border-radius: 20px;
    font-size: 0.73rem;
    font-weight: 600;
    color: var(--brand-gold-dark);
    cursor: pointer;
    transition: all 0.2s;
}

.active-filter-chip:hover {
    background: rgba(255, 59, 48, 0.08);
    border-color: rgba(255, 59, 48, 0.2);
    color: var(--accent-red);
}

.active-filter-chip .chip-remove {
    width: 13px;
    height: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
}

.mr-mobile-sort {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0.85rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    background: rgba(250, 248, 245, 0.6);
}

.mr-mobile-sort label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    flex-shrink: 0;
}

.mr-mobile-sort select {
    flex: 1;
    font-family: 'Vazirmatn', system-ui, sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.95);
    border: 1.5px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    padding: 0.5rem 0.7rem;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a7a7a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 0.6rem center;
    padding-left: 1.8rem;
}

.mr-mobile-sort-dir {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    border: 1.5px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    cursor: pointer;
    color: var(--brand-gold-dark);
    font-size: 1rem;
    font-weight: 700;
    transition: all 0.2s;
}

.mr-mobile-sort-dir:hover {
    border-color: var(--brand-gold);
    background: rgba(245, 166, 35, 0.08);
}

.mr-mobile-sort-dir svg {
    display: block;
    transition: transform 0.2s;
}

.mr-mobile-sort-dir.asc svg {
    transform: rotate(180deg);
}

.mr-cards {
    display: none;
    flex-direction: column;
    gap: 1rem;
    padding: 0.6rem;
}

.mc-card {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.mc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 11px;
    background: rgba(250, 248, 245, 0.6);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.mc-symbol {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    background: rgba(255, 255, 255, 0.95);
    border: 1.5px solid rgba(0, 0, 0, 0.08);
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    color: #2c2c2a;
}

.mc-period {
    font-size: 12px;
    color: #6a6862;
    font-weight: 500;
}

.mc-body {
    padding: 8px 12px 9px;
}

.mc-industry-line {
    font-size: 10px;
    padding-right: 1px;
    margin-bottom: 13px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.09);
    padding-bottom: 6px;
}

.mc-industry {
    color: #4a4a47;
    font-weight: 500;
}

.mc-dot {
    color: #6a6862;
    margin: 0 4px;
    font-weight: 700;
}

.mc-subgroup {
    color: #888780;
}

.mc-rev-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 2px;
}

.mc-rev-row+.mc-rev-row {
    margin-bottom: 7px;
}

.mc-rev-label {
    font-size: 12.5px;
    color: #888780;
}

.mc-rev-vals {
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.mc-rev-prev {
    color: #6a6862;
    font-size: 12px;
    font-weight: 500;
}

.mc-rev-arrow {
    color: #b4b2a9;
    margin: 0 5px;
    font-size: 10px;
}

.mc-rev-curr {
    color: #1c1c1a;
    font-weight: 500;
    font-size: 15px;
}

.mc-rev-unit-prev,
.mc-rev-unit {
    font-size: 9px;
    color: #888780;
    margin-right: 2px;
}

.mc-growths {
    border-top: 1px dashed rgba(0, 0, 0, 0.09);
    padding-top: 7px;
    margin-top: 4px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.mc-growth-box {
    border-radius: 7px;
    padding: 6px 3px;
    text-align: center;
    background: rgba(0, 0, 0, 0.02);
}

.mc-growth-val {
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    direction: ltr;
    line-height: 1.2;
    color: #5a5852;
}

.mc-growth-box.pos .mc-growth-val {
    color: #2d6a4f;
}

.mc-growth-box.neg .mc-growth-val {
    color: #8a3535;
}

.mc-growth-label {
    font-size: 9.5px;
    color: #6f6d66;
    margin-top: 1px;
    line-height: 1.2;
}

.latest-toggle-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.latest-toggle-wrap--mobile {
    display: none
}

.latest-toggle {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    cursor: pointer;
    user-select: none;
    font-size: .78rem;
    font-weight: 500;
    color: var(--text-primary, #2a2f3a);
}

.latest-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

.latest-switch {
    position: relative;
    width: 34px;
    height: 19px;
    border-radius: 999px;
    background: #d6d8de;
    transition: background .22s ease;
    flex-shrink: 0;
}

.latest-switch::after {
    content: "";
    position: absolute;
    top: 2px;
    right: 2px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
    transition: transform .22s ease;
}

.latest-toggle input:checked+.latest-switch {
    background: #f1a315
}

.latest-toggle input:checked+.latest-switch::after {
    transform: translateX(-15px)
}

.latest-toggle input:focus-visible+.latest-switch {
    box-shadow: 0 0 0 3px rgba(241, 163, 21, .28);
}

.latest-label-text {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    flex-wrap: wrap
}

.latest-badge {
    display: inline-flex;
    align-items: center;
    font-size: .72rem;
    font-weight: 600;
    color: var(--brand-gold-dark, #b8770a);
    padding: .15rem .5rem;
    border-radius: 6px;
    background: rgba(245, 166, 35, 0.12);
    white-space: nowrap;
}

.latest-info {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    color: #9097a3;
    cursor: help;
    outline: none;
    transition: color .18s ease;
}

.latest-info:hover,
.latest-info:focus {
    color: #f1a315
}

.latest-tooltip {
    position: absolute;
    top: calc(100% + 9px);
    right: 50%;
    transform: translateX(50%) translateY(-4px);
    background: #1f2330;
    color: #fff;
    font-size: .7rem;
    line-height: 1.65;
    font-weight: 400;
    padding: .6rem .75rem;
    border-radius: 8px;
    width: 240px;
    text-align: right;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
    z-index: 1000;
}

.latest-tooltip::after {
    content: "";
    position: absolute;
    bottom: 100%;
    right: 50%;
    transform: translateX(50%);
    border: 5px solid transparent;
    border-bottom-color: #1f2330;
}

.latest-info:hover .latest-tooltip,
.latest-info:focus .latest-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(50%) translateY(0);
}


@media (max-width: 768px) {
    .latest-toggle-wrap--desktop {
        display: none
    }

    .latest-toggle-wrap--mobile {
        display: flex;
        justify-content: center;
        margin-bottom: .25rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        background: rgba(250, 248, 245, 0.6);
        padding-bottom: 1rem;
    }

    .latest-tooltip {
        width: 220px;
        font-size: .68rem;
        right: auto;
    }

    .filter-bar {
        flex-direction: column;
        gap: 0.6rem;
    }

    .filter-group {
        min-width: 100%;
    }

    .filter-divider {
        display: none;
    }

    .active-filters {
        padding: 0 0.75rem 0.6rem;
    }

    .ig-cell {
        max-width: 200px;
    }

    .mr-table-scroll .mr-table {
        display: none;
    }

    .mr-cards {
        display: flex;
    }

    .mr-mobile-sort {
        display: flex;
        border-bottom: none;
    }

    .mr-table-top {
        padding: 0.65rem 0.85rem;
    }

    .mr-table-scroll {
        background: transparent;
    }

    .mr-table-container {
        background: transparent;
        border: none;
        box-shadow: none;
    }

    .mr-table-footer {
        box-shadow: 0 8px 40px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.95);
        justify-content: center;
    }

    .mc-rev-row {
        margin-bottom: 8px;
    }

    .mc-symbol {
        font-size: 15px;
    }

    .filter-reset-btn {
        padding: 0.45rem 0.75rem;
        align-self: center;
    }

    .mr-cards {
        padding: 0;
        margin-top: 1.1rem;
    }
}