/**
 * Modern AltText AI Styles
 * Clean SaaS-style design - Production Ready
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Manrope:wght@400;500;600;700;800&display=swap');

/* Production Dashboard Improvements */
:root {
    --bbai-dashboard-max-width: 1400px;
    --bbai-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --bbai-card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Reset WordPress admin styles */
.bbai-modern {
    margin: 0 !important;
    padding: 20px 20px 20px 2px;
    background: var(--bbai-bg-secondary) !important;
    font-family: var(--bbai-font-family);
    line-height: var(--bbai-leading-relaxed);
    color: var(--bbai-text-primary);
    overflow-x: hidden;
    overflow-y: visible !important;
}

.bbai-modern #wpbody-content {
    overflow-x: hidden !important;
    overflow-y: visible !important;
}

body.media_page_bbai,
body.media_page_bbai #wpwrap,
body.media_page_bbai #wpcontent {
    overflow-x: hidden !important;
    overflow-y: visible !important;
}

/* Fix double scrollbar - ensure html/body don't create extra scroll */
html.wp-toolbar body.media_page_bbai {
    overflow-y: auto !important;
}

html.wp-toolbar body.media_page_bbai #wpbody {
    overflow: visible !important;
}

html.wp-toolbar body.media_page_bbai #wpcontent {
    overflow: visible !important;
    max-height: none !important;
}

html.wp-toolbar body.media_page_bbai #wpbody-content {
    overflow: visible !important;
    max-height: none !important;
}

/* Prevent double scrollbar on plugin page */
body.media_page_bbai #wpwrap #wpcontent {
    overflow: visible !important;
}

body.media_page_bbai #wpwrap {
    overflow: visible !important;
}

/* Dark Header */
.bbai-header {
    background: #212B36;
    padding: 16px 32px;
    margin-bottom: 0;
    border-bottom: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.bbai-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1600px;
    margin: 0 auto;
    gap: 24px;
}

.bbai-header-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.bbai-layout {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 var(--bbai-space-6) var(--bbai-space-10) var(--bbai-space-6);
}

.bbai-section {
    margin: var(--bbai-space-10) 0;
}

.bbai-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.bbai-logo-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bbai-logo-text {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.bbai-logo-tagline {
    display: none; /* Hide tagline in navigation */
}

.bbai-logo-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.bbai-logo-icon rect {
    rx: 8; /* Rounded corners */
}

.bbai-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bbai-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 8px 16px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    border-radius: 20px;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

/* Ensure inactive links are clearly visible */
.bbai-nav-link:not(.active) {
    color: rgba(255, 255, 255, 0.9);
}

.bbai-nav-link svg {
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.bbai-nav-link:not(.active) svg {
    opacity: 0.75;
}

.bbai-nav-link:hover:not(.active) {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

.bbai-nav-link:hover:not(.active) svg {
    opacity: 1;
}

.bbai-nav-link:focus {
    outline: none;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.bbai-nav-link:focus svg {
    opacity: 1;
}

.bbai-nav-link:active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
    transform: scale(0.98);
}

.bbai-nav-link.active {
    color: #ffffff;
    background: #374151;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.bbai-nav-link.active svg {
    opacity: 1;
}

.bbai-nav-link.active:hover {
    background: #4B5563;
    color: #ffffff;
}

/* Header Logout Button */
.bbai-header-logout-btn {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.bbai-header-logout-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.bbai-header-logout-btn:active {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.2);
}

.bbai-header-logout-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.bbai-plan-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--bbai-space-4);
    padding: var(--bbai-space-4) var(--bbai-space-6);
    border-radius: var(--bbai-radius-lg);
    margin: var(--bbai-space-8) auto calc(-1 * var(--bbai-space-6)) auto;
    max-width: 1120px;
    background: var(--bbai-gradient-primary);
    border: 1px solid var(--bbai-border-color);
    box-shadow: var(--bbai-shadow-card);
}

.bbai-plan-banner p {
    margin: 0;
    font-weight: var(--bbai-font-semibold);
    color: var(--bbai-primary-dark);
}

.bbai-plan-banner__actions {
    display: flex;
    align-items: center;
    gap: var(--bbai-space-3);
}

.bbai-plan-link {
    font-weight: var(--bbai-font-semibold);
    color: var(--bbai-info);
    text-decoration: none;
}

.bbai-plan-link:hover {
    text-decoration: underline;
}

.bbai-refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem var(--bbai-space-3);
    border-radius: var(--bbai-radius-full);
    background: rgba(37, 99, 235, 0.08);
    color: #1e3a8a;
    font-size: 0.8rem;
    font-weight: var(--bbai-font-semibold);
    border: none;
    cursor: pointer;
    transition: var(--bbai-transition);
}

.bbai-refresh-btn:hover {
    background: rgba(37, 99, 235, 0.15);
    transform: translateY(-1px);
}

.bbai-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    color: var(--bbai-gray-500);
}

.bbai-tooltip-icon {
    display: inline-flex;
    width: var(--bbai-space-5);
    height: var(--bbai-space-5);
    border-radius: var(--bbai-radius-full);
    background: rgba(37, 99, 235, 0.12);
    color: var(--bbai-info);
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: var(--bbai-font-bold);
    cursor: help;
}

.bbai-upgrade-inline {
    color: var(--bbai-info);
    text-decoration: none;
    font-weight: var(--bbai-font-semibold);
}

.bbai-upgrade-inline:hover {
    text-decoration: underline;
}

/* Non-dashboard layout helpers */
.bbai-library-grid,
.bbai-guide-grid,
.bbai-table-scroll {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.bbai-library-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 24px;
    align-items: flex-start;
}

.bbai-library-table-card--full-width {
    grid-column: 1 / -1;
}

.bbai-guide-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.bbai-table-scroll {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
}

.bbai-table-scroll table {
    min-width: 720px;
    border-collapse: collapse;
}

.bbai-library-table th,
.bbai-library-table td {
    word-break: break-word;
}

@media (max-width: 1080px) {
    .bbai-library-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 900px) {
    .bbai-guide-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Main Container */
.bbai-container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    box-sizing: border-box;
    padding: 3.25rem 2.25rem; /* more breathing room */
}

/* Dashboard */
.bbai-dashboard {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    background: var(--bbai-white);
    border-radius: 14px;
    padding: 3.5rem 3.25rem; /* more internal padding */
    box-shadow: var(--bbai-shadow-card); /* soft elevated shadow */
    border: 1px solid var(--bbai-border-primary);
    box-sizing: border-box;
}

/* Hero Section */
.bbai-hero {
    text-align: center; /* match mockup */
    margin-bottom: 3rem;
}

.bbai-account-banner {
    background: #ffffff;
    border-radius: 20px;
    padding: 28px 32px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    border: 1px solid #e2e8f0;
    margin-bottom: 2.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
}

.bbai-account-banner__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
}

.bbai-account-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(20, 184, 166, 0.12);
    color: #0f172a;
    font-weight: 600;
    font-size: 0.85rem;
}

.bbai-account-chip::before {
    content: '🔒';
}

.bbai-account-banner__header h3 {
    margin: 12px 0 6px 0;
    font-size: 1.25rem;
    font-weight: var(--bbai-font-bold);
    color: #0f172a;
}

.bbai-account-banner__header p {
    margin: 0;
    color: #64748b;
    font-size: 0.95rem;
}

.bbai-account-plan {
    text-align: right;
}

.bbai-account-plan-label {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
}

.bbai-account-plan small {
    display: block;
    color: #94a3b8;
    font-size: 0.8rem;
    margin-top: 4px;
}

.bbai-account-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.bbai-account-btn {
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #0f172a;
    padding: 10px 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.bbai-account-btn:hover {
    border-color: #cbd5f5;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

.bbai-account-btn--primary {
    background: linear-gradient(135deg, #14b8a6 0%, #84cc16 100%);
    color: #ffffff;
    border: none;
    box-shadow: 0 8px 20px rgba(20, 184, 166, 0.35);
}

.bbai-account-btn--primary:hover {
    opacity: 0.92;
}

.bbai-account-btn--ghost {
    background: transparent;
    border: none;
    color: #ef4444;
    box-shadow: none;
}

.bbai-account-btn--ghost:hover {
    color: #dc2626;
}

.bbai-account-help {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
}

.bbai-hero-title {
    font-size: 2.625rem;
    font-weight: var(--bbai-font-bold);
    color: var(--bbai-gray-900);
    margin: 0 0 2.25rem 0;
    line-height: 1.2;
}

/* Stat Chips */
.bbai-stats-chips {
    display: inline-flex;
    gap: var(--bbai-space-3);
    align-items: center;
    justify-content: center; /* centered */
    margin: 0 0 var(--bbai-space-6) 0;
}

.bbai-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--bbai-space-2);
    padding: var(--bbai-space-2) var(--bbai-space-3);
    border-radius: var(--bbai-radius-full);
    font-size: 13px;
    border: 1px solid transparent;
}

.bbai-chip__label {
    color: var(--bbai-gray-600);
}

.bbai-chip__value {
    font-weight: var(--bbai-font-bold);
}

.bbai-chip--success {
    background: var(--bbai-success-bg);
    border-color: var(--bbai-success-light);
    color: #065f46;
}

.bbai-chip--warning {
    background: var(--bbai-warning-bg);
    border-color: var(--bbai-warning-light);
    color: #9a3412;
}

/* Usage Bar */
.bbai-usage-bar {
    max-width: 620px;
    margin: 0 auto var(--bbai-space-8); /* centered */
}

.bbai-usage-text {
    font-size: var(--bbai-text-sm);
    color: var(--bbai-gray-500);
    margin-bottom: var(--bbai-space-3);
    text-align: left;
}

.bbai-upgrade-inline {
    color: var(--bbai-info);
    text-decoration: none;
    font-weight: var(--bbai-font-semibold);
}

.bbai-upgrade-inline:hover {
    text-decoration: underline;
}

.bbai-progress-container {
    height: 10px;
    background: var(--bbai-gray-200);
    border-radius: var(--bbai-radius-full);
    overflow: hidden;
    box-shadow: var(--bbai-shadow-xs);
}

.bbai-progress-bar {
    height: 100%;
    background: var(--bbai-gradient-success);
    border-radius: var(--bbai-radius-full);
    min-width: 2px; /* Ensure it's always visible if > 0% */
    /* Removed transition to prevent animation conflicts */
}

/* Primary Button */
.bbai-btn-primary {
    background: #10b981;
    color: var(--bbai-white);
    font-size: var(--bbai-text-base);
    font-weight: var(--bbai-font-semibold);
    padding: 1.05rem 2.65rem;
    border: 1px solid #10b981;
    border-radius: var(--bbai-radius-md);
    cursor: pointer;
    transition: var(--bbai-transition);
    box-shadow: 0 8px 20px -6px rgba(16, 185, 129, 0.35);
}

/* Place primary CTA on a new line under the chips */
.bbai-hero .bbai-btn-primary {
    display: block;
    margin: 1rem auto 0; /* centered under chips */
}

.bbai-btn-primary:hover {
    background: #059669;
    border-color: #059669;
    transform: translateY(-1px);
    box-shadow: 0 12px 24px -8px rgba(5, 150, 105, 0.4);
}

.bbai-btn-primary:disabled {
    background: var(--bbai-gray-300);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Table */
.bbai-table-container {
    margin: 2.25rem auto;
    max-width: 980px;
    overflow-x: auto;
}

.bbai-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.bbai-table thead th {
    background: var(--bbai-gray-50);
    padding: 1.1rem var(--bbai-space-4);
    text-align: left;
    font-size: 13px;
    font-weight: var(--bbai-font-semibold);
    color: var(--bbai-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--bbai-gray-200);
}

.bbai-table thead th:first-child {
    border-top-left-radius: var(--bbai-radius-md);
}

.bbai-table thead th:last-child {
    border-top-right-radius: var(--bbai-radius-md);
}

.bbai-table tbody tr {
    border-bottom: 1px solid var(--bbai-border-primary);
    transition: var(--bbai-transition);
}

.bbai-table tbody tr:nth-child(odd) {
    background: var(--bbai-white);
}

.bbai-table tbody tr:nth-child(even) {
    background: var(--bbai-gray-50);
}

.bbai-table tbody tr:hover {
    background: var(--bbai-gray-100);
    box-shadow: inset 0 0 0 1px rgba(59,130,246,0.08);
}

.bbai-table tbody td {
    padding: 1.15rem var(--bbai-space-4);
    vertical-align: middle;
}

.bbai-table tbody td:last-child {
    text-align: right;
}

.bbai-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.65rem;
    border-radius: var(--bbai-radius-full);
    font-size: 0.825rem;
    font-weight: var(--bbai-font-semibold);
    letter-spacing: 0.01em;
}

.bbai-status-badge--optimized {
    background: rgba(16,185,129,0.12);
    color: #047857;
}

.bbai-status-badge--missing {
    background: rgba(251,191,36,0.18);
    color: #92400e;
}

.bbai-status-badge--regenerated {
    background: rgba(59,130,246,0.14);
    color: #1d4ed8;
}

.bbai-copy-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    color: var(--bbai-gray-800);
}

.bbai-copy-trigger:hover .bbai-copy-icon {
    opacity: 1;
    transform: translateY(-1px);
}

.bbai-copy-icon {
    width: var(--bbai-space-4);
    height: var(--bbai-space-4);
    opacity: 0;
    transition: var(--bbai-transition);
    color: var(--bbai-gray-500);
}

.bbai-table .text-muted {
    color: var(--bbai-gray-400);
    font-style: italic;
}

