/*
 * NewsPro Customer Portal — Stylesheet
 * Extends the cn- Blush design system
 * ─────────────────────────────────────── */

/* ── Portal Variables ── */
:root {
    --cp-sidebar-bg:      #1A0812;
    --cp-sidebar-active:  var(--cn-accent, #9D174D);
    --cp-sidebar-width:   260px;

    --cp-body-bg:         var(--cn-bg, #FDF0F4);
    --cp-card-bg:         var(--cn-surface, #FFFFFF);
    --cp-card-border:     var(--cn-border, #F0C8D8);
    --cp-card-radius:     var(--cn-radius, 16px);
    --cp-card-shadow:     var(--cn-shadow, 0 1px 3px rgba(26,8,18,0.06), 0 8px 32px rgba(157,23,77,0.06));

    --cp-accent:          var(--cn-accent, #9D174D);
    --cp-accent-hover:    var(--cn-accent-hover, #831843);
    --cp-accent-light:    var(--cn-accent-light, #BE185D);
    --cp-glow:            var(--cn-glow, rgba(157,23,77,0.15));
    --cp-glow-strong:     var(--cn-glow-strong, rgba(157,23,77,0.25));

    --cp-text:            var(--cn-text, #1A0812);
    --cp-muted:           var(--cn-muted, #A05070);
    --cp-light:           var(--cn-light, #FAE0EA);
    --cp-border:          var(--cn-border, #F0C8D8);

    --cp-success:         #059669;
    --cp-success-bg:      #ECFDF5;
    --cp-error:           #DC2626;
    --cp-error-bg:        #FEF2F2;
    --cp-warning:         #D97706;
    --cp-warning-bg:      #FFFBEB;
    --cp-info:            #2563EB;
    --cp-info-bg:         #EFF6FF;

    --cp-radius:          var(--cn-radius, 16px);
    --cp-radius-sm:       var(--cn-radius-sm, 10px);
    --cp-ease:            var(--cn-ease, cubic-bezier(0.4, 0, 0.2, 1));
}

/* ── Icon defaults ── */
svg[aria-hidden="true"] {
    width: 1em; height: 1em;
    fill: currentColor;
    vertical-align: -0.125em;
    flex-shrink: 0;
}

/* ══════════════════════════════════════════
   AUTH PAGES (Login / Signup / Forgot / 2FA)
   ══════════════════════════════════════════ */
.cp-auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, #FDF0F4 0%, #F9D5E2 40%, #F0C8D8 100%);
    position: relative;
    overflow: hidden;
}
.cp-auth-wrapper::before {
    content: '';
    position: absolute;
    top: -200px; right: -200px;
    width: 500px; height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(157,23,77,0.08) 0%, transparent 70%);
    pointer-events: none;
}
.cp-auth-wrapper::after {
    content: '';
    position: absolute;
    bottom: -150px; left: -150px;
    width: 400px; height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(225,29,72,0.06) 0%, transparent 70%);
    pointer-events: none;
}

/* Entrance animation — staggered fade-up */
@keyframes cpFadeUp {
    from { opacity: 0; transform: translateY(40px); }
    to   { opacity: 1; transform: translateY(0); }
}
.cp-auth-card {
    animation: cpFadeUp 0.7s var(--cp-ease) both;
}
.cp-auth-card .cp-auth-logo     { opacity: 0; animation: cpFadeUp 0.7s var(--cp-ease) 0.1s both; }
.cp-auth-card .cp-auth-title    { opacity: 0; animation: cpFadeUp 0.7s var(--cp-ease) 0.2s both; }
.cp-auth-card .cp-auth-subtitle { opacity: 0; animation: cpFadeUp 0.7s var(--cp-ease) 0.25s both; }
.cp-auth-card form              { opacity: 0; animation: cpFadeUp 0.7s var(--cp-ease) 0.35s both; }
.cp-auth-card .cp-auth-footer   { opacity: 0; animation: cpFadeUp 0.7s var(--cp-ease) 0.45s both; }
.cp-auth-card .cp-auth-terms    { opacity: 0; animation: cpFadeUp 0.7s var(--cp-ease) 0.5s both; }
.cp-auth-card .cp-2fa-methods   { opacity: 0; animation: cpFadeUp 0.7s var(--cp-ease) 0.35s both; }

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .cp-auth-card,
    .cp-auth-card .cp-auth-logo,
    .cp-auth-card .cp-auth-title,
    .cp-auth-card .cp-auth-subtitle,
    .cp-auth-card form,
    .cp-auth-card .cp-auth-footer,
    .cp-auth-card .cp-auth-terms,
    .cp-auth-card .cp-2fa-methods {
        animation: none;
        opacity: 1;
    }
}

.cp-auth-container {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
}

.cp-auth-logo {
    text-align: center;
    margin-bottom: 28px;
}
.cp-auth-logo a {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: transform 0.3s var(--cp-ease);
}
.cp-auth-logo a:hover { transform: scale(1.05); }
.cp-auth-logo img {
    height: 36px;
    width: auto;
}

.cp-auth-card {
    width: 100%;
    max-width: 460px;
    background: var(--cn-surface, #fff);
    border-radius: var(--cp-radius);
    padding: 40px 36px;
    border: 1px solid var(--cp-border);
    box-shadow: var(--cn-shadow, 0 1px 3px rgba(26,8,18,0.06), 0 8px 32px rgba(157,23,77,0.06));
}
@media (max-width: 480px) {
    .cp-auth-card { padding: 28px 20px; }
}

.cp-auth-title {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: clamp(24px, 4vw, 30px);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--cp-text);
    text-align: center;
    margin: 0 0 8px;
}
.cp-auth-subtitle {
    font-size: 15px;
    line-height: 1.6;
    color: var(--cp-muted);
    text-align: center;
    margin: 0 0 28px;
}
.cp-auth-link {
    color: var(--cp-accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.2s;
}
.cp-auth-link:hover {
    color: var(--cp-accent-hover);
    text-decoration: underline;
}

/* ── Google OAuth button ── */
.cp-btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px 20px;
    background: #fff;
    border: 1.5px solid #dadce0;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    color: #3c4043;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
    margin-bottom: 16px;
}
.cp-btn-google:hover {
    background: #f8f9fa;
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
    text-decoration: none;
    color: #3c4043;
}
.cp-btn-google svg { flex-shrink: 0; }

/* ── OR divider ── */
.cp-auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 0 16px;
    color: var(--cp-muted);
    font-size: 13px;
}
.cp-auth-divider::before,
.cp-auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--cp-border);
}

/* ── Alert box ── */
.cp-alert {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 14px;
    line-height: 1.5;
}
.cp-alert--error {
    background: var(--cp-error-bg);
    color: var(--cp-error);
    border: 1px solid #fca5a5;
}

.cp-auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--cp-muted);
}
.cp-auth-footer a {
    color: var(--cp-accent);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}
.cp-auth-footer a:hover {
    color: var(--cp-accent-hover);
    text-decoration: underline;
}
.cp-auth-terms {
    text-align: center;
    margin-top: 12px;
    font-size: 12px;
    color: var(--cp-muted);
    line-height: 1.5;
}
.cp-auth-terms a {
    color: var(--cp-accent);
    text-decoration: none;
}
.cp-auth-terms a:hover {
    text-decoration: underline;
}
.cp-form-actions {
    text-align: right;
    margin: 0 0 20px;
    font-size: 14px;
}

.cp-auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    font-size: 13px;
    color: var(--cp-muted);
}
.cp-auth-divider::before,
.cp-auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--cp-border);
}

