/* PWA App Styles */
/* Moved from user-web-portal-pwa/index.html <style> block */

/* ============================================
   ACCESSIBILITY - Focus Rings & Motion
   ============================================ */
*:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
    border-radius: 4px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* App Container - Responsive/Fullscreen */
html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    font-family: 'Sora', 'Inter', 'Segoe UI', sans-serif;
    background: var(--bg-radial);
    color: var(--text-primary);
}

.popup-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    box-shadow: none;
}

/* Header, logo, wrapper padding: see common/pwa-header.css for PWA-wide consistency */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-primary);
}

.brand {
    display: flex;
    align-items: center;
}

.brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.brand-logo-img {
    display: block;
}

.auth-logo-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 16px;
}

.brand-name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--gold);
}

.brand-subtitle {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 1px;
}

.header-actions {
    display: flex;
    gap: clamp(0.5rem, 1vw + 0.35rem, 0.75rem);
}

/* Let theme (.vvc-header-btn) control size; only add look that doesn’t override dimensions */
.header-btn {
    min-width: clamp(2rem, 5vw + 1.25rem, 2.375rem);
    min-height: clamp(2rem, 5vw + 1.25rem, 2.375rem);
    background: var(--bg-surface);
    border: 1px solid var(--border-gold);
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(0.875rem, 1vw + 0.6rem, 1rem);
}

.header-btn:hover {
    background: var(--bg-surface-hover);
    color: var(--gold);
    transform: translateY(-1px);
    box-shadow: var(--gold-glow);
}

/* Status Bar — Obsidian Glass */
.status-bar {
    display: flex;
    justify-content: flex-start;
    padding: 12px 24px;
    background: rgba(10, 10, 10, 0.4);
    border-bottom: 1px solid var(--border-subtle);
    gap: 12px;
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
}

.status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    transition: all 0.2s;
    cursor: pointer;
    flex: 0 0 auto;
    min-width: 100px;
    justify-content: center;
}

.status-pill:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-gold);
}

.status-pill.active {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-tertiary);
    box-shadow: 0 0 5px rgba(128, 128, 128, 0.3);
    transition: all 0.3s;
}

/* Status Colors */
.status-ok {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.status-ok .status-dot {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.status-warn {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

.status-warn .status-dot {
    background: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
}

.status-err {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.status-err .status-dot {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

/* Main Content */
.content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    position: relative;
    width: 100%; /* Phase 4: Full width */
    max-width: 100%; /* Phase 4: No max-width constraint */
}

.content::-webkit-scrollbar {
    width: 6px;
}

.content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

/* WhatsApp Auth Modal (override inline styles from runtime) */
#waAuthModal .fixed {
    background: rgba(5, 5, 5, 0.88) !important;
    -webkit-backdrop-filter: var(--glass-blur) !important;
    backdrop-filter: var(--glass-blur) !important;
}

#waAuthModal .fixed > div {
    background: rgba(20, 20, 20, 0.98) !important;
    border: 1px solid var(--border-gold) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(212, 175, 55, 0.06) !important;
}

#waAuthModal input,
#waAuthModal select {
    background: rgba(0, 0, 0, 0.4) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-medium) !important;
}

#waAuthModal input::placeholder {
    color: var(--text-tertiary) !important;
}

#waAuthCancel {
    background: var(--bg-surface) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-gold) !important;
}

#waAuthSubmit {
    background: var(--gold-gradient) !important;
    color: var(--text-inverse) !important;
    border: none !important;
}

/* Auth Card: card look from common (vvc-card); layout only */
.auth-card {
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    margin: 40px auto;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.auth-icon {
    width: 80px;
    height: 80px;
    background: var(--gold-gradient);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 24px;
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.35);
}

.auth-title { font-size: 24px; font-weight: 700; margin-bottom: 12px; }

.auth-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.6;
}