.bbai-table__cell--action {
    text-align: right;
}

.bbai-btn-regenerate {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    font-size: 0.9375rem;
    font-weight: var(--bbai-font-semibold);
    border-radius: var(--bbai-radius-lg);
    border: 1px solid rgba(14, 165, 233, 0.2);
    background: linear-gradient(135deg, rgba(236, 253, 245, 0.9) 0%, rgba(209, 250, 229, 0.9) 100%);
    color: #047857;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: var(--bbai-transition);
}

.bbai-btn-regenerate:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px -12px rgba(5, 150, 105, 0.45);
    border-color: rgba(5, 150, 105, 0.35);
}

.bbai-btn-regenerate:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.bbai-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: var(--bbai-radius-sm);
    border: 1px solid var(--bbai-border-primary);
    box-shadow: var(--bbai-shadow-xs);
}

.bbai-btn-regenerate:focus-visible,
.bbai-btn-primary:focus-visible,
.bbai-nav-link:focus-visible {
    outline: 3px solid rgba(59,130,246,0.55);
    outline-offset: 2px;
}

/* Footer */
.bbai-footer {
    text-align: center;
    margin-top: 2.25rem;
    padding-top: 2.25rem;
    border-top: 1px solid var(--bbai-border-primary);
}

.bbai-upgrade-link {
    color: var(--bbai-info);
    text-decoration: none;
    font-size: 15px;
    font-weight: var(--bbai-font-medium);
    transition: var(--bbai-transition-colors);
}

.bbai-upgrade-link:hover {
    color: var(--bbai-primary-dark);
}

/* Status Messages */
.bbai-dashboard__status {
    margin-top: var(--bbai-space-6);
    padding: var(--bbai-space-4);
    border-radius: var(--bbai-radius-md);
    display: none;
}

.bbai-dashboard__status.active {
    display: block;
}

.bbai-dashboard__status.success {
    background: var(--bbai-success-light);
    color: #065f46;
    border: 1px solid var(--bbai-success);
}

.bbai-dashboard__status.error {
    background: var(--bbai-danger-light);
    color: #991b1b;
    border: 1px solid var(--bbai-danger);
}

.bbai-dashboard__status.info {
    background: var(--bbai-info-light);
    color: #1e40af;
    border: 1px solid var(--bbai-info);
}

/* Responsive */
@media (max-width: 768px) {
    .bbai-container {
        padding: var(--bbai-space-8) 1.125rem;
    }

    .bbai-dashboard {
        padding: var(--bbai-space-8) var(--bbai-space-5);
    }

    .bbai-hero-title {
        font-size: var(--bbai-text-xl);
    }

    .bbai-table {
        font-size: var(--bbai-text-sm);
    }

    .bbai-thumb {
        width: 48px;
        height: 48px;
    }
}

/* Loading state */
.bbai-btn-regenerate:disabled,
.bbai-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.bbai-btn-regenerate.loading,
.bbai-btn-primary.loading {
    position: relative;
}

.bbai-btn-regenerate.loading::after,
.bbai-btn-primary.loading::after {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    top: 50%;
    left: 50%;
    margin-left: -7px;
    margin-top: -7px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =============================
   ALT Library polish
   ============================= */
.bbai-library {
    background: var(--bbai-white);
    border: 1px solid var(--bbai-border-primary);
    border-radius: var(--bbai-radius-lg);
    padding: var(--bbai-space-4) var(--bbai-space-4) var(--bbai-space-2);
    box-shadow: var(--bbai-shadow-sm);
}

.bbai-library__intro {
    padding: var(--bbai-space-2) var(--bbai-space-2) var(--bbai-space-5);
    border-bottom: 1px solid var(--bbai-border-primary);
}

.bbai-library__intro h2 {
    margin: 0 0 var(--bbai-space-1) 0;
}

.bbai-library__filters {
    display: flex;
    gap: var(--bbai-space-2);
    align-items: center;
    padding: var(--bbai-space-4) var(--bbai-space-2);
}

.bbai-library__table,
.bbai-audit__table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px; /* row gaps */
}

.bbai-library__table thead th {
    font-size: var(--bbai-text-xs);
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--bbai-gray-500);
    padding: var(--bbai-space-2) var(--bbai-space-3);
}

.bbai-library__table tbody tr {
    background: var(--bbai-gray-50);
    border: 1px solid var(--bbai-border-primary);
    border-radius: 10px;
    box-shadow: var(--bbai-shadow-xs);
}

.bbai-library__table tbody td {
    padding: .9rem .9rem;
    vertical-align: middle;
}

/* Ensure actions column inherits same background and border radius */
.bbai-library__table td:last-child,
.bbai-library__table th:last-child {
    background: transparent;
}

.bbai-library__row--recent {
    outline: 2px solid rgba(59,130,246,.15);
}

.bbai-library__row--missing {
    outline: 2px solid rgba(245,158,11,.18);
}

.bbai-library__row--updated {
    animation: bbaiRowHighlight 1.6s ease-out;
}

@keyframes bbaiRowHighlight {
    0%   { background-color: rgba(59,130,246,0.12); }
    60%  { background-color: rgba(59,130,246,0.06); }
    100% { background-color: transparent; }
}

.bbai-bulk-progress {
    margin-top: 16px;
    background: var(--bbai-info-bg);
    border-radius: var(--bbai-radius-lg);
    border: 1px solid rgba(99,102,241,0.2);
    padding: 14px 16px;
    color: #312e81;
    display: none; /* Hidden by default - only show when bulk operation is active */
    flex-direction: column;
    gap: 10px;
}

/* Show only when hidden attribute is removed (when bulk operation starts) */
.bbai-bulk-progress[hidden] {
    display: none !important;
}

/* Show when hidden attribute is removed */
.bbai-bulk-progress:not([hidden]) {
    display: flex !important;
}

.bbai-bulk-progress__header {
    display: flex;
    justify-content: space-between;
    font-weight: var(--bbai-font-semibold);
    font-size: var(--bbai-text-sm);
}

.bbai-bulk-progress__counts {
    color: #4338ca;
    font-weight: var(--bbai-font-medium);
}

.bbai-bulk-progress__bar {
    position: relative;
    width: 100%;
    height: 8px;
    background: rgba(99,102,241,0.18);
    border-radius: var(--bbai-radius-full);
    overflow: hidden;
}

.bbai-bulk-progress__bar span {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    transition: width var(--bbai-transition-base) ease;
}

.bbai-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    transition: var(--bbai-transition);
    padding: 24px;
}

.bbai-modal-overlay.is-visible {
    opacity: 1;
}

.bbai-modal {
    background: var(--bbai-white);
    border-radius: var(--bbai-radius-xl);
    padding: 28px;
    max-width: 520px;
    width: 100%;
    box-shadow: var(--bbai-shadow-modal);
    position: relative;
    transform: translateY(16px);
    transition: var(--bbai-transition-transform);
}

.bbai-modal-overlay.is-visible .bbai-modal {
    transform: translateY(0);
}

.bbai-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    border: none;
    background: transparent;
    font-size: var(--bbai-text-2xl);
    line-height: 1;
    cursor: pointer;
    color: var(--bbai-gray-500);
}

.bbai-modal__title {
    margin: 0 0 8px;
    font-size: var(--bbai-text-2xl);
    color: var(--bbai-gray-900);
}

.bbai-modal__subtitle {
    margin: 0 0 18px;
    color: var(--bbai-gray-500);
}

.bbai-modal__label {
    display: block;
    font-weight: var(--bbai-font-semibold);
    margin-bottom: 8px;
    color: var(--bbai-gray-700);
}

.bbai-modal__textarea {
    width: 100%;
    min-height: 110px;
    border-radius: 10px;
    border: 1px solid var(--bbai-gray-300);
    font-size: var(--bbai-text-base);
    padding: 12px 14px;
    resize: vertical;
    color: var(--bbai-gray-800);
    background: var(--bbai-gray-50);
    margin-bottom: 18px;
}

.bbai-modal__textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: var(--bbai-input-focus-ring);
}

.bbai-modal__notice {
    background: var(--bbai-warning-light);
    border: 1px solid #fcd34d;
    color: #92400e;
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 13px;
}

.bbai-modal__actions {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.bbai-modal__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.bbai-modal__badge {
    background: var(--bbai-info-bg);
    color: #3730a3;
    border-radius: var(--bbai-radius-full);
    padding: var(--bbai-space-1) var(--bbai-space-3);
    font-size: var(--bbai-text-xs);
    font-weight: var(--bbai-font-semibold);
}

.bbai-modal__issues {
    margin: 0;
    padding-left: 18px;
    color: #b45309;
    font-size: var(--bbai-text-sm);
}

.bbai-modal__issues li + li {
    margin-top: 4px;
}

.bbai-btn-disabled,
.bbai-btn-disabled:hover {
    cursor: not-allowed !important;
    opacity: 0.55 !important;
    box-shadow: none !important;
}

.bbai-badge {
    display:inline-block;
    padding: var(--bbai-space-1) var(--bbai-space-2);
    border-radius: var(--bbai-radius-full);
    font-size: var(--bbai-text-xs);
    border:1px solid var(--bbai-border-primary);
    background: var(--bbai-white);
}

.bbai-badge--excellent { color:#065f46; background: var(--bbai-success-bg); border-color: var(--bbai-success-light); }
.bbai-badge--critical { color:#991b1b; background: var(--bbai-danger-light); border-color:#fecaca; }

.bbai-library .button { transition: var(--bbai-transition); }
.bbai-library .button:hover { transform: translateY(-1px); }

/* Table Title Styling */
.bbai-table-title {
    font-size: var(--bbai-text-xl);
    font-weight: var(--bbai-font-extrabold);
    color: var(--bbai-gray-800);
    margin: 0 0 var(--bbai-space-8) 0;
    padding: 0;
    letter-spacing: var(--bbai-tracking-tight);
}

/* Table Container */
.bbai-table-container {
    background: linear-gradient(135deg, var(--bbai-gray-50) 0%, var(--bbai-gray-100) 100%);
    border: 1px solid var(--bbai-border-primary);
    border-radius: var(--bbai-radius-xl);
    padding: var(--bbai-space-8);
    margin-top: var(--bbai-space-8);
    box-shadow: var(--bbai-shadow-md);
}

/* Table Styling */
.bbai-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0;
}

.bbai-table th {
    background: linear-gradient(135deg, var(--bbai-gray-100) 0%, var(--bbai-gray-200) 100%);
    padding: var(--bbai-space-5) var(--bbai-space-4);
    text-align: left;
    font-weight: var(--bbai-font-bold);
    color: var(--bbai-gray-700);
    border-bottom: 2px solid var(--bbai-gray-300);
    font-size: var(--bbai-text-sm);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: relative;
}

.bbai-table td {
    padding: var(--bbai-space-5) var(--bbai-space-4);
    border-bottom: 1px solid var(--bbai-gray-100);
    vertical-align: top;
    background: var(--bbai-white);
}

.bbai-table tr:last-child td {
    border-bottom: none;
}

.bbai-table tr:hover {
    background: var(--bbai-gray-50);
}

/* Thumbnail styling */
.bbai-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--bbai-radius-sm);
    border: 1px solid var(--bbai-border-primary);
}

/* Regenerate button styling */
.bbai-btn-regenerate {
    padding: var(--bbai-space-3) var(--bbai-space-5);
    border: 1px solid var(--bbai-gray-300);
    background: linear-gradient(135deg, var(--bbai-white) 0%, var(--bbai-gray-50) 100%);
    border-radius: var(--bbai-radius-md);
    cursor: pointer;
    font-size: var(--bbai-text-sm);
    font-weight: var(--bbai-font-semibold);
    color: var(--bbai-gray-700);
    transition: var(--bbai-transition);
    box-shadow: var(--bbai-shadow-xs);
    letter-spacing: var(--bbai-tracking-wide);
}

.bbai-btn-regenerate:hover:not(:disabled):not(.bbai-btn-disabled) {
    background: linear-gradient(135deg, var(--bbai-gray-50) 0%, var(--bbai-gray-100) 100%);
    border-color: var(--bbai-gray-400);
    transform: translateY(-1px);
    box-shadow: var(--bbai-shadow-md);
}

.bbai-btn-regenerate:disabled,
.bbai-btn-regenerate.bbai-btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--bbai-gray-100);
    border-color: var(--bbai-border-primary);
    color: var(--bbai-gray-400);
}

/* Pagination */
.bbai-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--bbai-space-6);
    padding: var(--bbai-space-4) 0;
    border-top: 1px solid var(--bbai-border-primary);
}

.bbai-pagination-info {
    font-size: var(--bbai-text-sm);
    color: var(--bbai-gray-500);
    font-weight: var(--bbai-font-medium);
}

.bbai-pagination-controls {
    display: flex;
    align-items: center;
    gap: var(--bbai-space-2);
}

.bbai-pagination-pages {
    display: flex;
    align-items: center;
    gap: var(--bbai-space-1);
    margin: 0 var(--bbai-space-4);
}

.bbai-pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--bbai-space-8);
    height: var(--bbai-space-8);
    padding: 0 var(--bbai-space-2);
    font-size: var(--bbai-text-sm);
    font-weight: var(--bbai-font-medium);
    color: var(--bbai-gray-700);
    background: var(--bbai-white);
    border: 1px solid var(--bbai-gray-300);
    border-radius: var(--bbai-radius-sm);
    text-decoration: none;
    transition: var(--bbai-transition);
    cursor: pointer;
}