/* ══════════════════════════════════════════
   FORM ELEMENTS
   ══════════════════════════════════════════ */
.cp-form-group {
    margin-bottom: 20px;
}
.cp-form-group label,
.cp-form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--cp-text);
    margin-bottom: 6px;
}
.cp-form-input,
.cp-form-select {
    width: 100%;
    padding: 12px 16px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    color: #111;
    background: #fff;
    border: 1px solid #333;
    border-radius: var(--cp-radius-sm);
    transition: border-color 0.2s var(--cp-ease), box-shadow 0.2s var(--cp-ease);
    outline: none;
    box-sizing: border-box;
}
.cp-form-input:focus,
.cp-form-select:focus {
    border-color: var(--cp-accent);
    box-shadow: inset 0 0 0 1px var(--cp-accent), 0 0 0 3px var(--cp-glow);
}
.cp-form-input::placeholder {
    color: #999;
}
.cp-form-input.is-error {
    border-color: var(--cp-error);
    box-shadow: 0 0 0 3px rgba(220,38,38,0.1);
}
.cp-form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23A05070'%3E%3Cpath d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}
.cp-form-hint {
    font-size: 13px;
    color: var(--cp-muted);
    margin-top: 6px;
}
.cp-form-error {
    font-size: 13px;
    color: var(--cp-error);
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Password field with toggle */
.cp-password-wrap {
    position: relative;
}
.cp-password-wrap .cp-form-input {
    padding-right: 48px;
}
.cp-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #333;
    transition: color 0.2s;
    display: flex;
    align-items: center;
}
.cp-password-toggle:hover {
    color: #000;
}
.cp-password-toggle svg {
    width: 18px; height: 18px;
    fill: none;
    stroke: currentColor;
}

/* Password strength bar */
.cp-password-strength {
    height: 4px;
    border-radius: 2px;
    background: var(--cp-border);
    margin-top: 8px;
    overflow: hidden;
}
.cp-password-strength-bar {
    height: 100%;
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s var(--cp-ease), background 0.3s;
}
.cp-password-strength-bar[data-strength="0"] { width: 0%; }
.cp-password-strength-bar[data-strength="1"] { width: 25%; background: var(--cp-error); }
.cp-password-strength-bar[data-strength="2"] { width: 50%; background: var(--cp-warning); }
.cp-password-strength-bar[data-strength="3"] { width: 75%; background: #2563EB; }
.cp-password-strength-bar[data-strength="4"] { width: 100%; background: var(--cp-success); }

.cp-password-strength-text {
    font-size: 12px;
    margin-top: 4px;
    color: #333;
}

/* ══════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════ */
.cp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: 'Inter', -apple-system, sans-serif;
    font-weight: 600;
    font-size: 16px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s var(--cp-ease);
    white-space: nowrap;
    line-height: 1;
    position: relative;
    overflow: hidden;
}
.cp-btn svg { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }

.cp-btn--primary {
    background: var(--cp-accent);
    color: #fff;
    padding: 16px 36px;
    box-shadow: 0 2px 16px var(--cp-glow);
}
.cp-btn--primary:hover {
    background: var(--cp-accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 32px var(--cp-glow-strong), 0 0 0 4px var(--cp-glow);
}

.cp-btn--outline {
    background: transparent;
    color: var(--cp-accent);
    padding: 12px 24px;
    border: 1.5px solid var(--cp-accent);
}
.cp-btn--outline:hover {
    background: var(--cp-glow);
}

.cp-btn--danger {
    background: var(--cp-error);
    color: #fff;
    padding: 14px 32px;
}
.cp-btn--danger:hover {
    background: #B91C1C;
    transform: translateY(-1px);
}

.cp-btn--ghost {
    background: transparent;
    color: var(--cp-muted);
    padding: 10px 20px;
    font-size: 14px;
}
.cp-btn--ghost:hover {
    color: var(--cp-accent);
    background: rgba(157,23,77,0.06);
}

.cp-btn--sm {
    font-size: 13px;
    padding: 8px 18px;
}

.cp-btn--full {
    width: 100%;
    justify-content: center;
    padding: 16px 36px;
    font-size: 16px;
}

.cp-btn--block {
    width: 100%;
}

/* Loading state — works with plain text buttons, no inner wrappers needed */
.cp-btn.is-loading {
    pointer-events: none;
    color: transparent !important;
}
.cp-btn.is-loading::after {
    content: '';
    position: absolute;
    width: 20px; height: 20px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cp-spin 0.6s linear infinite;
}
.cp-btn--outline.is-loading::after,
.cp-btn--ghost.is-loading::after {
    border-color: rgba(157,23,77,0.2);
    border-top-color: var(--cp-accent);
}

/* Disabled */
.cp-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ══════════════════════════════════════════
   SPINNER
   ══════════════════════════════════════════ */
@keyframes cp-spin {
    to { transform: rotate(360deg); }
}
.cp-spinner {
    width: 20px; height: 20px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: cp-spin 0.6s linear infinite;
}
.cp-spinner--dark {
    border-color: rgba(26,8,18,0.15);
    border-top-color: var(--cp-accent);
}
.cp-spinner--lg {
    width: 32px; height: 32px;
    border-width: 3px;
}

/* ══════════════════════════════════════════
   TOAST NOTIFICATIONS
   ══════════════════════════════════════════ */
.cp-toast-container {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}
.cp-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 22px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10), 0 1px 4px rgba(0,0,0,0.06);
    pointer-events: auto;
    animation: cp-toast-in 0.38s var(--cp-ease);
    max-width: 480px;
    min-width: 260px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid transparent;
}
.cp-toast svg { width: 18px; height: 18px; flex-shrink: 0; }
.cp-toast.is-leaving {
    animation: cp-toast-out 0.3s var(--cp-ease) forwards;
}

@keyframes cp-toast-in {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes cp-toast-out {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(12px) scale(0.97); }
}

.cp-toast--success {
    background: rgba(240, 253, 244, 0.95);
    color: #15803d;
    border-color: rgba(134, 239, 172, 0.6);
}
.cp-toast--success svg { fill: #16a34a; }
.cp-toast--error {
    background: rgba(254, 242, 242, 0.95);
    color: #b91c1c;
    border-color: rgba(252, 165, 165, 0.6);
}
.cp-toast--error svg { fill: #dc2626; }
.cp-toast--info {
    background: rgba(239, 246, 255, 0.95);
    color: #1d4ed8;
    border-color: rgba(147, 197, 253, 0.6);
}
.cp-toast--info svg { fill: #2563eb; }

/* ══════════════════════════════════════════
   ALERT BANNERS
   ══════════════════════════════════════════ */
.cp-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--cp-radius-sm);
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
}
.cp-alert svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; margin-top: 1px; }

.cp-alert--success {
    background: var(--cp-success-bg);
    color: #065F46;
    border: 1px solid #A7F3D0;
}
.cp-alert--error {
    background: var(--cp-error-bg);
    color: #991B1B;
    border: 1px solid #FECACA;
}
.cp-alert--warning {
    background: var(--cp-warning-bg);
    color: #92400E;
    border: 1px solid #FCD34D;
}
.cp-alert--info {
    background: var(--cp-info-bg);
    color: #1E40AF;
    border: 1px solid #93C5FD;
}

/* ══════════════════════════════════════════
   OTP INPUT (6-digit code)
   ══════════════════════════════════════════ */
.cp-otp-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 24px 0;
}
.cp-otp-inputs input {
    width: 52px; height: 60px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    font-family: 'Inter', monospace;
    border: 2px solid var(--cp-border);
    border-radius: var(--cp-radius-sm);
    background: var(--cp-card-bg);
    color: var(--cp-text);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    -moz-appearance: textfield;
}
.cp-otp-inputs input::-webkit-inner-spin-button,
.cp-otp-inputs input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.cp-otp-inputs input:focus {
    border-color: var(--cp-accent);
    box-shadow: 0 0 0 3px var(--cp-glow);
}
.cp-otp-inputs input.is-filled {
    border-color: var(--cp-accent);
    background: var(--cp-light);
}

/* ══════════════════════════════════════════
   2FA METHOD SELECTOR
   ══════════════════════════════════════════ */
.cp-2fa-methods {
    display: grid;
    gap: 12px;
    margin: 24px 0;
}
.cp-2fa-method {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border: 2px solid var(--cp-border);
    border-radius: var(--cp-radius);
    background: var(--cp-card-bg);
    cursor: pointer;
    transition: all 0.2s var(--cp-ease);
    text-decoration: none;
    color: inherit;
}
.cp-2fa-method:hover {
    border-color: var(--cp-accent);
    box-shadow: 0 0 0 3px var(--cp-glow);
    transform: translateY(-1px);
}
.cp-2fa-method-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.cp-2fa-method-icon svg { width: 24px; height: 24px; }
.cp-2fa-method-icon--email {
    background: var(--cp-info-bg);
    color: var(--cp-info);
}
.cp-2fa-method-icon--app {
    background: var(--cp-success-bg);
    color: var(--cp-success);
}
.cp-2fa-method-info h4 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 4px;
}
.cp-2fa-method-info p {
    font-size: 13px;
    color: var(--cp-muted);
    margin: 0;
}
.cp-2fa-method-arrow {
    margin-left: auto;
    color: var(--cp-border);
    transition: color 0.2s;
}
.cp-2fa-method:hover .cp-2fa-method-arrow { color: var(--cp-accent); }

