/* Affiliate dashboard — sidebar layout */
.affiliate-dashboard.partner-page {
    max-width: 1120px;
}

.aff-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.aff-sidebar {
    position: sticky;
    top: 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(15, 23, 42, .06);
    overflow: hidden;
}

.aff-sidebar-head {
    padding: 1rem 1.1rem;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.aff-sidebar-head strong {
    display: block;
    font-size: .95rem;
    color: #0f172a;
    margin-bottom: .15rem;
}

.aff-sidebar-code {
    font-size: .8rem;
    color: #64748b;
    word-break: break-all;
}

.aff-nav {
    display: flex;
    flex-direction: column;
    padding: .5rem;
    gap: .2rem;
}

.aff-nav-item {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .65rem .75rem;
    border-radius: 8px;
    color: #475569;
    text-decoration: none;
    font-size: .9rem;
    font-weight: 500;
    border: 1px solid transparent;
    transition: background .15s, color .15s;
}

.aff-nav-item:hover {
    background: #f1f5f9;
    color: #1e293b;
    text-decoration: none;
}

.aff-nav-item.active {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.aff-nav-icon {
    width: 1.1rem;
    text-align: center;
    opacity: .85;
    font-size: .95rem;
}

.aff-sidebar-foot {
    padding: .85rem 1rem 1rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.aff-sidebar-balance-label {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #64748b;
    margin-bottom: .15rem;
}

.aff-sidebar-balance {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
}

.aff-sidebar-min {
    margin-top: .35rem;
    font-size: .78rem;
    color: #64748b;
}

.aff-main {
    min-width: 0;
}

.aff-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem 1.75rem;
    box-shadow: 0 4px 24px rgba(15, 23, 42, .06);
    margin-bottom: 1rem;
}

.aff-panel-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 .35rem;
    color: #0f172a;
}

.aff-panel-lead {
    color: #64748b;
    font-size: .9rem;
    margin: 0 0 1.1rem;
    line-height: 1.55;
}

.aff-panel + .aff-panel {
    margin-top: 0;
}

.aff-copy-row {
    display: flex;
    gap: .5rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.aff-copy-row .partner-ref-link {
    flex: 1;
    margin: 0;
    min-width: 0;
}

.aff-info-box {
    margin-top: 1rem;
    padding: .85rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.aff-info-box strong {
    display: block;
    margin-bottom: .35rem;
    color: #334155;
    font-size: .875rem;
}

.aff-table-wrap {
    overflow-x: auto;
    margin-top: .5rem;
}

.aff-table-wrap .cart-table {
    margin: 0;
    min-width: 560px;
}

.aff-empty {
    color: #64748b;
    font-size: .9rem;
    margin: 0;
    padding: 1rem 0;
}

.aff-mobile-nav {
    display: none;
    margin-bottom: 1rem;
}

.aff-mobile-nav select {
    width: 100%;
    padding: .65rem .75rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: .95rem;
    background: #fff;
}

@media (max-width: 900px) {
    .aff-layout {
        grid-template-columns: 1fr;
    }

    .aff-sidebar {
        position: static;
    }

    .aff-nav {
        display: none;
    }

    .aff-mobile-nav {
        display: block;
        padding: .75rem;
        border-bottom: 1px solid #e2e8f0;
    }

    .aff-sidebar-foot {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: .75rem;
        flex-wrap: wrap;
    }

    .aff-panel {
        padding: 1.15rem 1.1rem;
    }
}
