/* Media Portal Login Screen */
.media-login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    padding: 40px 20px;
}

/* Media Portal Global Filters - Layout & Spacing */
/* Add horizontal padding and top margin since global filters are outside .tab-content */
.main-content .global-filters {
    margin: 20px 32px 16px 32px; /* Reduced vertical spacing: top 32→20px, bottom 24→16px */
}

/* Override portal.css rule that makes first filter-group full width */
/* Media Portal has fewer filters, so we want them on one row on large screens */
.media-portal-screen .global-filters .filter-group:first-child {
    flex-basis: auto;
}

/* Add extra spacing before refresh button to visually separate it from time period buttons */
.media-portal-screen .global-filters .filter-group:last-child {
    margin-left: 48px;
}

/* Responsive global filters margins */
@media (max-width: 1200px) {
    /* Remove extra spacing on smaller screens for natural wrapping */
    .media-portal-screen .global-filters .filter-group:last-child {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .main-content .global-filters {
        margin: 16px 20px 12px 20px; /* Reduced vertical spacing for mobile too */
    }
}

.media-login-screen .login-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 16px;
    padding: 48px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    max-width: 480px;
    width: 100%;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.logo-icon-svg {
    flex-shrink: 0;
}

.login-logo .logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
}

.media-login-screen .login-card h1 {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
    text-align: center;
}

.media-login-screen .login-subtitle {
    text-align: center;
    color: var(--text-gray);
    margin-bottom: 32px;
}

.media-login-screen .demo-credentials {
    margin-top: 24px;
    padding: 16px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    text-align: center;
}

.media-login-screen .demo-credentials small {
    color: #166534;
}

/* OAuth Buttons for Media Portal */
.media-login-screen .oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.media-login-screen .btn-oauth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.media-login-screen .btn-google {
    background: white;
    color: #3c4043;
    border-color: #dadce0;
}

.media-login-screen .btn-google:hover {
    background: #f8f9fa;
    border-color: #4285f4;
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.2);
}

.media-login-screen .btn-microsoft {
    background: white;
    color: #3c4043;
    border-color: #dadce0;
}

.media-login-screen .btn-microsoft:hover {
    background: #f8f9fa;
    border-color: #00a4ef;
    box-shadow: 0 2px 8px rgba(0, 164, 239, 0.2);
}

.media-login-screen .oauth-icon {
    flex-shrink: 0;
}

/* Login Divider */
.media-login-screen .login-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
}

.media-login-screen .login-divider::before,
.media-login-screen .login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.media-login-screen .login-divider span {
    padding: 0 16px;
    font-size: 13px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Portal Layout */
.media-portal-screen {
    display: flex;
    min-height: 100vh;
    background: #f8fafc;
}

/* Hide navbar completely on media portal pages - sidebar replaces it */
body:has(.media-portal-screen) .navbar {
    display: none;
}

/* Sidebar - Full height, starts at top */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 1001;
    transition: transform 0.3s ease;
}

/* Mobile sidebar behavior */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
}

/* Desktop sidebar - always visible */
@media (min-width: 769px) {
    .sidebar {
        transform: translateX(0) !important;
    }
    
    .main-content {
        margin-left: 260px !important;
    }
}

.sidebar.collapsed {
    transform: translateX(-260px);
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 70px; /* Match old navbar height for consistency */
    display: flex;
    align-items: center;
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.sidebar-header .logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    font-weight: 700;
    color: white;
}

.sidebar-header .logo-text-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-header .portal-name {
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 24px 0;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin-bottom: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 24px;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-item.active {
    background: rgba(5, 150, 105, 0.15);
    color: #10b981;
    border-left-color: #10b981;
}

.nav-icon-svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-item:hover .nav-icon-svg,
.nav-item.active .nav-icon-svg {
    opacity: 1;
}

.nav-text {
    font-size: 15px;
}

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.logout-btn:hover {
    color: #f87171;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed + .main-content {
    margin-left: 0;
}

/* Content Header */
.content-header {
    background: white;
    padding: 20px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid #e2e8f0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text-dark);
    border-radius: 8px;
    transition: background 0.2s ease;
}

.sidebar-toggle:hover {
    background: #f1f5f9;
}

.content-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    font-weight: 600;
    color: var(--text-dark);
}

