/* =============================================
   COMPONENTS.CSS - Estilos unificados de componentes
   Fusión de: plans.css, plans-downgrade.css, plans-page.css,
              affiliate-role.css, campaign-detail.css, close-account.css,
              billing.css, team.css, my-organization.css, checkout.css
   ============================================= */

/* =============================================
   SECTION 1: PLANS & PRICING
   (plans.css + plans-downgrade.css + plans-page.css)
   ============================================= */

/* Plan Details Wrapper */
.plan-details-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

/* Back Button */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    padding: 6px 0;
    margin-bottom: 10px;
    transition: color 0.2s;
}

.btn-back:hover {
    color: var(--primary);
}

/* Plan Loading State */
.plan-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.plan-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

/* Pending Downgrade Banner */
.pending-downgrade-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(239, 68, 68, 0.1));
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 12px;
    margin-bottom: 24px;
}

.pending-icon {
    color: #f59e0b;
    flex-shrink: 0;
    font-size: 32px;
}

.pending-content {
    flex: 1;
}

.pending-content strong {
    display: block;
    color: #f59e0b;
    font-size: 15px;
    margin-bottom: 4px;
}

.pending-content p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

/* Pending Downgrade Notice (alternate style) */
.pending-downgrade-notice {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(251, 191, 36, 0.05));
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 8px;
    margin-bottom: 20px;
}

.pending-downgrade-notice .notice-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.pending-downgrade-notice .notice-content {
    flex: 1;
}

.pending-downgrade-notice .notice-content strong {
    color: #f59e0b;
    display: block;
    margin-bottom: 4px;
}

.pending-downgrade-notice .notice-content p {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 12px;
}

/* Plan Details Grid */
.plan-details-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 24px;
}

@media (max-width: 900px) {
    .plan-details-grid {
        grid-template-columns: 1fr;
    }
}

/* Plan Info Card */
.plan-info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    height: fit-content;
}

.plan-info-header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

/* Plan Badge */
.plan-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.plan-badge.starter,
.plan-badge.plan-starter {
    background: rgba(100, 116, 139, 0.2);
    color: var(--text-secondary);
}

.plan-badge.professional,
.plan-badge.plan-professional {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
    color: var(--primary);
}

.plan-badge.enterprise,
.plan-badge.plan-enterprise {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(239, 68, 68, 0.2));
    color: #f59e0b;
}

/* Plan Price Display */
.plan-price-display {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
}

.plan-price-display .price-amount {
    font-size: 42px;
    font-weight: 700;
    color: var(--text-primary);
}

.plan-price-display .price-period {
    font-size: 16px;
    color: var(--text-muted);
}

/* Usage Card */
.usage-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
}

.usage-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.usage-item {
    margin-bottom: 20px;
}

.usage-item:last-child {
    margin-bottom: 0;
}

.usage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.usage-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.usage-value {
    font-size: 14px;
    color: var(--text-muted);
    font-family: 'SF Mono', Monaco, monospace;
}

.usage-bar {
    height: 10px;
    background: var(--bg-dark);
    border-radius: 5px;
    overflow: hidden;
}

.usage-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 5px;
    transition: width 0.4s ease;
    min-width: 4px;
}

.usage-bar-fill.warning {
    background: linear-gradient(90deg, var(--primary), #f59e0b);
}

.usage-bar-fill.critical {
    background: linear-gradient(90deg, #f59e0b, #ef4444);
}

/* Change Plan Header */
.change-plan-header {
    text-align: center;
    margin-bottom: 40px;
}

.change-plan-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.change-plan-header p {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Plans Grid (Page) */
.plans-grid-page {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
}

@media (max-width: 900px) {
    .plans-grid-page {
        grid-template-columns: 1fr;
        max-width: 400px;
    }
}

/* Plan Option Card */
.plan-option-card {
    position: relative;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    transition: all 0.2s;
}

.plan-option-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
}

.plan-option-card.current {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.05);
}

.plan-option-card.popular {
    border-color: var(--primary);
}

.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.plan-option-header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.plan-option-header h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.plan-option-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
}

.plan-option-price .price {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary);
}

.plan-option-price .period {
    font-size: 14px;
    color: var(--text-muted);
}

.plan-option-features {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
}

.plan-option-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

/* Large Plan Card */
.plan-card-large {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
}

.plan-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

/* Downgrade Selection */
.downgrade-selection-container {
    max-height: 70vh;
    overflow-y: auto;
}

.downgrade-selection-page {
    max-width: 800px;
}

.downgrade-header {
    margin-bottom: 32px;
}

.downgrade-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.downgrade-warning {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    margin-bottom: 24px;
}

.downgrade-warning svg {
    color: #ef4444;
    flex-shrink: 0;
}

.downgrade-warning strong {
    color: #ef4444;
    display: block;
    margin-bottom: 4px;
}

.downgrade-warning p {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 0;
}

/* Resource Selection */
.resource-selection-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.resource-selection-section h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: var(--text-primary);
}

.selection-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.resource-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.resource-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.resource-item:hover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.resource-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.resource-item input[type="checkbox"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.resource-item.selected,
.resource-item:has(input:checked) {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.resource-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
}

.resource-detail,
.resource-code {
    font-size: 13px;
    color: var(--text-muted);
}

.resource-code {
    font-family: monospace;
    background: var(--bg-dark);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Selection Counter */
.selection-counter {
    margin-top: 12px;
    padding: 8px 12px;
    background: var(--bg-hover);
    border-radius: 6px;
    font-size: 13px;
}

.selection-counter.valid {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.selection-counter.valid span {
    color: var(--success);
}

.selection-counter.invalid {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.selection-counter.invalid span {
    color: var(--danger);
}

/* Downgrade Actions */
.downgrade-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

/* Button Outline Style */
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

/* Button Danger */
.btn-danger {
    background: #ef4444;
    color: white;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-danger:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-danger-outline {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

.btn-danger-outline:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: var(--text-muted);
}

.loading-state .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

/* Settings Page Styles */
.settings-page-content {
    max-width: 700px;
}

.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    margin-bottom: 24px;
    overflow: hidden;
}

.settings-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.settings-card-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.settings-card-body {
    padding: 24px;
}

/* Plan Summary (in settings modal) */
.plan-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.plan-summary-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.plan-summary-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.plan-summary-info {
    display: flex;
    flex-direction: column;
}

.plan-summary-name {
    font-weight: 600;
    font-size: 15px;
}

.plan-summary-price {
    color: var(--text-muted);
    font-size: 13px;
}

/* Responsive for Plans */
@media (max-width: 768px) {
    .plan-details-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .pending-downgrade-banner {
        flex-direction: column;
        text-align: center;
    }
    
    .pending-downgrade-banner button {
        width: 100%;
    }
    
    .plan-info-card,
    .usage-card {
        padding: 20px;
    }
    
    .plan-price-display .price-amount {
        font-size: 32px;
    }
    
    .downgrade-actions {
        flex-direction: column;
    }
    
    .downgrade-actions button {
        width: 100%;
    }
}


/* =============================================
   SECTION 2: AFFILIATE ROLE STYLES
   ============================================= */

body.is-affiliate .affiliate-hidden {
    display: none !important;
}

body.is-affiliate #plan-settings-section,
body.is-affiliate #plan-summary-card,
body.is-affiliate #org-settings-section,
body.is-affiliate #domains-settings-section,
body.is-affiliate #settings-plan-card,
body.is-affiliate #settings-org-card,
body.is-affiliate #settings-domains-card {
    display: none !important;
}

body.is-affiliate .nav-item[data-page="organizations"],
body.is-affiliate .nav-item[data-page="users"] {
    display: none !important;
}

body:not(.is-superadmin) .superadmin-only {
    display: none !important;
}

body.is-affiliate .admin-only {
    display: none !important;
}


/* =============================================
   SECTION 3: CAMPAIGN DETAIL STYLES
   ============================================= */

/* Campaign Detail Page */
.campaign-detail-page {
    padding: 0 32px 32px;
}

/* Campaign Header - Compacto */
.campaign-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 16px;
}

.campaign-header-info h1 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 6px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.campaign-status-badge {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 500;
}

.campaign-status-badge.active {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.campaign-status-badge.inactive {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.campaign-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.campaign-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--text-secondary);
}

.campaign-header-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

/* Campaign Stats Grid - Compacto */
.campaign-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.campaign-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 8px;
    text-align: center;
}

.campaign-stat-card .stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.campaign-stat-card .stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.campaign-stat-card.highlight {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
    border-color: rgba(59, 130, 246, 0.3);
}

.campaign-stat-card.highlight .stat-value {
    color: var(--primary);
}

.campaign-stat-card.earnings {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(16, 185, 129, 0.1));
    border-color: rgba(34, 197, 94, 0.3);
}

