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

th, td {
    padding: 6px 10px;
    text-align: left;
}

th:last-child,
td:last-child {
    text-align: right;
}

.no-data {
    font-style: italic;
    color: #777;
    margin: 6px 0 18px;
}

/* FIX : Make tab-like elements feel clickable */
.nav-tabs .nav-link,
.nav-pills .nav-link,
.tabs a,
.tab a,
[role="tab"] {
    cursor: pointer;
}

.nav-tabs .nav-link:hover,
.nav-pills .nav-link:hover,
[role="tab"]:hover {
    text-decoration: underline;
}

/* PITEfetch member subnav (scoped) */
.pf-subnav-wrap{
    max-width: 1140px;
    margin: 18px auto 0;
    padding: 0 16px;
}
.pf-subnav{
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    background: #fff;
    border-radius: 14px;
    padding: 10px 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,.05);
}
.pf-subnav a{
    display: inline-block;
    padding: 10px 14px;
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    color: inherit;
    opacity: .75;
}
.pf-subnav a:hover{
    opacity: 1;
    text-decoration: underline;
    cursor: pointer;
}
.pf-subnav a.pf-active{
    opacity: 1;
    background: rgba(0,0,0,.06);
    text-decoration: none;
}

/* Scope EVERYTHING to avoid breaking Martex/theme styles */
#pf-analytics {
    font-family: "Rubik", Helvetica, Arial, sans-serif;
    background: #f6f7f9;
    color: #111827;
    padding: 16px;
    border-radius: 12px;
}

#pf-analytics .pf-title {
    font-weight: 700;
    margin-bottom: 6px;
}

#pf-analytics .pf-subtitle {
    color: #6b7280;
    margin-bottom: 16px;
}

#pf-analytics .pf-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
    background: #fff;
    padding: 16px;
}

#pf-analytics .pf-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

#pf-analytics .pf-range-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

#pf-analytics .pf-range-label {
    font-weight: 600;
    color: #374151;
}

#pf-analytics .pf-range-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

#pf-analytics .pf-range-btn {
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
}

#pf-analytics .pf-range-btn:hover {
    border-color: #9ca3af;
}

#pf-analytics .pf-range-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

#pf-analytics .nav-tabs {
    border-bottom: 1px solid #e5e7eb;
}

#pf-analytics .nav-tabs .nav-link {
    border: none;
    color: #6b7280;
    font-weight: 500;
    padding: 12px 16px;
    background: transparent;
}

#pf-analytics .nav-tabs .nav-link.active {
    color: #111827;
    border-bottom: 2px solid #2563eb;
}

/* Force tabs to be horizontal inside pf widget (theme overrides them otherwise) */
#pf-analytics .nav.nav-tabs {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
}

#pf-analytics .nav.nav-tabs .nav-item {
    margin-bottom: 0 !important;
}

#pf-analytics .nav.nav-tabs .nav-link {
    width: auto !important;
    display: inline-block !important;
}

/* Optional: make it scroll instead of wrapping on small screens */
@media (max-width: 576px) {
    #pf-analytics .nav.nav-tabs {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
    }
    #pf-analytics .nav.nav-tabs .nav-link {
        white-space: nowrap !important;
    }
}

#pf-analytics .pf-chart-wrapper {
    height: 320px;
}

#pf-analytics table {
    font-size: 14px;
}

#pf-analytics thead th {
    color: #6b7280;
    font-weight: 600;
    border-bottom: 1px solid #e5e7eb;
}

#pf-analytics tbody tr {
    border-bottom: 1px solid #f1f5f9;
}

#pf-analytics tbody td {
    padding: 12px 8px;
    vertical-align: top;
}

#pf-analytics tbody td:last-child {
    font-weight: 600;
}

#pf-analytics .pf-muted {
    color: #6b7280;
}

#pf-analytics .pf-empty {
    padding: 12px 0;
    color: #6b7280;
    font-style: italic;
}

@media (max-width: 576px) {
    #pf-analytics .pf-chart-wrapper {
        height: 240px;
    }
}

@media (max-width: 576px) {
    #pf-analytics .pf-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 350px) {
    #pf-analytics #pfSiteSelector {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 6px !important;
    }
}