.user-badge {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Tab Content */
/* Override portal.css - Media Portal uses .tab-content as a wrapper, not for individual tabs */
.media-portal-screen .tab-content {
    display: block !important; /* Force override portal.css rule */
    padding: 32px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Welcome Banner */
.welcome-banner {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
    padding: 32px;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.2);
}

.welcome-text h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.welcome-text p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
}

.date-range {
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-range .filter-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
}

.date-range .filter-select option {
    background: #1e293b;
    color: white;
}

/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.kpi-grid.small {
    grid-template-columns: repeat(4, 1fr);
}

.kpi-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.kpi-card.highlight {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: white;
    border: none;
}

.kpi-card.highlight .kpi-label {
    color: rgba(255, 255, 255, 0.8);
}

.kpi-card.highlight .kpi-change {
    color: rgba(255, 255, 255, 0.9);
}

.kpi-icon-container {
    width: 56px;
    height: 56px;
    background: #f0fdf4;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-icon-container.highlight {
    background: rgba(255, 255, 255, 0.2);
}

.kpi-icon-container.warning {
    background: #fef2f2;
}

.kpi-content {
    flex: 1;
    min-width: 0;
}

.kpi-label {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 4px;
    font-weight: 500;
}

.kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.kpi-card.highlight .kpi-value {
    color: white;
}

.kpi-change {
    font-size: 12px;
    margin-top: 4px;
    font-weight: 500;
}

.kpi-change.positive {
    color: #059669;
}

.kpi-change.negative {
    color: #dc2626;
}

/* Charts Row */
.charts-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.charts-row.full-width {
    grid-template-columns: 1fr;
}

/* Line Graph Styles */
.line-graph-container {
    display: flex;
    padding: 20px 0;
}

.line-graph-y-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-right: 16px;
    height: 220px;
    text-align: right;
}

.line-graph-y-axis span {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
}

.line-graph-main {
    flex: 1;
    position: relative;
    height: 250px;
}

.line-graph-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.line-grid-row {
    border-bottom: 1px solid #e2e8f0;
    width: 100%;
}

.line-graph-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 220px;
    shape-rendering: geometricPrecision;
    overflow: visible;
}

.line-graph-line {
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
    shape-rendering: geometricPrecision;
}

.line-graph-area {
    shape-rendering: geometricPrecision;
}

.line-graph-points circle {
    fill: #10b981;
    stroke: white;
    stroke-width: 4;
    cursor: pointer;
    transition: transform 0.15s ease;
    shape-rendering: geometricPrecision;
}

.line-graph-points circle:hover {
    transform: scale(1.3);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.line-graph-tooltip {
    position: absolute;
    background: #1e293b;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    white-space: nowrap;
    z-index: 10;
    transform: translateX(-50%);
    margin-top: -45px;
}

.line-graph-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #1e293b transparent transparent transparent;
}

.line-graph-tooltip.visible {
    opacity: 1;
}

