/* ==========================================================================
   ASTROAPP PRO - MASTER DESIGN SYSTEM (FULL DUAL-THEME & UI POLISH)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. VARIABILI ROOT: TEMA SCURO "COSMIC DARK" (DEFAULT)
   -------------------------------------------------------------------------- */
:root {
    --bg-deep: #060911;
    --bg-dark: #070a12;
    --bg-sidebar: rgba(10, 15, 29, 0.98);
    --bg-card: #0d1527;
    --bg-card-hover: #1e293b;
    --card-glass: rgba(13, 21, 39, 0.85);
    
    --border-gold: rgba(251, 191, 36, 0.35);
    --border-gold-strong: rgba(251, 191, 36, 0.7);
    --border-purple: rgba(192, 132, 252, 0.35);
    --border-cyan: rgba(56, 189, 248, 0.35);
    --border-line: rgba(255, 255, 255, 0.1);
    
    --gold-gradient: linear-gradient(135deg, #fef08a 0%, #fbbf24 50%, #d97706 100%);
    --gold-btn: linear-gradient(135deg, #fcd34d 0%, #fbbf24 50%, #d97706 100%);
    
    --text-gold: #fbbf24;
    --text-cyan: #38bdf8;
    --text-purple: #c084fc;
    --text-emerald: #34d399;
    --text-danger: #f87171;
    --text-main: #f8fafc;
    --text-bright-sub: #cbd5e1;
    --text-muted: #94a3b8;
    
    --input-bg: rgba(9, 14, 28, 0.85);
    --input-text: #ffffff;
    --input-border: rgba(251, 191, 36, 0.35);
    --table-th-bg: #0b1120;
    --table-row-hover: rgba(30, 41, 59, 0.6);
    --hero-sintesi-bg: linear-gradient(135deg, rgba(234, 179, 8, 0.08) 0%, rgba(15, 23, 42, 0.85) 100%);
    --micro-arch-bg: rgba(15, 23, 42, 0.6);
    
    /* Modale Zoom HD Dark */
    --zoom-overlay-bg: rgba(4, 7, 15, 0.96);
    --zoom-header-bg: #0b1120;
    --zoom-btn-bg: #1e293b;
    --zoom-btn-border: rgba(255, 255, 255, 0.2);
    --zoom-btn-text: #f8fafc;
    
    --body-bg-gradient: 
        radial-gradient(circle at 12% 18%, rgba(192, 132, 252, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 88% 75%, rgba(56, 189, 248, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(251, 191, 36, 0.03) 0%, transparent 60%);
}

/* --------------------------------------------------------------------------
   2. VARIABILI ROOT: TEMA CHIARO "EDITORIAL LIGHT"
   -------------------------------------------------------------------------- */
[data-theme="light"] {
    --bg-deep: #f1f5f9;
    --bg-dark: #e2e8f0;
    --bg-sidebar: #0f172a;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --card-glass: #ffffff;
    
    --border-gold: #cbd5e1;
    --border-gold-strong: #ca8a04;
    --border-purple: #ddd6fe;
    --border-cyan: #bae6fd;
    --border-line: #e2e8f0;
    
    --gold-gradient: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    --gold-btn: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    
    --text-gold: #b45309;
    --text-cyan: #0284c7;
    --text-purple: #7c3aed;
    --text-emerald: #047857;
    --text-danger: #b91c1c;
    --text-main: #0f172a;
    --text-bright-sub: #334155;
    --text-muted: #64748b;
    
    --input-bg: #f8fafc;
    --input-text: #0f172a;
    --input-border: #cbd5e1;
    --table-th-bg: #f8fafc;
    --table-row-hover: #f8fafc;
    --hero-sintesi-bg: linear-gradient(135deg, #fefce8 0%, #ffffff 100%);
    --micro-arch-bg: #f8fafc;
    
    /* Modale Zoom HD Light */
    --zoom-overlay-bg: rgba(241, 245, 249, 0.98);
    --zoom-header-bg: #ffffff;
    --zoom-btn-bg: #ffffff;
    --zoom-btn-border: #cbd5e1;
    --zoom-btn-text: #0f172a;
    
    --body-bg-gradient: none;
}

/* ==========================================================================
   RESET & STRUTTURA DEL LAYOUT
   ========================================================================== */
body {
    display: block !important;
    position: relative !important;
    background-color: var(--bg-deep) !important;
    background-image: var(--body-bg-gradient);
    background-attachment: fixed;
    color: var(--text-main) !important;
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* NEUTRALIZZAZIONE BOOTSTRAP IN LIGHT MODE */
[data-theme="light"] .bg-dark { background-color: var(--bg-card) !important; }
[data-theme="light"] .text-white, [data-theme="light"] .text-light { color: var(--text-main) !important; }
[data-theme="light"] .border-secondary { border-color: var(--border-line) !important; }

/* FIX DEFINITIVO TESTI BADGE IN LIGHT MODE */
[data-theme="light"] .badge {
    color: #0f172a !important;
}

/* LAYOUT MAIN CONTENT */
.main-content {
    margin-left: 255px !important;
    width: calc(100% - 255px) !important;
    padding: 1.25rem 2rem 2.5rem 2rem !important;
    min-height: 100vh;
    box-sizing: border-box !important;
    background-color: transparent;
}

.container-fluid { width: 100% !important; max-width: 100% !important; padding-left: 0 !important; padding-right: 0 !important; }
.container { max-width: 1140px; margin: 0 auto; }

/* ==========================================================================
   TIPOGRAFIA
   ========================================================================== */
h1, h2, h3, h4, h5, h6, .font-cinzel {
    font-family: 'Cinzel', serif;
    color: var(--text-gold) !important;
    letter-spacing: 1px;
}

.title-gold-gradient {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    letter-spacing: 1.5px;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-muted { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-bright-sub) !important; }
.small-desc { color: var(--text-bright-sub) !important; }
.txt-bright { color: var(--text-main) !important; }
.txt-time { color: var(--text-cyan) !important; font-weight: 600; }

/* ==========================================================================
   SIDEBAR SINISTRA
   ========================================================================== */
.sidebar-wrapper {
    width: 255px;
    min-width: 255px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-gold);
    min-height: 100vh;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem 1rem;
    z-index: 1050;
    backdrop-filter: blur(16px);
    box-sizing: border-box;
}

.sidebar-brand {
    font-family: 'Cinzel', serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fbbf24 !important;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(251, 191, 36, 0.15);
    margin-bottom: 1.5rem;
}

.sidebar-section-title {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #64748b;
    margin: 1.2rem 0 0.5rem 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.65rem 0.85rem;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 2px;
}
.sidebar-link i { width: 20px; text-align: center; font-size: 1rem; }
.sidebar-link:hover { background: rgba(30, 41, 59, 0.8); color: #fbbf24; }
.sidebar-link.active { background: rgba(251, 191, 36, 0.15); color: #fbbf24 !important; font-weight: 600; border-left: 3px solid #fbbf24; }

/* ==========================================================================
   CARDS & CONTENITORI
   ========================================================================== */
.card-custom, .settings-card, .header-box, .stat-card, .crm-header-banner {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-gold) !important;
    border-radius: 16px;
    padding: 1.4rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    color: var(--text-main);
}

.glass-card, .form-card {
    max-width: 760px !important;
    margin: 0 auto !important;
    background: var(--card-glass) !important;
    border: 1px solid var(--border-gold) !important;
    border-radius: 20px !important;
    padding: 2.2rem 2.5rem !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    color: var(--text-main);
}

.chart-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #ffffff;
    border-radius: 12px;
    padding: 0.5rem;
}
.chart-container img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

/* ==========================================================================
   CLIENT HUB & DROPDOWNS
   ========================================================================== */
.client-hub-box {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-gold) !important;
    border-radius: 16px;
    padding: 1.25rem 1.75rem;
    margin-bottom: 1.75rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.hub-btn {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-line) !important;
    color: var(--text-main) !important;
    padding: 0.5rem 0.95rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}
.hub-btn:hover { border-color: var(--text-gold) !important; color: var(--text-gold) !important; transform: translateY(-1px); }
.hub-btn-active { background: rgba(251, 191, 36, 0.18) !important; border-color: var(--text-gold) !important; color: var(--text-gold) !important; font-weight: 600; }

.dropdown-menu-cosmic {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-gold) !important;
    border-radius: 10px;
    padding: 0.5rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}
.dropdown-menu-cosmic .dropdown-item {
    color: var(--text-main) !important;
    font-size: 0.88rem;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}
.dropdown-menu-cosmic .dropdown-item:hover { background: var(--bg-card-hover) !important; color: var(--text-gold) !important; }

/* ==========================================================================
   SUBJECT CARDS (SINASTRIA, TRANSITI, RIVOLUZIONI)
   ========================================================================== */
.subject-card {
    background: var(--bg-card) !important;
    border-radius: 14px !important;
    padding: 1.2rem 1.5rem !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4) !important;
    transition: all 0.25s ease;
    border: 1px solid var(--border-line) !important;
}
.subject-card:hover { transform: translateY(-2px); box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6) !important; }
.subject-p1, .subject-radix { border: 1px solid rgba(56, 189, 248, 0.4) !important; border-left: 5px solid var(--text-cyan) !important; }
.subject-p2 { border: 1px solid rgba(192, 132, 252, 0.4) !important; border-left: 5px solid var(--text-purple) !important; }
.subject-rs, .subject-transit { border: 1px solid rgba(251, 191, 36, 0.4) !important; border-left: 5px solid var(--text-gold) !important; }

/* ==========================================================================
   TABELLE CUSTOM
   ========================================================================== */
.table-custom-container {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-gold) !important;
    border-radius: 16px;
    overflow: hidden;
    width: 100% !important;
}

