/* ============================================================
   [PROGETTO] crm.uniplan.it
   [DESCR  ] Foglio di stile principale
   [PALETTE] Indaco/Viola moderno (Linear / Notion / Stripe)
              base   #6366F1  dark   #4338CA
              light  #A5B4FC  accent #818CF8
              text   #1E1B4B  bg     #FAFAFC
   ============================================================ */

:root {
    --crm-primary:       #6366F1;
    --crm-primary-dark:  #4338CA;
    --crm-primary-light: #A5B4FC;
    --crm-accent:        #818CF8;
    --crm-text:          #1E1B4B;
    --crm-text-muted:    #6B7280;
    --crm-bg-content:    #FAFAFC;
    --crm-bg-sidebar:    #F8F7FF;
    --crm-bg-card:       #FFFFFF;
    --crm-hover:         #E0E7FF;
    --crm-active:        #C7D2FE;
    --crm-border:        #E5E7EB;
    --crm-info:          #6366F1;
    --crm-warning:       #F59E0B;
    --crm-high:          #DC2626;
    --crm-ok:            #10B981;
}

/* ============================================================
   CL-0376: TEMI COLORE PER AZIENDA (solo accento primario)
   Le custom properties ereditano: ridefinendole su body.crm-theme-*
   sovrascrivono :root per tutto cio' che e' dentro al body, senza
   toccare nessuna pagina. INDACO = default (:root, nessuna classe).
   I colori di STATO (warning/high/ok) restano invariati per leggibilita'.
   ============================================================ */
body.crm-theme-blu {
    --crm-primary:#2563EB; --crm-primary-dark:#1E40AF; --crm-primary-light:#93C5FD;
    --crm-accent:#3B82F6; --crm-hover:#DBEAFE; --crm-active:#BFDBFE; --crm-info:#2563EB;
}
body.crm-theme-verde {
    --crm-primary:#059669; --crm-primary-dark:#047857; --crm-primary-light:#6EE7B7;
    --crm-accent:#10B981; --crm-hover:#D1FAE5; --crm-active:#A7F3D0; --crm-info:#059669;
}
body.crm-theme-teal {
    --crm-primary:#0891B2; --crm-primary-dark:#0E7490; --crm-primary-light:#67E8F9;
    --crm-accent:#06B6D4; --crm-hover:#CFFAFE; --crm-active:#A5F3FC; --crm-info:#0891B2;
}
body.crm-theme-viola {
    --crm-primary:#7C3AED; --crm-primary-dark:#6D28D9; --crm-primary-light:#C4B5FD;
    --crm-accent:#8B5CF6; --crm-hover:#EDE9FE; --crm-active:#DDD6FE; --crm-info:#7C3AED;
}
body.crm-theme-arancio {
    --crm-primary:#EA580C; --crm-primary-dark:#C2410C; --crm-primary-light:#FDBA74;
    --crm-accent:#F97316; --crm-hover:#FFEDD5; --crm-active:#FED7AA; --crm-info:#EA580C;
}
body.crm-theme-rosso {
    --crm-primary:#E11D48; --crm-primary-dark:#BE123C; --crm-primary-light:#FDA4AF;
    --crm-accent:#F43F5E; --crm-hover:#FFE4E6; --crm-active:#FECDD3; --crm-info:#E11D48;
}
body.crm-theme-grafite {
    --crm-primary:#475569; --crm-primary-dark:#334155; --crm-primary-light:#CBD5E1;
    --crm-accent:#64748B; --crm-hover:#F1F5F9; --crm-active:#E2E8F0; --crm-info:#475569;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    color: var(--crm-text);
    background: var(--crm-bg-content);
}

body { display: flex; flex-direction: column; }

form#form1 {
    display: flex;
    flex-direction: column;
    height: 100%;
    flex: 1;
}

a { color: var(--crm-primary); text-decoration: none; }
a:hover { color: var(--crm-primary-dark); }

/* ============================================================
   HEADER
   ============================================================ */
.crm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
    background: linear-gradient(90deg, var(--crm-primary-dark) 0%, var(--crm-primary) 50%, var(--crm-primary-light) 100%);
    color: #fff;
    padding: 0 20px;
    flex-shrink: 0;
    z-index: 1000;
    box-shadow: 0 3px 8px rgba(67, 56, 202, 0.25);
}