.bbai-pagination-btn:hover:not(.bbai-pagination-btn--disabled) {
    background: var(--bbai-gray-100);
    border-color: var(--bbai-gray-400);
    color: var(--bbai-gray-800);
}

.bbai-pagination-btn--current {
    background: var(--bbai-info);
    color: var(--bbai-white);
    border-color: var(--bbai-info);
    font-weight: var(--bbai-font-semibold);
}

.bbai-pagination-btn--disabled {
    background: var(--bbai-gray-50);
    color: var(--bbai-gray-400);
    border-color: var(--bbai-border-primary);
    cursor: not-allowed;
}

.bbai-pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--bbai-space-8);
    height: var(--bbai-space-8);
    font-size: var(--bbai-text-sm);
    color: var(--bbai-gray-400);
    font-weight: var(--bbai-font-medium);
}

@media (max-width: 640px) {
    .bbai-pagination {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .bbai-pagination-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .bbai-pagination-pages {
        margin: 0 0.5rem;
    }
}

/* Clean Dashboard Design */
.bbai-clean-dashboard {
    background: var(--bbai-white);
    border-radius: 20px;
    padding: var(--bbai-space-10);
    box-shadow: var(--bbai-shadow-lg);
    border: 1px solid rgba(229, 231, 235, 0.8);
    position: relative;
    overflow: hidden;
}

.bbai-main-content {
    margin-bottom: var(--bbai-space-8);
}

.bbai-main-title {
    font-size: var(--bbai-text-4xl);
    font-weight: var(--bbai-font-extrabold);
    color: var(--bbai-gray-800);
    margin: 0 0 var(--bbai-space-8) 0;
    line-height: 1.1;
    letter-spacing: var(--bbai-tracking-tight);
    background: linear-gradient(135deg, var(--bbai-gray-800) 0%, var(--bbai-gray-700) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bbai-usage-display {
    margin-bottom: var(--bbai-space-6);
}

.bbai-usage-text {
    font-size: var(--bbai-text-lg);
    color: var(--bbai-gray-600);
    margin-bottom: var(--bbai-space-3);
    display: flex;
    align-items: center;
    gap: var(--bbai-space-2);
    flex-wrap: wrap;
    font-weight: var(--bbai-font-medium);
}

.bbai-reset-info {
    font-size: var(--bbai-text-sm);
    color: var(--bbai-gray-400);
    font-style: italic;
}

.bbai-progress-bar-container {
    background: var(--bbai-gray-100);
    height: 10px;
    border-radius: var(--bbai-radius-md);
    overflow: hidden;
    box-shadow: var(--bbai-shadow-xs);
}

.bbai-progress-bar-fill {
    height: 100%;
    background: var(--bbai-gradient-success);
    border-radius: var(--bbai-radius-md);
    transition: width 0.5s ease;
    position: relative;
    box-shadow: var(--bbai-shadow-xs);
}

.bbai-progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

/* Optimization Progress */
.bbai-optimization-progress {
    background: linear-gradient(135deg, var(--bbai-gray-50) 0%, var(--bbai-gray-100) 100%);
    border: 1px solid var(--bbai-border-primary);
    border-radius: var(--bbai-radius-xl);
    padding: var(--bbai-space-8);
    margin-bottom: var(--bbai-space-8);
    box-shadow: var(--bbai-shadow-sm);
    position: relative;
    overflow: hidden;
}

/* Removed blue top border */

/* Post Optimization Banner */
.bbai-post-optimization-banner {
    display: none;
    margin-top: var(--bbai-space-8);
    padding: var(--bbai-space-6);
    border-radius: 14px;
    background: linear-gradient(120deg, #ede9fe 0%, #dbeafe 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow: var(--bbai-shadow-lg);
    align-items: center;
    gap: var(--bbai-space-5);
}

.bbai-post-optimization-banner.active {
    display: flex;
}

.bbai-post-optimization-text {
    font-size: var(--bbai-text-base);
    font-weight: var(--bbai-font-semibold);
    color: #312e81;
    margin: 0;
}

.bbai-post-optimization-banner .bbai-pricing-btn {
    margin-left: auto;
}

/* Progress Log - Detailed Bulk Optimization Tracking */
.bbai-progress-log {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    background: var(--bbai-white);
    border-radius: 20px;
    box-shadow: var(--bbai-shadow-2xl);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bbai-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--bbai-space-6) var(--bbai-space-8);
    border-bottom: 1px solid var(--bbai-border-primary);
    background: linear-gradient(135deg, var(--bbai-gray-50) 0%, var(--bbai-gray-100) 100%);
}

.bbai-progress-header h3 {
    margin: 0;
    font-size: var(--bbai-text-xl);
    font-weight: var(--bbai-font-bold);
    color: var(--bbai-gray-800);
}

.bbai-progress-close {
    background: none;
    border: none;
    color: var(--bbai-gray-500);
    cursor: pointer;
    padding: var(--bbai-space-2);
    border-radius: var(--bbai-radius-md);
    transition: var(--bbai-transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bbai-progress-close:hover {
    background: var(--bbai-gray-100);
    color: var(--bbai-gray-700);
}

.bbai-progress-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--bbai-space-4);
    padding: var(--bbai-space-6) var(--bbai-space-8);
    background: var(--bbai-gray-50);
    border-bottom: 1px solid var(--bbai-border-primary);
}

.bbai-progress-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.bbai-progress-label {
    font-size: var(--bbai-text-sm);
    font-weight: var(--bbai-font-medium);
    color: var(--bbai-gray-500);
    margin-bottom: var(--bbai-space-1);
}

.bbai-progress-percentage,
.bbai-progress-count,
.bbai-progress-success,
.bbai-progress-errors {
    font-size: var(--bbai-text-2xl);
    font-weight: var(--bbai-font-bold);
    color: var(--bbai-gray-800);
}

.bbai-progress-success {
    color: var(--bbai-success);
}

.bbai-progress-errors {
    color: var(--bbai-danger);
}

/* Removed duplicate progress bar CSS - using the main one below */

.bbai-progress-log-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.bbai-progress-log-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--bbai-space-4) var(--bbai-space-8);
    max-height: 300px;
    background: var(--bbai-gray-50);
}

.bbai-progress-log-entry {
    display: flex;
    align-items: flex-start;
    gap: var(--bbai-space-3);
    padding: var(--bbai-space-2) 0;
    border-bottom: 1px solid var(--bbai-border-primary);
    font-size: var(--bbai-text-sm);
    line-height: 1.4;
}

.bbai-progress-log-entry:last-child {
    border-bottom: none;
}

.bbai-progress-log-time {
    color: var(--bbai-gray-500);
    font-weight: var(--bbai-font-medium);
    min-width: 60px;
    flex-shrink: 0;
}

.bbai-progress-log-message {
    flex: 1;
    color: var(--bbai-gray-700);
}

.bbai-progress-log-entry--info {
    background: var(--bbai-info-bg);
    border-left: 3px solid var(--bbai-info);
    padding-left: var(--bbai-space-3);
    margin-left: calc(-1 * var(--bbai-space-3));
}

.bbai-progress-log-entry--success {
    background: var(--bbai-success-bg);
    border-left: 3px solid var(--bbai-success);
    padding-left: var(--bbai-space-3);
    margin-left: calc(-1 * var(--bbai-space-3));
}

.bbai-progress-log-entry--error {
    background: var(--bbai-danger-bg);
    border-left: 3px solid var(--bbai-danger);
    padding-left: var(--bbai-space-3);
    margin-left: calc(-1 * var(--bbai-space-3));
}

.bbai-progress-log-entry--warning {
    background: var(--bbai-warning-bg);
    border-left: 3px solid var(--bbai-warning);
    padding-left: var(--bbai-space-3);
    margin-left: calc(-1 * var(--bbai-space-3));
}

.bbai-progress-actions {
    padding: var(--bbai-space-6) var(--bbai-space-8);
    border-top: 1px solid var(--bbai-border-primary);
    background: var(--bbai-white);
    display: flex;
    justify-content: center;
}

.bbai-progress-cancel {
    background: var(--bbai-danger);
    color: var(--bbai-white);
    border: none;
    padding: var(--bbai-space-3) var(--bbai-space-6);
    border-radius: var(--bbai-radius-md);
    font-weight: var(--bbai-font-semibold);
    cursor: pointer;
    transition: var(--bbai-transition);
}

.bbai-progress-cancel:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-1px);
}

.bbai-progress-cancel:disabled {
    background: var(--bbai-gray-400);
    cursor: not-allowed;
    transform: none;
}

/* Progress log overlay */
.bbai-progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    /* backdrop-filter removed to prevent blur on modal content */
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.bbai-optimization-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.bbai-optimization-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.bbai-optimization-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: #1f2937;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.bbai-optimization-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
    font-weight: 500;
}

.bbai-optimization-separator {
    font-size: 1.5rem;
    color: #9ca3af;
    font-weight: 300;
    margin: 0 0.5rem;
}

.bbai-optimization-bar {
    background: #e5e7eb;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 1rem;
    position: relative;
}

.bbai-optimization-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 6px;
    transition: width 0.5s ease;
    position: relative;
}

.bbai-optimization-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.bbai-optimization-text {
    text-align: center;
    font-size: 0.875rem;
    color: #374151;
    font-weight: 500;
}

.bbai-main-cta {
    margin-bottom: 2rem;
}

.bbai-bulk-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    padding: 1.25rem 2.5rem;
    border-radius: 16px;
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3), 0 2px 4px rgba(59, 130, 246, 0.2);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.025em;
}

.bbai-bulk-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.bbai-bulk-btn:hover:not(:disabled)::before {
    left: 100%;
}

.bbai-bulk-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    transform: translateY(-3px);
    box-shadow: 0 12px 24px -4px rgba(59, 130, 246, 0.4), 0 4px 8px rgba(59, 130, 246, 0.3);
}

.bbai-bulk-btn:disabled,
.bbai-bulk-btn.loading {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    color: #ffffff;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    opacity: 0.7;
}

.bbai-bulk-btn:disabled:hover,
.bbai-bulk-btn.loading:hover {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.bbai-bulk-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 4px 8px -2px rgba(59, 130, 246, 0.3);
}

.bbai-bulk-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 4px rgba(156, 163, 175, 0.2);
}

.bbai-bulk-btn--limit {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    position: relative;
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 2.5rem 1rem 2.5rem;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3), 0 2px 4px rgba(239, 68, 68, 0.2);
}

.bbai-bulk-btn--limit::before {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}

.bbai-bulk-btn--limit:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -4px rgba(239, 68, 68, 0.3);
}

.bbai-bulk-btn--limit:active {
    transform: translateY(0);
    box-shadow: 0 4px 8px -2px rgba(239, 68, 68, 0.3);
}

.bbai-bulk-btn__badge {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2), 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 2px solid #ffffff;
    position: relative;
    z-index: 1;
}

/* Upgrade Modal */
.bbai-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bbai-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    /* backdrop-filter removed to prevent blur on modal content */
}

.bbai-modal__content {
    position: relative;
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.bbai-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;
}

.bbai-modal__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.bbai-modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s;
    z-index: 10;
}

.bbai-modal__close:hover {
    background: #f3f4f6;
    color: #374151;
}

.bbai-modal__body {
    padding: 2rem;
}

.bbai-limit-message {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    border-radius: 12px;
    text-align: center;
}

.bbai-limit-icon {
    font-size: 3rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.bbai-limit-text h3 {
    margin: 0 0 0.5rem 0;
    color: #92400e;
    font-size: 1.5rem;
    font-weight: 700;
}

.bbai-limit-text p {
    margin: 0;
    color: #a16207;
    font-size: 1rem;
    font-weight: 500;
}

.bbai-pricing-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.bbai-pricing-card {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s;
}

.bbai-pricing-card--pro {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.bbai-pricing-card--featured {
    border-color: #1d4ed8;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    position: relative;
    transform: scale(1.05);
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.3);
}

.bbai-pricing-card--credits {
    border-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}

.bbai-pricing-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.1);
}

.bbai-pricing-header h4 {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
}

.bbai-pricing-price {
    margin-bottom: 1.5rem;
}

.bbai-pricing-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1f2937;
}

.bbai-pricing-period {
    font-size: 1rem;
    color: #6b7280;
    margin-left: 0.25rem;
}

.bbai-pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #1d4ed8;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 4px rgba(29, 78, 216, 0.3);
}

.bbai-pricing-savings {
    font-size: 0.875rem;
    color: #059669;
    font-weight: 600;
    margin-top: 0.5rem;
}

.bbai-pricing-value {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

.bbai-pricing-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
    text-align: left;
}

.bbai-pricing-features li {
    padding: 0.5rem 0;
    color: #374151;
    font-size: 0.875rem;
}

.bbai-pricing-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    width: 100%;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.bbai-pricing-btn--primary {
    background: #3b82f6;
    color: white;
}

.bbai-pricing-btn--primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.bbai-pricing-btn--secondary {
    background: #10b981;
    color: white;
}

.bbai-pricing-btn--secondary:hover {
    background: #059669;
    transform: translateY(-1px);
}