/* Google sign-in: common vvc-btn-1 provides look; layout only */
.google-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px; }

/* Dashboard Tabs — Obsidian Gold */
.tabs {
    display: flex;
    background: rgba(10, 10, 10, 0.5);
    padding: 6px;
    border-radius: 14px;
    margin-bottom: 24px;
    border: 1px solid var(--border-gold);
    max-width: 100%;
    width: 100%;
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--gold-100);
    color: var(--gold);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.tab-btn:hover:not(.active) {
    color: var(--text-primary);
    background: var(--bg-surface);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* 4 cols on large screen */
    gap: 16px;
    margin-bottom: 24px;
    width: 100%; /* Phase 4: Full width */
    max-width: 100%; /* Phase 4: No constraint */
}

/* Stat card: look from common (vvc-card); layout only */
.stat-card { border-radius: 16px; padding: 20px; position: relative; overflow: hidden; }

.stat-label {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.stat-unit {
    font-size: 14px;
    color: var(--text-tertiary);
    font-weight: 500;
}

/* Action Buttons Grid */
.action-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    width: 100%; /* Phase 4: Full width */
    max-width: 100%; /* Phase 4: No constraint */
}

/* Action card: look from common (vvc-card); layout only */
.action-card {
    border-radius: 16px;
    padding: 24px;
    cursor: pointer;
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    height: 100%;
}
.action-card:hover { transform: translateY(-4px); }

.action-icon {
    font-size: 32px;
    margin-bottom: 4px;
}

.action-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.action-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Footer — Obsidian Gold */
.footer {
    padding: 16px 24px;
    background: #020617;
    border-top: 1px solid var(--border-gold);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-tertiary);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-link:hover {
    color: var(--gold);
}

/* Panel Helpers */
.panel {
    display: none;
}

.panel.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

/* Compose View */
.input-group {
    margin-bottom: 20px;
}

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

.input-field,
.textarea-field,
.select-field {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-medium);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    transition: all 0.2s;
    box-sizing: border-box;
}

.input-field:focus,
.textarea-field:focus,
.select-field:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.textarea-field {
    min-height: 200px;
    /* Taller */
    resize: vertical;
    line-height: 1.6;
}

/* Tools Bar */
.tools-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 0 4px;
}

.tool-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 15px;
    transition: all 0.2s;
}

.tool-btn:hover {
    color: var(--gold);
    background: var(--bg-surface-hover);
}

.dropdown-menu {
    position: absolute;
    background: rgba(15, 15, 15, 0.95);
    border: 1px solid var(--border-gold);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
    z-index: 50;
    min-width: 180px;
    max-height: 250px;
    overflow-y: auto;
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
}

.emoji-picker {
    position: absolute;
    background: rgba(15, 15, 15, 0.95);
    border: 1px solid var(--border-gold);
    border-radius: 16px;
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
    width: 320px;
    height: 240px;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
    z-index: 60;
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 12px;
}

.mb-4 {
    margin-bottom: 24px;
}

.w-full {
    width: 100%;
}

/* Buttons: styled by common (vvc-btn, vvc-btn-1, vvc-btn-4) */

/* Table Styles (Reports) — Obsidian Gold */
.data-table-container {
    background: var(--glass-bg);
    border: 1px solid var(--border-gold);
    border-radius: 16px;
    overflow: hidden;
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
}

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

.data-table th {
    text-align: left;
    padding: 16px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gold);
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--border-subtle);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 16px;
    font-size: 1rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
}

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

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Phase 8: Responsive Design - Full screen width utilization */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .action-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .popup-wrapper {
        border-radius: 0;
        max-width: 100%;
        width: 100%;
    }
    
    .content {
        padding: 16px;
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        width: 100%;
        max-width: 100%;
    }

    .action-grid {
        grid-template-columns: 1fr;
        width: 100%;
        max-width: 100%;
    }

    .header {
        padding: 12px 16px;
        width: 100%;
    }

    .status-bar {
        padding: 10px 16px;
        overflow-x: auto;
        width: 100%;
    }
    
    .tabs {
        width: 100%;
        max-width: 100%;
    }
    
    .panel {
        width: 100%;
        max-width: 100%;
    }
}