.line-graph-x-axis {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.line-graph-x-axis span {
    font-size: 11px;
    color: #64748b;
    text-align: center;
}

.chart-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.chart-card.warning-card {
    border-color: #fecaca;
    background: linear-gradient(180deg, #fff 0%, #fef2f2 100%);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
}

.warning-badge {
    background: #fef2f2;
    color: #dc2626;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.chart-legend {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

.legend-dot.leads {
    background: #059669;
}

.legend-dot.signups {
    background: #3b82f6;
}

/* Chart Placeholder */
.chart-placeholder {
    height: 200px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 20px 0;
}

.chart-bars {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    height: 100%;
    width: 100%;
    justify-content: space-around;
}

.chart-bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
    max-width: 60px;
}

.chart-bar-group span {
    font-size: 12px;
    color: #64748b;
    margin-top: 8px;
}

.chart-bar {
    width: 100%;
    border-radius: 4px 4px 0 0;
    transition: height 0.3s ease;
}

.chart-bar.leads {
    background: linear-gradient(180deg, #059669 0%, #10b981 100%);
    max-width: 24px;
}

.chart-bar.signups {
    background: linear-gradient(180deg, #3b82f6 0%, #60a5fa 100%);
    max-width: 24px;
}

/* Publisher List */
.publisher-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.publisher-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.publisher-item:hover {
    background: #f1f5f9;
}

.publisher-item.top {
    border-left: 3px solid #059669;
}

.publisher-item.worst {
    border-left: 3px solid #dc2626;
    background: #fef2f2;
}

.publisher-rank {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
    margin-right: 8px;
}

.publisher-rank.positive {
    background: #d1fae5;
    color: #047857;
}

.publisher-rank.negative {
    background: #fee2e2;
    color: #b91c1c;
}

.publisher-rank.warning {
    background: #dc2626;
}

.publisher-info {
    flex: 1;
    min-width: 0;
}

.publisher-info .publisher-name {
    font-weight: 600;
    color: #0f172a;
    display: block;
    margin-bottom: 2px;
}

.publisher-info .publisher-id {
    font-size: 12px;
    color: #64748b;
}

/* Publisher Ranking Styles (Top 5 / Worst 5) */
.top-publishers-list,
.worst-publishers-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.publisher-ranking-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg-light);
    border-radius: 8px;
}

.publisher-bar-container {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.publisher-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.publisher-bar.positive {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
}

.publisher-bar.negative {
    background: linear-gradient(90deg, #ef4444 0%, #f87171 100%);
}

.publisher-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
}

.publisher-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
}

.publisher-rate {
    font-size: 12px;
    font-weight: 500;
}

.publisher-rate.positive {
    color: #047857;
}

.publisher-rate.negative {
    color: #b91c1c;
}

.publisher-metrics {
    text-align: center;
}

.publisher-metrics .metric-value {
    font-size: 18px;
    font-weight: 700;
    display: block;
}

.publisher-metrics .metric-value.positive {
    color: #059669;
}

.publisher-metrics .metric-value.negative {
    color: #dc2626;
}

.publisher-metrics .metric-label {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.publisher-revenue {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    min-width: 80px;
    text-align: right;
}

.publisher-actions {
    display: flex;
    gap: 8px;
}

.btn-action {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-action.pause {
    background: #fef3c7;
    color: #92400e;
}

.btn-action.pause:hover {
    background: #fde68a;
}

.btn-action.disable {
    background: #fecaca;
    color: #dc2626;
}

.btn-action.disable:hover {
    background: #fca5a5;
}

/* Section Header */
.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.section-header-row h2 {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.section-description {
    color: #64748b;
    font-size: 14px;
    margin: -16px 0 24px 0;
}

.filter-controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-select {
    padding: 10px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    background: white;
    color: #0f172a;
    transition: border-color 0.2s ease;
}

.filter-select:focus {
    outline: none;
    border-color: #059669;
}

/* Data Table */
.data-table-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    margin-top: 24px;
}

/* Collapsible Table Card */
.data-table-card.collapsible {
    padding: 0;
}

.data-table-card.collapsible .collapsible-header {
    padding: 20px 24px;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.15s ease;
}

.data-table-card.collapsible .collapsible-header:hover {
    background: #f8fafc;
}

.data-table-card.collapsible .header-left-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.data-table-card.collapsible .collapse-icon {
    transition: transform 0.25s ease;
    color: #64748b;
}

.data-table-card.collapsible.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.data-table-card.collapsible .collapsible-content {
    padding: 0 24px 24px;
    max-height: 600px;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.25s ease;
    opacity: 1;
}

.data-table-card.collapsible.collapsed .collapsible-content {
    max-height: 0;
    padding: 0 24px;
    opacity: 0;
}

.data-table-card.collapsible .table-scroll-container {
    max-height: 450px;
    overflow-y: auto;
    margin-top: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.data-table-card.collapsible .table-scroll-container::-webkit-scrollbar {
    width: 8px;
}

.data-table-card.collapsible .table-scroll-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.data-table-card.collapsible .table-scroll-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.data-table-card.collapsible .table-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.data-table-card.collapsible .data-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f8fafc;
}

.data-table-card.collapsible .table-header {
    margin-bottom: 0;
}

/* Expandable Publisher Rows */
.publisher-row.expandable {
    cursor: pointer;
    transition: background 0.15s ease;
}

.publisher-row.expandable:hover {
    background: #f1f5f9;
}

.publisher-row.expandable.expanded {
    background: #f8fafc;
}

.publisher-cell.expandable-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.publisher-cell.expandable-cell .expand-icon {
    transition: transform 0.2s ease;
    color: #64748b;
    flex-shrink: 0;
}

.publisher-row.expandable.expanded .expand-icon {
    transform: rotate(180deg);
}

.publisher-details {
    background: #f8fafc;
}

.publisher-details td {
    padding: 0 !important;
}

.dq-reasons-panel {
    padding: 16px 24px 20px;
    border-top: 1px solid #e2e8f0;
}

.dq-reasons-panel h4 {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dq-reasons-grid {
    display: flex;
    gap: 24px;
}

.dq-reason-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    min-width: 200px;
    flex: 1;
    max-width: 280px;
}

.dq-reason {
    font-size: 13px;
    color: #334155;
    font-weight: 500;
}

.dq-percentage {
    font-size: 14px;
    font-weight: 600;
    color: #dc2626;
    background: #fef2f2;
    padding: 4px 10px;
    border-radius: 12px;
}

/* Sortable Table Headers */
.data-table th.sortable,
.cases-table th.sortable,
.invoice-leads-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
    position: relative;
}

.data-table th.sortable:hover,
.cases-table th.sortable:hover,
.invoice-leads-table th.sortable:hover {
    background: #e2e8f0;
}

.sort-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 4px;
    vertical-align: middle;
    opacity: 0.4;
}

.sort-icon::after {
    content: '⇅';
    font-size: 12px;
}

th.sortable.asc .sort-icon::after {
    content: '↑';
    opacity: 1;
}

th.sortable.desc .sort-icon::after {
    content: '↓';
    opacity: 1;
}

th.sortable.asc .sort-icon,
th.sortable.desc .sort-icon {
    opacity: 1;
}

/* Pagination Button Disabled State */
.btn-small:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.data-table-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.table-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.table-search input {
    border: none;
    background: none;
    outline: none;
    font-size: 14px;
    color: #0f172a;
    width: 200px;
}

.table-search input::placeholder {
    color: #94a3b8;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: #f8fafc;
}

.data-table th {
    text-align: left;
    padding: 14px 16px;
    font-weight: 600;
    color: #475569;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e2e8f0;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
    font-size: 14px;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.data-table tbody tr.warning-row {
    background: #fef2f2;
}

.data-table tbody tr.warning-row:hover {
    background: #fee2e2;
}

.positive {
    color: #059669;
    font-weight: 600;
}

.negative {
    color: #dc2626;
    font-weight: 600;
}

.trend-up {
    color: #059669;
    font-weight: 600;
}

.trend-down {
    color: #dc2626;
    font-weight: 600;
}

.publisher-cell {
    display: flex;
    flex-direction: column;
}

.publisher-cell .publisher-name {
    font-weight: 600;
    color: #0f172a;
}

.publisher-cell .publisher-id {
    font-size: 12px;
    color: #94a3b8;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.active {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.paused {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.disabled {
    background: #f3f4f6;
    color: #6b7280;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #64748b;
}

.btn-icon:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-icon.warning {
    border-color: #fcd34d;
    color: #d97706;
}

.btn-icon.warning:hover {
    background: #fef3c7;
}

.btn-icon.danger {
    border-color: #fca5a5;
    color: #dc2626;
}

.btn-icon.danger:hover {
    background: #fef2f2;
}

.btn-icon.success {
    border-color: #86efac;
    color: #059669;
}

.btn-icon.success:hover {
    background: #f0fdf4;
}

.table-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
    color: #64748b;
    font-size: 14px;
}

.pagination-controls {
    display: flex;
    gap: 8px;
}

/* Geographic Content */
.geo-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.geo-content.geo-content-full {
    grid-template-columns: 1fr;
}

.geo-table-card.geo-table-full {
    width: 100%;
}

.geo-table-card.geo-table-full .table-scroll-container {
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-top: 16px;
}

.geo-table-card.geo-table-full .table-scroll-container::-webkit-scrollbar {
    width: 8px;
}

.geo-table-card.geo-table-full .table-scroll-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.geo-table-card.geo-table-full .table-scroll-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.geo-table-card.geo-table-full .table-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.geo-table-card.geo-table-full .data-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f8fafc;
}

.map-placeholder {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.map-visual {
    height: 400px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.us-map-icon {
    opacity: 0.8;
}

.map-text {
    font-size: 20px;
    font-weight: 600;
    color: #166534;
}

.map-instructions {
    font-size: 14px;
    color: #4ade80;
}

.map-legend {
    display: flex;
    gap: 16px;
    margin-top: 16px;
}

.legend-item {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.legend-item.high {
    background: #059669;
    color: white;
}

.legend-item.medium {
    background: #34d399;
    color: white;
}

.legend-item.low {
    background: #a7f3d0;
    color: #065f46;
}

.geo-table-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15), 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 2px solid #10b981;
}

.geo-table-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 20px;
}

/* Green Table Headers for Geographic Tables */
.geo-table-card .data-table thead {
    background: rgba(16, 185, 129, 0.85);
}

.geo-table-card .data-table th {
    background: rgba(16, 185, 129, 0.85);
    color: white;
}

.geo-table-card .data-table th.sortable:hover {
    background: rgba(5, 150, 105, 0.9);
}

/* Draggable Column Headers */
.geo-table-card th.sortable {
    cursor: grab;
    user-select: none;
}

.geo-table-card th.sortable:active {
    cursor: grabbing;
}

.geo-table-card th.sortable.dragging {
    opacity: 0.5;
    background: #047857;
}

.geo-table-card th.sortable.drag-over {
    background: #059669;
    border-left: 3px solid white;
}

.geo-table-card td.dragging {
    opacity: 0.5;
}

.geo-table-card td.drag-over {
    border-left: 3px solid #10b981;
}

/* Signup Rate Color Coding */
.rate-red {
    color: #dc2626;
    font-weight: 600;
}

.rate-yellow {
    color: #d97706;
    font-weight: 600;
}

.rate-green {
    color: #059669;
    font-weight: 600;
}

/* Negative Revenue Row */
.state-row.negative-revenue {
    background: #fef2f2;
}

.state-row.negative-revenue:hover {
    background: #fee2e2;
}

.revenue-negative {
    color: #dc2626;
    font-weight: 600;
}

/* Returns List */
.returns-list-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.returns-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 8px;
}