.table-custom, table, .table {
    width: 100%;
    margin-bottom: 0;
    color: var(--text-main) !important;
    background-color: transparent !important;
    border-collapse: collapse;
}

.table-custom th, table th, .table th {
    background-color: var(--table-th-bg) !important;
    color: var(--text-gold) !important;
    font-family: 'Cinzel', serif;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 0.95rem 1.1rem !important;
    border: none !important;
    border-bottom: 2px solid var(--border-gold) !important;
    text-transform: uppercase;
}

.table-custom td, table td, .table td {
    background-color: transparent !important;
    color: var(--text-main) !important;
    padding: 0.9rem 1.1rem !important;
    vertical-align: middle;
    border: none !important;
    border-bottom: 1px solid var(--border-line) !important;
}

.table-custom tbody tr:hover td, table tbody tr:hover td { 
    background-color: var(--table-row-hover) !important; 
}

/* NAV TABS */
.nav-tabs-cosmic { border-bottom: 2px solid var(--border-gold) !important; }
.nav-tabs-cosmic .nav-link {
    color: var(--text-muted);
    border: none;
    border-bottom: 3px solid transparent;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    padding: 0.8rem 1.4rem;
    transition: all 0.2s ease;
}
.nav-tabs-cosmic .nav-link.active {
    color: var(--text-gold) !important;
    background: rgba(251, 191, 36, 0.1) !important;
    border-bottom: 3px solid var(--text-gold) !important;
    border-radius: 8px 8px 0 0;
    font-weight: 700;
}