/* Phase 8: Large screens - Centered with max-width */
@media (min-width: 1200px) {
    .popup-wrapper {
        max-width: 1280px;
        margin: 0 auto;
    }
}

/* ===================================================
   Enhanced PWA Styles — Polished UI Additions
   =================================================== */

/* -------------------------------------------------
   1. Emoji Picker (enhanced)
   ------------------------------------------------- */
.emoji-picker {
    position: absolute;
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid var(--border-gold);
    border-radius: 16px;
    padding: 12px;
    max-height: 280px;
    overflow-y: auto;
    width: 100%;
    z-index: 100;
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
}

.emoji-picker::-webkit-scrollbar {
    width: 5px;
}

.emoji-picker::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 3px;
}

.emoji-picker::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}

.emoji-picker::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* -------------------------------------------------
   2. Variable Dropdown (glassmorphism)
   ------------------------------------------------- */
.dropdown-menu {
    position: absolute;
    background: rgba(10, 10, 10, 0.95);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-gold);
    border-radius: 14px;
    padding: 8px;
    z-index: 100;
    min-width: 200px;
    max-height: 260px;
    overflow-y: auto;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
}

.dropdown-menu::-webkit-scrollbar {
    width: 5px;
}

.dropdown-menu::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 3px;
}

.dropdown-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}

.dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* -------------------------------------------------
   3. Template Card List Container
   ------------------------------------------------- */
.templates-list-container {
    max-height: 300px;
    overflow-y: auto;
}

.templates-list-container::-webkit-scrollbar {
    width: 5px;
}

.templates-list-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 3px;
}

.templates-list-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}

.templates-list-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* -------------------------------------------------
   4. Loading Skeleton / Shimmer
   ------------------------------------------------- */
.skeleton {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    color: transparent !important;
}

.skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.06) 40%,
        rgba(255, 255, 255, 0.06) 60%,
        transparent 100%
    );
    animation: shimmer 1.6s ease-in-out infinite;
}

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

/* -------------------------------------------------
   5. PWA-Specific Responsive Improvements
   ------------------------------------------------- */
.content {
    flex: 1;
}

/* Large screens: 4-column grids (already default, reinforce) */
@media (min-width: 769px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .action-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* -------------------------------------------------
   6. Better Button States
   ------------------------------------------------- */
/* vvc-btn :disabled handled in common */

/* -------------------------------------------------
   7. Smooth Transitions on Interactive Elements
   ------------------------------------------------- */
.tab-btn {
    transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}


.header-btn {
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.status-pill {
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.footer-link {
    transition: color 0.2s ease;
}

.tool-btn {
    transition: color 0.2s ease, background 0.2s ease;
}

/* ============================================
   PROFILE / ACCOUNT DETAILS MODAL (shared layout)
   ============================================ */
.profile-modal-content.account-detail-modal {
    overflow-y: auto;
    max-height: 90vh;
}
.profile-modal-content.account-detail-modal.profile-detail {
    max-width: 720px !important;
    padding: 1.5rem !important;
}
.account-detail-section {
    margin-bottom: 1.5rem;
}
.account-detail-section:last-of-type {
    margin-bottom: 0;
}
.account-detail-heading {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--vvc-text-muted, #94a3b8);
    margin: 0 0 0.75rem 0;
}
.flex-min {
    flex: 1;
    min-width: 0;
}
.profile-user-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem !important;
    margin-bottom: 0.75rem;
}
.profile-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
}
#profileModal #closeProfileBtn,
#subscriptionModal #closeSubscriptionBtn {
    color: #fff !important;
    font-size: 1.75rem !important;
    font-weight: 600;
    line-height: 1;
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255,255,255,0.15) !important;
    border: 1px solid rgba(255,255,255,0.25) !important;
    cursor: pointer;
}
#profileModal #closeProfileBtn:hover,
#subscriptionModal #closeSubscriptionBtn:hover {
    background: rgba(255,255,255,0.25) !important;
    color: #fff !important;
    border-color: rgba(255,255,255,0.4) !important;
}
#profileModal #closeProfileBtn:focus-visible,
#subscriptionModal #closeSubscriptionBtn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}
.profile-created-row {
    display: grid;
    grid-template-columns: minmax(6.5rem, auto) 1fr;
    gap: 0.75rem 1.25rem;
    align-items: baseline;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}