.return-item {
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.returns-list::-webkit-scrollbar {
    width: 8px;
}

.returns-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.returns-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.returns-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.return-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: white;
    border-bottom: 1px solid #e2e8f0;
}

.return-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.return-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.return-id {
    font-weight: 600;
    font-size: 13px;
    color: #0f172a;
}

.return-date {
    font-size: 13px;
    color: #64748b;
}

.return-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    min-width: 110px;
    text-align: center;
    display: inline-block;
}

.return-status.pending {
    background: #fef3c7;
    color: #92400e;
}

.return-status.approved {
    background: #d1fae5;
    color: #065f46;
}

.return-status.rejected {
    background: #fecaca;
    color: #991b1b;
}

/* Return Rate Conditional Highlighting */
.kpi-card.return-rate-green {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%) !important;
    border: 1px solid #10b981 !important;
}

.kpi-card.return-rate-green .kpi-label {
    color: #065f46 !important;
}

.kpi-card.return-rate-green .kpi-value {
    color: #047857 !important;
}

.kpi-card.return-rate-yellow {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
    border: 1px solid #f59e0b !important;
}

.kpi-card.return-rate-yellow .kpi-label {
    color: #92400e !important;
}

.kpi-card.return-rate-yellow .kpi-value {
    color: #b45309 !important;
}