.bbai-modal-footer {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.bbai-modal-urgency {
    margin-bottom: 1rem;
}

.bbai-modal-note {
    margin: 0;
    color: #dc2626;
    font-size: 1rem;
    font-weight: 600;
    background: #fef2f2;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid #fecaca;
}

.bbai-modal-guarantee {
    margin-top: 1rem;
}

.bbai-guarantee-text {
    margin: 0;
    color: #059669;
    font-size: 0.875rem;
    font-weight: 500;
    background: #ecfdf5;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid #d1fae5;
}

/* Limit Reached State */
.bbai-limit-reached {
    background: #FEF9C3;
    border-top: 3px solid #f59e0b;
    border-left: 1px solid #fde047;
    border-right: 1px solid #fde047;
    border-bottom: 1px solid #fde047;
    border-radius: 12px;
    padding: 24px;
    margin: 30px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    text-align: center;
    position: relative;
}

.bbai-limit-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 50%;
    margin-bottom: 16px;
    color: #f59e0b;
}

.bbai-limit-header-icon svg {
    width: 24px;
    height: 24px;
}

.bbai-limit-title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 12px 0;
}

.bbai-limit-description {
    font-size: 15px;
    color: #374151;
    margin: 0 0 24px 0;
    line-height: 1.5;
}

.bbai-limit-upgrade-btn {
    width: 100%;
    height: 48px;
    padding: 0 28px;
    background: #0B66FF;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(11, 102, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bbai-limit-upgrade-btn:hover {
    background: #0A5AE6;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(11, 102, 255, 0.4);
}

.bbai-limit-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 2rem;
}

.bbai-limit-icon {
    font-size: 2.5rem;
    line-height: 1;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.bbai-limit-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #92400e;
}

.bbai-limit-description {
    margin: 0;
    color: #a16207;
    line-height: 1.6;
    font-size: 1rem;
}

/* Countdown Timer */
.bbai-countdown {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 24px 0;
}

.bbai-countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.bbai-countdown-separator {
    color: #677388;
    font-size: 18px;
    font-weight: 600;
    margin: 0 4px;
    padding-top: 12px;
}

.bbai-countdown-number {
    font-size: 40px;
    font-weight: 700;
    color: #111827;
    line-height: 1;
    margin-bottom: 4px;
}

.bbai-countdown-label {
    font-size: 11px;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bbai-limit-cta {
    text-align: center;
    margin-top: 1.5rem;
}

.bbai-limit-upgrade-btn--full {
    width: 100%;
    max-width: 100%;
}

.bbai-limit-cta .bbai-pricing-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
}

.bbai-upgrade-options {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

.bbai-btn-upgrade {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 2.5rem;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 8px 16px -4px rgba(59, 130, 246, 0.3);
    min-width: 280px;
    position: relative;
    overflow: hidden;
}

.bbai-btn-upgrade::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.bbai-btn-upgrade:hover::before {
    left: 100%;
}

.bbai-btn-upgrade:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px -4px rgba(59, 130, 246, 0.4);
    color: white;
    text-decoration: none;
}

.bbai-btn-upgrade__main {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.bbai-btn-upgrade__subtitle {
    font-size: 0.875rem;
    font-weight: 400;
    opacity: 0.9;
    margin-bottom: 0.25rem;
}

.bbai-btn-upgrade__price {
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    margin-top: 0.25rem;
}

/* Benefits List */
.bbai-benefits {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    max-width: 300px;
}

.bbai-benefit {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    font-size: 0.875rem;
    color: #92400e;
}

.bbai-benefit-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.bbai-or-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #a16207;
    font-size: 0.875rem;
    font-weight: 500;
}

.bbai-or-divider::before,
.bbai-or-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(161, 98, 7, 0.3);
}

.bbai-wait-option {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.bbai-wait-option p {
    margin: 0;
    color: #a16207;
    font-size: 0.875rem;
    font-style: italic;
}

/* ================================
   SaaS Dashboard Refresh Utilities
   ================================ */
.max-w-5xl { max-width: 64rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.p-6 { padding: 1.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-8 { margin-top: 2rem; }
.hidden { display: none !important; }

.shadow-sm { box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08); }
.hover\:shadow-md:hover { box-shadow: 0 18px 35px -18px rgba(15, 23, 42, 0.35); transform: translateY(-1px); }
.transition-shadow { transition: box-shadow 0.3s ease, transform 0.3s ease; }
.transition-colors { transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease; }
.transition-all { transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); }

.bg-white { background-color: #ffffff; }
.bg-gray-50 { background-color: #f9fafb; }
.hover\:bg-gray-100:hover { background-color: #f1f5f9; }

.rounded-2xl { border-radius: 1rem; }

.flex { display: flex; }
.inline-flex { display: inline-flex; }
.items-center { align-items: center; }
.gap-1 { gap: 0.25rem; }
.gap-3 { gap: 0.75rem; }

.text-sm { font-size: 0.875rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.text-slate-800 { color: #1e293b; }
.text-slate-500 { color: #64748b; }
.text-teal-600 { color: #0f766e; }
.text-emerald-600 { color: #047857; }

.bg-gradient-to-r {
    background-image: linear-gradient(to right, var(--tw-gradient-from, #38bdf8), var(--tw-gradient-to, #0ea5e9));
}

.from-teal-400 { --tw-gradient-from: #2dd4bf; }
.to-lime-400 { --tw-gradient-to: #a3e635; }

/* ================================
   Dashboard Shell & Plan Banner
   ================================ */
.bbai-dashboard-shell {
    padding-bottom: 3rem;
}

.bbai-plan-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1rem 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(15, 118, 110, 0.12);
    margin: 2rem 0 1.5rem 0;
    background: linear-gradient(120deg, rgba(94, 234, 212, 0.12) 0%, rgba(163, 230, 53, 0.12) 100%);
    /* backdrop-filter removed to prevent blur on modal content */
}

.bbai-plan-banner--free {
    border-color: rgba(56, 189, 248, 0.18);
}

.bbai-plan-banner--pro {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.16) 0%, rgba(16, 185, 129, 0.16) 100%);
    border-color: rgba(30, 64, 175, 0.2);
    box-shadow: 0 20px 40px -28px rgba(30, 64, 175, 0.55);
}

.bbai-plan-banner__copy {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.bbai-plan-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.12);
    color: #0f172a;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.bbai-plan-badge--pro {
    background: rgba(16, 185, 129, 0.15);
    color: #064e3b;
}

.bbai-plan-banner__copy strong {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
}

.bbai-plan-banner__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.bbai-plan-upgrade {
    padding: 0.6rem 1.1rem;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #14b8a6 0%, #22d3ee 100%);
    color: white;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 14px 30px -18px rgba(13, 148, 136, 0.6);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bbai-plan-upgrade:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 36px -18px rgba(13, 148, 136, 0.7);
}

.bbai-plan-upgrade--secondary {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(129, 140, 248, 0.18) 100%);
    color: #1e293b;
    box-shadow: none;
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.bbai-plan-upgrade--secondary:hover {
    box-shadow: 0 12px 24px -22px rgba(99, 102, 241, 0.45);
}

.bbai-plan-manage {
    color: #0f172a;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid rgba(15, 23, 42, 0.25);
    padding-bottom: 0.1rem;
}

.bbai-plan-manage:hover {
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.4);
}

/* ================================
   Usage Display Card
   ================================ */
.bbai-usage-display {
    border: 1px solid rgba(15, 118, 110, 0.08);
    border-radius: 18px;
    background: #ffffff;
    margin-top: 1.5rem;
}

.bbai-usage-display__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.bbai-usage-meta {
    flex-wrap: wrap;
}

.bbai-refresh-status {
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
    color: #0f766e;
    font-size: 0.875rem;
}

.bbai-refresh-status:hover {
    color: #0d9488;
}

.bbai-refresh-status.is-refreshing {
    opacity: 0.65;
    cursor: wait;
}

.bbai-usage-alert {
    margin: 0;
    font-size: 0.9rem;
}

.bbai-progress-bar-container {
    position: relative;
    margin-top: 1.25rem;
    height: 12px;
    background: #f0fdf4;
    border-radius: 999px;
    overflow: hidden;
}

.bbai-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
    border-radius: 999px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 1px 3px rgba(34, 197, 94, 0.3);
}

.bbai-progress-bar-fill--animated {
    position: relative;
    box-shadow: 0 8px 16px -12px rgba(5, 150, 105, 0.6);
    animation: bbai-progress-glow 2.4s ease-in-out infinite;
}

@keyframes bbai-progress-glow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.08); }
}

.bbai-progress-bar-fill--animated::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(120deg, rgba(255,255,255,0.15) 0%, transparent 100%);
    animation: shimmer 3s linear infinite;
}

/* Special styling when limit is reached */
.bbai-progress-bar-fill--limit-reached {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 1px 3px rgba(239, 68, 68, 0.3);
}

.bbai-savings {
    font-size: 0.875rem;
    color: #475569;
}

.bbai-optimization-progress {
    border: 1px solid rgba(94, 234, 212, 0.18);
    background: linear-gradient(135deg, rgba(240, 253, 250, 0.85) 0%, rgba(224, 242, 254, 0.85) 100%);
}

.bbai-post-optimize-banner {
    margin-top: 1.5rem;
    border-radius: 16px;
    background: linear-gradient(120deg, rgba(59, 130, 246, 0.12) 0%, rgba(129, 140, 248, 0.12) 100%);
    border: 1px solid rgba(37, 99, 235, 0.12);
    padding: 1.25rem 1.5rem;
}

.bbai-post-optimize-banner__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.bbai-post-optimize-banner__content p {
    margin: 0;
    font-weight: 600;
    color: #1e293b;
}

.bbai-post-optimize-btn {
    border: none;
    background: linear-gradient(135deg, #6366f1 0%, #22d3ee 100%);
    color: white;
    padding: 0.6rem 1.4rem;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bbai-post-optimize-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px -20px rgba(99, 102, 241, 0.6);
}

/* ================================
   ALT Library Enhancements
   ================================ */
.bbai-table {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.bbai-table-row {
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.bbai-table__cell {
    vertical-align: middle;
}

.bbai-table__cell--media .bbai-media-cell {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.bbai-thumb-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    overflow: hidden;
    background: #f1f5f9;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bbai-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bbai-thumb--placeholder {
    font-size: 0.75rem;
    color: #94a3b8;
}

.bbai-media-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.bbai-media-title {
    font-weight: 600;
    color: #1f2937;
}

.bbai-media-link {
    color: #2563eb;
    font-size: 0.8125rem;
    text-decoration: none;
}

.bbai-media-link:hover {
    text-decoration: underline;
}

.bbai-copy-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #0f172a;
    font-weight: 500;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.bbai-copy-trigger:hover .bbai-copy-icon {
    opacity: 1;
    transform: translateY(-1px);
}

.bbai-copy-icon {
    font-size: 0.85rem;
    color: #64748b;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.bbai-table__cell--status {
    width: 140px;
}

.bbai-table__cell--date {
    width: 130px;
    white-space: nowrap;
}

.bbai-date {
    font-size: 0.875rem;
    color: #6b7280;
}

.bbai-table__cell--action {
    width: 150px;
}

/* ================================
   Tab System
   ================================ */
.bbai-tabs-container {
    margin-bottom: 2rem;
}

.bbai-tabs-nav {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
    padding: 0;
    margin: 0;
}

.bbai-tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    position: relative;
}

.bbai-tab-btn svg {
    width: 20px;
    height: 20px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.bbai-tab-btn:hover {
    color: #374151;
    background: #f9fafb;
}

.bbai-tab-btn:hover svg {
    opacity: 0.8;
}

.bbai-tab-btn.active {
    color: #8b5cf6;
    border-bottom-color: #8b5cf6;
    background: #faf5ff;
}

.bbai-tab-btn.active svg {
    opacity: 1;
}

/* ================================
   Toast tweaks
   ================================ */
.bbai-toast-container {
    font-family: 'Inter', 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ================================
   Background Queue Card
   ================================ */
.bbai-queue-card {
    border: 1px solid rgba(148, 163, 184, 0.12);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.bbai-queue-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.bbai-queue-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
}

.bbai-queue-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
    color: #64748b;
}

.bbai-queue-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bbai-queue-btn {
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    border: 1px solid rgba(14, 165, 233, 0.2);
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.12) 0%, rgba(59, 130, 246, 0.18) 100%);
    color: #0f172a;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.bbai-queue-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px -24px rgba(59, 130, 246, 0.55);
}

.bbai-queue-btn--secondary {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.12) 0%, rgba(16, 185, 129, 0.18) 100%);
    border-color: rgba(16, 185, 129, 0.25);
}

.bbai-queue-btn--ghost {
    background: transparent;
    border-color: rgba(148, 163, 184, 0.35);
}

.bbai-queue-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
}

.bbai-queue-stat {
    background: rgba(241, 245, 249, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.bbai-queue-stat__label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
}

.bbai-queue-stat__value {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1e293b;
}

.bbai-queue-stat__value--failed {
    color: #dc2626;
}

.bbai-queue-recent__title,
.bbai-queue-failures__title {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
}

.bbai-queue-recent__list,
.bbai-queue-failures__list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bbai-queue-empty {
    margin: 0;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    background: rgba(241, 245, 249, 0.6);
    color: #64748b;
    font-size: 0.875rem;
}

.bbai-queue-item {
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    background: #fff;
}

.bbai-queue-item__meta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.75rem;
    color: #64748b;
}

.bbai-queue-item__title {
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.bbai-queue-item__link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.bbai-queue-item__link:hover {
    text-decoration: underline;
}

.bbai-queue-item--failed {
    border-color: rgba(220, 38, 38, 0.3);
    background: rgba(254, 242, 242, 0.9);
}

.bbai-queue-item__error {
    margin: 0;
    font-size: 0.8125rem;
    color: #b91c1c;
}

.bbai-queue-card.has-failures {
    border-color: rgba(220, 38, 38, 0.3);
    box-shadow: 0 18px 38px -26px rgba(220, 38, 38, 0.35);
}

.bbai-queue-btn.is-refreshing {
    opacity: 0.6;
    cursor: wait;
}

/* Mini queue badge for Media Library */
.bbai-queue-mini {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: 1rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(248, 250, 252, 0.85);
    color: #0f172a;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.bbai-queue-mini:hover {
    border-color: rgba(59, 130, 246, 0.35);
    box-shadow: 0 12px 25px -18px rgba(59, 130, 246, 0.35);
}

.bbai-queue-mini--busy {
    border-color: rgba(16, 185, 129, 0.35);
}

.bbai-queue-mini--error {
    border-color: rgba(220, 38, 38, 0.35);
    color: #b91c1c;
}

.bbai-queue-mini__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.6;
}

.bbai-queue-mini__counts {
    font-variant-numeric: tabular-nums;
}

/* ======================================
   Regenerate Modal Styles
   ====================================== */

.bbai-regenerate-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    animation: bbai-modal-fade-in 0.2s ease-out;
}