.profile-created-row span:last-child {
    text-align: right;
    color: var(--vvc-text-main, #f1f5f9);
}
.profile-license-card {
    background: rgba(212,175,55,0.06);
    border: 1px solid rgba(212,175,55,0.15);
    border-radius: 12px;
    padding: 1rem 1.25rem;
}
.profile-license-grid {
    display: grid;
    grid-template-columns: minmax(6.5rem, auto) 1fr;
    gap: 0.5rem 1.25rem;
    align-items: baseline;
    font-size: 0.875rem;
}
.profile-license-label {
    color: var(--vvc-text-muted, #94a3b8);
}
.profile-license-value {
    text-align: right;
    color: var(--vvc-text-main, #f1f5f9);
    word-break: break-word;
}
.profile-license-value-id {
    color: var(--vvc-accent, #f59e0b);
    font-family: ui-monospace, monospace;
    font-size: 0.8rem;
}
.profile-modal-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.profile-modal-actions .vvc-btn {
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
    width: auto;
    min-width: 0;
}
.profile-password-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.profile-password-form .auth-input {
    width: 100%;
    box-sizing: border-box;
}
.profile-password-form button[type="submit"] {
    align-self: flex-start;
}

/* ============================================
   EXPIRED SUBSCRIPTION POPUP — CTA, high visibility
   ============================================ */
.expired-subscription-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    padding: 1.5rem;
}
.expired-subscription-overlay.hidden {
    display: none !important;
}
@keyframes expired-popup-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.35); }
    50% { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
}
.expired-subscription-card {
    background: linear-gradient(145deg, rgba(30, 20, 20, 0.98), rgba(20, 15, 15, 0.98));
    border: 2px solid rgba(239, 68, 68, 0.5);
    border-radius: 16px;
    padding: 1.75rem 2rem;
    max-width: 420px;
    width: 100%;
    text-align: center;
    animation: expired-popup-pulse 2s ease-in-out infinite;
    will-change: box-shadow;
}
.expired-subscription-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.75rem;
}
.expired-subscription-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fca5a5;
    margin: 0 0 0.5rem 0;
    letter-spacing: 0.02em;
}
.expired-subscription-desc {
    font-size: 1rem;
    color: var(--vvc-text-muted, #94a3b8);
    line-height: 1.5;
    margin: 0 0 1.5rem 0;
}
.expired-subscription-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}
.expired-subscription-actions .vvc-btn {
    min-width: 120px;
}
.expired-popup-cta {
    background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
    color: #fff !important;
    font-weight: 600 !important;
    border-color: rgba(239, 68, 68, 0.6) !important;
}

/* ============================================
   TRIAL BANNER - Premium Dark Theme
   ============================================ */
.trial-banner {
    background: var(--gold-gradient-subtle);
    border: 1px solid var(--border-gold);
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    animation: fadeIn 0.3s ease-out;
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    font-size: 1.2rem;
}

.trial-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.trial-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-gold);
    margin-bottom: 2px;
}