.campaign-stat-card.earnings .stat-value {
    color: var(--success);
}

/* Campaign Content Grid */
.campaign-content-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 24px;
}

@media (max-width: 1100px) {
    .campaign-content-grid {
        grid-template-columns: 1fr;
    }
}

/* Campaign Section Card */
.campaign-section-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

.campaign-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-dark);
}

.campaign-section-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.campaign-section-body {
    padding: 20px;
}

/* Tracking Info Section */
.tracking-info-section {
    margin-bottom: 20px;
}

.tracking-info-section:last-child {
    margin-bottom: 0;
}

.tracking-info-section h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Code Block */
.code-block {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    position: relative;
    margin-bottom: 12px;
}

.code-block:last-child {
    margin-bottom: 0;
}

.code-block code {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 12px;
    color: var(--text-primary);
    word-break: break-all;
    line-height: 1.5;
    display: block;
}

.code-block .code-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: block;
}

.code-block .copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s;
}

.code-block .copy-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Info Note */
.info-note {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.info-note svg {
    flex-shrink: 0;
    color: var(--primary);
    margin-top: 2px;
}

.info-note.warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.2);
}

.info-note.warning svg {
    color: #f59e0b;
}

/* Variables Table */
.variables-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.variables-table th,
.variables-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.variables-table th {
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-hover);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.variables-table td code {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 12px;
    background: var(--bg-dark);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--primary);
}

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

/* Detail Tabs */
.detail-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-dark);
    border-radius: 8px;
    margin-bottom: 16px;
}

.detail-tab {
    flex: 1;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}

.detail-tab:hover {
    color: var(--text-primary);
}

.detail-tab.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.detail-tab-content {
    display: none;
}

.detail-tab-content.active {
    display: block;
}

/* Responsive Campaign Detail */
@media (max-width: 768px) {
    .campaign-detail-header {
        flex-direction: column;
    }
    
    .campaign-header-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .campaign-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .campaign-header-info h1 {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .campaign-detail-page {
        padding: 0 16px 32px;
    }
    
    .campaign-stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .campaign-stat-card {
        padding: 16px;
    }
    
    .campaign-stat-card .stat-value {
        font-size: 22px;
    }
}


/* =============================================
   SECTION 4: CLOSE ACCOUNT STYLES
   ============================================= */

/* Close Account Warning Box */
.close-account-warning {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 10px;
    margin-bottom: 20px;
}

.close-account-warning .warning-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: rgba(239, 68, 68, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-account-warning .warning-content h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--danger);
    margin-bottom: 6px;
}

.close-account-warning .warning-content p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Close Account Modal */
.close-account-modal .modal-content {
    max-width: 480px;
}

.close-account-modal .modal-header {
    border-bottom-color: rgba(239, 68, 68, 0.2);
}