.bbai-regenerate-modal.active {
    display: flex;
}

@keyframes bbai-modal-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.bbai-regenerate-modal__content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: bbai-modal-slide-up 0.3s ease-out;
}

@keyframes bbai-modal-slide-up {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.bbai-regenerate-modal__header {
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.bbai-regenerate-modal__title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 8px 0;
}

.bbai-regenerate-modal__subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

.bbai-regenerate-modal__body {
    padding: 24px;
}

.bbai-regenerate-modal__image-preview {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
}

.bbai-regenerate-modal__thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.bbai-regenerate-modal__image-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.bbai-regenerate-modal__image-title {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 4px 0;
}

.bbai-regenerate-modal__image-meta {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
}

.bbai-regenerate-modal__loading {
    display: none;
    text-align: center;
    padding: 32px 0;
}

.bbai-regenerate-modal__loading.active {
    display: block;
}

.bbai-regenerate-modal__spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: bbai-spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes bbai-spin {
    to { transform: rotate(360deg); }
}

.bbai-regenerate-modal__loading-text {
    font-size: 14px;
    color: #6b7280;
}

.bbai-regenerate-modal__result {
    display: none;
}

.bbai-regenerate-modal__result.active {
    display: block;
}

.bbai-regenerate-modal__alt-text-label {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 8px 0;
}

.bbai-regenerate-modal__alt-text {
    padding: 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    color: #1f2937;
    margin: 0 0 16px 0;
    min-height: 80px;
}

.bbai-regenerate-modal__footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.bbai-regenerate-modal__btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}

.bbai-regenerate-modal__btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bbai-regenerate-modal__btn--cancel {
    background: #f3f4f6;
    color: #374151;
}

.bbai-regenerate-modal__btn--cancel:hover:not(:disabled) {
    background: #e5e7eb;
}

.bbai-regenerate-modal__btn--accept {
    background: #6366f1;
    color: white;
}

.bbai-regenerate-modal__btn--accept:hover:not(:disabled) {
    background: #4f46e5;
}

.bbai-regenerate-modal__error {
    display: none;
    padding: 12px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #dc2626;
    font-size: 14px;
    margin-bottom: 16px;
}

.bbai-regenerate-modal__error.active {
    display: block;
}

/* ========================================
   DASHBOARD UI OVERHAUL - CLEAN MODERN DESIGN WITH WHITE SPACE
   ======================================== */

/* Two-Column Dashboard Grid - Increased spacing */
.bbai-dashboard-grid {
    display: grid;
    grid-template-columns: 58% 42%;
    gap: 40px;
    margin-top: 48px;
}

.bbai-dashboard-main {
    min-width: 0;
}

/* Full Width Cards Container - More spacing */
.bbai-dashboard-fullwidth {
    width: 100%;
    margin-top: 56px;
}

/* Metrics Grid - Three Cards in a Row - Cleaner spacing */
.bbai-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 48px;
}

.bbai-metric-card {
    background: white;
    border: 1px solid #f3f4f6;
    border-radius: 16px;
    padding: 32px 28px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.bbai-metric-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    border-color: #e5e7eb;
}

.bbai-metric-card--highlight {
    background: linear-gradient(135deg, #0ea5e9 0%, #0891b2 100%);
    border-color: #0891b2;
    color: white;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.2);
}

.bbai-metric-card--highlight:hover {
    box-shadow: 0 6px 16px rgba(14, 165, 233, 0.3);
}

.bbai-metric-card--highlight .bbai-metric-label,
.bbai-metric-card--highlight .bbai-metric-description {
    color: rgba(255, 255, 255, 0.95);
}

.bbai-metric-card--highlight .bbai-metric-value {
    color: white;
}

.bbai-metric-card--highlight svg {
    color: white;
}

.bbai-metric-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.bbai-metric-label {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.bbai-metric-card--highlight .bbai-metric-label {
    color: rgba(255, 255, 255, 0.95);
}

.bbai-metric-header svg {
    color: #9ca3af;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.bbai-metric-value {
    font-size: 36px;
    font-weight: 700;
    color: #111827;
    line-height: 1.1;
    margin-bottom: 12px;
    letter-spacing: -0.03em;
}

.bbai-metric-description {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
}

.bbai-optimization-main-card {
    margin-bottom: 0;
}

/* Responsive Metrics Grid */
@media (max-width: 768px) {
    .bbai-metrics-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .bbai-dashboard-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

.bbai-dashboard-sidebar {
    position: sticky;
    top: 24px;
    height: fit-content;
}

/* Circular Progress Usage Card - Cleaner design */
.bbai-usage-card-circular {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    margin-bottom: 0;
    border: 1px solid #f3f4f6;
    transition: all 0.2s ease;
}

.bbai-usage-card-circular:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #e5e7eb;
}

.bbai-usage-circular-container {
    display: flex;
    align-items: center;
    gap: 40px;
}

/* Circular Progress Ring */
.bbai-circular-progress {
    position: relative;
    width: 180px;
    height: 180px;
    flex-shrink: 0;
}

.bbai-circular-progress-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.bbai-circular-progress-bg {
    fill: none;
    stroke: #f3f4f6;
    stroke-width: 12;
}

.bbai-circular-progress-bar {
    fill: none;
    stroke: #9b5cff;
    stroke-width: 12;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.bbai-circular-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.bbai-circular-progress-percent {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    line-height: 1;
    letter-spacing: -0.02em;
}

.bbai-circular-progress-label {
    font-size: 11px;
    color: #6b7280;
    margin-top: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Usage Details - Better spacing */
.bbai-usage-circular-details {
    flex: 1;
}

.bbai-usage-circular-title {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 8px;
    line-height: 1.4;
}

.bbai-usage-circular-title strong {
    font-weight: 600;
}

.bbai-usage-circular-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 24px;
    line-height: 1.6;
}

.bbai-usage-circular-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.bbai-usage-stat-number {
    font-weight: 700;
    font-size: 16px;
    color: #111827;
}

.bbai-usage-stat-text {
    color: #6b7280;
    font-size: 14px;
}

.bbai-usage-stat-separator {
    color: #d1d5db;
    font-size: 14px;
}

.bbai-usage-circular-link {
    margin-top: 0;
}

.bbai-upgrade-link {
    color: #8b5cf6;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: color 0.2s ease;
}

.bbai-upgrade-link:hover {
    color: #7c3aed;
    text-decoration: underline;
}

/* Pro Upsell Card (Right Sidebar) - Cleaner design */
.bbai-pro-upsell-card {
    background: linear-gradient(135deg, #0ea5e9 0%, #0891b2 100%);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
}

.bbai-pro-upsell-card:hover {
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.25);
    transform: translateY(-2px);
}

.bbai-pro-upsell-header {
    margin-bottom: 28px;
}

.bbai-pro-upsell-title {
    font-size: 22px;
    font-weight: 700;
    color: white;
    line-height: 1.3;
    margin: 0;
    letter-spacing: -0.02em;
}

.bbai-pro-upsell-features {
    list-style: none;
    padding: 0;
    margin: 0 0 32px 0;
}

.bbai-pro-upsell-features li {
    display: flex;
    align-items: start;
    gap: 14px;
    padding: 10px 0;
    color: white;
    font-size: 15px;
    line-height: 1.6;
}

.bbai-pro-upsell-features li:first-child {
    padding-top: 0;
}

.bbai-pro-upsell-features li:last-child {
    padding-bottom: 0;
}

.bbai-feature-check {
    flex-shrink: 0;
    margin-top: 3px;
}

.bbai-btn-block {
    width: 100%;
    justify-content: center;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.bbai-btn-block:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Section Upsell Text */
.bbai-section-upsell {
    margin-top: 8px;
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
    line-height: 1.5;
}

/* CTA Upsell Link */
.bbai-cta-upsell {
    margin-top: 12px;
    text-align: center;
}

.bbai-upgrade-link {
    color: #0891b2;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.bbai-upgrade-link:hover {
    color: #0e7490;
    text-decoration: underline;
}

/* Testimonials Grid */
.bbai-testimonials-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-top: 28px;
    margin-bottom: 40px;
}

/* Testimonial Block */
.bbai-testimonials-grid {
    gap: 28px;
    margin-top: 32px;
    margin-bottom: 32px;
}

.bbai-testimonial-block {
    background: #FEFCE8;
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease;
}

.bbai-testimonial-block:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.bbai-testimonial-stars {
    font-size: 18px;
    margin-bottom: 16px;
    letter-spacing: 1px;
    color: #fbbf24;
    line-height: 1.2;
}

.bbai-testimonial-quote {
    font-size: 16px;
    font-weight: 500;
    color: #111827;
    line-height: 1.6;
    margin: 0 0 12px 0;
    font-style: normal;
}

.bbai-testimonial-author-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}

.bbai-testimonial-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #7B61FF;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.bbai-testimonial-author {
    font-size: 14px;
    color: #677388;
    font-style: normal;
    font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .bbai-dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .bbai-dashboard-sidebar {
        position: static;
    }
    
    .bbai-pro-upsell-card {
        max-width: 600px;
        margin: 0 auto;
    }
}

@media (max-width: 640px) {
    .bbai-usage-circular-container {
        flex-direction: column;
        text-align: center;
    }
    
    .bbai-circular-progress {
        margin: 0 auto;
    }
    
    .bbai-usage-circular-stats {
        justify-content: center;
    }
}

/* Add gradient definition for circular progress */
.bbai-circular-progress-svg defs {
    display: none;
}

/* Inject gradient via inline SVG */


/* ========================================
   ALT LIBRARY - TWO COLUMN LAYOUT & MODERN TABLE
   ======================================== */

/* Library Grid Layout */
.bbai-library-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
}

.bbai-library-main {
    min-width: 0;
}

.bbai-library-sidebar {
    position: relative;
}

/* Search Wrapper */
.bbai-search-wrapper {
    position: relative;
}

/* Filter Buttons */
.bbai-filter-btn:hover {
    background: #f9fafb !important;
    border-color: #d1d5db !important;
}

.bbai-filter-btn.active {
    background: #eff6ff !important;
    border-color: #3b82f6 !important;
    color: #1e40af !important;
}

/* Library Table Hover States */
.bbai-library-row {
    transition: background-color 0.2s ease;
}