.kpi-card.return-rate-red {
    background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%) !important;
    border: 1px solid #ef4444 !important;
}

.kpi-card.return-rate-red .kpi-label {
    color: #991b1b !important;
}

.kpi-card.return-rate-red .kpi-value {
    color: #dc2626 !important;
}

/* Cancels Card Red Highlight */
.kpi-card.cancels-alert {
    background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%) !important;
    border: 1px solid #ef4444 !important;
}

.kpi-card.cancels-alert .kpi-label {
    color: #991b1b !important;
}

.kpi-card.cancels-alert .kpi-value {
    color: #dc2626 !important;
}

/* Return Summary Section Styles */
.return-summary-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    padding: 16px 0 !important;
}

.return-summary-item {
    display: block !important;
    background: #f8fafc !important;
    border-radius: 10px !important;
    border: 1px solid #e2e8f0 !important;
    overflow: visible !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease;
}

.return-summary-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.08);
}

.return-summary-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 12px 16px !important;
    background: white !important;
    border-bottom: 1px solid #e2e8f0 !important;
    visibility: visible !important;
    opacity: 1 !important;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-radius: 10px 10px 0 0;
}

.return-summary-header:hover {
    background: #f8fafc !important;
}

.return-summary-header .collapse-icon {
    transition: transform 0.3s ease;
    color: #64748b;
    margin-left: 12px;
    flex-shrink: 0;
}