.trial-desc {
    font-size: 1.2rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.btn-buy-license {
    white-space: nowrap;
    padding: 8px 16px;
    font-size: 1.2rem;
    border-radius: 10px;
    flex-shrink: 0;
}

/* Email Auth Form */
.email-auth-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.auth-input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.auth-input:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.15);
}

.auth-input::placeholder {
    color: var(--text-tertiary);
}

.email-auth-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2px;
}

.email-auth-links .text-link {
    background: none;
    border: none;
    color: var(--accent-gold);
    cursor: pointer;
    font-size: 12px;
    padding: 2px 0;
    text-decoration: none;
}

.email-auth-links .text-link:hover {
    text-decoration: underline;
}

/* Footer Contact Section */
.footer-contact-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px 32px;
}

.footer-contact-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.footer-contact-link {
    color: var(--gold);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.footer-contact-link:hover {
    color: var(--gold-light);
    text-decoration: underline;
}

@media (max-width: 640px) {
    .footer-contact-section {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .trial-banner {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
}

/* ============================================
   BOTTOM NAVIGATION - PWA Polish
   ============================================ */
@media (max-width: 768px) {
    .tabs {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 100;
        background: rgba(10, 10, 10, 0.95);
        -webkit-backdrop-filter: var(--glass-blur);
        backdrop-filter: var(--glass-blur);
        border-top: 1px solid var(--border-gold);
        padding: 8px 0;
        padding-bottom: max(8px, env(safe-area-inset-bottom));
        margin-bottom: 0;
        border-radius: 0;
        border-bottom: none;
        top: auto;
    }

    .tabs .tab-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        padding: 6px 8px;
        font-size: 11px;
        font-weight: 500;
        color: var(--text-tertiary);
        transition: all 0.2s ease;
        border: none;
        background: none;
        cursor: pointer;
        min-width: 64px;
        border-bottom: none;
    }

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

    .tabs .tab-btn.active {
        color: var(--gold);
    }

    .tabs .tab-btn .tab-icon {
        font-size: 20px;
        line-height: 1;
    }
}

.tab-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10, 10, 10, 0.95);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--border-gold);
    padding: 8px 0;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
}

.tab-nav .tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-tertiary);
    transition: all 0.2s ease;
    border: none;
    background: none;
    cursor: pointer;
    min-width: 64px;
}

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

.tab-nav .tab-btn.active {
    color: var(--gold);
}

.tab-nav .tab-btn .tab-icon {
    font-size: 20px;
    line-height: 1;
}

/* Ensure main content doesn't get hidden behind fixed bottom nav */
@media (max-width: 768px) {
    .popup-wrapper,
    .tab-content {
        padding-bottom: 80px;
    }
}

/* ============================================
   PRICING MODAL — Obsidian Gold
   ============================================ */
.pricing-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.75);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.2s ease;
}

.pricing-modal-overlay.hidden { display: none; }

.pricing-modal {
    background: linear-gradient(145deg, #141414, #0A0A0A);
    border-radius: 20px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
    position: relative;
}

.pricing-header {
    text-align: center;
    margin-bottom: 28px;
    position: relative;
}

.pricing-title {
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, #FFF, #D4AF37);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 6px;
}

.pricing-subtitle {
    color: #A0A0A0;
    font-size: 0.9rem;
}

.btn-close-pricing {
    position: absolute;
    top: 0; right: 0;
    background: none;
    border: none;
    color: #808080;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 8px;
    transition: all 0.2s;
}

.btn-close-pricing:hover {
    color: #FFF;
    background: rgba(255,255,255,0.05);
}

/* Tutorial-en style: larger cards, 2rem gap */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 1.5rem;
}

/* Pricing card: tutorial-style (vvc-card gets gradient/radius from theme-dark) */
.pricing-card {
    border-radius: var(--vvc-card-radius, 32px);
    padding: 2.5rem 2rem;
    min-height: 300px;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
}
.pricing-card:hover { transform: translateY(-12px); }