/* Responsive Layout */
@media (max-width: 1200px) {
    .bbai-library-grid {
        grid-template-columns: 1fr;
    }
    
    .bbai-library-sidebar {
        position: static;
    }
    
    .bbai-pro-upsell-card {
        max-width: 600px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .bbai-library-controls {
        flex-direction: column;
    }
    
    .bbai-search-wrapper {
        min-width: 100%;
    }
    
    .bbai-filters {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .bbai-filter-btn {
        flex: 1 1 calc(50% - 4px);
        min-width: 140px;
    }
    
    /* Stack table cells on mobile */
    .bbai-library-table {
        font-size: 13px;
    }
    
    .bbai-library-table th,
    .bbai-library-table td {
        padding: 10px 12px !important;
    }
}

@media (max-width: 640px) {
    .bbai-library-stats {
        font-size: 13px !important;
    }
    
    .bbai-filter-btn {
        font-size: 13px !important;
        padding: 7px 12px !important;
    }
}

/* ========================================
   PRODUCTION DASHBOARD POLISH
   ======================================== */

/* Dashboard Container Improvements */
.bbai-dashboard-shell {
    max-width: var(--bbai-dashboard-max-width) !important;
    margin: 0 auto !important;
    padding: 0 24px 40px !important;
}

/* Dashboard Header Spacing */
.bbai-dashboard-container > div[style*="text-align: center"] {
    padding: 24px 0 32px !important;
}

/* Consistent H1 Typography Across All Tabs */
.bbai-dashboard-container h1,
.bbai-guide-container h1,
.bbai-settings-container h1,
.bbai-container h1,
.bbai-container > div[style*="text-align: center"] h1 {
    font-size: 2rem !important; /* 32px */
    font-weight: 700 !important;
    color: #111827 !important;
    margin: 0 0 12px 0 !important;
    letter-spacing: -0.02em !important;
    line-height: 1.2 !important;
    font-family: var(--bbai-font-family, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif) !important;
}

.bbai-dashboard-container > div[style*="text-align: center"] p {
    font-size: 16px !important;
    color: #6b7280 !important;
    margin: 0 !important;
    line-height: 1.5 !important;
}

/* Usage Card Polish */
.bbai-usage-card-circular {
    background: white !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 16px !important;
    padding: 32px !important;
    box-shadow: var(--bbai-card-shadow) !important;
    transition: box-shadow 0.2s ease !important;
}

.bbai-usage-card-circular:hover {
    box-shadow: var(--bbai-card-shadow-hover) !important;
}

.bbai-usage-circular-container {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 32px !important;
}

/* Circular Progress Sizing */
.bbai-circular-progress {
    position: relative !important;
    width: 160px !important;
    height: 160px !important;
    flex-shrink: 0 !important;
}

.bbai-circular-progress-svg {
    width: 100% !important;
    height: 100% !important;
    transform: rotate(-90deg) !important;
}

.bbai-circular-progress-text {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
}

.bbai-circular-progress-percent {
    font-size: 36px !important;
    font-weight: 700 !important;
    color: #111827 !important;
    line-height: 1 !important;
    margin-bottom: 4px !important;
}

.bbai-circular-progress-label {
    font-size: 13px !important;
    color: #6b7280 !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
}

/* Usage Details */
.bbai-usage-circular-details {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
}

.bbai-usage-circular-title strong {
    font-size: 20px !important;
    font-weight: 600 !important;
    color: #111827 !important;
    display: block !important;
}

.bbai-usage-circular-subtitle {
    font-size: 14px !important;
    color: #6b7280 !important;
    line-height: 1.5 !important;
}

.bbai-usage-circular-stats {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    margin-top: 4px !important;
}

.bbai-usage-stat-number {
    font-size: 24px !important;
    font-weight: 700 !important;
    color: #111827 !important;
}

.bbai-usage-stat-text {
    font-size: 14px !important;
    color: #6b7280 !important;
}

.bbai-usage-stat-separator {
    color: #d1d5db !important;
    font-size: 14px !important;
}

.bbai-upgrade-link {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #8b5cf6 !important;
    text-decoration: none !important;
    transition: color 0.2s ease !important;
}

.bbai-upgrade-link:hover {
    color: #7c3aed !important;
}

/* Info Notice Polish */
.bbai-info-notice {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%) !important;
    border-left: 4px solid #0ea5e9 !important;
    padding: 20px !important;
    border-radius: 12px !important;
    margin-bottom: 24px !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 16px !important;
    box-shadow: var(--bbai-card-shadow) !important;
}

.bbai-info-notice strong {
    color: #0c4a6e !important;
    display: block !important;
    margin-bottom: 6px !important;
    font-size: 15px !important;
}

.bbai-info-notice p {
    color: #075985 !important;
    margin: 0 !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
}

/* Time Saved Card */
.bbai-time-saved-card {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%) !important;
    border: 1px solid #10b981 !important;
    border-radius: 12px !important;
    padding: 28px !important;
    margin-bottom: 24px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

.bbai-time-saved-badge {
    display: inline-block !important;
    padding: 6px 12px !important;
    background: #10b981 !important;
    color: white !important;
    border-radius: 20px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    margin-bottom: 16px !important;
}

/* Image Optimization Card */
.bbai-optimization-card {
    background: white !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 12px !important;
    padding: 28px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    transition: box-shadow 0.2s ease !important;
}

.bbai-optimization-card:hover {
    box-shadow: var(--bbai-card-shadow-hover) !important;
}

.bbai-optimization-badge {
    display: inline-block !important;
    padding: 6px 12px !important;
    background: #dbeafe !important;
    color: #1e40af !important;
    border-radius: 20px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    margin-bottom: 16px !important;
}

/* Progress Bar Polish - Note: .bbai-optimization-progress is the container, not the bar */
.bbai-optimization-progress-bar {
    height: 6px !important;
    background: #f3f4f6 !important;
    border-radius: 999px !important;
    overflow: hidden !important;
    margin: 20px 0 !important;
}

.bbai-optimization-progress-bar .bbai-optimization-progress-fill {
    height: 100% !important;
    background: linear-gradient(90deg, #8b5cf6 0%, #a855f7 100%) !important;
    border-radius: 999px !important;
    transition: width 0.3s ease !important;
}

/* Stats Row Polish */
.bbai-optimization-stats {
    display: flex !important;
    justify-content: space-between !important;
    margin-top: 16px !important;
}

.bbai-optimization-stat {
    text-align: center !important;
}

.bbai-optimization-stat-label {
    font-size: 12px !important;
    color: #6b7280 !important;
    margin-bottom: 4px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    font-weight: 600 !important;
}

.bbai-optimization-stat-value {
    font-size: 24px !important;
    font-weight: 700 !important;
    color: #111827 !important;
}

/* Bottom Action Buttons */
.bbai-dashboard-actions {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    margin-top: 32px !important;
    align-items: center !important;
}

.bbai-btn-generate-primary {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 16px 32px !important;
    background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 12px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3) !important;
    min-width: 300px !important;
}

.bbai-btn-generate-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4) !important;
}

.bbai-btn-generate-primary:active {
    transform: translateY(0) !important;
}

.bbai-btn-regenerate-secondary {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 12px 24px !important;
    background: white !important;
    color: #6b7280 !important;
    border: 1px solid #d1d5db !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.bbai-btn-regenerate-secondary:hover {
    background: #f9fafb !important;
    border-color: #9ca3af !important;
    color: #374151 !important;
}

/* Dashboard Layout - Full width cards */
.bbai-dashboard-main {
    display: block !important;
}

/* All cards full width with consistent spacing */
.bbai-usage-card-circular,
.bbai-info-notice,
.bbai-time-saved-card,
.bbai-dashboard-card {
    margin-bottom: 32px !important;
    width: 100% !important;
}

@media (max-width: 768px) {
    .bbai-usage-circular-container {
        flex-direction: column !important;
        text-align: center !important;
    }

    .bbai-usage-circular-stats {
        justify-content: center !important;
    }

    .bbai-dashboard-shell {
        padding: 0 16px 24px !important;
    }

    .bbai-btn-generate-primary {
        min-width: 100% !important;
    }
}

/* ============================================
   PREMIUM DASHBOARD DESIGN
   ============================================ */

/* Header Account Bar - Polished Design */
.bbai-header-account-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 6px 6px 14px;
    background: #374151;
    border-radius: 24px;
    font-size: 13px;
    white-space: nowrap;
}

.bbai-header-account-email {
    color: #ffffff;
    font-weight: 500;
    font-size: 13px;
    margin-right: 2px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bbai-header-plan-badge {
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.4;
}

.bbai-header-signup-btn,
.bbai-header-upgrade-btn,
.bbai-header-manage-btn {
    padding: 6px 14px;
    background: #10B981;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.bbai-header-signup-btn:hover,
.bbai-header-upgrade-btn:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.bbai-header-manage-btn {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.bbai-header-manage-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.bbai-header-disconnect-btn {
    padding: 6px 14px;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.bbai-header-disconnect-btn:hover {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.05);
}

/* Premium Dashboard Container */
.bbai-premium-dashboard {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px 48px;
    background: #F8F9FB;
    min-height: 100vh;
}

/* Dashboard Header Section */
.bbai-dashboard-header-section {
    text-align: center;
    padding: 12px 0 32px;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.06);
    margin-bottom: 24px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.5), transparent);
}

.bbai-dashboard-title {
    font-size: 32px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 12px 0;
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-align: center;
}

.bbai-dashboard-subtitle {
    font-size: 16px;
    color: #677388;
    margin: 0;
    line-height: 1.5;
    text-align: center;
}

/* Premium Cards - Glassmorphism */
.bbai-premium-card {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #EAECF0;
    backdrop-filter: blur(12px);
    padding: 32px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.bbai-premium-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* Premium Stats Grid - 50/50 layout for usage + upsell cards */
.bbai-premium-stats-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 24px;
    margin-bottom: 24px;
    align-items: stretch !important;
    position: relative;
    z-index: 1;
}

.bbai-premium-stats-grid > * {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-width: 0;
    align-self: stretch !important;
}

.bbai-premium-stats-grid > .bbai-premium-card {
    flex: 1 1 0;
    min-width: 0;
    max-width: 50%;
    display: flex;
    flex-direction: column;
    align-self: stretch !important;
    height: 100%;
}

/* When both cards present, ensure equal widths */
.bbai-premium-stats-grid > .bbai-usage-card,
.bbai-premium-stats-grid > .bbai-upsell-card {
    flex-basis: calc(50% - 12px);
}

.bbai-premium-stats-grid--single {
    /* When upgrade card is hidden, usage card becomes full width via .bbai-premium-stats-grid--single > .bbai-premium-card rule below */
}

.bbai-premium-stats-grid--single > .bbai-premium-card {
    max-width: 100%;
}

.bbai-usage-card--full-width {
    flex: 1 1 100% !important;
    max-width: 100% !important;
}

/* Usage Card */
.bbai-usage-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 24px;
    padding: 32px;
    flex: 1 1 auto;
    justify-content: space-between;
    position: relative;
    align-self: stretch !important;
    height: 100% !important;
}

.bbai-usage-plan-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.4;
}

.bbai-usage-plan-badge--free {
    background: #f3f4f6;
    color: #6b7280;
}

.bbai-usage-plan-badge--pro {
    background: #dbeafe;
    color: #1e40af;
}

.bbai-usage-plan-badge--agency {
    background: #f3e8ff;
    color: #7c3aed;
}

.bbai-usage-card-title {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 20px 0;
}

.bbai-usage-ring-wrapper {
    position: relative;
    display: inline-block;
}

.bbai-usage-tooltip {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    color: #6b7280;
    transition: all 0.2s ease;
    padding: 0;
}

.bbai-usage-tooltip:hover {
    background: #e5e7eb;
    color: #374151;
}

.bbai-usage-tooltip svg {
    width: 14px;
    height: 14px;
}

.bbai-usage-upgrade-link,
.bbai-usage-billing-link {
    display: inline-block;
    margin-top: 16px;
    font-size: 14px;
    color: #7B61FF;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
    padding-top: 4px;
}

.bbai-usage-upgrade-link:hover,
.bbai-usage-billing-link:hover {
    color: #6B4FE8;
    text-decoration: underline;
}

.bbai-usage-details {
    flex: 1;
}

.bbai-usage-text {
    font-size: 15px;
    color: #111827;
    margin-bottom: 8px;
    line-height: 1.5;
    font-weight: 500;
}

.bbai-usage-text strong {
    font-weight: 600;
    color: #111827;
}

.bbai-usage-microcopy {
    font-size: 13px;
    color: #677388;
    margin-top: 4px;
}

/* Circular Progress Refinements */
.bbai-circular-progress {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto;
}

.bbai-circular-progress-svg {
    width: 100%;
    height: 100%;
}

.bbai-circular-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.bbai-circular-progress-percent {
    font-size: 44px;
    font-weight: 700;
    color: #111827;
    line-height: 1;
}

.bbai-circular-progress-label {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 6px;
    font-weight: 400;
}

/* Premium Upsell Card */
.bbai-upsell-card {
    background: linear-gradient(180deg, #4f8dfc 0%, #6aa8ff 100%);
    color: white !important;
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
    border-radius: 14px;
    position: relative;
    border: none;
    z-index: 1;
    overflow: hidden;
    flex: 1 1 auto;
    align-self: stretch !important;
    height: 100% !important;
}

/* Force all text in upgrade card to be white */
.bbai-upsell-card *:not(svg):not(path):not(circle) {
    color: white !important;
}

.bbai-upsell-title {
    font-size: 24px;
    font-weight: 700;
    color: white !important;
    margin: 0 0 24px 0;
    line-height: 1.3;
}

.bbai-upsell-features {
    list-style: none;
    padding: 0;
    margin: 0 0 32px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bbai-upsell-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.95) !important;
    line-height: 1.5;
}

.bbai-upsell-cta {
    width: 100%;
    height: 48px;
    padding: 0 24px;
    background: #0EAD4B;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(14, 173, 75, 0.4), 0 0 20px rgba(14, 173, 75, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bbai-upsell-cta--large {
    height: 56px;
    font-size: 18px;
    font-weight: 700;
    padding: 0 32px;
}

.bbai-upsell-cta:hover {
    background: #0D9D42;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(14, 173, 75, 0.5), 0 0 24px rgba(14, 173, 75, 0.3);
}

.bbai-upsell-microcopy {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    margin: 20px 0 0 0;
    text-align: center;
    position: relative;
    z-index: 1;
    padding-top: 4px;
}

/* Premium Metrics Grid */
.bbai-premium-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 32px;
    margin-bottom: 32px;
    position: relative;
    z-index: 1;
}

.bbai-metric-card {
    text-align: center;
    padding: 36px 28px;
}

.bbai-metric-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
    color: #677388;
    opacity: 0.6;
}

.bbai-metric-icon svg {
    width: 22px;
    height: 22px;
}

.bbai-metric-value {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
    line-height: 1.2;
}

.bbai-metric-label {
    font-size: 12px;
    font-weight: 600;
    color: #677388;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bbai-metric-description {
    font-size: 13px;
    color: #677388;
    margin-top: 4px;
    font-style: italic;
}

/* Info Notice */
.bbai-info-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    margin-bottom: 30px;
    background: rgba(59, 130, 246, 0.05);
    border-left: 4px solid #3B82F6;
    border-top: 1px solid rgba(59, 130, 246, 0.15);
    border-right: 1px solid rgba(59, 130, 246, 0.15);
    border-bottom: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
}

.bbai-info-notice svg {
    flex-shrink: 0;
    color: #3B82F6;
}

.bbai-info-notice span {
    font-size: 14px;
    color: #677388;
    line-height: 1.6;
}