.close-account-modal .modal-header h2 {
    color: var(--danger);
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-account-steps {
    margin-bottom: 24px;
}

.close-account-step {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.close-account-step:last-child {
    border-bottom: none;
}

.step-number {
    width: 28px;
    height: 28px;
    background: var(--bg-dark);
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.step-number.active {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
}

.step-number.completed {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.step-content {
    flex: 1;
}

.step-content h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.step-content p {
    font-size: 13px;
    color: var(--text-muted);
}

/* Close Account Form */
.close-account-form .form-group {
    margin-bottom: 20px;
}

.close-account-form .form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.close-account-form .form-control {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
}

.close-account-form .form-control:focus {
    outline: none;
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* Verification Code Input */
.verification-code-input {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 20px 0;
}

.verification-code-input input,
.code-digit {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    background: var(--bg-dark);
    border: 2px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
}

.verification-code-input input:focus,
.code-digit:focus {
    outline: none;
    border-color: var(--primary);
}

/* Close Account Actions */
.close-account-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* Close Account Loading */
.close-account-loading {
    text-align: center;
    padding: 40px;
}

.close-account-loading .spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--danger);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

/* Resend Code */
.resend-code {
    text-align: center;
    margin-bottom: 20px;
}

.resend-code button {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
}

.resend-code button:not(:disabled):hover {
    color: var(--primary);
}


/* =============================================
   SECTION 5: BILLING STYLES
   ============================================= */

/* Billing Page */
.billing-page {
    max-width: 1000px;
    margin: 0 auto;
}

.billing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

@media (max-width: 900px) {
    .billing-grid {
        grid-template-columns: 1fr;
    }
}

/* Billing Card */
.billing-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

.billing-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.billing-card-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.billing-card-body {
    padding: 24px;
}

/* Payment Method Display */
.payment-method-display {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-dark);
    border-radius: 12px;
    margin-bottom: 20px;
}

.card-icon {
    width: 48px;
    height: 32px;
    background: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 11px;
    color: #1a1f36;
}

.card-details {
    flex: 1;
}

.card-number {
    font-family: monospace;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.card-expiry {
    font-size: 13px;
    color: var(--text-muted);
}

/* Subscription Info */
.subscription-info {
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.subscription-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.subscription-row label {
    font-size: 14px;
    color: var(--text-secondary);
}

.subscription-row span {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

/* Billing Address */
.billing-address {
    padding-top: 16px;
    border-top: 1px solid var(--border);
    margin-bottom: 20px;
}

.billing-address label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 8px;
}

.billing-address p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* Invoices List */
.invoices-list {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.no-invoices {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
}

.no-invoices p {
    color: var(--text-muted);
    margin: 12px 0 0;
    font-size: 14px;
}

/* Invoices Table */
.invoices-table {
    width: 100%;
    border-collapse: collapse;
}

.invoices-table th {
    text-align: left;
    padding: 14px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border);
}

.invoices-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

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

.invoices-table tr:hover {
    background: var(--bg-hover);
}

/* Invoice Number & Plan */
.invoice-number {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
}

.invoice-plan {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
}


/* =============================================
   SECTION 6: TEAM STYLES
   ============================================= */

/* Team Section */
.team-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.team-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.team-section-header h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

/* Team Info */
.team-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
}

/* Members List */
.members-list {
    background: var(--bg-dark);
    border-radius: 12px;
    overflow: hidden;
}

.member-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.member-row:last-child {
    border-bottom: none;
}

.member-row.is-current {
    background: rgba(59, 130, 246, 0.05);
}

.member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
}

.member-info {
    flex: 1;
    min-width: 0;
}

.member-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.you-badge {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

.member-email {
    font-size: 13px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-role {
    flex-shrink: 0;
}

.role-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.role-badge.role-admin {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
}

.role-badge.role-user {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.member-status {
    flex-shrink: 0;
}

.member-actions {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
}

/* Pending Invitations */
.pending-invitations {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.invitations-list {
    background: var(--bg-dark);
    border-radius: 8px;
    overflow: hidden;
}

.invitation-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.invitation-row:last-child {
    border-bottom: none;
}

.invitation-info {
    flex: 1;
}

.invitation-email {
    font-weight: 500;
    color: var(--text-primary);
}

.invitation-meta {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.invitation-actions {
    display: flex;
    gap: 8px;
}

/* Modal Description */
.modal-description {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

/* Confirm Modal */
.confirm-modal {
    text-align: center;
    padding: 20px 0;
}

.confirm-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.confirm-icon.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.confirm-dialog h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.confirm-dialog p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.confirm-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}


/* =============================================
   SECTION 7: MY ORGANIZATION STYLES
   ============================================= */

/* My Organization Page */
.my-org-content {
    max-width: 900px;
    margin: 0 auto;
}

/* Organization Info Card */
.org-info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
}

.org-info-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.org-avatar {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.org-info-details h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.org-plan-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.org-plan-badge.plan-starter {
    background: var(--bg-dark);
    color: var(--text-muted);
}

.org-plan-badge.plan-professional {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
    color: var(--primary);
}

.org-plan-badge.plan-enterprise {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(239, 68, 68, 0.2));
    color: #f59e0b;
}

/* Organization Stats Row */
.org-stats-row {
    display: flex;
    gap: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.org-stat {
    display: flex;
    flex-direction: column;
}

.org-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.org-stat-label {
    font-size: 14px;
    color: var(--text-muted);
}

.org-stat-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Upgrade Notice Card */
.upgrade-notice-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    margin-bottom: 24px;
}

.upgrade-notice-icon {
    width: 48px;
    height: 48px;
    background: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.upgrade-notice-content {
    flex: 1;
}

.upgrade-notice-content h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: var(--text-primary);
}

.upgrade-notice-content p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* Organization Section */
.org-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    margin-bottom: 24px;
    overflow: hidden;
}

.org-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.org-section-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.org-section-body {
    padding: 24px;
}

/* Team Members Grid */
.team-members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.team-member-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 12px;
    position: relative;
}

.team-member-card:hover {
    border-color: var(--primary);
}

.member-card-avatar {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    color: white;
    flex-shrink: 0;
}

.member-card-info {
    flex: 1;
    min-width: 0;
}

.member-card-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.member-card-email {
    font-size: 13px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-card-role {
    position: absolute;
    top: 12px;
    right: 12px;
}

.member-card-remove {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
}

.team-member-card:hover .member-card-remove {
    opacity: 1;
}

.member-card-remove:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* Invitation Item */
.invitation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 10px;
    gap: 16px;
    margin-bottom: 12px;
}

.invitation-item:last-child {
    margin-bottom: 0;
}

.invitation-item.pending {
    border-left: 3px solid #f59e0b;
}

.invitation-item-info {
    flex: 1;
    min-width: 0;
}

.invitation-item-email {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.invitation-item-meta {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.invitation-item-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* History */
.invitations-history-list {
    padding-top: 16px;
    border-top: 1px solid var(--border);
    margin-top: 16px;
}

.invitation-item.history {
    opacity: 0.7;
    border-left: none;
}

.invitation-item.history.accepted {
    border-left: 3px solid var(--success);
}

.invitation-item.history.expired,
.invitation-item.history.cancelled {
    border-left: 3px solid var(--text-muted);
}

.status-tag {
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
}

.status-tag.accepted {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.status-tag.expired,
.status-tag.cancelled {
    background: var(--bg-hover);
    color: var(--text-muted);
}

/* Collapsed Section */
.collapsed-section .org-section-header.clickable {
    cursor: pointer;
    margin-bottom: 0;
}

.collapsed-section .org-section-header.clickable:hover {
    opacity: 0.8;
}

.collapsed-section .chevron {
    transition: transform 0.2s;
}

.collapsed-section.expanded .chevron {
    transform: rotate(180deg);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state p {
    margin: 0;
}

/* Confirm Dialog */
.confirm-dialog {
    text-align: center;
    padding: 20px;
}

/* Responsive My Organization */
@media (max-width: 768px) {
    .org-info-header {
        flex-direction: column;
        text-align: center;
    }
    
    .org-stats-row {
        justify-content: center;
    }
    
    .upgrade-notice-card {
        flex-direction: column;
        text-align: center;
    }
    
    .team-members-grid {
        grid-template-columns: 1fr;
    }
    
    .invitation-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .invitation-item-actions {
        width: 100%;
        margin-top: 12px;
    }
    
    .invitation-item-actions .btn {
        flex: 1;
    }
}


/* =============================================
   SECTION 8: CHECKOUT STYLES
   ============================================= */

/* Checkout Page */
.checkout-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px;
}

.checkout-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
    align-items: start;
}

@media (max-width: 900px) {
    .checkout-grid {
        grid-template-columns: 1fr;
    }
}

/* Checkout Card */
.checkout-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

.checkout-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.checkout-card-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.checkout-card-body {
    padding: 24px;
}

/* Billing Toggle */
.billing-toggle {
    display: flex;
    gap: 8px;
    padding: 4px;
    background: var(--bg-dark);
    border-radius: 10px;
    margin-bottom: 24px;
}

.billing-option {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.billing-option.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.billing-option .save-badge {
    background: var(--success);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

/* Order Summary */
.order-summary {
    background: var(--bg-dark);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.order-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 14px;
}

.order-item.total {
    border-top: 1px solid var(--border);
    margin-top: 12px;
    padding-top: 16px;
    font-weight: 600;
    font-size: 16px;
}

.vat-row {
    color: var(--text-muted);
    font-size: 13px;
}

/* Payment Methods */
.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.payment-method-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-dark);
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.payment-method-option:hover {
    border-color: var(--primary);
}

.payment-method-option.active {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.payment-method-option input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* Card Input Fields */
.card-inputs {
    margin-top: 16px;
}

.card-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Secure Payment Notice */
.secure-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 10px;
    font-size: 13px;
    color: var(--success);
    margin-top: 20px;
}

/* Money Back Guarantee */
.money-back {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    background: var(--bg-dark);
    border-radius: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Features List in Checkout */
.checkout-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.checkout-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.checkout-features li:last-child {
    border-bottom: none;
}

.checkout-features li svg {
    color: var(--success);
    flex-shrink: 0;
}

/* =============================================
   BOTONES DE ACCIÓN PARA CONVERSIONES
   Añadir a styles.css o components.css
   ============================================= */

/* Botones de icono para acciones */
.btn-icon {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-dark);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.15s ease;
    padding: 0;
    line-height: 1;
}

.btn-icon:hover {
    transform: translateY(-1px);
}

/* Botón Aprobar (success/verde) */
.btn-icon.success {
    border-color: rgba(34, 197, 94, 0.3);
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.btn-icon.success:hover {
    background: #22c55e;
    border-color: #22c55e;
    color: white;
}

/* Botón Rechazar (danger/rojo) */
.btn-icon.danger {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.btn-icon.danger:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
}

/* Botón Pendiente (warning/amarillo) */
.btn-icon.warning {
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.btn-icon.warning:hover {
    background: #f59e0b;
    border-color: #f59e0b;
    color: white;
}

/* Grupo de botones de acción */
.action-buttons {
    display: flex;
    gap: 6px;
    justify-content: center;
}

/* Versión más pequeña para tablas densas */
.btn-icon.sm {
    width: 28px;
    height: 28px;
    font-size: 12px;
}

/* =============================================
   FIX: Campaign Content Grid Layout
   El HTML debe ocupar más espacio, tracking más compacto
   ============================================= */

/* Campaign Content Grid - 60% HTML, 40% Tracking */
.campaign-content-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 20px;
    align-items: stretch;
}

@media (max-width: 1100px) {
    .campaign-content-grid {
        grid-template-columns: 1fr;
    }
}

/* Ambas cards con la misma altura */
.campaign-content-grid > .campaign-detail-card {
    height: calc(100vh - 240px);
    min-height: 450px;
    max-height: 750px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* HTML Preview - ocupa todo el espacio con position absolute */
.html-preview-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    background: #fff;
}

.html-preview-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}

/* Card body con scroll interno */
.campaign-content-grid > .campaign-detail-card .campaign-card-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px;
}

/* HTML card body - posición relativa para el iframe absoluto */
.campaign-content-grid > .campaign-detail-card:first-child .campaign-card-body {
    position: relative;
    padding: 0;
    overflow: hidden;
}

/* Scrollbar personalizado para ambos paneles */
.campaign-content-grid > .campaign-detail-card .campaign-card-body::-webkit-scrollbar {
    width: 6px;
}

.campaign-content-grid > .campaign-detail-card .campaign-card-body::-webkit-scrollbar-track {
    background: var(--bg-dark);
    border-radius: 3px;
}

.campaign-content-grid > .campaign-detail-card .campaign-card-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.campaign-content-grid > .campaign-detail-card .campaign-card-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Tabs */
.detail-tabs {
    display: flex;
    gap: 2px;
    padding: 4px;
    background: var(--bg-dark);
    border-radius: 6px;
    margin-bottom: 14px;
}

.detail-tab {
    flex: 1;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}

.detail-tab:hover {
    color: var(--text-primary);
}

.detail-tab.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Code blocks con fuente legible */
.code-block {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px 14px;
    position: relative;
    margin-bottom: 10px;
}

.code-block:last-child {
    margin-bottom: 0;
}

.code-block code {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 12px;
    color: var(--text-primary);
    word-break: break-all;
    line-height: 1.4;
    display: block;
    padding-right: 60px;
}

.code-block .code-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: block;
}

.code-block .copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s;
}

.code-block .copy-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Tracking sections */
.tracking-info-section {
    margin-bottom: 14px;
}

.tracking-info-section:last-child {
    margin-bottom: 0;
}

.tracking-info-section h4 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Variables table */
.variables-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.variables-table th,
.variables-table td {
    padding: 6px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.variables-table th {
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-hover);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.variables-table td code {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 11px;
    background: var(--bg-dark);
    padding: 2px 5px;
    border-radius: 3px;
    color: var(--primary);
}

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

/* Info note */
.info-note {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.info-note svg {
    flex-shrink: 0;
    color: var(--primary);
    margin-top: 1px;
    width: 14px;
    height: 14px;
}

/* Test as affiliate section - más compacta */
.test-as-affiliate-section {
    padding: 12px !important;
    margin-top: 12px !important;
}

.test-as-affiliate-section h4 {
    font-size: 10px !important;
    margin-bottom: 6px !important;
}

.test-as-affiliate-section p {
    font-size: 10px !important;
    margin: 4px 0 10px 0 !important;
}

.test-as-affiliate-section .form-select {
    padding: 6px 10px;
    font-size: 11px;
}

.test-as-affiliate-section .btn {
    padding: 6px 12px;
    font-size: 11px;
}

/* Campaign card header */
.campaign-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-dark);
}

.campaign-card-header h3 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.campaign-card-header h3 svg {
    width: 14px;
    height: 14px;
}

/* =============================================
   BILLING SECTION STYLES (para Plan Details)
   Añadir a components.css en SECTION 5: BILLING STYLES
   ============================================= */

/* Billing Section Container */
.billing-section {
    margin-top: 32px;
}

.billing-section .section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.billing-section .section-title svg {
    color: var(--text-muted);
}

/* Billing Info Card */
.billing-info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}

/* Billing Info Grid - Layout de 2 columnas */
.billing-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 16px;
}

@media (max-width: 600px) {
    .billing-info-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* Billing Info Item */
.billing-info-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.billing-info-item label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.billing-info-item span {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

/* Payment Method Display dentro de billing-info-item */
.billing-info-item .payment-method-display {
    padding: 0;
    background: transparent;
    margin: 0;
}

.billing-info-item .payment-method-display .no-payment-method {
    color: var(--text-muted);
    font-style: italic;
    font-size: 14px;
}

.billing-info-item .payment-method-display .payment-card,
.billing-info-item .payment-method-display .payment-sepa {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-primary);
}

.billing-info-item .payment-method-display .card-exp {
    color: var(--text-muted);
    font-size: 12px;
    margin-left: 4px;
}

/* Billing Address dentro de billing-info-card */
.billing-info-card .billing-address {
    padding-top: 16px;
    border-top: 1px solid var(--border);
    margin-bottom: 16px;
    margin-top: 4px;
}

/* Edit Button */
.billing-info-card .btn-secondary.btn-sm {
    margin-top: 8px;
}

/* =============================================
   MY ORGANIZATION TABS & NEW SECTIONS STYLES
   Add this to components.css
   ============================================= */

/* Organization Tabs */
.org-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    padding: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.org-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.org-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.org-tab.active {
    background: var(--primary);
    color: white;
}

.org-tab.active svg {
    stroke: white;
}

.org-tab svg {
    stroke: var(--text-secondary);
    transition: stroke 0.2s;
}

.org-tab:hover svg {
    stroke: var(--text-primary);
}

.tab-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.org-tab:not(.active) .tab-badge {
    background: var(--bg-hover);
    color: var(--text-muted);
}

/* Tab Content */
.org-tab-content {
    display: none;
}

.org-tab-content.active {
    display: block;
}

/* Plan Card Inline */
.plan-card-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.plan-card-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.plan-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.plan-card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.plan-card-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.plan-card-price {
    font-size: 14px;
    color: var(--text-muted);
}

.plan-card-right {
    display: flex;
    align-items: center;
}

.plan-active-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
}

/* Organization Info Form */
.org-info-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.org-info-form .form-group {
    margin-bottom: 0;
}

.org-info-form .form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.org-info-form .form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.org-info-form .form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.org-info-form .form-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 8px;
}

.org-info-form .btn {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Quick Stats */
.org-quick-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 24px;
}

.quick-stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.quick-stat-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-hover);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.quick-stat-info {
    display: flex;
    flex-direction: column;
}

.quick-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.quick-stat-label {
    font-size: 13px;
    color: var(--text-muted);
}

/* Spinner Small */
.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

/* Team member card you tag */
.you-tag {
    font-size: 11px;
    padding: 2px 8px;
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary);
    border-radius: 4px;
    font-weight: 500;
}