.crm-header-left { display: flex; align-items: center; gap: 14px; }

.crm-logo {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.crm-title {
    font-size: 13px;
    color: rgba(255,255,255,0.9);
    font-weight: 400;
    border-left: 1px solid rgba(255,255,255,0.35);
    padding-left: 14px;
}

.crm-header-right { display: flex; align-items: center; gap: 16px; }

.crm-tenant-pill {
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 16px;
    padding: 4px 12px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}
.crm-tenant-pill strong { color: #fff7d6; }

.crm-header-btn {
    background: rgba(255,255,255,0.15);
    color: #fff;
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s;
}
.crm-header-btn:hover { background: rgba(255,255,255,0.28); color: #fff; }

.crm-menu-toggle {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 0;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    font-size: 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.crm-menu-toggle:hover { background: rgba(255,255,255,0.28); }

.crm-help-btn {
    background: #fff;
    color: var(--crm-primary-dark);
    border: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    transition: transform 0.15s;
}
.crm-help-btn:hover { transform: translateY(-1px); }

/* Screen code badge (debug aid) */
.crm-screen-badge {
    display: inline-block;
    background: rgba(0,0,0,0.25);
    color: #FFF1DC;
    padding: 3px 10px;
    margin-left: 10px;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.35);
}

/* ============================================================
   BODY LAYOUT
   ============================================================ */
.crm-body { display: flex; flex: 1; min-height: 0; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.crm-sidebar {
    width: 250px;
    min-width: 250px;
    background: var(--crm-bg-sidebar);
    color: var(--crm-text);
    overflow-y: auto;
    flex-shrink: 0;
    z-index: 900;
    border-right: 1px solid var(--crm-border);
}

.crm-menu {
    list-style: none;
    padding: 8px 0;
}

.crm-menu-group {
    border-bottom: 1px solid var(--crm-border);
}

.crm-menu-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--crm-text);
    transition: background 0.2s;
    user-select: none;
}
.crm-menu-header:hover { background: var(--crm-hover); }

.crm-menu-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    color: var(--crm-primary);
}

.crm-menu-arrow {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.2s;
    color: var(--crm-text-muted);
}
.crm-menu-group.collapsed .crm-menu-arrow { transform: rotate(-90deg); }

.crm-submenu {
    list-style: none;
    overflow: hidden;
    max-height: 500px;
    transition: max-height 0.3s ease;
    background: rgba(0,0,0,0.02);
}
.crm-menu-group.collapsed .crm-submenu { max-height: 0; }

.crm-submenu li a {
    display: block;
    padding: 9px 18px 9px 48px;
    color: var(--crm-text);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}
.crm-submenu li a:hover {
    background: var(--crm-hover);
    border-left-color: var(--crm-primary);
}
/* CL-CAT-CLEAN-2: badge "SA" visibile solo quando body.is-superadmin sui menu riservati */
body.is-superadmin .menu-sa-only > li > a {
    background: linear-gradient(90deg, rgba(168,85,247,0.08), transparent 55%);
}
body.is-superadmin .menu-sa-only > li > a::after {
    content: "SA";
    margin-left: 8px;
    padding: 1px 6px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .5px;
    background: #A855F7;
    color: #fff;
    border-radius: 8px;
    vertical-align: middle;
}
/* Sotto-gruppo dentro un sub-menu (Configurazione > Dati Utenti, Utilita Generali) */
.crm-submenu-sub { list-style: none; padding: 0; margin: 0; }
.crm-submenu-sub-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 9px 18px 9px 28px;
    color: var(--crm-text-muted);
    font-size: 11px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700;
    cursor: pointer; user-select: none;
    border-left: 3px solid transparent;
}
.crm-submenu-sub-header:hover { background: var(--crm-hover); color: var(--crm-text); }
.crm-submenu-sub-arrow { transition: transform 0.2s; font-size: 11px; }
.crm-submenu-sub.collapsed .crm-submenu-sub-arrow { transform: rotate(-90deg); }
.crm-sub-submenu {
    list-style: none; padding: 0; margin: 0;
    max-height: 500px; overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0,0,0,0.015);
}
.crm-submenu-sub.collapsed .crm-sub-submenu { max-height: 0; }
.crm-sub-submenu li a {
    display: block;
    padding: 8px 18px 8px 60px;
    color: var(--crm-text);
    text-decoration: none;
    font-size: 12px;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}