/* Optimization Card */
.bbai-optimization-card {
    padding-top: 24px;
    padding-bottom: 20px;
    padding-left: 24px;
    padding-right: 24px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.bbai-optimization-card--complete {
    border-left: 6px solid #0EAD4B;
}

.bbai-optimization-accent-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    background: #0EAD4B;
}

.bbai-optimization-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.bbai-optimization-success-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #0EAD4B;
    border-radius: 6px;
    flex-shrink: 0;
}

.bbai-optimization-success-chip svg {
    width: 16px;
    height: 16px;
}

.bbai-optimization-title {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bbai-optimization-check-icon {
    color: #0EAD4B;
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    display: inline-block;
}

.bbai-optimization-card--complete {
    box-shadow: 0 0 0 1px rgba(14, 173, 75, 0.1), 0 4px 12px rgba(0, 0, 0, 0.04);
}

.bbai-optimization-progress {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
}

.bbai-optimization-progress-bar {
    width: 100%;
    height: 10px;
    background: #f3f4f6;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 16px;
}

.bbai-optimization-progress-fill {
    height: 100%;
    background: #9b5cff;
    border-radius: 5px;
    transition: width 0.3s ease;
    box-shadow: 0 2px 4px rgba(155, 92, 255, 0.2);
}

.bbai-optimization-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.bbai-optimization-stat {
    text-align: center;
}

.bbai-optimization-stat-label {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.bbai-optimization-stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #111827;
}

.bbai-optimization-actions {
    display: flex !important;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
    visibility: visible !important;
    opacity: 1 !important;
}

.bbai-optimization-cta {
    flex: 1;
    min-width: 200px;
    height: 48px;
    padding: 0 24px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    visibility: visible !important;
    opacity: 1 !important;
}

.bbai-optimization-cta--primary {
    background: linear-gradient(135deg, #9b5cff 0%, #7c3aed 100%);
    box-shadow: 0 2px 8px rgba(155, 92, 255, 0.3);
}

.bbai-optimization-cta--primary:hover:not(:disabled):not(.bbai-optimization-cta--locked) {
    background: linear-gradient(135deg, #8b4cff 0%, #6d2aed 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(155, 92, 255, 0.4);
}

.bbai-optimization-cta--secondary {
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
    box-shadow: none;
}

.bbai-optimization-cta--secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.bbai-optimization-cta:active:not(:disabled) {
    transform: translateY(0);
}

.bbai-optimization-cta--locked,
.bbai-optimization-cta:disabled {
    opacity: 0.72;
    cursor: not-allowed;
    transform: none;
    background: #e5e7eb !important;
    background-image: none !important;
    box-shadow: none !important;
    color: #6b7280 !important;
    border: 1px solid #d1d5db !important;
}

.bbai-optimization-cta--locked:hover,
.bbai-optimization-cta:disabled:hover {
    transform: none;
    box-shadow: none !important;
    background: #e5e7eb !important;
    background-image: none !important;
    opacity: 0.72;
}

.bbai-optimization-cta--locked .bbai-btn-icon,
.bbai-optimization-cta:disabled .bbai-btn-icon {
    opacity: 0.6;
}

@media (max-width: 640px) {
    .bbai-optimization-actions {
        flex-direction: column;
    }
    
    .bbai-optimization-cta {
        width: 100%;
        min-width: auto;
    }
}

.bbai-optimization-empty {
    text-align: center;
    padding: 40px 20px;
}

.bbai-optimization-empty p {
    font-size: 15px;
    color: #6b7280;
    margin-bottom: 20px;
}

/* Footer CTA */
.bbai-premium-footer-cta {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(168, 85, 247, 0.12) 100%);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    padding: 20px 24px;
    margin: 30px 0 16px;
    text-align: center;
    transition: all 0.3s ease;
}

.bbai-premium-footer-cta:hover {
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
    transform: translateY(-1px);
}

.bbai-footer-cta-text {
    font-size: 14px;
    color: #374151;
    margin: 0;
    line-height: 1.6;
}

.bbai-footer-cta-link {
    color: #7B61FF;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
}

.bbai-footer-cta-link:hover {
    color: #6B4FE8;
    background: rgba(123, 97, 255, 0.1);
    text-decoration: none;
}

.bbai-footer-cta-link--coming-soon {
    cursor: default;
    opacity: 0.7;
}

.bbai-footer-cta-link--coming-soon:hover {
    background: transparent;
    color: #7B61FF;
}

.bbai-footer-cta-badge-coming-soon {
    font-size: 11px;
    color: #677388;
    background: rgba(103, 115, 136, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-left: 6px;
}

.bbai-footer-cta-badge-new {
    font-size: 10px;
    color: #ffffff;
    background: #10B981;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-left: 6px;
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.3);
}

.bbai-footer-cta-icon {
    display: inline-block;
    font-size: 16px;
    line-height: 1;
}

.bbai-footer-cta-badge {
    font-size: 13px;
    color: #677388;
    margin-left: 8px;
}

/* Footer Divider */
.bbai-premium-footer-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 30px 0 20px 0;
}

/* Footer Branding */
.bbai-premium-footer-branding {
    text-align: center;
    padding: 16px 0;
    font-size: 13px;
    color: #677388;
}

.bbai-premium-footer-branding strong {
    color: #677388;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 780px) {
    .bbai-premium-stats-grid {
        flex-direction: column;
    }

    .bbai-premium-stats-grid > .bbai-premium-card {
        max-width: 100%;
        flex-basis: auto;
    }
    
    .bbai-premium-metrics-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .bbai-optimization-stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .bbai-usage-card {
        flex-direction: column;
        text-align: center;
    }
    
    .bbai-header-content {
        flex-wrap: wrap;
        gap: 16px;
    }

    .bbai-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 4px;
    }

    .bbai-header-account-bar {
        order: 2;
        flex-wrap: wrap;
        justify-content: center;
        padding: 8px 12px;
        gap: 8px;
    }

    .bbai-header-account-email {
        font-size: 12px;
    }

    .bbai-header-signup-btn,
    .bbai-header-upgrade-btn,
    .bbai-header-manage-btn,
    .bbai-header-disconnect-btn {
        padding: 5px 10px;
        font-size: 11px;
    }
    
    .bbai-dashboard-title {
        font-size: 28px;
    }
    
    .bbai-dashboard-subtitle {
        font-size: 15px;
    }
    
    .bbai-testimonials-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .bbai-countdown {
        gap: 16px;
    }
    
    .bbai-guide-grid {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }
    
    .bbai-countdown-item {
        min-width: 60px;
    }
    
    .bbai-countdown-number {
        font-size: 24px;
    }
}

/* Guide Container Styling */
.bbai-guide-container {
    max-width: 900px !important;
    margin: 0 auto;
    padding: 0 24px 48px;
}

/* Ensure guide styles apply even when combined with dashboard-container */
.bbai-dashboard-container.bbai-guide-container {
    max-width: 900px !important;
}

@media (max-width: 768px) {
    .bbai-guide-container {
        padding: 0 16px 32px;
    }
}

/* ============================================
   DEBUG LOGS REDESIGN
   ============================================ */

/* Stats Card */
.bbai-debug-stats-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.bbai-debug-stats-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.bbai-debug-stats-title h3 {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 4px 0;
}

.bbai-debug-stats-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.bbai-debug-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 24px;
    border-top: 1px solid #f3f4f6;
    padding-top: 24px;
}

.bbai-debug-stat-item {
    display: flex;
    flex-direction: column;
}

.bbai-debug-stat-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.bbai-debug-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}

.bbai-debug-stat-value--warning {
    color: #f59e0b;
}

.bbai-debug-stat-value--error {
    color: #ef4444;
}

.bbai-debug-stat-value--small {
    font-size: 16px;
    font-weight: 600;
}

/* Filter Card */
.bbai-debug-filters-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.bbai-debug-filters-form {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.bbai-debug-filter-group {
    flex: 1;
    min-width: 150px;
}

.bbai-debug-filter-group--search {
    flex: 2;
    min-width: 200px;
}

.bbai-debug-filter-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.bbai-debug-filter-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #6b7280;
}

.bbai-debug-filter-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.bbai-debug-filter-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.bbai-debug-filter-actions {
    display: flex;
    gap: 8px;
}

/* Debug Buttons */
.bbai-debug-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.bbai-debug-btn--primary {
    background: #3b82f6;
    color: white;
}

.bbai-debug-btn--primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.bbai-debug-btn--secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.bbai-debug-btn--secondary:hover:not(:disabled) {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.bbai-debug-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bbai-debug-btn--upsell {
    margin-top: 20px;
    padding: 12px 24px;
    font-size: 15px;
}

/* Table Card */
.bbai-debug-table-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.bbai-debug-table {
    width: 100%;
    border-collapse: collapse;
}

.bbai-debug-table thead {
    background: #f9fafb;
}

.bbai-debug-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e5e7eb;
}

.bbai-debug-table-row {
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s;
}

.bbai-debug-table-row:nth-child(even) {
    background: #fafbfc;
}

.bbai-debug-table-row:hover {
    background: #f9fafb;
}

.bbai-debug-table-cell {
    padding: 10px 16px;
    font-size: 13px;
    color: #374151;
}

.bbai-debug-table-cell--timestamp {
    color: #6b7280;
    white-space: nowrap;
}

.bbai-debug-table-cell--message {
    color: #111827;
    max-width: 500px;
    word-break: break-word;
}

.bbai-debug-table-empty {
    text-align: center;
    padding: 60px 24px;
    color: #6b7280;
    font-size: 14px;
}

/* Debug Badge */
.bbai-debug-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.bbai-debug-badge-icon {
    font-size: 14px;
    line-height: 1;
}

.bbai-debug-badge-text {
    line-height: 1.4;
}

/* Context Toggle */
.bbai-debug-context-toggle {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.15s;
}

.bbai-debug-context-toggle:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.bbai-debug-context-toggle.is-expanded {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.bbai-debug-context-empty {
    color: #9ca3af;
    font-size: 13px;
    font-style: italic;
}

/* Context Row (Inline) */
.bbai-debug-context-row {
    background: #fafbfc;
}

.bbai-debug-context-cell {
    padding: 0;
}

.bbai-debug-context-content {
    padding: 16px;
    background: #1f2937;
    border-radius: 6px;
    margin: 8px 16px;
}

.bbai-debug-context-json {
    margin: 0;
    padding: 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
    font-size: 12px;
    line-height: 1.6;
    color: #e5e7eb;
    background: transparent;
    border: none;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

.bbai-debug-context-json::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.bbai-debug-context-json::-webkit-scrollbar-track {
    background: #111827;
    border-radius: 4px;
}

.bbai-debug-context-json::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 4px;
}

.bbai-debug-context-json::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}

/* Upsell Card */
.bbai-debug-upsell-card {
    background: linear-gradient(135deg, #f0f9ff 0%, #dbeafe 100%);
    border-radius: 10px;
    padding: 32px;
    text-align: center;
    margin-bottom: 24px;
    border: 1px solid #bfdbfe;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.bbai-debug-upsell-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e40af;
    margin: 0 0 20px;
}

.bbai-debug-upsell-features {
    list-style: none;
    padding: 0;
    margin: 0 0 0;
    display: inline-block;
    text-align: left;
}

.bbai-debug-upsell-features li {
    font-size: 14px;
    color: #1e40af;
    margin-bottom: 10px;
    padding-left: 24px;
    position: relative;
}

.bbai-debug-upsell-features li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: 700;
}

