/* ============================================================
   ReplyGenius — Premium Design System
   ============================================================ */

/* ── CSS Variables ────────────────────────────────────────── */
:root {
    /* Brand Colors */
    --primary: #0d9488;
    --primary-hover: #0f766e;
    --primary-light: rgba(13, 148, 136, 0.08);
    --primary-glow: rgba(13, 148, 136, 0.25);
    --accent: #f59e0b;
    --accent-hover: #d97706;

    /* Semantic Colors */
    --success: #059669;
    --success-light: rgba(5, 150, 105, 0.12);
    --danger: #dc2626;
    --danger-light: rgba(220, 38, 38, 0.12);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.12);
    --info: #3b82f6;
    --info-light: rgba(59, 130, 246, 0.12);

    /* Surface / Layout */
    --surface: #0f172a;
    --surface-light: #1e293b;
    --surface-hover: #334155;
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --muted: #64748b;
    --border: #e2e8f0;
    --border-light: #f1f5f9;

    /* Typography */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;

    /* Spacing Scale */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-primary: 0 4px 14px -3px rgba(13, 148, 136, 0.4);
    --shadow-danger: 0 4px 14px -3px rgba(220, 38, 38, 0.3);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
    --transition-spring: 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Reset & Base ─────────────────────────────────────────── */
[x-cloak] { display: none !important; }

body {
    font-feature-settings: "ss01", "ss02";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Keyframe Animations ──────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(24px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-24px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes priorityGlow {
    0%, 100% { box-shadow: var(--shadow-sm), 0 0 0 1px var(--border), 0 0 0 3px rgba(59, 130, 246, 0.15); }
    50% { box-shadow: var(--shadow-md), 0 0 0 1px var(--info), 0 0 0 4px rgba(59, 130, 246, 0.25); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

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

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

@keyframes countUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes checkmark {
    0% { stroke-dashoffset: 24; }
    100% { stroke-dashoffset: 0; }
}

@keyframes progressBar {
    from { width: 0; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100%); }
}

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

@keyframes modalContentIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes confettiDrop {
    0% { opacity: 1; transform: translateY(0) rotate(0deg); }
    100% { opacity: 0; transform: translateY(300px) rotate(720deg); }
}

/* ── Animation Utilities ──────────────────────────────────── */
.animate-fade-in { animation: fadeIn var(--transition-slow) ease both; }
.animate-fade-out { animation: fadeOut var(--transition-fast) ease both; }
.animate-slide-up { animation: slideUp var(--transition-slow) ease both; }
.animate-slide-down { animation: slideDown var(--transition-slow) ease both; }
.animate-slide-right { animation: slideInRight var(--transition-slow) ease both; }
.animate-slide-left { animation: slideInLeft var(--transition-slow) ease both; }
.animate-scale-in { animation: scaleIn var(--transition-base) ease both; }
.animate-bounce { animation: bounce 0.6s ease infinite; }
.animate-shake { animation: shake 0.4s ease; }
.animate-spin { animation: spin 1s linear infinite; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }

/* Stagger children */
.animate-stagger-1 { animation-delay: 50ms; }
.animate-stagger-2 { animation-delay: 100ms; }
.animate-stagger-3 { animation-delay: 150ms; }
.animate-stagger-4 { animation-delay: 200ms; }
.animate-stagger-5 { animation-delay: 250ms; }
.animate-stagger-6 { animation-delay: 300ms; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.25rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-xl);
    transition: all var(--transition-base);
    cursor: pointer;
    border: 2px solid transparent;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}
.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}
.btn svg { width: 1.125rem; height: 1.125rem; flex-shrink: 0; }

.btn-primary {
    background: var(--primary);
    color: var(--text-inverse);
    border-color: var(--primary);
}
.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-primary);
}
.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--bg);
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
    padding: 0.5rem 0.75rem;
}
.btn-ghost:hover:not(:disabled) {
    background: var(--primary-light);
    color: var(--primary);
}

.btn-danger {
    background: var(--danger);
    color: var(--text-inverse);
    border-color: var(--danger);
}
.btn-danger:hover:not(:disabled) {
    background: #b91c1c;
    border-color: #b91c1c;
    transform: translateY(-1px);
    box-shadow: var(--shadow-danger);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-xl);
    border: 2px solid var(--primary);
    color: var(--primary);
    background: transparent;
    transition: all var(--transition-base);
    cursor: pointer;
}
.btn-outline:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
}