/* 2FA method choice cards (verify page) */
.cp-2fa-method-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 20px;
    border: 2px solid var(--cp-border);
    border-radius: var(--cp-radius);
    background: var(--cp-card-bg);
    cursor: pointer;
    transition: all 0.2s var(--cp-ease);
    text-align: center;
    width: 100%;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}
.cp-2fa-method-card:hover {
    border-color: var(--cp-accent);
    box-shadow: 0 0 0 3px var(--cp-glow);
    transform: translateY(-2px);
}
.cp-2fa-method-card .cp-2fa-method-icon {
    width: 56px; height: 56px;
    border-radius: 14px;
    background: var(--cp-bg);
    color: var(--cp-accent);
}
.cp-2fa-method-card .cp-2fa-method-label {
    font-size: 16px;
    font-weight: 700;
    color: var(--cp-text);
}
.cp-2fa-method-card .cp-2fa-method-desc {
    font-size: 13px;
    color: var(--cp-muted);
    line-height: 1.4;
}

/* ══════════════════════════════════════════
   PORTAL LAYOUT (Sidebar + Main)
   ══════════════════════════════════════════ */
.cp-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.cp-sidebar {
    width: var(--cp-sidebar-width);
    background: var(--cp-sidebar-bg);
    padding: 24px 0;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.cp-sidebar-logo {
    padding: 0 24px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 8px;
}
.cp-sidebar-logo a {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    display: inline-block;
}
.cp-sidebar-logo a span {
    background: linear-gradient(135deg, #E11D48, var(--cp-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cp-sidebar-nav {
    padding: 8px 12px;
    flex: 1;
}
.cp-sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: rgba(255,255,255,0.55);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 2px;
    transition: all 0.2s var(--cp-ease);
}
.cp-sidebar-nav a svg {
    width: 16px; height: 16px;
    fill: currentColor;
    flex-shrink: 0;
}
.cp-sidebar-nav a:hover {
    color: #fff;
    background: rgba(255,255,255,0.06);
}
.cp-sidebar-nav a.active {
    color: #fff;
    background: var(--cp-accent);
    box-shadow: 0 2px 12px var(--cp-glow);
}

.cp-sidebar-section {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.25);
    padding: 16px 16px 8px;
    font-weight: 600;
}

.cp-sidebar-bottom {
    padding: 16px 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.cp-sidebar-bottom a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    color: rgba(255,255,255,0.4);
    font-size: 13px;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
}
.cp-sidebar-bottom a:hover {
    color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.04);
}

/* Mobile sidebar toggle — hidden on desktop, shown inside topbar on mobile */
.cp-sidebar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    color: var(--cp-text);
    transition: background 0.2s;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
}
.cp-sidebar-toggle:hover { background: rgba(157,23,77,0.08); }
.cp-sidebar-toggle svg { width: 20px; height: 20px; display: block; }

.cp-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(26,8,18,0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s;
}
.cp-sidebar-overlay.is-open {
    display: block;
    opacity: 1;
}

/* Main content */
.cp-content {
    flex: 1;
    background: var(--cp-body-bg);
    min-width: 0;
}

.cp-topbar {
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--cp-border);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}
.cp-topbar h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--cp-text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.cp-topbar h1 a {
    color: var(--cp-muted);
    text-decoration: none;
    display: flex;
    transition: color 0.2s;
}
.cp-topbar h1 a:hover { color: var(--cp-accent); }
.cp-topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cp-body {
    padding: 32px;
}

/* ══════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════ */
.cp-card {
    background: var(--cp-card-bg);
    border-radius: var(--cp-card-radius);
    border: 1px solid var(--cp-card-border);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--cp-card-shadow);
    transition: box-shadow 0.3s var(--cp-ease);
}
.cp-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 16px;
    color: var(--cp-text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.cp-card h3 svg { color: var(--cp-accent); }

/* KPI card */
.cp-kpi {
    text-align: center;
}
.cp-kpi-label {
    font-size: 13px;
    color: var(--cp-muted);
    margin-bottom: 4px;
}
.cp-kpi-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--cp-text);
}

/* ══════════════════════════════════════════
   BADGES
   ══════════════════════════════════════════ */