/* Role tag */
.role-tag {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.role-tag.admin {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
}

.role-tag.user {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

/* Member card meta */
.member-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

/* Invitations list in org-section */
.org-section .invitations-list {
    padding: 0;
}

.org-section .invitation-item {
    margin-bottom: 0;
    border-radius: 0;
    border-bottom: 1px solid var(--border);
}

.org-section .invitation-item:last-child {
    border-bottom: none;
}

.org-section .invitation-item:first-child {
    border-radius: 8px 8px 0 0;
}

.org-section .invitation-item:last-child {
    border-radius: 0 0 8px 8px;
}

.org-section .invitation-item:only-child {
    border-radius: 8px;
}

/* History list */
.invitations-history-list {
    padding: 16px 24px;
}

/* Badge in header */
.org-section-header .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    background: var(--primary);
    color: white;
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
}

.org-section-header .badge.muted {
    background: var(--bg-hover);
    color: var(--text-muted);
}

/* Collapsed section styles */
.collapsed-section .org-section-header {
    border-bottom: none;
}

.collapsed-section.expanded .org-section-header {
    border-bottom: 1px solid var(--border);
}

/* Responsive */
@media (max-width: 900px) {
    .org-quick-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .org-tabs {
        flex-direction: column;
    }
    
    .org-tab {
        justify-content: center;
    }
    
    .plan-card-inline {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .plan-card-left {
        flex-direction: column;
    }
}

/* =============================================
   MY ORGANIZATION PAGE - TABS VERSION
   ============================================= */

/* Page Container */
.my-org-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Header */
.my-org-header {
    padding: 32px 0 24px;
}

.my-org-header-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.my-org-avatar {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.my-org-title h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.my-org-plan-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
}

.my-org-plan-badge.plan-starter {
    background: var(--bg-dark);
    color: var(--text-muted);
}

.my-org-plan-badge.plan-professional {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
    color: #60a5fa;
}

.my-org-plan-badge.plan-enterprise {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(249, 115, 22, 0.2));
    color: #fbbf24;
}

/* Tabs */
.my-org-tabs {
    display: flex;
    gap: 4px;
    padding: 6px;
    background: var(--bg-dark);
    border-radius: 14px;
    margin-bottom: 24px;
    width: fit-content;
}

.my-org-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.my-org-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.my-org-tab.active {
    background: var(--primary);
    color: white;
}

.my-org-tab.active svg {
    stroke: white;
}

.my-org-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 11px;
    font-size: 12px;
    font-weight: 600;
}