.return-summary-item.collapsed .return-summary-header {
    border-bottom: none !important;
    border-radius: 10px !important;
}

.return-summary-item.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.return-summary-content {
    max-height: 200px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease;
    opacity: 1;
}

.return-summary-item.collapsed .return-summary-content {
    max-height: 0 !important;
    opacity: 0;
}

.return-summary-body {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 16px !important;
    padding: 12px 16px !important;
    background: #f8fafc !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    max-height: none !important;
}

.return-summary-body > div {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.return-summary-footer {
    display: flex !important;
    justify-content: space-between !important;
    padding: 10px 16px !important;
    background: white !important;
    border-top: 1px solid #e2e8f0 !important;
    font-size: 12px !important;
    color: #64748b !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.return-body {
    display: block !important;
    padding: 20px !important;
    background: #f8fafc;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

.returns-list .return-item .return-body,
.return-item > .return-body {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    max-height: none !important;
    padding: 20px !important;
}

.returns-list .return-item .return-footer,
.return-item > .return-footer {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    max-height: none !important;
    padding: 12px 20px !important;
}

.return-lead {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.lead-name {
    font-weight: 600;
    color: #0f172a;
}

.lead-id {
    font-size: 13px;
    color: #64748b;
}

.lead-type {
    background: #e0e7ff;
    color: #3730a3;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.lead-phone {
    font-size: 13px;
    color: #475569;
    font-weight: 500;
}

.lead-age {
    font-size: 12px;
    color: #64748b;
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 20px;
}

.return-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notes-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.notes-row .detail-row {
    flex: 1;
}

.detail-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    font-weight: 600;
}

.detail-value {
    color: #0f172a;
}

.detail-value.notes {
    background: white;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    border: 1px solid #e2e8f0;
    margin: 0;
}

.reason-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}

.reason-badge.no-contact {
    background: #fef3c7;
    color: #92400e;
}

.reason-badge.duplicate {
    background: #dbeafe;
    color: #1e40af;
}

.reason-badge.not-qualified {
    background: #fecaca;
    color: #991b1b;
}

.reason-badge.already-represented {
    background: #e0e7ff;
    color: #3730a3;
}

.reason-badge.bad-info {
    background: #fed7aa;
    color: #c2410c;
}

.return-footer {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px !important;
    background: white;
    border-top: 1px solid #e2e8f0;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    max-height: none !important;
}

.return-amount {
    font-weight: 700;
    color: #059669;
}

.return-publisher {
    font-size: 13px;
    color: #64748b;
}

/* Accounting Styles */
.accounting-summary {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.summary-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

.summary-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.summary-row.total {
    border-top: 2px solid #0f172a;
    border-bottom: none;
    margin-top: 12px;
    padding-top: 16px;
}

.summary-label {
    color: #64748b;
}

.summary-row.total .summary-label {
    font-weight: 700;
    color: #0f172a;
}

.summary-value {
    font-weight: 600;
    color: #0f172a;
}

.summary-value.deduction {
    color: #dc2626;
}

.summary-row.total .summary-value {
    font-size: 24px;
    color: #059669;
}

/* Payment Instructions */
.payment-instructions {
    background: #f8fafc;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #e2e8f0;
}

.payment-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
}

.payment-row:last-child {
    border-bottom: none;
}

.payment-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.payment-value {
    font-size: 14px;
    color: #0f172a;
    font-weight: 600;
    font-family: 'Monaco', 'Consolas', monospace;
}

.payment-status {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: #f0fdf4;
    border-radius: 12px;
    margin-bottom: 20px;
}

.status-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-icon.paid {
    background: #059669;
}

.status-text {
    font-weight: 600;
    color: #059669;
    margin-bottom: 4px;
}

.status-date {
    font-size: 13px;
    color: #64748b;
}

.bank-info {
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
}

.bank-label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
}