.btn-sm { padding: 0.375rem 0.875rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.75rem 1.75rem; font-size: 1rem; }
.btn-icon { padding: 0.5rem; border-radius: var(--radius-lg); }

/* ── Cards ────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-slow);
}
.card:hover {
    box-shadow: var(--shadow-md);
}
.card-interactive:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.card-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Review cards: base + priorità (nuove / non risposte) */
.review-card {
    box-shadow: var(--shadow-sm);
    border-left: 3px solid transparent;
}
.review-card--priority {
    border-left-color: var(--info);
    background: linear-gradient(to right, rgba(59, 130, 246, 0.04) 0%, var(--bg-card) 12%);
    animation: priorityGlow 2.5s ease-in-out infinite;
}
.review-card--priority .badge-info {
    animation: pulse 1.8s ease-in-out infinite;
}

/* ── Pagina Recensioni: header, filtri, progress ────────────── */
.reviews-page-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.reviews-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.02em;
}
.reviews-page-subtitle {
    font-size: 0.875rem;
    color: var(--muted);
    margin: 0.25rem 0 0 0;
}
.reviews-page-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.reviews-account-switch {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.reviews-account-switch-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--muted);
}
.reviews-account-select {
    min-width: 12rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
}

.reviews-filters-card {
    background: var(--bg-card);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}
.reviews-filters-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}
.reviews-filter-select {
    min-width: 10rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
}
.reviews-filters-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.reviews-filters-clear-btn {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--primary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0;
}
.reviews-filters-clear-btn:hover {
    text-decoration: underline;
}

/* Overlay + progress bar Aggiorna recensioni */
.fetch-progress-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.fetch-progress-card {
    background: var(--bg-card);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    padding: 1.75rem 2rem;
    min-width: 320px;
    max-width: 420px;
}
.fetch-progress-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}
.fetch-progress-label {
    font-size: 0.875rem;
    color: var(--muted);
    margin: 0 0 0.75rem 0;
}
.fetch-progress-track {
    height: 8px;
    background: var(--border-light);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.fetch-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #14b8a6);
    border-radius: var(--radius-full);
    transition: width 0.35s ease;
}
.fetch-progress-count {
    font-size: 0.75rem;
    color: var(--muted);
    margin: 0;
}

.reviews-results-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.reviews-results-count {
    font-size: 0.875rem;
    color: var(--muted);
    margin: 0;
}
.reviews-results-priority {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--info);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}
.reviews-results-priority-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--info);
    animation: pulse 1.8s ease-in-out infinite;
}