.my-org-tab.active .my-org-tab-badge {
    background: rgba(255, 255, 255, 0.25);
}

/* Tab Content */
.my-org-tab-content {
    min-height: 400px;
}

/* Cards */
.my-org-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    margin-bottom: 20px;
    overflow: hidden;
}

.my-org-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
}

.my-org-card-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.my-org-card-header h3 svg {
    color: var(--text-muted);
}

.header-count {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 8px;
}

.header-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 8px;
    background: var(--primary);
    color: white;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
}

.my-org-card-body {
    padding: 20px 24px;
}

/* Plan Info */
.my-org-plan-info {
    text-align: center;
    padding: 20px 0;
}

.plan-name-large {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.next-billing {
    font-size: 14px;
    color: var(--text-muted);
}

/* Stats Grid */
.my-org-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 768px) {
    .my-org-stats-grid {
        grid-template-columns: 1fr;
    }
}

.my-org-stat-item {
    background: var(--bg-dark);
    border-radius: 12px;
    padding: 16px;
    position: relative;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.stat-icon.team {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.stat-icon.campaigns {
    background: rgba(168, 85, 247, 0.15);
    color: #a78bfa;
}

.stat-icon.affiliates {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.stat-details {
    margin-bottom: 12px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-max {
    font-size: 16px;
    font-weight: 400;
    color: var(--text-muted);
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.stat-progress {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.stat-progress .progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.3s;
}

/* Upgrade Card */
.my-org-upgrade-card {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-top: 20px;
}

.my-org-upgrade-card .upgrade-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(59, 130, 246, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.my-org-upgrade-card .upgrade-content h4 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.my-org-upgrade-card .upgrade-content p {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0 0 16px 0;
    line-height: 1.5;
}

/* Team Upgrade Notice (inside card) */
.team-upgrade-notice {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    background: rgba(59, 130, 246, 0.08);
    border-radius: 12px;
    margin-bottom: 20px;
}

.team-upgrade-notice .notice-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.team-upgrade-notice .notice-content h4 {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 6px 0;
}

.team-upgrade-notice .notice-content p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 12px 0;
}

/* Team Members List */
.team-members-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.team-member-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: var(--bg-dark);
    border-radius: 10px;
    margin-bottom: 8px;
}

.team-member-row:last-child {
    margin-bottom: 0;
}

.team-member-row.is-you {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.member-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 15px;
    color: white;
    flex-shrink: 0;
}

.member-avatar.admin {
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
}

.member-info {
    flex: 1;
    min-width: 0;
}

.member-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.you-tag {
    font-size: 11px;
    font-weight: 500;
    color: var(--primary);
    background: rgba(59, 130, 246, 0.15);
    padding: 2px 8px;
    border-radius: 10px;
}

.member-email {
    font-size: 13px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-role {
    flex-shrink: 0;
}

.role-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.role-tag.admin {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
}

.role-tag.user {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.btn-icon-danger {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon-danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* Invitations List */
.invitations-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.invitation-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--bg-dark);
    border-radius: 10px;
}

.invitation-info {
    flex: 1;
}

.invitation-email {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.invitation-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-muted);
}

.sent-date {
    color: var(--text-muted);
}

.invitation-actions {
    display: flex;
    gap: 8px;
}

/* Billing */
.billing-empty-state {
    text-align: center;
    padding: 40px 20px;
}

.billing-empty-state svg {
    color: var(--text-muted);
    opacity: 0.5;
    margin-bottom: 16px;
}

.billing-empty-state p {
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.billing-empty-state p.text-muted {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.billing-details {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.billing-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.billing-row:last-child {
    border-bottom: none;
}

.billing-label {
    font-size: 14px;
    color: var(--text-muted);
}

.billing-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.payment-card {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Invoices Table */
.invoices-table-container {
    overflow-x: auto;
}

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

.invoices-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.invoices-table td {
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}

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

.invoices-table tr:hover {
    background: var(--bg-hover);
}

.invoice-number {
    font-weight: 600;
    color: var(--text-primary);
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.status-paid {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.status-badge.status-pending {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.status-badge.status-failed {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* Button Variations */
.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}

.btn-danger-outline {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.btn-danger-outline:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state p {
    margin: 0;
    font-size: 14px;
}

/* Confirm Dialog */
.confirm-dialog {
    text-align: center;
    padding: 20px;
}

.confirm-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.confirm-icon.danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.confirm-dialog h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.confirm-dialog p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.confirm-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* Modal Description */
.modal-description {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .my-org-header-info {
        flex-direction: column;
        text-align: center;
    }
    
    .my-org-tabs {
        width: 100%;
        overflow-x: auto;
    }
    
    .my-org-tab {
        padding: 10px 14px;
        font-size: 13px;
        white-space: nowrap;
    }
    
    .my-org-upgrade-card {
        flex-direction: column;
        text-align: center;
    }
    
    .team-upgrade-notice {
        flex-direction: column;
        text-align: center;
    }
    
    .team-member-row {
        flex-wrap: wrap;
    }
    
    .invitation-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .invitation-actions {
        width: 100%;
    }
    
    .invitation-actions .btn {
        flex: 1;
    }
    
    .billing-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* =============================================
   ENHANCED PLAN CARD STYLES
   Add this to components.css
   ============================================= */

/* Plan Card Enhanced */
.plan-card-enhanced .my-org-card-body {
    padding: 24px;
}

.plan-display-enhanced {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 20px;
    background: var(--bg-dark);
    border-radius: 16px;
    border: 1px solid var(--border);
}

@media (max-width: 768px) {
    .plan-display-enhanced {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .plan-features-quick {
        width: 100%;
        justify-content: center;
    }
}

/* Plan Icon Wrapper */
.plan-icon-wrapper {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.plan-icon-wrapper:hover {
    transform: scale(1.05);
}

.plan-icon-wrapper.plan-starter {
    background: linear-gradient(135deg, rgba(100, 116, 139, 0.2), rgba(71, 85, 105, 0.3));
    color: #94a3b8;
    border: 1px solid rgba(100, 116, 139, 0.3);
}

.plan-icon-wrapper.plan-professional {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.plan-icon-wrapper.plan-enterprise {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(249, 115, 22, 0.2));
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Plan Info Main */
.plan-info-main {
    flex: 1;
    min-width: 0;
}

.plan-name-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.plan-display-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.plan-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.plan-status-badge.active {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.plan-status-badge.cancelled {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.plan-price-row {
    display: flex;
    align-items: baseline;
    gap: 2px;
    margin-bottom: 8px;
}

.plan-price-amount {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.plan-price-period {
    font-size: 14px;
    color: var(--text-muted);
}

.plan-billing-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.plan-billing-info svg {
    flex-shrink: 0;
}

/* Plan Features Quick */
.plan-features-quick {
    display: flex;
    gap: 16px;
    flex-shrink: 0;
}

.plan-features-quick .feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    min-width: 80px;
}

.plan-features-quick .feature-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.plan-features-quick .feature-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .plan-icon-wrapper {
        width: 64px;
        height: 64px;
        border-radius: 16px;
    }
    
    .plan-icon-wrapper svg {
        width: 28px;
        height: 28px;
    }
    
    .plan-display-name {
        font-size: 20px;
    }
    
    .plan-price-amount {
        font-size: 24px;
    }
    
    .plan-features-quick {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .plan-features-quick .feature-item {
        padding: 10px 16px;
        min-width: 70px;
    }
    
    .plan-features-quick .feature-value {
        font-size: 18px;
    }
}

/* Invoice status badges */
.invoice-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.invoice-status.paid {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.invoice-status.pending {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.invoice-status.failed {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* Invoices table */
.invoices-table-wrapper {
    overflow-x: auto;
}

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

.invoices-table th,
.invoices-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.invoices-table th {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.invoices-table td {
    font-size: 14px;
    color: var(--text-primary);
}

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

.invoices-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Billing upgrade notice */
.billing-upgrade-notice {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-muted);
}

.billing-upgrade-notice p {
    margin-bottom: 16px;
}

/* Empty state in cards */
.my-org-card .empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.my-org-card .empty-state svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.my-org-card .empty-state p {
    margin: 0;
}

/* Team upgrade notice */
.team-upgrade-notice {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.08));
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    margin-bottom: 20px;
}

.team-upgrade-notice .notice-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.team-upgrade-notice .notice-content h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 6px 0;
}

.team-upgrade-notice .notice-content p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 12px 0;
}

/* Upgrade prompt in team section */
.upgrade-prompt {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 32px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.08));
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 12px;
    margin-bottom: 20px;
}

.upgrade-prompt .upgrade-icon {
    flex-shrink: 0;
    color: var(--primary);
    opacity: 0.9;
}

.upgrade-prompt-content {
    flex: 1;
}

.upgrade-prompt-content h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 6px 0;
}

.upgrade-prompt-content p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 16px 0;
    line-height: 1.5;
}

/* Team member row */
.team-member-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.team-member-row:last-child {
    border-bottom: none;
}

.team-member-row.is-you {
    background: rgba(59, 130, 246, 0.05);
    margin: 0 -24px;
    padding: 14px 24px;
    border-radius: 8px;
}

.member-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.member-avatar.admin {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(59, 130, 246, 0.2));
    color: #a78bfa;
}

.member-info {
    flex: 1;
    min-width: 0;
}

.member-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.member-email {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

.member-role {
    flex-shrink: 0;
}

/* Invitation row */
.invitation-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.invitation-row:last-child {
    border-bottom: none;
}

.invitation-info {
    flex: 1;
    min-width: 0;
}

.invitation-email {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.invitation-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.sent-date {
    font-size: 12px;
    color: var(--text-muted);
}

.invitation-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* Button icon danger */
.btn-icon-danger {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

/* Danger outline button */
.btn-danger-outline {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.btn-danger-outline:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.5);
}

/* =============================================
   BILLING MODAL STYLES - Añadir a components.css
   ============================================= */

/* Form Section Dividers */
#edit-billing-form .form-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

#edit-billing-form .form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

#edit-billing-form .form-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 16px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Form Rows for Two Columns */
#edit-billing-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 500px) {
    #edit-billing-form .form-row {
        grid-template-columns: 1fr;
    }
}

/* Form Groups inside Modal */
#edit-billing-form .form-group {
    margin-bottom: 16px;
}

#edit-billing-form .form-group:last-child {
    margin-bottom: 0;
}

#edit-billing-form .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

#edit-billing-form .form-control {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s;
}

#edit-billing-form .form-control:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

#edit-billing-form .form-control::placeholder {
    color: var(--text-muted);
}

#edit-billing-form select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

/* Form Hint */
#edit-billing-form .form-hint {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Form Actions */
#edit-billing-form .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* =============================================
   BILLING GRID IN MY ORGANIZATION
   ============================================= */

/* Billing Grid - 2x2 Layout */
.billing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .billing-grid {
        grid-template-columns: 1fr;
    }
}

/* Billing Section */
.billing-section {
    margin-bottom: 0;
}

.billing-section h4 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

/* Billing Row */
.billing-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0;
}

.billing-row:last-child {
    padding-bottom: 0;
}

.billing-label {
    font-size: 13px;
    color: var(--text-muted);
}

.billing-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
}

.billing-value.text-muted {
    color: var(--text-muted);
    font-style: italic;
    font-weight: 400;
}

/* Billing Address Block */
.billing-address-block {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.6;
}

.billing-address-block .text-muted {
    color: var(--text-muted);
    font-style: italic;
}

/* Payment Card Display */
.payment-card {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.payment-card svg {
    color: var(--text-muted);
}

/* =============================================
   INVOICES TABLE STYLES
   ============================================= */

.invoices-table {
    overflow-x: auto;
}

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

.invoices-table th {
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 8px;
    border-bottom: 1px solid var(--border);
}

.invoices-table td {
    padding: 14px 8px;
    font-size: 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
}

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

.invoices-table tr:hover td {
    background: var(--bg-hover);
}

/* Invoice Status */
.invoice-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.invoice-status.status-paid {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.invoice-status.status-pending {
    background: rgba(234, 179, 8, 0.1);
    color: #eab308;
}

.invoice-status.status-failed {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.invoice-status.status-draft {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

.invoice-status.status-void {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

/* =============================================
   INVOICE DETAIL MODAL
   ============================================= */

.invoice-detail-modal {
    padding: 0;
}

.invoice-detail-header {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

.invoice-detail-header .invoice-number-large {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.invoice-detail-header .invoice-number-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'SF Mono', Monaco, 'Consolas', monospace;
}

.invoice-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 20px;
}

.invoice-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.invoice-meta-item .meta-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.invoice-meta-item .meta-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.invoice-meta-item .meta-value.highlight {
    color: var(--primary);
    font-weight: 600;
}

/* Invoice Items Table */
.invoice-items-section {
    margin-bottom: 24px;
}

.invoice-items-section .section-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.invoice-items-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.invoice-items-table thead tr {
    background: var(--bg-tertiary);
}

.invoice-items-table th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.invoice-items-table th:last-child {
    text-align: right;
}

.invoice-items-table tbody td {
    padding: 14px 16px;
    font-size: 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
}

.invoice-items-table tbody td:last-child {
    text-align: right;
    font-weight: 500;
    font-family: 'SF Mono', Monaco, 'Consolas', monospace;
}

.invoice-items-table tbody tr:last-child td {
    border-bottom: none;
}

.invoice-items-table tfoot {
    background: var(--bg-tertiary);
}

.invoice-items-table tfoot td {
    padding: 12px 16px;
    font-size: 14px;
    border-top: 1px solid var(--border);
}

.invoice-items-table tfoot td:first-child {
    text-align: right;
    color: var(--text-muted);
}

.invoice-items-table tfoot td:last-child {
    text-align: right;
    font-family: 'SF Mono', Monaco, 'Consolas', monospace;
}

.invoice-items-table tfoot .total-row td {
    font-size: 16px;
    padding-top: 14px;
    padding-bottom: 14px;
}

.invoice-items-table tfoot .total-row td:first-child {
    color: var(--text-primary);
}

.invoice-items-table tfoot .total-row td:last-child {
    color: var(--primary);
    font-weight: 700;
}

/* Invoice Detail Actions */
.invoice-detail-actions {
    display: flex;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}

.invoice-detail-actions .btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.invoice-detail-actions .btn svg {
    flex-shrink: 0;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .invoice-meta-grid {
        grid-template-columns: 1fr;
    }

    .invoice-detail-actions {
        flex-direction: column;
    }

    .invoice-items-table th:nth-child(2),
    .invoice-items-table td:nth-child(2) {
        display: none;
    }
}

/* =============================================
   EMPTY STATE SMALL
   ============================================= */

.empty-state.small {
    padding: 32px 20px;
}

.empty-state.small svg {
    margin-bottom: 12px;
    color: var(--text-muted);
}

.empty-state.small p {
    font-size: 14px;
}

/* =============================================
   SECTION: INTEGRATIONS
   ============================================= */

/* Integrations Grid */
/* Integrations Page Header */
.integrations-page-header {
    margin-bottom: 32px;
}

.integrations-page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.integrations-page-header p {
    font-size: 15px;
    color: var(--text-secondary);
}

.integrations-section {
    margin-bottom: 48px;
}

.integrations-section .section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.integrations-section .section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.integrations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Integration Card - Enhanced */
.integration-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.integration-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
    transition: background 0.25s ease;
}

.integration-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.integration-card:hover::before {
    background: linear-gradient(90deg, var(--primary), #8b5cf6);
}

.integration-card.status-active {
    border-color: rgba(16, 185, 129, 0.3);
}

.integration-card.status-active::before {
    background: var(--success);
}

.integration-card.status-active:hover {
    border-color: var(--success);
}

.integration-card .integration-logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: white;
    margin-bottom: 20px;
    transition: transform 0.25s ease;
}

.integration-card:hover .integration-logo {
    transform: scale(1.05);
}

/* Logo color variants */
.integration-card .integration-logo.logo-ga {
    background: linear-gradient(135deg, #F9AB00, #E37400);
}

.integration-card .integration-logo.logo-ds {
    background: linear-gradient(135deg, #4285F4, #1A73E8);
}

.integration-card .integration-logo.logo-slack {
    background: linear-gradient(135deg, #4A154B, #611f69);
}

.integration-card .integration-logo.logo-zapier {
    background: linear-gradient(135deg, #FF4F00, #FF7A00);
}

.integration-card .integration-logo.logo-default {
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
}

.integration-card h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.integration-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
}

.integration-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--bg-hover);
    color: var(--text-muted);
}

.integration-status.status-active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.integration-status.status-configured {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.status-dot.status-active {
    background: var(--success);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.status-dot.status-configured {
    background: var(--warning);
}

.status-dot.status-inactive {
    background: var(--text-muted);
}

/* Integration Detail Card */
.integration-detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 36px;
    margin-bottom: 24px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}

.integration-header {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 36px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border);
}

.integration-logo-lg {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Logo variants for detail pages */
.integration-logo-lg.logo-ga {
    background: linear-gradient(135deg, #F9AB00, #E37400);
}

.integration-logo-lg.logo-ds {
    background: linear-gradient(135deg, #4285F4, #1A73E8);
}

.integration-logo-lg.logo-slack {
    background: linear-gradient(135deg, #4A154B, #611f69);
}

.integration-logo-lg.logo-zapier {
    background: linear-gradient(135deg, #FF4F00, #FF7A00);
}

.integration-logo-lg:not(.logo-ga):not(.logo-ds):not(.logo-slack):not(.logo-zapier) {
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
}

.integration-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.integration-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

.integration-toggle {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text-secondary);
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-hover);
    transition: 0.3s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--success);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

/* Integration Form */
.integration-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.integration-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.integration-form label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.integration-form small {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.integration-form .form-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

/* Radio Group */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-option {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.radio-option:hover {
    border-color: var(--primary);
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.radio-option input[type="radio"]:checked + span::before {
    background: var(--primary);
    border-color: var(--primary);
}

.radio-option span {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.radio-option span::before {
    content: '';
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.2s;
}

.radio-option small {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 28px;
}

.radio-option:has(input:checked) {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    gap: 20px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
}

/* Integration Info */
.integration-info {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.integration-info h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.integration-info ul,
.integration-info ol {
    padding-left: 20px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8;
}

.integration-info li {
    margin-bottom: 8px;
}

.integration-info code {
    background: var(--bg-dark);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--primary);
}

/* Endpoints List (Data Studio) */
.endpoints-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.endpoint {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg-dark);
    border-radius: 8px;
}

.endpoint code {
    background: var(--bg-hover);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--primary);
    white-space: nowrap;
}

.endpoint span {
    font-size: 13px;
    color: var(--text-secondary);
}

/* API Key Section */
.api-key-section {
    margin-top: 24px;
}

.api-key-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.api-key-display {
    display: flex;
    gap: 8px;
}

.api-key-display input {
    flex: 1;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 13px;
}

.api-key-stats {
    display: flex;
    gap: 24px;
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

/* Webhooks Section */
.webhooks-list {
    margin-top: 24px;
}

.webhooks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.webhooks-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.webhooks-table {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.webhook-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.webhook-info {
    flex: 1;
}

.webhook-info strong {
    display: block;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.webhook-url {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    font-family: monospace;
    margin-bottom: 8px;
}

.webhook-events {
    display: flex;
    gap: 6px;
}

.event-tag {
    display: inline-block;
    padding: 2px 8px;
    background: var(--bg-hover);
    border-radius: 4px;
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: capitalize;
}

.webhook-stats {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.webhook-actions {
    display: flex;
    gap: 8px;
}

/* Integration Logs */
.integration-logs-section {
    margin-top: 32px;
}

.integration-logs-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.logs-container {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    max-height: 300px;
    overflow-y: auto;
}

.logs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.logs-table th {
    text-align: left;
    padding: 8px 12px;
    color: var(--text-muted);
    font-weight: 500;
    border-bottom: 1px solid var(--border);
}

.logs-table td {
    padding: 8px 12px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

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

.logs-table tr.log-failed td {
    color: var(--danger);
}

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

.status-badge.status-success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.status-badge.status-failed {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.status-badge.status-pending {
    background: rgba(234, 179, 8, 0.15);
    color: var(--warning);
}

/* Upgrade Required Card */
.upgrade-required-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 80px 40px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    max-width: 500px;
    margin: 40px auto;
}

.upgrade-required-card .upgrade-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.upgrade-required-card .upgrade-icon svg {
    color: white;
}

.upgrade-required-card h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.upgrade-required-card p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
    max-width: 360px;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
}

/* =============================================
   TRAFFIC SOURCES STYLES
   ============================================= */

/* Section badge for Traffic Sources */
.section-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 3px 8px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: white;
    border-radius: 4px;
    margin-left: 12px;
    vertical-align: middle;
}

.section-description {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
    margin-top: -8px;
}

.section-icon {
    margin-right: 8px;
}

/* Traffic Source Card enhancements */
.traffic-source-card .account-badge {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-hover);
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
    display: inline-block;
}

.traffic-source-card .sync-info {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

.sync-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.sync-status-dot.success { background: var(--success); }
.sync-status-dot.failed { background: var(--danger); }
.sync-status-dot.partial { background: var(--warning); }
.sync-status-dot.unknown { background: var(--text-muted); }

/* Logo variants for Traffic Sources */
.integration-card .integration-logo.logo-facebook {
    background: linear-gradient(135deg, #1877F2, #0D6EFD);
}

.integration-card .integration-logo.logo-google {
    background: linear-gradient(135deg, #4285F4, #34A853);
}

.integration-card .integration-logo.logo-tiktok {
    background: linear-gradient(135deg, #000000, #25F4EE);
}

.integration-card .integration-logo.logo-microsoft {
    background: linear-gradient(135deg, #00A4EF, #7FBA00);
}

.integration-card .integration-logo.logo-taboola {
    background: linear-gradient(135deg, #0052CC, #0066FF);
}

.integration-card .integration-logo.logo-outbrain {
    background: linear-gradient(135deg, #FF6600, #FF8533);
}

/* Traffic Source Dashboard */
.traffic-source-dashboard {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.traffic-source-connect-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 48px;
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.source-header-centered {
    margin-bottom: 32px;
}

.source-logo-xl {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: white;
    margin: 0 auto 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.source-header-centered h2 {
    font-size: 28px;
    margin-bottom: 8px;
}

.source-description {
    color: var(--text-secondary);
    font-size: 15px;
}

.connect-benefits {
    text-align: left;
    margin: 32px 0;
    padding: 24px;
    background: var(--bg-hover);
    border-radius: 12px;
}

.connect-benefits h4 {
    margin-bottom: 16px;
    font-size: 16px;
}

.connect-benefits ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.connect-benefits li {
    padding: 10px 0;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.connect-benefits .benefit-icon {
    color: var(--success);
    font-weight: bold;
}

.connect-actions {
    margin: 24px 0;
}

.oauth-note {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 16px;
}

/* Credentials Form Section */
.credentials-form-section {
    text-align: left;
    margin: 32px 0;
    padding: 28px;
    background: var(--bg-hover);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.credentials-form-section h4 {
    margin-bottom: 8px;
    font-size: 18px;
    font-weight: 600;
}

.credentials-form-section .form-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}

.credentials-form .form-group {
    margin-bottom: 20px;
}

.credentials-form .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
}

.credentials-form .form-control {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    transition: all 0.2s;
}

.credentials-form .form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.credentials-form .form-control::placeholder {
    color: var(--text-muted);
}

.credentials-form .field-help {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.credentials-form .form-actions {
    margin-top: 24px;
    text-align: center;
}

.docs-link {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.docs-link a {
    color: var(--primary);
    text-decoration: none;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.docs-link a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Demo Mode Section */
.demo-mode-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.demo-divider {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 16px;
    position: relative;
}

.demo-divider span {
    background: var(--bg-card);
    padding: 0 12px;
    position: relative;
    z-index: 1;
}

.demo-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border);
}

.demo-mode-section .btn-secondary {
    font-size: 13px;
    padding: 10px 20px;
}

/* Spinner for loading states */
.spinner-small {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

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

/* Source Header Card */
.source-header-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
}

.source-header {
    display: flex;
    align-items: center;
    gap: 20px;
}

.source-logo-lg {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.source-info {
    flex: 1;
}

.source-info h2 {
    font-size: 24px;
    margin-bottom: 4px;
}

.source-info .account-name {
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-size: 14px;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.connection-status.connected {
    color: var(--success);
}

.status-dot-lg {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.source-actions {
    display: flex;
    gap: 12px;
}

.sync-info-bar {
    display: flex;
    gap: 24px;
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
}

/* Metrics Summary Grid */
.metrics-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.metric-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.metric-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.metric-change {
    font-size: 12px;
    margin-top: 4px;
}

.metric-change.positive { color: var(--success); }
.metric-change.negative { color: var(--danger); }

/* Source Tabs */
.source-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
    padding: 24px 0;
}

.tab-content.active {
    display: block;
}

/* Campaigns Table */
.campaigns-table-wrapper {
    overflow-x: auto;
}

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

.campaigns-table th,
.campaigns-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.campaigns-table th {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    background: var(--bg-hover);
}

.campaigns-table td {
    font-size: 14px;
    color: var(--text-secondary);
}

.campaign-name {
    font-weight: 500;
    color: var(--text-primary);
}

.campaign-id {
    font-size: 11px;
    color: var(--text-muted);
    font-family: monospace;
}

/* Campaign Status Badges */
.status-badge.status-active {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.status-badge.status-paused {
    background: rgba(234, 179, 8, 0.15);
    color: var(--warning);
}

.status-badge.status-deleted,
.status-badge.status-archived {
    background: rgba(107, 114, 128, 0.15);
    color: var(--text-muted);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    max-width: 400px;
    margin: 0 auto;
}

/* Settings Section */
.settings-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
}

.settings-section h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.settings-section.danger-zone {
    border-color: rgba(239, 68, 68, 0.3);
}

.settings-section.danger-zone h4 {
    color: var(--danger);
}

.settings-section.danger-zone p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 16px;
}

.info-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.info-label {
    color: var(--text-muted);
}

.info-value {
    color: var(--text-primary);
    font-weight: 500;
}

/* Toggle Switch */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.toggle-label input {
    display: none;
}

.toggle-switch {
    width: 44px;
    height: 24px;
    background: var(--bg-hover);
    border-radius: 12px;
    position: relative;
    transition: all 0.2s;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.2s;
}

.toggle-label input:checked + .toggle-switch {
    background: var(--primary);
}

.toggle-label input:checked + .toggle-switch::after {
    left: 22px;
}

/* Metrics Controls */
.metrics-controls {
    margin-bottom: 20px;
}

.metrics-filters {
    display: flex;
    gap: 12px;
}

.metrics-filters select {
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
}

.chart-placeholder {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

.chart-placeholder.error {
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

/* Metrics Table */
.metrics-table {
    width: 100%;
    margin-top: 20px;
}

.metrics-table th,
.metrics-table td {
    padding: 10px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.metrics-table th {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    background: var(--bg-hover);
}

/* Button Variants */
.btn-danger-outline {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
}

.btn-danger-outline:hover {
    background: var(--danger);
    color: white;
}

/* Spinner Small */
.spinner-small {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .integrations-page-header {
        margin-bottom: 24px;
    }

    .integrations-page-header h1 {
        font-size: 24px;
    }

    .integrations-grid {
        grid-template-columns: 1fr;
    }

    .integration-card {
        padding: 24px;
    }

    .integration-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .integration-toggle {
        margin-left: 0;
        margin-top: 16px;
    }

    .integration-detail-card {
        padding: 24px;
        border-radius: 16px;
    }

    .integration-logo-lg {
        width: 64px;
        height: 64px;
        font-size: 22px;
    }

    .webhook-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .webhook-actions {
        width: 100%;
        justify-content: flex-end;
    }
}