.pricing-card-badge {
    position: absolute;
    top: 1rem; right: 1rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: #A0A0A0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pricing-badge-popular {
    color: #D4AF37;
    background: rgba(212,175,55,0.1);
    padding: 4px 10px;
    border-radius: 6px;
}

.pricing-plan-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: #F0F0F0;
    margin-bottom: 0.75rem;
    letter-spacing: -0.5px;
}

.pricing-price {
    margin-bottom: 1.25rem;
}

.pricing-amount {
    font-size: 2.1rem;
    font-weight: 800;
    color: #D4AF37;
}

.pricing-period {
    font-size: 1rem;
    color: var(--vvc-text-muted, #94a3b8);
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
    flex: 1;
    text-align: left;
    font-size: 0.95rem;
    color: var(--vvc-text-muted, #94a3b8);
}

.pricing-features li {
    padding: 0.4rem 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

/* Pricing button: common vvc-btn-1 / vvc-btn-4 provides look */
.btn-pricing-select {
    width: 100%;
    margin-top: auto;
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
}

.btn-pricing-select:disabled {
    opacity: 0.5;
    cursor: default;
    transform: none;
}

.pricing-footer-note {
    text-align: center;
    color: #808080;
    font-size: 0.75rem;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 900px) {
    .pricing-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
}

@media (max-width: 768px) {
    .pricing-modal { padding: 1.5rem 1rem; }
    .pricing-card { padding: 2rem 1.5rem; min-height: 280px; }
}

@media (max-width: 480px) {
    .pricing-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* Shared utility/layout classes (no inline styles) */
.header-brand-link { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: inherit; }
.flex-min { flex: 1; min-width: 0; }
.profile-license-card { background: rgba(212,175,55,0.06); border: 1px solid rgba(212,175,55,0.15); border-radius: 12px; padding: 14px 16px; margin-top: 12px; }
.profile-license-card .license-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.profile-license-card .license-card-label { font-size: 13px; font-weight: 600; color: #D4AF37; }
.profile-license-card .license-card-value { font-size: 12px; color: #f8fafc; font-weight: 500; text-align: right; }
.profile-license-card .license-card-muted { font-size: 12px; color: #94a3b8; }
.profile-license-card .license-card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; font-size: 12px; }
.profile-license-card .license-card-id { color: #D4AF37; font-weight: 600; font-family: monospace; font-size: 11px; text-align: right; }
.status-pill-sm { font-size: 11px; padding: 2px 10px; }
.activity-log-card { margin-top: 1.5rem; padding: 1rem 1.25rem; }
.card-title-no-margin { margin: 0; }
.live-log-list { min-height: 120px; }
.auth-name-field { display: none; }
.stats-page-title { margin-bottom: 1.5rem; }
.report-panel.hidden { display: none; }
.trial-banner-spacing { margin: 1rem 1.5rem; }
.pricing-brand-link { text-decoration: none; display: flex; align-items: center; gap: 0.75rem; }
.pricing-btn-center { display: inline-block; text-align: center; }
.text-amber-gold { color: #D4AF37; }
.pricing-trial-mt { margin-top: 2rem; }
.contact-muted-p { color: #A0A0A0; margin-bottom: 20px; }
.text-center { text-align: center; }
.brand-link { text-decoration: none; display: flex; align-items: center; gap: 0.75rem; }
.tutorial-close-btn { padding: 0.5rem 1.2rem; font-size: 0.85rem; border-radius: 10px; }
.tutorial-step-num { background: var(--vrk-gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.tutorial-card-delay-1 { animation-delay: 0.1s; }
.tutorial-card-delay-2 { animation-delay: 0.2s; }
.tutorial-card-delay-3 { animation-delay: 0.3s; }
.tutorial-card-delay-4 { animation-delay: 0.4s; }
.tutorial-card-delay-5 { animation-delay: 0.5s; }
.tutorial-card-delay-6 { animation-delay: 0.6s; }