.bank-value {
    font-weight: 600;
    color: #0f172a;
}

/* Billing Statements */
.billing-statements-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

.billing-statements-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 8px;
}

.statements-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.statement-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: all 0.2s ease;
}

.statement-item:hover {
    background: #f0fdf4;
    border-color: #86efac;
}

.statement-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.statement-icon {
    flex-shrink: 0;
}

.statement-details {
    display: flex;
    flex-direction: column;
}

.statement-period {
    font-weight: 600;
    color: #0f172a;
}

.statement-date {
    font-size: 13px;
    color: #64748b;
}

.statement-amount {
    font-size: 20px;
    font-weight: 700;
    color: #059669;
    min-width: 140px;
    text-align: right;
}

.statement-actions {
    display: flex;
    gap: 8px;
}

/* ============================================ */
/* Publisher Rankings Styling */
/* ============================================ */

.publisher-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.publisher-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.publisher-item:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.publisher-item.top {
    border-left: 4px solid var(--primary-color);
}

.publisher-item.worst {
    border-left: 4px solid #ef4444;
}

.publisher-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.publisher-name {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-dark);
}

.publisher-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--primary-color);
    color: white;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.publisher-rank.warning {
    background: #ef4444;
}

.publisher-id {
    font-size: 13px;
    color: var(--text-gray);
    font-weight: 500;
    font-family: 'Courier New', monospace;
}

.publisher-metrics {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 0 20px;
}

.metric-value {
    font-size: 18px;
    font-weight: 700;
}

.metric-value.positive {
    color: var(--primary-color);
}

.metric-value.negative {
    color: #ef4444;
}

.metric-label {
    font-size: 12px;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.publisher-revenue {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    min-width: 120px;
    text-align: right;
}

.publisher-actions {
    display: flex;
    gap: 8px;
}

.btn-action {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--card-border) !important;
    color: var(--text-muted) !important;
}

.btn-action.pause {
    background: #fef3c7;
    color: #92400e;
}

.btn-action.pause:hover {
    background: #fde68a;
}

.btn-action.disable {
    background: #fee2e2;
    color: #991b1b;
}