/* BARRE PROGRESSO ELEMENTI */
.progress-micro {
    height: 7px;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid var(--border-line);
    overflow: hidden;
    margin-top: 4px;
    margin-bottom: 8px;
}
[data-theme="light"] .progress-micro { background-color: #cbd5e1 !important; }

/* ==========================================================================
   FORM INPUTS, SELECT & CHECKBOX
   ========================================================================== */
.form-label-custom, .form-label {
    color: var(--text-gold);
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 0.45rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-control, .form-select, .form-control-custom, .form-select-custom, .search-box, input, select, textarea {
    background-color: var(--input-bg) !important;
    border: 1px solid var(--input-border) !important;
    color: var(--input-text) !important;
    border-radius: 10px;
    padding: 0.65rem 1rem;
    font-size: 0.92rem;
    transition: all 0.25s ease;
}
.form-control::placeholder, .search-box::placeholder { color: var(--text-muted) !important; }

.form-control:focus, .form-select:focus, input:focus, select:focus {
    border-color: var(--text-cyan) !important;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.25) !important;
}

.form-check {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin-bottom: 0.45rem !important;
    padding-left: 0 !important;
}
.form-check-input {
    margin: 0 !important;
    float: none !important;
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0 !important;
    cursor: pointer;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
}
.form-check-input:checked { background-color: #eab308 !important; border-color: #ca8a04 !important; }
.form-check-label { color: var(--text-main) !important; font-size: 0.88rem; cursor: pointer; margin-bottom: 0 !important; }

#citta-dropdown {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-gold) !important;
    border-radius: 10px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 1050;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px);
}
.dropdown-city-item {
    background-color: transparent !important;
    color: var(--text-main) !important;
    border-bottom: 1px solid var(--border-line) !important;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}