.reviews-pagination {
    margin-top: 1rem;
    margin-bottom: 1rem;
}
.reviews-pagination-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}
.reviews-pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: border-color var(--transition-base), background var(--transition-base);
}
.reviews-pagination-btn:hover:not(:disabled) {
    border-color: var(--primary);
    background: var(--primary-light);
}
.reviews-pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.reviews-pagination-info {
    font-size: 0.875rem;
    color: var(--muted);
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.review-card-block {
    background: var(--bg-card);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem 1.5rem;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}
.review-card-block:hover {
    border-color: var(--border);
    box-shadow: var(--shadow-md);
}
.review-card-block.review-card--priority {
    border-left-width: 4px;
}

/* ── Pill recensioni (piattaforma, sentiment, stato) FontAwesome ─ */
.rg-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    line-height: 1.2;
    white-space: nowrap;
}
.rg-pill i {
    font-size: 0.875em;
    opacity: 0.95;
}
.rg-pill-platform {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
.rg-pill-platform.rg-platform-google { background: rgba(66, 133, 244, 0.12); border-color: rgba(66, 133, 244, 0.3); color: #1a73e8; }
.rg-pill-platform.rg-platform-tripadvisor { background: rgba(0, 128, 0, 0.1); border-color: rgba(0, 128, 0, 0.25); color: #0d6b0d; }
.rg-pill-platform.rg-platform-trustpilot { background: rgba(0, 182, 122, 0.12); border-color: rgba(0, 182, 122, 0.3); color: #00b67a; }
.rg-pill-platform.rg-platform-booking { background: rgba(0, 102, 153, 0.1); border-color: rgba(0, 102, 153, 0.25); color: #003d99; }
.rg-pill-platform.rg-platform-facebook { background: rgba(24, 119, 242, 0.12); border-color: rgba(24, 119, 242, 0.3); color: #1877f2; }
.rg-pill-platform.rg-platform-yelp { background: rgba(211, 35, 35, 0.1); border-color: rgba(211, 35, 35, 0.25); color: #d32323; }
.rg-pill-platform.rg-platform-amazon { background: rgba(255, 153, 0, 0.12); border-color: rgba(255, 153, 0, 0.3); color: #e47911; }
.rg-pill-platform.rg-platform-thefork { background: rgba(0, 128, 128, 0.12); border-color: rgba(0, 128, 128, 0.3); color: #0d9488; }
.rg-pill-platform.rg-platform-justeat { background: rgba(232, 93, 0, 0.12); border-color: rgba(232, 93, 0, 0.3); color: #e85d00; }
.rg-pill-platform.rg-platform-airbnb { background: rgba(255, 90, 95, 0.12); border-color: rgba(255, 90, 95, 0.3); color: #ff5a5f; }
.rg-pill-platform.rg-platform-hotelscom { background: rgba(214, 17, 30, 0.1); border-color: rgba(214, 17, 30, 0.25); color: #d6111e; }
.rg-pill-platform.rg-platform-deliveroo { background: rgba(0, 204, 188, 0.12); border-color: rgba(0, 204, 188, 0.3); color: #00ccbc; }
.rg-pill-platform.rg-platform-ebay { background: rgba(229, 50, 56, 0.1); border-color: rgba(229, 50, 56, 0.25); color: #e53238; }
.rg-pill-platform.rg-platform-glassdoor { background: rgba(0, 166, 153, 0.12); border-color: rgba(0, 166, 153, 0.3); color: #00a699; }
.rg-pill-platform.rg-platform-vinted { background: rgba(0, 170, 155, 0.12); border-color: rgba(0, 170, 155, 0.3); color: #00aa9b; }
.rg-pill-platform.rg-platform-manuale { background: var(--primary-light); border-color: rgba(13, 148, 136, 0.35); color: var(--primary); }

.rg-pill-sentiment.badge-positive { background: var(--success-light); border: 1px solid rgba(5, 150, 105, 0.35); color: var(--success); }
.rg-pill-sentiment.badge-neutral { background: var(--warning-light); border: 1px solid rgba(245, 158, 11, 0.35); color: #92400e; }
.rg-pill-sentiment.badge-negative { background: var(--danger-light); border: 1px solid rgba(220, 38, 38, 0.35); color: var(--danger); }
.rg-pill-sentiment.badge-muted { background: #f1f5f9; border: 1px solid var(--border); color: var(--muted); }

.rg-pill-status.badge-info { background: var(--info-light); border: 1px solid rgba(59, 130, 246, 0.35); color: var(--info); }
.rg-pill-status.badge-primary { background: var(--primary-light); border: 1px solid rgba(13, 148, 136, 0.35); color: var(--primary); }
.rg-pill-status.badge-neutral { background: var(--warning-light); border: 1px solid rgba(245, 158, 11, 0.35); color: #92400e; }
.rg-pill-status.badge-positive { background: var(--success-light); border: 1px solid rgba(5, 150, 105, 0.35); color: var(--success); }
.rg-pill-status.badge-negative { background: var(--danger-light); border: 1px solid rgba(220, 38, 38, 0.35); color: var(--danger); }
.rg-pill-status.badge-muted { background: #f1f5f9; border: 1px solid var(--border); color: var(--muted); }

.rg-pill-muted { background: #f1f5f9; border: 1px solid var(--border); color: var(--muted); }

/* Righe card recensione */
.review-card-meta-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.review-card-stars {
    display: inline-flex;
    align-items: center;
}
.review-card-stars .star-filled { color: #f59e0b; }
.review-card-stars .star-empty { color: var(--border); }
.review-card-badges-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.review-card-text {
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--text-primary);
    margin: 0 0 0.75rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.review-card-footer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--muted);
}
.review-card-author {
    font-weight: 500;
    color: var(--text-secondary);
}
.review-card-date::before {
    content: '·';
    margin-right: 0.5rem;
    color: var(--muted);
}
.review-card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}
.review-card-actions .btn i { margin-left: 0.25rem; }
.review-card-actions .btn:first-child i { margin-left: 0; margin-right: 0.25rem; }

.card-public {
    border-radius: var(--radius-2xl);
    border: 1px solid var(--border);
    background: var(--bg-card);
    transition: all var(--transition-slow);
}
.card-public:hover {
    border-color: var(--primary);
    box-shadow: 0 20px 40px -15px rgba(13, 148, 136, 0.12);
}

.card-premium {
    background: var(--bg-card);
    border-radius: var(--radius-2xl);
    border: 2px solid var(--accent);
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.1), var(--shadow-md);
    position: relative;
}
.card-premium::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: var(--radius-2xl);
    background: linear-gradient(135deg, var(--accent), #f97316, var(--accent));
    z-index: -1;
    opacity: 0.15;
}

/* ── Badges ───────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.625rem;
    border-radius: var(--radius-full);
    line-height: 1.5;
    white-space: nowrap;
}
.badge svg { width: 0.75rem; height: 0.75rem; }

.badge-positive { background: var(--success-light); color: var(--success); }
.badge-negative { background: var(--danger-light); color: var(--danger); }
.badge-neutral { background: var(--warning-light); color: #92400e; }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-muted { background: #f1f5f9; color: var(--muted); }

.badge-plan-free { background: #f1f5f9; color: var(--muted); }
.badge-plan-starter { background: var(--primary-light); color: var(--primary); }
.badge-plan-professional { background: var(--warning-light); color: #92400e; }
.badge-plan-agency { background: linear-gradient(135deg, #7c3aed, #a855f7); color: white; }

.badge-dot::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

/* ── Toast Notifications ──────────────────────────────────── */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 420px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-xl);
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xl);
    animation: toastIn 0.3s ease both;
    pointer-events: auto;
    min-width: 300px;
}
.toast.toast-exit {
    animation: toastOut 0.2s ease both;
}

.toast-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    margin-top: 1px;
}
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-weight: 600; font-size: 0.875rem; color: var(--text-primary); }
.toast-message { font-size: 0.8125rem; color: var(--text-secondary); margin-top: 0.125rem; }
.toast-close {
    flex-shrink: 0;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    background: none;
    border: none;
}
.toast-close:hover { background: #f1f5f9; color: var(--text-primary); }

.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info .toast-icon { color: var(--info); }

.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-info { border-left: 3px solid var(--info); }

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: modalOverlayIn 0.2s ease both;
}
.modal-overlay.modal-exit {
    animation: fadeOut 0.15s ease both;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 32rem;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalContentIn 0.25s ease both;
}
.modal-content.modal-lg { max-width: 48rem; }
.modal-content.modal-sm { max-width: 24rem; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
}
.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}
.modal-body { padding: 1.5rem; }
.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-light);
}

/* ── Skeleton Loading ─────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}
.skeleton-text { height: 0.875rem; margin-bottom: 0.5rem; }
.skeleton-text:last-child { width: 60%; }
.skeleton-title { height: 1.5rem; width: 40%; margin-bottom: 0.75rem; }
.skeleton-circle { border-radius: 50%; }
.skeleton-card {
    background: var(--bg-card);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--border);
    padding: 1.25rem;
}

/* ── Spinner ──────────────────────────────────────────────── */
.spinner {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
.spinner-sm { width: 1rem; height: 1rem; border-width: 1.5px; }
.spinner-lg { width: 2rem; height: 2rem; border-width: 3px; }
.spinner-white { border-color: rgba(255,255,255,0.3); border-top-color: white; }

/* ── Form Styling ─────────────────────────────────────────── */
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border-radius: var(--radius-xl);
    border: 1.5px solid var(--border);
    background: var(--bg-card);
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: all var(--transition-base);
    outline: none;
}
.form-input:hover,
.form-select:hover,
.form-textarea:hover {
    border-color: #cbd5e1;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}
.form-input.is-error,
.form-select.is-error,
.form-textarea.is-error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}
.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}
.form-error {
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Custom Select */
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 0.625rem center;
    background-repeat: no-repeat;
    background-size: 1.25rem;
    padding-right: 2.5rem;
}

/* Custom Checkbox */
.form-checkbox {
    appearance: none;
    width: 1.125rem;
    height: 1.125rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
}
.form-checkbox:checked {
    background: var(--primary);
    border-color: var(--primary);
}
.form-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.form-checkbox:focus-visible {
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Custom Radio */
.form-radio {
    appearance: none;
    width: 1.125rem;
    height: 1.125rem;
    border: 1.5px solid var(--border);
    border-radius: 50%;
    transition: all var(--transition-fast);
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
}
.form-radio:checked {
    border-color: var(--primary);
    border-width: 5px;
}
.form-radio:focus-visible {
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-flex;
    width: 2.75rem;
    height: 1.5rem;
    flex-shrink: 0;
    cursor: pointer;
}
.toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-track {
    position: absolute;
    inset: 0;
    background: var(--border);
    border-radius: var(--radius-full);
    transition: background var(--transition-base);
}
.toggle input:checked + .toggle-track {
    background: var(--primary);
}
.toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 1.25rem;
    height: 1.25rem;
    background: white;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-spring);
}
.toggle input:checked ~ .toggle-thumb {
    transform: translateX(1.25rem);
}

/* ── Star Rating SVG ──────────────────────────────────────── */
.stars-svg {
    display: inline-flex;
    gap: 2px;
    align-items: center;
}
.stars-svg .star {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}
.stars-svg .star-filled { color: #eab308; }
.stars-svg .star-empty { color: #e2e8f0; }
.stars-svg .star-half { color: #eab308; }

.stars-svg.stars-lg .star { width: 1.25rem; height: 1.25rem; }
.stars-svg.stars-xl .star { width: 1.5rem; height: 1.5rem; }

/* Interactive stars */
.stars-interactive .star {
    cursor: pointer;
    transition: transform var(--transition-fast);
}
.stars-interactive .star:hover {
    transform: scale(1.2);
}

/* ── Platform Icons ───────────────────────────────────────── */
.platform-icon {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.platform-icon.platform-google { color: #4285f4; }
.platform-icon.platform-tripadvisor { color: #00af87; }
.platform-icon.platform-booking { color: #003580; }
.platform-icon.platform-facebook { color: #1877f2; }
.platform-icon.platform-yelp { color: #d32323; }
.platform-icon.platform-trustpilot { color: #00b67a; }
.platform-icon.platform-amazon { color: #ff9900; }
.platform-icon.platform-manuale { color: var(--muted); }

/* ── Progress Bar ─────────────────────────────────────────── */
.progress-bar {
    height: 0.5rem;
    border-radius: var(--radius-full);
    background: var(--border-light);
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--primary);
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.progress-bar-fill.progress-success { background: var(--success); }
.progress-bar-fill.progress-warning { background: var(--warning); }
.progress-bar-fill.progress-danger { background: var(--danger); }

/* Animated stepper */
.stepper {
    display: flex;
    align-items: center;
    gap: 0;
}
.stepper-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}
.stepper-circle {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    border: 2px solid var(--border);
    color: var(--text-muted);
    background: var(--bg-card);
    transition: all var(--transition-slow);
    flex-shrink: 0;
}
.stepper-step.active .stepper-circle {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}
.stepper-step.completed .stepper-circle {
    border-color: var(--success);
    background: var(--success);
    color: white;
}
.stepper-line {
    flex: 1;
    height: 2px;
    background: var(--border);
    margin: 0 0.5rem;
    transition: background var(--transition-slow);
}
.stepper-line.completed { background: var(--success); }

.stepper-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color var(--transition-slow);
    white-space: nowrap;
}
.stepper-step.active .stepper-label { color: var(--primary); font-weight: 600; }
.stepper-step.completed .stepper-label { color: var(--success); }

/* ── KPI Card ─────────────────────────────────────────────── */
.kpi-card {
    background: var(--bg-card);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--border);
    padding: 1.25rem;
    transition: all var(--transition-slow);
}
.kpi-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}
.kpi-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}
.kpi-label svg { width: 1rem; height: 1rem; }
.kpi-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 0.375rem;
    line-height: 1.2;
}
.kpi-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.25rem;
}
.kpi-trend svg { width: 0.875rem; height: 0.875rem; }
.kpi-trend-up { color: var(--success); }
.kpi-trend-down { color: var(--danger); }
.kpi-trend-flat { color: var(--text-muted); }

/* ── Upgrade Banner ───────────────────────────────────────── */
.upgrade-banner {
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.08), rgba(245, 158, 11, 0.06));
    border: 1px solid rgba(13, 148, 136, 0.2);
    border-radius: var(--radius-xl);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.upgrade-banner-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.upgrade-banner-text strong { color: var(--text-primary); }

/* ── Upgrade Wall / Lock Overlay ──────────────────────────── */
.feature-locked {
    position: relative;
    overflow: hidden;
}
.feature-locked::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(3px);
    z-index: 10;
    border-radius: inherit;
}
.feature-lock-cta {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 11;
    text-align: center;
    padding: 1.5rem;
}

/* ── Notification Bell Badge ──────────────────────────────── */
.notification-bell {
    position: relative;
    display: inline-flex;
}
.notification-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 1rem;
    height: 1rem;
    padding: 0 0.25rem;
    border-radius: var(--radius-full);
    background: var(--danger);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 2px solid var(--surface);
}

/* ── Dropdown ─────────────────────────────────────────────── */
.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    min-width: 14rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 0.375rem;
    animation: scaleIn 0.15s ease both;
    z-index: 50;
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    cursor: pointer;
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}
.dropdown-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}
.dropdown-item svg { width: 1rem; height: 1rem; flex-shrink: 0; }
.dropdown-divider {
    height: 1px;
    background: var(--border-light);
    margin: 0.375rem 0;
}

/* ── Chip / Tag ───────────────────────────────────────────── */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: var(--radius-full);
    background: #f1f5f9;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}
.chip-active {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}
.chip-removable { padding-right: 0.375rem; }
.chip-close {
    width: 1rem;
    height: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background var(--transition-fast);
    cursor: pointer;
    flex-shrink: 0;
}
.chip-close:hover { background: rgba(0,0,0,0.1); }

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}
.empty-state-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    color: var(--text-muted);
    opacity: 0.5;
}
.empty-state-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
}
.empty-state-text {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
}

/* ── Tab Navigation ───────────────────────────────────────── */
.tab-nav {
    display: flex;
    gap: 0.25rem;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }
.tab-btn {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    transition: all var(--transition-base);
    white-space: nowrap;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    cursor: pointer;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

/* Pill tabs */
.tab-pills {
    display: inline-flex;
    gap: 0.25rem;
    background: #f1f5f9;
    padding: 0.25rem;
    border-radius: var(--radius-xl);
}
.tab-pill {
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    cursor: pointer;
    border: none;
    background: none;
}
.tab-pill:hover { color: var(--text-primary); }
.tab-pill.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

/* ── Responsive Utilities ─────────────────────────────────── */
@media (max-width: 640px) {
    .hide-mobile { display: none !important; }
    .kpi-value { font-size: 1.375rem; }
    .toast-container { left: 1rem; right: 1rem; max-width: none; }
    .toast { min-width: unset; }
    .modal-content { margin: 0.5rem; }
}
@media (min-width: 641px) {
    .hide-desktop { display: none !important; }
}

/* ── Misc Utilities ───────────────────────────────────────── */
.text-gradient {
    background: linear-gradient(135deg, var(--primary), #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.scroll-smooth { scroll-behavior: smooth; }
.no-scrollbar { scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* Focus ring */
input:focus, button:focus, textarea:focus, a:focus-visible, select:focus {
    outline: none;
}
input:focus, textarea:focus, select:focus {
    box-shadow: 0 0 0 3px var(--primary-glow);
    border-color: var(--primary);
}

/* ── Hamburger Menu ───────────────────────────────────────── */
.hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
}
.hamburger-line {
    width: 100%;
    height: 2px;
    background: white;
    border-radius: 1px;
    transition: all var(--transition-base);
    transform-origin: center;
}
.hamburger.active .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.hamburger.active .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile sidebar */
.mobile-nav {
    position: fixed;
    inset: 0;
    z-index: 100;
    pointer-events: none;
}
.mobile-nav.open { pointer-events: auto; }
.mobile-nav-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    opacity: 0;
    transition: opacity var(--transition-slow);
}
.mobile-nav.open .mobile-nav-overlay { opacity: 1; }
.mobile-nav-panel {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    background: var(--surface);
    transform: translateX(-100%);
    transition: transform var(--transition-slow);
    overflow-y: auto;
    padding: 1.5rem 1rem;
}
.mobile-nav.open .mobile-nav-panel { transform: translateX(0); }
.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    color: #cbd5e1;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
    text-decoration: none;
}
.mobile-nav-link:hover,
.mobile-nav-link.active {
    background: rgba(255,255,255,0.08);
    color: white;
}
.mobile-nav-link svg { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }

/* ── Avatar ───────────────────────────────────────────────── */
.avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 700;
    color: white;
    background: var(--primary);
    flex-shrink: 0;
    text-transform: uppercase;
}
.avatar-sm { width: 1.5rem; height: 1.5rem; font-size: 0.625rem; }
.avatar-lg { width: 2.5rem; height: 2.5rem; font-size: 1rem; }

/* ── Breadcrumb ───────────────────────────────────────────── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}
.breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb-sep { color: #cbd5e1; }
.breadcrumb-current { color: var(--text-primary); font-weight: 500; }