.cp-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
}
.cp-badge--success { background: var(--cp-success-bg); color: var(--cp-success); }
.cp-badge--error   { background: var(--cp-error-bg);   color: var(--cp-error); }
.cp-badge--warning { background: var(--cp-warning-bg); color: var(--cp-warning); }
.cp-badge--info    { background: var(--cp-info-bg);    color: var(--cp-info); }
.cp-badge--neutral { background: #F3F4F6; color: #6B7280; }
.cp-badge--muted   { background: var(--cp-border); color: var(--cp-muted); }

/* ══════════════════════════════════════════
   SECURITY / 2FA SETTINGS
   ══════════════════════════════════════════ */
.cp-security-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 4px 0;
}
.cp-security-info h4 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--cp-text);
}
.cp-security-info p {
    font-size: 13px;
    color: var(--cp-muted);
    margin: 0;
}
.cp-security-action {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.cp-security-divider {
    height: 1px;
    background: var(--cp-border);
    margin: 16px 0;
}

/* Account info grid */
.cp-info-grid {
    font-size: 14px;
    display: grid;
    gap: 10px;
}
.cp-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.cp-info-row span:first-child {
    color: var(--cp-muted);
}
.cp-info-row span:last-child {
    font-weight: 600;
    color: var(--cp-text);
}

@media (max-width: 480px) {
    .cp-security-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* ══════════════════════════════════════════
   TABLES
   ══════════════════════════════════════════ */
.cp-table {
    width: 100%;
    font-size: 14px;
    border-collapse: collapse;
}
.cp-table thead tr {
    border-bottom: 2px solid var(--cp-border);
}
.cp-table th {
    text-align: left;
    padding: 10px 0;
    font-weight: 600;
    color: var(--cp-text);
    font-size: 13px;
}
.cp-table td {
    padding: 12px 0;
    border-bottom: 1px solid rgba(240,200,216,0.4);
    color: var(--cp-text);
}
.cp-table tr:last-child td { border-bottom: none; }

/* ══════════════════════════════════════════
   MODALS
   ══════════════════════════════════════════ */
.cp-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(26,8,18,0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.cp-modal-backdrop.is-open {
    display: flex;
}
.cp-modal {
    background: var(--cp-card-bg);
    border-radius: var(--cp-card-radius);
    padding: 32px;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(26,8,18,0.2);
    animation: cp-modal-in 0.3s var(--cp-ease);
}
@keyframes cp-modal-in {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ══════════════════════════════════════════
   PROGRESS BAR
   ══════════════════════════════════════════ */
.cp-progress {
    height: 4px;
    background: var(--cp-border);
    border-radius: 2px;
    overflow: hidden;
}
.cp-progress-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s var(--cp-ease);
}
.cp-progress-bar--accent { background: var(--cp-accent); }
.cp-progress-bar--success { background: var(--cp-success); }
.cp-progress-bar--warning { background: var(--cp-warning); }
.cp-progress-bar--error { background: var(--cp-error); }

/* ══════════════════════════════════════════
   QR CODE (for TOTP setup)
   ══════════════════════════════════════════ */
.cp-qr-wrap {
    text-align: center;
    padding: 24px;
    background: #fff;
    border: 1px solid var(--cp-border);
    border-radius: var(--cp-radius);
    margin: 16px 0;
}
.cp-qr-wrap img {
    width: 200px; height: 200px;
    border-radius: 8px;
}
.cp-secret-key {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    margin-top: 12px;
    padding: 10px 16px;
    background: var(--cp-light);
    border-radius: var(--cp-radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--cp-text);
}

/* ══════════════════════════════════════════
   SECURITY SETTINGS (2FA toggle cards)
   ══════════════════════════════════════════ */
.cp-security-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border: 1px solid var(--cp-border);
    border-radius: var(--cp-radius);
    margin-bottom: 12px;
    background: var(--cp-card-bg);
    transition: border-color 0.2s;
}
.cp-security-item:hover { border-color: var(--cp-accent); }

.cp-security-item-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}
.cp-security-item-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.cp-security-item-icon svg { width: 22px; height: 22px; }

.cp-security-item-text h4 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 2px;
    color: var(--cp-text);
}
.cp-security-item-text p {
    font-size: 13px;
    color: var(--cp-muted);
    margin: 0;
}