.crm-sub-submenu li a:hover { background: var(--crm-hover); border-left-color: var(--crm-primary); }

.crm-submenu li a.active {
    background: var(--crm-active);
    color: var(--crm-primary-dark);
    border-left-color: var(--crm-primary);
    font-weight: 700;
}

/* Voci speciali "card" colorate (Home + Guida iniziale + Novita) */
.crm-menu-card {
    margin: 8px;
    border-radius: 8px;
    padding: 12px 14px;
    cursor: pointer;
    font-weight: 700;
    color: var(--crm-primary-dark);
    background: #FFFBEE;
    border: 1px solid var(--crm-border);
    transition: all 0.15s;
}
.crm-menu-card:hover {
    background: var(--crm-active);
    transform: translateY(-1px);
}
.crm-menu-card .crm-menu-icon { color: var(--crm-primary-dark); }

/* === Sezione FISSA in cima alla sidebar: Tutorial / Dashboard / Home === */
.crm-menu-fixed {
    padding: 10px 8px;
    background: linear-gradient(180deg, #FFF8EE 0%, var(--crm-bg-sidebar) 100%);
    border-bottom: 2px solid var(--crm-primary-light);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.crm-menu-fixed-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--crm-border);
    color: var(--crm-primary-dark);
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.crm-menu-fixed-item:hover {
    background: var(--crm-active);
    border-color: var(--crm-primary);
    transform: translateX(2px);
    color: var(--crm-primary-dark);
    text-decoration: none;
}
.crm-menu-fixed-item.active {
    background: var(--crm-primary);
    border-color: var(--crm-primary-dark);
    color: #fff;
    box-shadow: 0 2px 6px rgba(156, 90, 51, 0.3);
}
.crm-menu-fixed-item.active .crm-menu-fixed-sub { color: rgba(255,255,255,0.85); }
.crm-menu-fixed-icon {
    font-size: 18px;
    width: 22px;
    text-align: center;
    color: var(--crm-primary);
}
.crm-menu-fixed-item.active .crm-menu-fixed-icon { color: #fff; }
.crm-menu-fixed-label { flex: 1; }
.crm-menu-fixed-sub {
    font-size: 10px;
    font-weight: 600;
    text-transform: lowercase;
    color: var(--crm-text-muted);
    letter-spacing: 0;
}

/* ============================================================
   CONTENT
   ============================================================ */
.crm-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--crm-bg-content);
    position: relative;
    min-height: 0;
    padding: 18px 24px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.crm-footer {
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--crm-primary-dark);
    color: rgba(255,255,255,0.85);
    font-size: 12px;
    flex-shrink: 0;
}
.crm-footer a { color: #FFE4C7; text-decoration: underline; }
.crm-footer a:hover { color: #fff; }

/* ============================================================
   CARDS & BUTTONS
   ============================================================ */
.crm-card {
    background: var(--crm-bg-card);
    border: 1px solid var(--crm-border);
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    margin-bottom: 16px;
}
.crm-card-header {
    font-size: 14px;
    font-weight: 700;
    color: var(--crm-primary-dark);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--crm-border);
    padding-bottom: 8px;
}

.crm-btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}
.crm-btn-primary {
    background: var(--crm-primary);
    color: #fff;
}
.crm-btn-primary:hover {
    background: var(--crm-primary-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(67, 56, 202, 0.3);
}
.crm-btn-secondary {
    background: #fff;
    color: var(--crm-primary-dark);
    border-color: var(--crm-border);
}
.crm-btn-secondary:hover {
    background: var(--crm-hover);
    border-color: var(--crm-primary);
}
.crm-btn-accent {
    background: var(--crm-accent);
    color: #fff;
}
.crm-btn-accent:hover { background: #6366F1; }

/* ============================================================
   FORMS
   ============================================================ */
.crm-form-group { margin-bottom: 14px; }
.crm-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--crm-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.crm-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--crm-border);
    border-radius: 6px;
    font-size: 14px;
    color: var(--crm-text);
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.crm-input:focus {
    outline: none;
    border-color: var(--crm-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* ============================================================
   TABLES
   ============================================================ */
.crm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: #fff;
}
.crm-table th {
    background: var(--crm-bg-sidebar);
    padding: 10px 12px;
    text-align: left;
    font-weight: 700;
    color: var(--crm-primary-dark);
    border-bottom: 2px solid var(--crm-border);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.crm-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--crm-border);
    color: var(--crm-text);
}
.crm-table tr:hover td { background: var(--crm-hover); }

/* ============================================================
   BADGE SEVERITA' (tenue)
   ============================================================ */
.severity-info    { color: var(--crm-info);    font-weight: 600; }
.severity-warning { color: var(--crm-warning); font-weight: 600; }
.severity-high    { color: var(--crm-high);    font-weight: 700; }
.severity-ok      { color: var(--crm-ok);      font-weight: 600; }

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.badge-info    { background: #DBEAFE; color: var(--crm-info); }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-high    { background: #FEE2E2; color: var(--crm-high); }
.badge-ok      { background: #D1FAE5; color: #065F46; }
.badge-primary { background: var(--crm-active); color: var(--crm-primary-dark); }

/* ============================================================
   UTILITY
   ============================================================ */
.text-muted   { color: var(--crm-text-muted); }
.text-primary { color: var(--crm-primary-dark); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }

/* ============================================================
   LOGIN
   ============================================================ */
.crm-login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--crm-primary-dark) 0%, var(--crm-primary) 50%, var(--crm-primary-light) 100%);
}
.crm-login-card {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
.crm-login-card h1 {
    color: var(--crm-primary-dark);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 4px;
}
.crm-login-card .subtitle {
    color: var(--crm-text-muted);
    font-size: 13px;
    margin-bottom: 24px;
}
.crm-login-step {
    display: none;
}
.crm-login-step.active { display: block; }
.crm-login-otp-input {
    font-family: 'Consolas', monospace;
    font-size: 28px;
    letter-spacing: 12px;
    text-align: center;
    font-weight: 700;
    color: var(--crm-primary-dark);
}
.crm-login-channel-radio {
    display: flex;
    gap: 12px;
    margin: 12px 0;
}
.crm-login-channel-radio label {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--crm-border);
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    font-weight: 600;
    transition: all 0.15s;
    background: #fff;
}
.crm-login-channel-radio input { display: none; }
.crm-login-channel-radio input:checked + label,
.crm-login-channel-radio label:hover {
    border-color: var(--crm-primary);
    background: var(--crm-hover);
    color: var(--crm-primary-dark);
}
.crm-login-error {
    color: var(--crm-high);
    background: #FCEDEF;
    border: 1px solid #F2C8CE;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-top: 12px;
    display: none;
}
.crm-login-error.show { display: block; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .crm-sidebar { width: 220px; min-width: 220px; }
}
@media (max-width: 700px) {
    .crm-sidebar { display: none; }
    .crm-title { display: none; }
    .crm-content { padding: 12px; }
}