.bbai-debug-upsell-btn {
    margin-top: 32px;
    padding: 12px 24px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.bbai-debug-upsell-btn:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

/* Pagination */
.bbai-debug-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.bbai-debug-pagination-info {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .bbai-debug-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .bbai-debug-filters-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .bbai-debug-filter-group {
        min-width: 100%;
    }
    
    .bbai-debug-filter-actions {
        width: 100%;
        justify-content: stretch;
    }
    
    .bbai-debug-filter-actions .bbai-debug-btn {
        flex: 1;
    }
    
    .bbai-debug-pagination {
        flex-direction: column;
        gap: 16px;
    }
    
    .bbai-debug-pagination-info {
        order: -1;
    }
}

@media (max-width: 480px) {
    .bbai-debug-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   SETTINGS PAGE REDESIGN - 2025 Design System
   ============================================ */

/* Settings Page Container */
.bbai-settings-page {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px;
    background: #F9FAFB;
}

/* Page Header */
.bbai-settings-page-header {
    text-align: center;
    padding: 0 0 40px;
}

.bbai-settings-page-title {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 12px 0;
    line-height: 1.2;
}

.bbai-settings-page-subtitle {
    font-size: 16px;
    color: #6B7280;
    margin: 0;
    line-height: 1.5;
}

/* Site-Wide Settings Banner */
.bbai-settings-sitewide-banner {
    background: #F0F7FF;
    border: 1px solid #D0E7FF;
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 40px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.bbai-settings-sitewide-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.bbai-settings-sitewide-content {
    flex: 1;
}

.bbai-settings-sitewide-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1e40af;
    margin-bottom: 4px;
}

.bbai-settings-sitewide-text {
    font-size: 13px;
    color: #1e40af;
    line-height: 1.5;
}

/* Plan Summary Card */
.bbai-settings-plan-summary-card {
    background: #FFFFFF;
    border-radius: 14px;
    border: 1px solid #EAECF0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
    padding: 28px;
    margin-bottom: 40px;
    position: relative;
}

.bbai-settings-plan-badge-top {
    position: absolute;
    top: 20px;
    left: 20px;
}

.bbai-settings-plan-badge-text {
    display: inline-block;
    padding: 4px 12px;
    background: #F3F4F6;
    color: #6B7280;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bbai-settings-plan-quota {
    margin: 60px 0 24px;
    text-align: center;
}

.bbai-settings-plan-quota-meter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 32px;
    font-weight: 700;
    color: #111827;
}

.bbai-settings-plan-quota-used,
.bbai-settings-plan-quota-limit {
    display: inline-block;
}

.bbai-settings-plan-quota-divider {
    color: #9CA3AF;
    font-weight: 300;
}

.bbai-settings-plan-quota-label {
    font-size: 14px;
    color: #6B7280;
    margin-top: 8px;
    font-weight: 500;
}

.bbai-settings-plan-info {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #EAECF0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bbai-settings-plan-info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #374151;
    line-height: 1.5;
}

.bbai-settings-plan-info-item svg {
    flex-shrink: 0;
    color: #6B7280;
}

.bbai-settings-plan-info-item span {
    flex: 1;
}

.bbai-settings-plan-info-item strong {
    font-weight: 600;
    color: #111827;
}

.bbai-settings-plan-upgrade-btn-large {
    width: 100%;
    height: 48px;
    background: #22C55E;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bbai-settings-plan-upgrade-btn-large:hover {
    background: #16a34a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

/* Account Management Card */
.bbai-settings-card {
    background: #FFFFFF;
    border-radius: 14px;
    border: 1px solid #EAECF0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
    padding: 28px;
    margin-bottom: 40px;
}

.bbai-settings-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.bbai-settings-card-header-icon {
    flex-shrink: 0;
}

.bbai-settings-card-icon-emoji {
    font-size: 20px;
    line-height: 1;
}

.bbai-settings-card-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.bbai-settings-account-info-banner {
    background: #EEF2FF;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #4338ca;
}

.bbai-settings-account-upgrade-link {
    text-align: center;
}

.bbai-settings-account-upgrade-btn {
    background: none;
    border: none;
    color: #2563EB;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.bbai-settings-account-upgrade-btn:hover {
    color: #1d4ed8;
}

/* License Management */
.bbai-settings-license-form {
    padding: 4px 0;
}

.bbai-settings-license-description {
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
    margin: 0 0 20px 0;
}

.bbai-settings-license-input-group {
    margin-bottom: 16px;
}

.bbai-settings-license-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
}

.bbai-settings-license-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bbai-settings-license-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.bbai-settings-license-activate-btn {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: #4f46e5;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.bbai-settings-license-activate-btn:hover {
    background: #4338ca;
}

.bbai-settings-license-activate-btn:active {
    transform: scale(0.98);
}

.bbai-settings-license-activate-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

.bbai-settings-license-active {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--bbai-space-4, 16px);
    padding: var(--bbai-space-4, 16px);
}

.bbai-settings-license-status {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.bbai-settings-license-status svg {
    flex-shrink: 0;
}

.bbai-settings-license-title {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.bbai-settings-license-subtitle {
    font-size: 13px;
    color: #64748b;
}

.bbai-settings-license-deactivate-btn {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #dc2626;
    background: #fff;
    border: 1px solid #fecaca;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bbai-settings-license-deactivate-btn:hover {
    background: #fef2f2;
    border-color: #dc2626;
}

/* Generation Settings */
.bbai-settings-generation-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 24px 0;
}

.bbai-settings-form-group {
    margin-bottom: 24px;
}

.bbai-settings-form-field--toggle {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.bbai-settings-form-field-content {
    flex: 1;
}

.bbai-settings-form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.bbai-settings-form-description {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

.bbai-settings-form-input,
.bbai-settings-form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #D1D5DB;
    border-radius: 10px;
    font-size: 14px;
    color: #374151;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}

.bbai-settings-form-input:focus,
.bbai-settings-form-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.bbai-settings-form-textarea {
    resize: vertical;
    min-height: 110px;
}

.bbai-settings-form-actions {
    margin-top: var(--bbai-space-8, 32px);
    padding-top: var(--bbai-space-6, 24px);
    border-top: 1px solid #F3F4F6;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

/* Save Settings Button - Plain Text Style */
.bbai-settings-save-btn {
    background: none !important;
    background-color: transparent !important;
    color: var(--bbai-text, #111827) !important;
    border: none !important;
    padding: 0 !important;
    font-size: var(--bbai-text-base, 14px) !important;
    font-weight: var(--bbai-font-medium, 500) !important;
    cursor: pointer;
    text-decoration: none;
    box-shadow: none !important;
    min-width: auto;
}

.bbai-settings-save-btn:hover {
    background: none !important;
    background-color: transparent !important;
    color: var(--bbai-primary, #10B981) !important;
    text-decoration: underline;
    transform: none;
    box-shadow: none !important;
}

.bbai-settings-save-btn:active {
    transform: none;
    box-shadow: none !important;
}

/* Credit Filter Clear Link - Plain Text Style (like Save Settings) */
.bbai-clear-filter-link,
.bbai-credit-filter-actions .bbai-clear-filter-link,
.bbai-credit-filter-actions a.bbai-clear-filter-link {
    display: inline !important;
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    color: var(--bbai-text, #111827) !important;
    border: none !important;
    border-color: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: var(--bbai-text-base, 14px) !important;
    font-weight: var(--bbai-font-medium, 500) !important;
    line-height: normal !important;
    cursor: pointer;
    text-decoration: none !important;
    box-shadow: none !important;
    min-width: auto !important;
    width: auto !important;
    height: auto !important;
    border-radius: 0 !important;
    transition: color 0.2s ease !important;
}

.bbai-clear-filter-link:hover,
.bbai-credit-filter-actions .bbai-clear-filter-link:hover,
.bbai-credit-filter-actions a.bbai-clear-filter-link:hover {
    display: inline !important;
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    color: var(--bbai-primary, #10B981) !important;
    border: none !important;
    border-color: transparent !important;
    text-decoration: underline !important;
    transform: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Toggle Switch - Green when ON */
.bbai-settings-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.bbai-settings-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.bbai-settings-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db;
    transition: 0.3s;
    border-radius: 24px;
}

.bbai-settings-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.bbai-settings-toggle input:checked + .bbai-settings-toggle-slider {
    background-color: #22C55E;
}

.bbai-settings-toggle input:checked + .bbai-settings-toggle-slider:before {
    transform: translateX(24px);
}

.bbai-settings-toggle input:focus + .bbai-settings-toggle-slider {
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

/* Pro Upsell Banner */
.bbai-settings-pro-upsell-banner {
    background: linear-gradient(135deg, #E8F1FF 0%, #F4F8FF 100%);
    border-radius: 14px;
    border: 1px solid #EAECF0;
    padding: 32px;
    margin-top: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.bbai-settings-pro-upsell-content {
    flex: 1;
}

.bbai-settings-pro-upsell-title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 16px 0;
}

.bbai-settings-pro-upsell-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bbai-settings-pro-upsell-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #374151;
}

.bbai-settings-pro-upsell-features li svg {
    flex-shrink: 0;
}

.bbai-settings-pro-upsell-btn {
    padding: 10px 20px;
    background: #2563EB;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.bbai-settings-pro-upsell-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .bbai-settings-page {
        margin: 20px auto;
        padding: 0 16px;
    }
    
    .bbai-settings-pro-upsell-banner {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .bbai-settings-pro-upsell-btn {
        width: 100%;
    }
}

/* ============================================
   SETTINGS PAGE REDESIGN (Legacy - Keep for compatibility)
   ============================================ */

/* Base Settings Card */
.bbai-settings-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.bbai-settings-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 24px;
}

.bbai-settings-card-header-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 2px;
}

.bbai-settings-card-header-icon svg {
    width: 100%;
    height: 100%;
}

.bbai-settings-card-header-content {
    flex: 1;
}

.bbai-settings-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 4px 0;
}

.bbai-settings-card-description {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

/* Plan Status Card */
.bbai-settings-plan-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.bbai-settings-plan-card--free {
    background: linear-gradient(135deg, #2bb8ff 0%, #0070f3 100%);
    border: none;
    color: white;
}

.bbai-settings-plan-card--pro {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    color: white;
}

.bbai-settings-plan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.bbai-settings-plan-badge {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.bbai-settings-plan-badge--free {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.bbai-settings-plan-badge--pro {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.bbai-settings-plan-renewal {
    text-align: right;
}

.bbai-settings-plan-renewal-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
    opacity: 0.9;
}

.bbai-settings-plan-renewal-date {
    display: block;
    font-size: 14px;
    font-weight: 600;
}

.bbai-settings-plan-usage {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

.bbai-settings-plan-usage-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bbai-settings-plan-usage-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
}

.bbai-settings-plan-usage-label {
    font-size: 12px;
    font-weight: 500;
    opacity: 0.9;
    margin-top: 4px;
}

.bbai-settings-plan-usage-divider {
    font-size: 24px;
    font-weight: 300;
    opacity: 0.7;
}

.bbai-settings-plan-progress {
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 24px;
}

.bbai-settings-plan-card--free .bbai-settings-plan-progress {
    background: rgba(255, 255, 255, 0.2);
}

.bbai-settings-plan-card--pro .bbai-settings-plan-progress {
    background: rgba(255, 255, 255, 0.2);
}

.bbai-settings-plan-progress-bar {
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.bbai-settings-plan-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.bbai-settings-plan-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
}

.bbai-settings-plan-feature svg {
    flex-shrink: 0;
}

.bbai-settings-plan-card--free .bbai-settings-plan-feature svg,
.bbai-settings-plan-card--pro .bbai-settings-plan-feature svg {
    color: rgba(255, 255, 255, 0.95);
}

.bbai-settings-plan-upgrade-btn {
    width: 100%;
    padding: 14px 24px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.bbai-settings-plan-upgrade-btn:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

/* Account Management */
.bbai-settings-info-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f0f9ff;
    border-left: 4px solid #0ea5e9;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #0c4a6e;
}

.bbai-settings-info-banner svg {
    flex-shrink: 0;
    color: #0ea5e9;
}

.bbai-settings-account-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #f9fafb;
    border-radius: 6px;
    margin-bottom: 20px;
}

.bbai-settings-account-status-label {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.bbai-settings-account-status-value {
    font-size: 14px;
    color: #111827;
    font-weight: 700;
}

.bbai-settings-account-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.bbai-settings-account-action-btn {
    width: 100%;
    padding: 12px 24px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.bbai-settings-account-action-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.bbai-settings-account-action-info {
    padding: 16px;
    background: #f9fafb;
    border-radius: 6px;
}

.bbai-settings-account-action-info p {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 12px 0;
    font-weight: 500;
}

.bbai-settings-account-action-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bbai-settings-account-action-info li {
    font-size: 13px;
    color: #374151;
    padding-left: 24px;
    position: relative;
}

.bbai-settings-account-action-info li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: 700;
}

/* Form Fields */
.bbai-settings-form-group {
    margin-bottom: 24px;
}

.bbai-settings-form-group:last-child {
    margin-bottom: 0;
}

.bbai-settings-form-field {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.bbai-settings-form-field--toggle {
    justify-content: space-between;
}

.bbai-settings-form-field-content {
    flex: 1;
}

.bbai-settings-form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.bbai-settings-form-description {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

.bbai-settings-form-input,
.bbai-settings-form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}

.bbai-settings-form-input:focus,
.bbai-settings-form-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.bbai-settings-form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Removed duplicate - using unified styles from line 6243 */

/* Settings Buttons */
.bbai-settings-btn {
    padding: 12px 32px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.bbai-settings-btn--primary {
    background: #14b8a6;
    color: white;
}

.bbai-settings-btn--primary:hover {
    background: #0d9488;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3);
}

/* Toggle Switch */
.bbai-settings-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.bbai-settings-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.bbai-settings-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db;
    transition: 0.3s;
    border-radius: 24px;
}

.bbai-settings-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.bbai-settings-toggle input:checked + .bbai-settings-toggle-slider {
    background-color: #14b8a6;
}

.bbai-settings-toggle input:checked + .bbai-settings-toggle-slider:before {
    transform: translateX(24px);
}

.bbai-settings-toggle input:focus + .bbai-settings-toggle-slider {
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.2);
}

/* Upsell Banner */
.bbai-settings-upsell-banner {
    background: linear-gradient(135deg, #f0f9ff 0%, #dbeafe 100%);
    border-radius: 10px;
    padding: 32px;
    text-align: center;
    margin-top: 32px;
    border: 1px solid #bfdbfe;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.bbai-settings-upsell-title {
    font-size: 20px;
    font-weight: 700;
    color: #1e40af;
    margin: 0 0 20px;
}

.bbai-settings-upsell-features {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    display: inline-block;
    text-align: left;
}

.bbai-settings-upsell-features li {
    font-size: 14px;
    color: #1e40af;
    margin-bottom: 10px;
    padding-left: 24px;
    position: relative;
}

.bbai-settings-upsell-features li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: 700;
}

.bbai-settings-upsell-btn {
    padding: 12px 32px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.bbai-settings-upsell-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .bbai-settings-plan-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .bbai-settings-plan-renewal {
        text-align: left;
    }
    
    .bbai-settings-plan-features {
        gap: 10px;
    }
    
    .bbai-settings-form-field--toggle {
        flex-direction: column;
        gap: 12px;
    }
}

/* Library Status Badges - Match Design */
.bbai-library__status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    border: 1px solid transparent;
}

.bbai-library__status--generated {
    background: #D1FAE5;
    color: #065F46;
    border-color: #A7F3D0;
}

.bbai-library__status--missing {
    background: #FEE2E2;
    color: #991B1B;
    border-color: #FECACA;
}