.dropdown-city-item:hover { background-color: var(--bg-card-hover) !important; color: var(--text-gold) !important; padding-left: 1.25rem; }

/* ==========================================================================
   PULSANTI GLOBALI
   ========================================================================== */
.btn-radiant-gold, button.btn-radiant-gold, button[type="submit"].btn-radiant-gold {
    background: var(--gold-btn) !important;
    color: #090d16 !important;
    font-weight: 700 !important;
    font-size: 1.02rem !important;
    letter-spacing: 0.5px;
    padding: 0.9rem 2rem !important;
    border-radius: 12px !important;
    border: none !important;
    box-shadow: 0 6px 20px rgba(251, 191, 36, 0.3) !important;
    transition: all 0.25s ease;
    width: 100%;
    cursor: pointer;
}
.btn-radiant-gold:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(251, 191, 36, 0.45) !important; }

.btn-cosmic {
    background: rgba(251, 191, 36, 0.18) !important;
    border: 1px solid var(--text-gold) !important;
    color: var(--text-gold) !important;
    font-weight: 700 !important;
    border-radius: 10px;
    padding: 0.65rem 1.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
}
.btn-cosmic:hover { background: var(--text-gold) !important; color: #090d16 !important; }
[data-theme="light"] .btn-cosmic { background: #fefce8 !important; border-color: #d97706 !important; color: #b45309 !important; }
[data-theme="light"] .btn-cosmic:hover { background: #f59e0b !important; color: #ffffff !important; }

/* Bottoni Azione CRM */
.btn-action-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    text-decoration: none;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}
[data-theme="dark"] .btn-view { background: rgba(56, 189, 248, 0.15); color: var(--text-cyan) !important; border: 1px solid rgba(56, 189, 248, 0.4); }
[data-theme="dark"] .btn-pdf { background: rgba(251, 191, 36, 0.15); color: var(--text-gold) !important; border: 1px solid rgba(251, 191, 36, 0.5); }
[data-theme="dark"] .btn-journal { background: rgba(52, 211, 153, 0.15); color: var(--text-emerald) !important; border: 1px solid rgba(52, 211, 153, 0.4); }
[data-theme="dark"] .btn-edit { background: rgba(192, 132, 252, 0.15); color: var(--text-purple) !important; border: 1px solid rgba(192, 132, 252, 0.4); }
[data-theme="dark"] .btn-delete { background: rgba(239, 68, 68, 0.15); color: #f87171 !important; border: 1px solid rgba(239, 68, 68, 0.4); }

[data-theme="light"] .btn-view { background: #f0f9ff !important; border: 1px solid #bae6fd !important; color: #0284c7 !important; }
[data-theme="light"] .btn-pdf { background: #fefce8 !important; border: 1px solid #fef08a !important; color: #b45309 !important; }
[data-theme="light"] .btn-journal { background: #ecfdf5 !important; border: 1px solid #a7f3d0 !important; color: #047857 !important; }
[data-theme="light"] .btn-edit { background: #faf5ff !important; border: 1px solid #e9d5ff !important; color: #7e22ce !important; }
[data-theme="light"] .btn-delete { background: #fef2f2 !important; border: 1px solid #fecaca !important; color: #b91c1c !important; }

/* ==========================================================================
   BADGES & TRINITÀ RADIX AD ALTO CONTRASTO
   ========================================================================== */
.badge-astro {
    background: rgba(251, 191, 36, 0.15) !important;
    border: 1px solid #f59e0b !important;
    color: #b45309 !important;
    font-weight: 700 !important;
    font-size: 0.75rem;
    padding: 0.25em 0.6em;
    border-radius: 6px;
}
[data-theme="dark"] .badge-astro { color: #fbbf24 !important; }

.badge-sign, .trinity-badge, .table td span.badge {
    font-size: 0.76rem !important;
    font-weight: 700 !important;
    padding: 0.35em 0.65em !important;
    border-radius: 6px;
}

[data-theme="light"] .table-custom td:nth-child(5) .badge,
[data-theme="light"] .table td:nth-child(5) .badge,
[data-theme="light"] .badge-sign,
[data-theme="light"] .trinity-badge {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.badge-kpi { font-size: 0.9rem; padding: 0.55rem 1.1rem; border-radius: 8px; font-weight: 600; }
.badge-exact {
    background-color: rgba(239, 68, 68, 0.2) !important;
    color: #fca5a5 !important;
    border: 1px solid rgba(239, 68, 68, 0.5) !important;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.25em 0.55em;
    margin-left: 6px;
}
.badge-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #10b981;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15em 0.45em;
    border-radius: 10px;
}

/* ==========================================================================
   MODULO INTERPRETAZIONI PRO & HERO BOX (BIG THREE FIX LIGHT MODE)
   ========================================================================== */
.interp-card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-gold) !important;
    border-radius: 12px;
    margin-bottom: 0.85rem;
}
.interp-card-header {
    padding: 0.9rem 1.15rem;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card-hover) !important;
}
[data-theme="light"] .interp-card-header strong { color: #0f172a !important; }

.micro-section {
    padding: 0.75rem 0.95rem;
    border-radius: 8px;
    margin-bottom: 0.65rem;
    font-size: 0.875rem;
    line-height: 1.6;
}
.micro-archetipo { background: var(--micro-arch-bg); border-left: 3px solid #6366f1; color: var(--text-main); }
.micro-integrazione { background: rgba(16, 185, 129, 0.08); border-left: 3px solid #10b981; color: var(--text-main); }
.micro-casa { background: rgba(14, 165, 233, 0.08); border-left: 3px solid #0ea5e9; color: var(--text-main); }

.aspect-harmonic { border-left: 4px solid #38bdf8 !important; }
.aspect-harmonic .aspect-badge { background: rgba(14, 165, 233, 0.15); color: #0284c7; border: 1px solid rgba(14, 165, 233, 0.35); }
.aspect-dynamic { border-left: 4px solid #f87171 !important; }
.aspect-dynamic .aspect-badge { background: rgba(239, 68, 68, 0.15); color: #dc2626; border: 1px solid rgba(239, 68, 68, 0.35); }
.aspect-fusion { border-left: 4px solid #c084fc !important; }
.aspect-fusion .aspect-badge { background: rgba(168, 85, 247, 0.15); color: #9333ea; border: 1px solid rgba(168, 85, 247, 0.35); }

.filter-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    color: var(--text-muted);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
}
.filter-btn.active {
    background: #eab308 !important;
    border-color: #ca8a04 !important;
    color: #0f172a !important;
    font-weight: 700 !important;
}

.hero-sintesi-box {
    background: var(--hero-sintesi-bg) !important;
    border: 1px solid var(--border-gold-strong) !important;
}

/* FIX TESTI BIG THREE NEL BOX SINTESI */
.badge-pill-three {
    font-weight: 700 !important;
    padding: 0.35em 0.75em !important;
    border-radius: 6px;
}
[data-theme="dark"] .badge-pill-three {
    background: #090e1a !important;
    color: #f8fafc !important;
}
[data-theme="light"] .badge-pill-three {
    background: #ffffff !important;
    color: #0f172a !important; /* TESTO SCURO NITIDO */
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
[data-theme="light"] .badge-pill-sole { border: 1px solid #f59e0b !important; color: #78350f !important; }
[data-theme="light"] .badge-pill-luna { border: 1px solid #0ea5e9 !important; color: #0369a1 !important; }
[data-theme="light"] .badge-pill-asc { border: 1px solid #6366f1 !important; color: #4338ca !important; }

.tag-big-three {
    font-weight: 700 !important;
    padding: 0.25em 0.6em !important;
    border-radius: 6px;
}
[data-theme="dark"] .tag-big-three {
    background: rgba(251, 191, 36, 0.15) !important;
    color: #fbbf24 !important;
    border: 1px solid #fbbf24 !important;
}
[data-theme="light"] .tag-big-three {
    background: #fef08a !important;
    color: #854d0e !important;
    border: 1px solid #eab308 !important;
}

.house-pill-badge {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-gold);
    color: var(--text-muted);
    font-size: 0.72rem;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    font-family: 'Cinzel', serif;
}

/* ==========================================================================
   LOGO STUDIO & MODALI
   ========================================================================== */
.logo-preview-box {
    width: 100% !important;
    height: 160px !important;
    max-height: 160px !important;
    overflow: hidden !important;
    border: 2px dashed var(--border-gold) !important;
    border-radius: 12px !important;
    background: var(--input-bg) !important;
    padding: 10px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}
.logo-preview-box img {
    max-height: 105px !important;
    max-width: 100% !important;
    object-fit: contain !important;
    border-radius: 6px !important;
}

.orb-card {
    background: var(--input-bg) !important;
    border: 1px solid var(--border-gold) !important;
    border-radius: 10px;
    padding: 1rem 0.75rem;
    text-align: center;
    transition: all 0.2s ease;
}

.modal-content-cosmic, .modal-content {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-gold) !important;
    border-radius: 16px;
    color: var(--text-main);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}
.modal-header-cosmic, .modal-header {
    background: var(--table-th-bg);
    border-bottom: 1px solid var(--border-gold);
    padding: 1.25rem 1.5rem;
}
.note-card {
    background: var(--bg-card-hover);
    border-left: 4px solid var(--text-emerald);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}
[data-theme="light"] .btn-close { filter: none !important; }

/* ==========================================================================
   MODALE ZOOM FULLSCREEN (ADATTIVA DARK & LIGHT)
   ========================================================================== */
.zoom-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: var(--zoom-overlay-bg) !important;
    backdrop-filter: blur(16px);
    z-index: 99999; display: none; flex-direction: column;
}
.zoom-modal-header {
    background: var(--zoom-header-bg) !important;
    border-bottom: 1px solid var(--border-gold) !important;
    padding: 0.8rem 1.5rem;
    display: flex; justify-content: space-between; align-items: center;
}
.zoom-modal-header span, .zoom-modal-header .font-cinzel {
    color: var(--text-gold) !important;
}

/* Pulsanti Zoom (+ / - / Reset) */
.zoom-modal-header button.btn-dark {
    background: var(--zoom-btn-bg) !important;
    border: 1px solid var(--zoom-btn-border) !important;
    color: var(--zoom-btn-text) !important;
    font-weight: 600;
}
.zoom-modal-header button.btn-dark:hover {
    background: var(--border-gold) !important;
    color: #000000 !important;
}

.zoom-viewport {
    flex-grow: 1; overflow: hidden; position: relative;
    cursor: grab; display: flex; justify-content: center; align-items: center;
}
.zoom-img-target {
    max-width: 90vw; max-height: 85vh; object-fit: contain;
    background: #ffffff; border-radius: 12px;
}

/* ==========================================================================
   RESPONSIVE PER TABLET E MOBILE (< 992px)
   ========================================================================== */
@media (max-width: 991px) {
    body { flex-direction: column !important; }
    .sidebar-wrapper { transform: translateX(-100%); }
    .sidebar-wrapper.show { transform: translateX(0) !important; }
    .main-content { margin-left: 0 !important; width: 100% !important; padding: 1rem !important; }
}

@media print {
    .sidebar-wrapper, .mobile-topbar, .client-hub-box, .no-print { display: none !important; }
    .main-content { margin-left: 0 !important; width: 100% !important; padding: 0 !important; }
}

/* ==========================================================================
   ANIMAZIONE ONDE AUDIO REGISTRATORE
   ========================================================================== */
.audio-bar {
    width: 4px;
    height: 10px;
    background: #fbbf24;
    border-radius: 2px;
    display: inline-block;
    animation: wave 1.2s ease-in-out infinite;
}
.audio-bar:nth-child(1) { animation-delay: 0.1s; height: 12px; }
.audio-bar:nth-child(2) { animation-delay: 0.3s; height: 22px; }
.audio-bar:nth-child(3) { animation-delay: 0.2s; height: 16px; }
.audio-bar:nth-child(4) { animation-delay: 0.4s; height: 26px; }
.audio-bar:nth-child(5) { animation-delay: 0.15s; height: 18px; }
.audio-bar:nth-child(6) { animation-delay: 0.35s; height: 24px; }
.audio-bar:nth-child(7) { animation-delay: 0.25s; height: 14px; }
.audio-bar:nth-child(8) { animation-delay: 0.45s; height: 8px; }

@keyframes wave {
    0%, 100% { transform: scaleY(0.4); opacity: 0.5; }
    50% { transform: scaleY(1.3); opacity: 1; }
}

.animate-pulse {
    animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ==========================================================================
   SESSION STUDIO PRO: FLOATING BOTTOM DOCK & OFFCANVAS DRAWER
   ========================================================================== */

/* BARRA FLUTTUANTE IN BASSO (NON COPRE MAI IL GRAFICO) */
.floating-session-dock {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    z-index: 1060;
    background: var(--bg-card);
    border: 1px solid var(--border-gold-strong);
    border-radius: 50px;
    padding: 0.65rem 1.4rem;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(251, 191, 36, 0.15);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(16px);
}

.floating-session-dock.dock-active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

[data-theme="light"] .floating-session-dock {
    background: #ffffff;
    border: 1px solid #d97706;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15), 0 0 15px rgba(217, 119, 6, 0.15);
}

/* CASSETTO DI REVISIONE LATERALE (OFFCANVAS) */
.offcanvas-session-review {
    width: 520px !important;
    max-width: 90vw !important;
    background: var(--bg-card) !important;
    color: var(--text-main) !important;
    border-left: 1px solid var(--border-gold) !important;
    box-shadow: -15px 0 40px rgba(0, 0, 0, 0.5) !important;
}

.offcanvas-session-review .offcanvas-header {
    background: var(--table-th-bg);
    border-bottom: 1px solid var(--border-gold);
    padding: 1.1rem 1.4rem;
}

/* TEXTAREA REVISIONE SINTESI */
.review-textarea {
    background: var(--bg-input) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
    border-radius: 8px;
    font-size: 0.88rem;
    line-height: 1.6;
    resize: vertical;
}
.review-textarea:focus {
    border-color: var(--text-gold) !important;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.15) !important;
}


/* ==========================================================================
   CONTRASTO PULSANTE CHIUSURA (X) PER MODALI E OFFCANVAS
   ========================================================================== */
[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%) !important;
    opacity: 0.75;
}
[data-theme="dark"] .btn-close:hover {
    opacity: 1;
}

[data-theme="light"] .btn-close {
    filter: none !important;
    opacity: 0.6;
}
[data-theme="light"] .btn-close:hover {
    opacity: 0.9;
}
/* ==========================================================================
   INTERRUTTORE DI LICENZA (BASE vs PRO) & PAYWALL TEASERS
   ========================================================================== */

.tier-toggle-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: var(--text-main);
    border-radius: 8px;
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.tier-toggle-btn:hover {
    border-color: #fbbf24;
    color: #fbbf24;
}
.tier-badge-base {
    background: #475569;
    color: #f8fafc;
}
.tier-badge-pro {
    background: linear-gradient(135deg, #fcd34d 0%, #fbbf24 60%, #d97706 100%);
    color: #090d16;
    font-weight: 700;
}

/* Effetto Blocco su elementi PRO quando si è in modalità BASE */
[data-tier="base"] .pro-only-action {
    position: relative;
    opacity: 0.65;
}
[data-theme="light"] .tier-toggle-btn {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}