/* Menu hidden mode (hamburger toggle) */
body.crm-menu-hidden .crm-sidebar { display: none; }

/* ============================================================
   TOAST notifiche non bloccanti (crm-core.js)
   ============================================================ */
.crm-toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.crm-toast {
    min-width: 260px;
    max-width: 420px;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    pointer-events: auto;
    animation: crm-toast-in 0.25s ease-out;
    border-left: 4px solid rgba(255,255,255,0.4);
}
.crm-toast-ok    { background: #6E8F69; }
.crm-toast-err   { background: #A8434E; }
.crm-toast-info  { background: var(--crm-primary-dark); }
.crm-toast-out   { animation: crm-toast-out 0.6s ease-in forwards; }
@keyframes crm-toast-in  {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes crm-toast-out {
    to   { opacity: 0; transform: translateX(20px); }
}

/* ============================================================
   CONFIRM dialog (crm-core.js CRM.conferma)
   ============================================================ */
.crm-confirm-bg {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}
.crm-confirm-card {
    background: var(--crm-bg-card);
    border: 1px solid var(--crm-border);
    border-radius: 12px;
    padding: 24px;
    width: 92%;
    max-width: 440px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
.crm-confirm-msg {
    font-size: 14px;
    color: var(--crm-text);
    margin-bottom: 18px;
    line-height: 1.5;
}
.crm-confirm-btns {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ============================================================
   RELEASE NOTES popup
   ============================================================ */
.crm-release-popup {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}
.crm-release-card {
    background: #fff;
    border-radius: 12px;
    max-width: 620px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 26px 28px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    position: relative;
}
.crm-release-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: 0;
    font-size: 22px;
    cursor: pointer;
    color: var(--crm-text-muted);
}
.crm-release-title {
    margin: 0 0 6px;
    color: var(--crm-primary-dark);
    font-size: 18px;
    font-weight: 800;
}
.crm-release-content {
    font-size: 13px;
    color: var(--crm-text);
    line-height: 1.7;
}
.crm-release-item {
    border-left: 3px solid var(--crm-primary);
    padding: 10px 14px;
    margin-bottom: 14px;
    background: var(--crm-bg-sidebar);
    border-radius: 0 6px 6px 0;
}
.crm-release-item .ver {
    font-weight: 800;
    color: var(--crm-primary-dark);
}
.crm-release-item .data {
    color: var(--crm-text-muted);
    font-size: 11px;
    margin-left: 6px;
}
.crm-release-item .titolo {
    margin-top: 2px;
    color: var(--crm-text-muted);
    font-size: 12px;
}
.crm-release-item ul {
    margin: 6px 0 0;
    padding-left: 18px;
}

/* ============================================================
   HELP popup
   ============================================================ */
.crm-help-popup {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 9998;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 6vh;
}
.crm-help-card {
    background: #fff;
    border-radius: 12px;
    max-width: 720px;
    width: 92%;
    max-height: 86vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
}
.crm-help-header {
    background: linear-gradient(90deg, var(--crm-primary-dark) 0%, var(--crm-primary) 100%);
    color: #fff;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.crm-help-header .crm-help-title {
    font-size: 16px;
    font-weight: 800;
}
.crm-help-header .crm-help-code {
    background: rgba(0,0,0,0.25);
    color: #FFE4C7;
    padding: 3px 10px;
    border-radius: 4px;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 11px;
    letter-spacing: 1px;
    margin-left: 10px;
}
.crm-help-close {
    background: rgba(255,255,255,0.18);
    color: #fff;
    border: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
}
.crm-help-search {
    padding: 12px 20px;
    border-bottom: 1px solid var(--crm-border);
    flex-shrink: 0;
}
.crm-help-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--crm-border);
    border-radius: 6px;
    font-size: 13px;
}
.crm-help-body {
    padding: 18px 22px;
    overflow-y: auto;
    flex: 1;
}
.crm-help-callout {
    background: var(--crm-hover);
    border-left: 3px solid var(--crm-primary);
    padding: 10px 14px;
    border-radius: 0 6px 6px 0;
    margin-bottom: 14px;
    color: var(--crm-primary-dark);
    font-size: 13px;
}
.crm-help-content {
    font-size: 13px;
    color: var(--crm-text);
    line-height: 1.6;
}
.crm-help-content h3 {
    color: var(--crm-primary-dark);
    margin: 12px 0 6px;
    font-size: 15px;
}
.crm-help-content p { margin: 6px 0; }
.crm-help-content ol, .crm-help-content ul { margin: 6px 0 6px 22px; }
.crm-help-content code { background: var(--crm-bg-sidebar); padding: 1px 4px; border-radius: 3px; font-size: 12px; }
.crm-help-correlati {
    border-top: 1px solid var(--crm-border);
    padding-top: 10px;
    margin-top: 14px;
}
.crm-help-correlati .chip {
    display: inline-block;
    margin: 2px;
    padding: 3px 10px;
    background: var(--crm-active);
    color: var(--crm-primary-dark);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}
.crm-help-correlati .chip:hover { background: var(--crm-primary); color: #fff; }
.crm-help-footer {
    border-top: 1px solid var(--crm-border);
    padding: 8px 20px;
    background: var(--crm-bg-sidebar);
    font-size: 11px;
    color: var(--crm-text-muted);
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
}
.crm-help-search-results {
    border-bottom: 1px solid var(--crm-border);
    background: var(--crm-bg-sidebar);
    max-height: 200px;
    overflow-y: auto;
}
.crm-help-search-results .voce {
    padding: 8px 20px;
    border-bottom: 1px solid var(--crm-border);
    cursor: pointer;
}
.crm-help-search-results .voce:hover { background: var(--crm-hover); }
.crm-help-search-results .voce .cod {
    font-family: Consolas, monospace;
    font-size: 10px;
    color: var(--crm-primary-dark);
    font-weight: 700;
    margin-right: 6px;
}