.btn-action.disable:hover {
    background: #fecaca;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .publisher-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .publisher-info {
        width: 100%;
    }

    .publisher-metrics {
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
        padding: 0;
    }

    .publisher-revenue {
        width: 100%;
        text-align: left;
    }

    .publisher-actions {
        width: 100%;
    }

    .btn-action {
        flex: 1;
    }
}

}

/* Button Styles */
.btn-small {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: white;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #475569;
}

.btn-small:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-small.btn-primary {
    background: #059669;
    color: white;
    border-color: #059669;
}

.btn-small.btn-primary:hover {
    background: #047857;
    border-color: #047857;
}

.btn-secondary {
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: white;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    color: #475569;
}

.btn-secondary:hover {
    background: #f8fafc;
}

.btn-primary {
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 8px;
    border: none;
    background: #059669;
    color: white;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: #047857;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
}

.modal-content.invoice-modal {
    max-width: 900px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: #f1f5f9;
    border-radius: 8px;
    cursor: pointer;
    font-size: 24px;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

/* Invoice Styles */
.invoice-container {
    padding: 32px;
    max-height: 60vh;
    overflow-y: auto;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid #e2e8f0;
}

.invoice-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.invoice-logo {
    flex-shrink: 0;
}

.brand-text h1 {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.brand-text p {
    font-size: 13px;
    color: #64748b;
    margin: 4px 0 0 0;
}

.invoice-meta {
    text-align: right;
}

.invoice-number {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
}

.invoice-date,
.invoice-period {
    font-size: 13px;
    color: #64748b;
}

.invoice-parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
}

.invoice-from h4,
.invoice-to h4 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    margin-bottom: 12px;
}

.invoice-from p,
.invoice-to p {
    margin: 4px 0;
    color: #475569;
    font-size: 14px;
}

.invoice-summary-section {
    margin-bottom: 32px;
}

.invoice-summary-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 16px;
}

.invoice-summary-table {
    width: 100%;
    border-collapse: collapse;
}

.invoice-summary-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
}

.invoice-summary-table td:first-child {
    color: #64748b;
}

.invoice-summary-table td:last-child {
    text-align: right;
    font-weight: 600;
    color: #0f172a;
}

.invoice-summary-table .deduction {
    color: #dc2626;
}

.invoice-summary-table .total-row td {
    border-top: 2px solid #0f172a;
    border-bottom: none;
    font-size: 18px;
}

.invoice-summary-table .total-row td:last-child {
    color: #059669;
}

.invoice-leads-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 16px;
}

.leads-table-wrapper {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.invoice-leads-table {
    width: 100%;
    border-collapse: collapse;
}

.invoice-leads-table thead {
    background: #f8fafc;
    position: sticky;
    top: 0;
}

.invoice-leads-table th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    color: #475569;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e2e8f0;
}

.invoice-leads-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
    font-size: 13px;
}

/* Responsive */
@media (max-width: 1280px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-260px);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    .geo-content {
        grid-template-columns: 1fr;
    }

    .accounting-summary {
        grid-template-columns: 1fr;
    }

    .charts-row {
        grid-template-columns: 1fr;
    }

    .invoice-parties {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .content-header {
        padding: 16px 20px;
    }

    .tab-content {
        padding: 20px;
    }

    .welcome-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .kpi-grid.small {
        grid-template-columns: repeat(2, 1fr);
    }

    .section-header-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-controls {
        width: 100%;
    }

    .filter-select {
        flex: 1;
    }

    .publisher-item {
        flex-wrap: wrap;
    }

    .publisher-metrics,
    .publisher-revenue {
        text-align: left;
    }

    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 10px 8px;
    }

    .return-lead {
        flex-wrap: wrap;
    }

    .statement-item {
        flex-wrap: wrap;
    }

    .statement-amount {
        width: 100%;
        text-align: left;
        margin-top: 8px;
    }

    .modal-content.invoice-modal {
        max-width: 100%;
    }

    .invoice-header {
        flex-direction: column;
        gap: 20px;
    }

    .invoice-meta {
        text-align: left;
    }
}