/* Toggle switch */
.cp-toggle {
    position: relative;
    width: 48px; height: 26px;
    flex-shrink: 0;
}
.cp-toggle input {
    opacity: 0;
    width: 0; height: 0;
    position: absolute;
}
.cp-toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--cp-border);
    border-radius: 26px;
    cursor: pointer;
    transition: background 0.2s;
}
.cp-toggle-slider::before {
    content: '';
    position: absolute;
    left: 3px; top: 3px;
    width: 20px; height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.cp-toggle input:checked + .cp-toggle-slider {
    background: var(--cp-accent);
}
.cp-toggle input:checked + .cp-toggle-slider::before {
    transform: translateX(22px);
}

/* ══════════════════════════════════════════
   UTILITY
   ══════════════════════════════════════════ */
.cp-text-center { text-align: center; }
.cp-text-muted { color: var(--cp-muted); }
.cp-text-accent { color: var(--cp-accent); }
.cp-text-success { color: var(--cp-success); }
.cp-text-error { color: var(--cp-error); }
.cp-mt-0 { margin-top: 0; }
.cp-mb-0 { margin-bottom: 0; }
.cp-mb-8 { margin-bottom: 8px; }
.cp-mb-16 { margin-bottom: 16px; }
.cp-mb-24 { margin-bottom: 24px; }
.cp-gap-8 { gap: 8px; }
.cp-gap-16 { gap: 16px; }
.cp-gap-20 { gap: 20px; }
.cp-flex { display: flex; }
.cp-flex-col { flex-direction: column; }
.cp-items-center { align-items: center; }
.cp-justify-between { justify-content: space-between; }
.cp-grid { display: grid; }

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */
@media (max-width: 1024px) {
    .cp-body { padding: 24px; }
}

@media (max-width: 768px) {
    .cp-sidebar {
        position: fixed;
        left: -280px;
        z-index: 999;
        transition: left 0.3s var(--cp-ease);
        width: 260px;
    }
    .cp-sidebar.is-open {
        left: 0;
    }
    .cp-sidebar-toggle {
        display: flex;
    }
    .cp-topbar {
        padding: 12px 16px;
    }
    .cp-body {
        padding: 16px;
    }

    /* Auth pages */
    .cp-auth-card {
        padding: 28px 24px;
    }
    .cp-otp-inputs input {
        width: 44px; height: 52px;
        font-size: 20px;
    }

    /* Tables scroll */
    .cp-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Security items stack */
    .cp-security-item {
        flex-wrap: wrap;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .cp-auth-wrapper {
        padding: 12px;
    }
    .cp-auth-card {
        padding: 24px 16px;
    }
    .cp-auth-logo a {
        font-size: 24px;
    }
    .cp-otp-inputs {
        gap: 6px;
    }
    .cp-otp-inputs input {
        width: 38px; height: 46px;
        font-size: 18px;
    }
    .cp-body {
        padding: 12px;
    }
    .cp-card {
        padding: 16px;
    }
}

/* ── Utility classes ─────────────────────── */
.cp-grid { display: grid; gap: 16px; }
.cp-grid--2 { grid-template-columns: repeat(2, 1fr); }
.cp-grid--3 { grid-template-columns: repeat(3, 1fr); }
.cp-grid--4 { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
@media (max-width: 640px) {
    .cp-grid--2, .cp-grid--3 { grid-template-columns: 1fr; }
    .cp-grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 380px) {
    .cp-grid--4 { grid-template-columns: 1fr; }
}

.cp-back-link { color: var(--cp-muted); text-decoration: none; display: flex; }
.cp-back-link:hover { color: var(--cp-accent); }

/* ── Toggle group (monthly/yearly) ────── */
.cp-toggle-group {
    display: inline-flex; align-items: center;
    background: var(--cp-light); border-radius: 30px;
    padding: 4px; gap: 4px;
}
.cp-toggle-btn {
    padding: 8px 24px; border-radius: 26px; border: none;
    font-size: 14px; font-weight: 600; cursor: pointer;
    background: transparent; color: var(--cp-muted);
    font-family: inherit; transition: all 0.2s;
}
.cp-toggle-btn.is-active {
    background: var(--cp-card-bg); color: var(--cp-text);
    box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
@media (max-width: 480px) {
    .cp-toggle-group { width: 100%; justify-content: center; }
    .cp-toggle-btn { padding: 7px 14px; font-size: 13px; flex: 1; text-align: center; }
    .cp-toggle-save-badge { display: none; }
    .cp-toggle-save-hint { display: block !important; }
}

/* ══════════════════════════════════════════
   LEGACY COMPAT — map old class names
   (keeps existing portal pages working
    until they're redesigned)
   ══════════════════════════════════════════ */
.portal-layout      { display: flex; min-height: 100vh; }
.portal-sidebar     { width: var(--cp-sidebar-width); background: var(--cp-sidebar-bg); padding: 24px 0; flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.portal-sidebar-logo { padding: 0 24px 24px; border-bottom: 1px solid rgba(255,255,255,0.06); margin-bottom: 8px; }
.portal-sidebar-logo a { font-size: 20px; font-weight: 800; color: #fff; text-decoration: none; }
.portal-sidebar-logo a span { background: linear-gradient(135deg, #E11D48, var(--cp-accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.portal-sidebar-nav { padding: 8px 12px; }
.portal-sidebar-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 16px; color: rgba(255,255,255,0.55); font-size: 14px; font-weight: 500; text-decoration: none; border-radius: 10px; margin-bottom: 2px; transition: all 0.2s; }
.portal-sidebar-nav a svg { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }
.portal-sidebar-nav a:hover { color: #fff; background: rgba(255,255,255,0.06); }
.portal-sidebar-nav a.active { color: #fff; background: var(--cp-accent); box-shadow: 0 2px 12px var(--cp-glow); }
.portal-sidebar-section { font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: rgba(255,255,255,0.25); padding: 16px 16px 8px; font-weight: 600; }
.portal-sidebar-bottom { position: absolute; bottom: 0; left: 0; right: 0; padding: 16px 12px; border-top: 1px solid rgba(255,255,255,0.06); }
.portal-sidebar-bottom a { display: flex; align-items: center; gap: 10px; padding: 8px 16px; color: rgba(255,255,255,0.4); font-size: 13px; text-decoration: none; border-radius: 8px; }
.portal-sidebar-bottom a:hover { color: rgba(255,255,255,0.7); }

.portal-content { flex: 1; background: var(--cp-body-bg); }
.portal-topbar { background: rgba(255,255,255,0.75); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--cp-border); padding: 16px 32px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; gap: 8px; }
.portal-topbar h1 { font-size: 20px; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.portal-topbar-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.portal-body { padding: 32px; margin: 0 auto; width: 100%; box-sizing: border-box; }

.portal-card { background: var(--cp-card-bg); border-radius: var(--cp-card-radius); border: 1px solid var(--cp-card-border); padding: 24px; margin-bottom: 20px; box-shadow: var(--cp-card-shadow); }
.portal-card h3 { font-size: 16px; font-weight: 700; margin: 0 0 16px; }

/* Legacy form elements */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; color: var(--cp-text); margin-bottom: 6px; }
.form-input { width: 100%; padding: 12px 16px; font-family: 'Inter', -apple-system, sans-serif; font-size: 15px; color: var(--cp-text); background: var(--cp-card-bg); border: 1.5px solid var(--cp-border); border-radius: var(--cp-radius-sm); transition: border-color 0.2s, box-shadow 0.2s; outline: none; box-sizing: border-box; }
.form-input:focus { border-color: var(--cp-accent); box-shadow: 0 0 0 3px var(--cp-glow); }

/* Legacy buttons */
.btn-primary { display: inline-flex; align-items: center; gap: 8px; background: var(--cp-accent); color: #fff; padding: 14px 32px; border-radius: 50px; border: none; font-family: 'Inter', sans-serif; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; transition: all 0.3s var(--cp-ease); box-shadow: 0 2px 16px var(--cp-glow); }
.btn-primary:hover { background: var(--cp-accent-hover); transform: translateY(-1px); box-shadow: 0 4px 24px var(--cp-glow-strong); }
.btn-primary svg { width: 16px; height: 16px; fill: currentColor; }

.btn-outline { display: inline-flex; align-items: center; gap: 8px; background: transparent; color: var(--cp-accent); padding: 12px 24px; border-radius: 50px; border: 1.5px solid var(--cp-accent); font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; transition: all 0.2s; }
.btn-outline:hover { background: var(--cp-glow); }

.btn-back { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; color: var(--cp-muted); font-size: 14px; font-weight: 500; cursor: pointer; padding: 8px 0; transition: color 0.2s; font-family: 'Inter', sans-serif; text-decoration: none; }
.btn-back:hover { color: var(--cp-accent); }
.btn-back svg { width: 14px; height: 14px; fill: currentColor; }

/* Legacy variables mapping */
:root {
    --navy:       var(--cp-sidebar-bg);
    --pink:       var(--cp-accent);
    --pink-light: var(--cp-light);
    --white:      #FFFFFF;
    --gray-50:    #FAFAFA;
    --gray-100:   #F5F5F5;
    --gray-200:   var(--cp-border);
    --gray-300:   #D1D5DB;
    --gray-400:   #9CA3AF;
    --gray-500:   var(--cp-muted);
    --gray-600:   #6B7280;
    --gray-700:   #374151;
    --success:    var(--cp-success);
    --blue-light: var(--cp-info-bg);
}

/* Mobile sidebar for legacy layout */
@media (max-width: 768px) {
    .portal-sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        z-index: 999;
        height: 100vh;
        width: 260px;
        transition: left 0.3s ease;
        display: flex;
        flex-direction: column;
    }
    .portal-sidebar.is-open {
        left: 0;
    }
    .portal-body { padding: 16px; }
    .portal-topbar {
        padding: 10px 14px;
        gap: 8px;
    }
    .portal-topbar h1 {
        font-size: 16px;
        flex: 1;
        min-width: 0;
    }
    .portal-topbar-actions .cp-btn--sm {
        font-size: 12px;
        padding: 8px 12px;
    }
    .portal-topbar-actions .cp-btn--sm svg {
        display: none;
    }
}
@media (max-width: 480px) {
    .portal-topbar-actions .cp-btn--sm span.hide-xs {
        display: none;
    }
    .portal-body { padding: 12px; }
    .portal-card { padding: 16px; }
}
@media (max-width: 360px) {
    .portal-topbar { padding: 8px 10px; }
    .portal-topbar h1 { font-size: 14px; }
    .portal-body { padding: 10px; }
}

/* ── Site detail — small screen fixes ────────────── */

/* KPI cards: 2 per row on small, 1 per row on very small */
@media (max-width: 480px) {
    /* KPI grid override — force 2 cols */
    .cp-kpi { padding: 14px 12px; }
    .cp-kpi-value { font-size: 18px !important; }

    /* Card padding tighter */
    .cp-card { padding: 16px; }

    /* Subscription action buttons — stack on tiny screens */
    .cp-sub-actions { flex-wrap: wrap; }
    .cp-sub-actions .cp-btn { flex: 1; min-width: 120px; justify-content: center; }

    /* Transactions table — hide less important cols */
    .cp-table th:nth-child(1),
    .cp-table td:nth-child(1) { display: none; } /* # ID */
    .cp-table th:nth-child(3),
    .cp-table td:nth-child(3) { display: none; } /* Description */

    /* Info rows — allow wrapping */
    .cp-info-row { flex-wrap: wrap; gap: 2px; }
    .cp-info-row span:last-child { font-size: 13px; }
}

@media (max-width: 360px) {
    .cp-card { padding: 12px; }

    /* Transactions table — also hide receipt col */
    .cp-table th:nth-child(6),
    .cp-table td:nth-child(6) { display: none; }
}

/* Dashboard main 2-col grid → single column on mobile */
.cp-dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    align-items: start;
}
@media (max-width: 900px) {
    .cp-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Range tab buttons ── */
.cp-range-tabs {
    display: flex;
    gap: 2px;
    background: var(--cp-light);
    border-radius: var(--cp-radius-sm);
    padding: 3px;
    flex-shrink: 0;
}
.cp-range-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: calc(var(--cp-radius-sm) - 2px);
    color: var(--cp-muted);
    transition: background .15s, color .15s;
    font-family: inherit;
}
.cp-range-btn.active {
    background: #fff;
    color: var(--cp-accent);
    box-shadow: 0 1px 3px rgba(0,0,0,.12);
}
/* ── Analytics loading state ── */
.cp-analytics-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 140px;
}
.cp-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--cp-border);
    border-top-color: var(--cp-accent);
    border-radius: 50%;
    animation: cp-spin .7s linear infinite;
}
@keyframes cp-spin { to { transform: rotate(360deg); } }
/* ── SVG line chart ── */
.cp-chart-wrap {
    width: 100%;
    margin-bottom: 12px;
}
.cp-chart-wrap svg {
    display: block;
    width: 100%;
    height: 220px;
    overflow: visible;
}
.cp-chart-grid line {
    stroke: var(--cp-border);
    stroke-dasharray: 4 4;
    stroke-width: 1;
}
.cp-chart-area {
    /* fill set via inline gradient in JS */
}
.cp-chart-line {
    fill: none;
    stroke: var(--cp-accent);
    stroke-width: 2.5;
    stroke-linejoin: round;
    stroke-linecap: round;
}
.cp-chart-dot {
    fill: var(--cp-accent);
    opacity: 0;
    transition: opacity .15s;
    pointer-events: none;
}
.cp-chart-hit {
    cursor: crosshair;
}
.cp-chart-hit:hover + .cp-chart-dot,
.cp-chart-dot[style*="opacity: 1"] {
    opacity: 1;
}
.cp-chart-labels {
    font-size: 10px;
    fill: var(--cp-muted);
}
.cp-chart-labels--y {
    font-size: 9px;
}
/* ── Content pills ── */
.cp-content-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}
.cp-content-pill {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 99px;
    background: var(--cp-light);
    font-size: 12px;
    font-weight: 600;
    color: var(--cp-text);
}
.cp-content-pill svg { color: var(--cp-accent); }

/* ══════════════════════════════════════════
   MOBILE RESPONSIVE — all pages ≥ 320px
   ══════════════════════════════════════════ */

/* Affiliate 2fr/1fr → single column */
.cp-affiliate-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}
@media (max-width: 768px) {
    .cp-affiliate-grid {
        grid-template-columns: 1fr;
    }
}

/* Site detail 2-col grids → single column */
.cp-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
@media (max-width: 640px) {
    .cp-two-col {
        grid-template-columns: 1fr;
    }
}

/* Upgrade page portal-body max-width container */
@media (max-width: 480px) {
    .portal-body[style*="max-width:1100px"],
    .portal-body[style*="max-width: 1100px"] {
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* Plan cards — never overflow on tiny screens */
.cp-plan-card {
    min-width: 0;
}

/* KPI cards — stay readable on 320px */
.cp-kpi {
    min-width: 0;
    overflow: hidden;
}
.cp-kpi-value {
    word-break: break-word;
}

/* Affiliate link input+button — stack on tiny screens */
@media (max-width: 480px) {
    .cp-aff-link-row {
        flex-direction: column;
    }
    .cp-aff-link-row .cp-form-input {
        width: 100%;
    }
}

/* Wizard nav buttons — wrap on very small */
@media (max-width: 380px) {
    .wz-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    .wz-nav > * { width: 100%; justify-content: center; }
    .wz-nav > span { display: none; }
}

/* Topbar "Create New Site" button text — hide on tiny */
@media (max-width: 380px) {
    .cp-topbar-hide-xs { display: none; }
}

/* Hide icons inside site card action buttons on small screens (keep trash icon) */
@media (max-width: 480px) {
    .cp-site-card-actions a svg { display: none; }
}

/* ── Cancel Subscription Page ─────────────────────── */
.cp-back-btn { color: var(--cp-muted); text-decoration: none; display: flex; align-items: center; flex-shrink: 0; transition: color 0.15s; }
.cp-back-btn:hover { color: var(--cp-text); }

.cp-state-card { text-align: center; padding: 48px 32px; }
.cp-state-icon { width: 72px; height: 72px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; font-size: 30px; }
.cp-state-icon--success { background: var(--cp-success-bg); color: var(--cp-success); }
.cp-state-icon--danger  { background: #FEF2F2; color: #DC2626; }
.cp-state-title { font-size: 22px; font-weight: 700; margin: 0 0 10px; }
.cp-state-text  { color: var(--cp-muted); margin: 0 0 8px; line-height: 1.6; }
.cp-state-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }
.cp-state-actions .cp-btn { min-width: 140px; }

.cp-cancel-header { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.cp-cancel-icon { width: 48px; height: 48px; border-radius: 12px; background: #FEF2F2; color: #DC2626; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.cp-cancel-title { font-size: 20px; font-weight: 700; margin: 0 0 4px; }
.cp-cancel-title span { color: var(--cp-accent); }
.cp-cancel-subtitle { color: var(--cp-muted); font-size: 14px; margin: 0; }

.cp-cancel-consequences { background: #FFFBEB; border: 1px solid #FDE68A; border-radius: 10px; padding: 16px 18px; margin-bottom: 20px; }
.cp-cancel-consequences-label { font-weight: 600; font-size: 14px; color: #92400E; margin: 0 0 10px; display: flex; align-items: center; gap: 6px; }
.cp-cancel-consequences-label svg { fill: #92400E; }
.cp-cancel-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.cp-cancel-list li { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #78350F; }
.cp-cancel-list li svg { fill: #D97706; flex-shrink: 0; width: 14px; height: 14px; }
.cp-cancel-list li strong { color: #92400E; }

.cp-cancel-actions { display: grid; gap: 10px; margin-top: 24px; }
.cp-btn--full { width: 100%; justify-content: center; }

@media (max-width: 480px) {
    .cp-state-card { padding: 32px 20px; }
    .cp-state-actions { flex-direction: column; }
    .cp-state-actions .cp-btn { min-width: 0; width: 100%; justify-content: center; }
    .cp-cancel-header { flex-direction: column; align-items: flex-start; gap: 12px; }
}
