﻿:root {
    --navy-950: #f8fafc;
    --navy-900: #f1f5f9;
    --navy-800: #ffffff;
    --navy-700: #f8fafc;
    --navy-600: #e2e8f0;
    --teal-500: #0f766e;
    --teal-400: #0f766e;
    --teal-300: #115e59;
    --gray-300: #334155;
    --gray-400: #64748b;
    --gray-500: #94a3b8;
    --white: #ffffff;
    --sidebar-width: 260px;
    --topbar-height: 56px;
}

/* === LAYOUT GENERALE === */
.cpm-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: var(--navy-950);
    font-family: 'DM Sans', sans-serif;
}

/* === SIDEBAR === */
.cpm-sidebar {
    width: var(--sidebar-width);
    background: var(--navy-900);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

    .cpm-sidebar::-webkit-scrollbar {
        width: 4px;
    }

    .cpm-sidebar::-webkit-scrollbar-track {
        background: transparent;
    }

    .cpm-sidebar::-webkit-scrollbar-thumb {
        background: rgba(45,212,191,0.2);
        border-radius: 4px;
    }

/* Logo area */
.cpm-logo {
    padding: 24px 20px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(45,212,191,0.1);
    margin-bottom: 8px;
    flex-shrink: 0;
}

.cpm-logo-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.cpm-logo-text {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 21px;
    line-height: 1;
}

    .cpm-logo-text .pro {
        color: var(--teal-400);
        font-weight: 700;
    }

    .cpm-logo-text .manager {
        color: var(--white);
        font-weight: 400;
    }

/* Nav items */
.cpm-nav {
    flex: 1;
    padding: 8px 0;
}

.cpm-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--gray-300);
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.15s;
    border-left: 3px solid transparent;
    user-select: none;
}

    .cpm-nav-item:hover {
        background: rgba(45,212,191,0.06);
        color: var(--white);
    }

    .cpm-nav-item.active {
        background: rgba(45,212,191,0.1);
        color: var(--teal-400);
        border-left-color: var(--teal-400);
    }

    .cpm-nav-item svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
        opacity: 0.8;
    }

    .cpm-nav-item.active svg {
        opacity: 1;
    }

/* Gruppo con sottomenu */
.cpm-nav-group {
}

.cpm-nav-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    color: var(--gray-300);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
    border-left: 3px solid transparent;
    user-select: none;
}

    .cpm-nav-group-header:hover {
        background: rgba(45,212,191,0.06);
        color: var(--white);
    }

    .cpm-nav-group-header .left {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .cpm-nav-group-header svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
        opacity: 0.8;
    }

.cpm-chevron {
    width: 14px;
    height: 14px;
    transition: transform 0.2s;
    opacity: 0.5;
}

    .cpm-chevron.open {
        transform: rotate(180deg);
    }

/* Sottomenu */
.cpm-submenu {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.25s ease;
}

    .cpm-submenu.open {
        max-height: 300px;
    }

.cpm-submenu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px 8px 48px;
    color: var(--gray-400);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.15s;
    cursor: pointer;
}

    .cpm-submenu-item:hover {
        color: var(--white);
        background: rgba(45,212,191,0.04);
    }

    .cpm-submenu-item.active {
        color: var(--teal-400);
    }

    .cpm-submenu-item svg {
        width: 15px;
        height: 15px;
        opacity: 0.7;
    }

/* Footer sidebar */
.cpm-sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(45,212,191,0.1);
    font-size: 11px;
    color: var(--gray-500);
    flex-shrink: 0;
}

/* === MAIN AREA === */
.cpm-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* Topbar */
.cpm-topbar {
    height: var(--topbar-height);
    background: var(--navy-800);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(45,212,191,0.1);
}

.cpm-topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cpm-topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cpm-page-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--white);
}

/* ═══════════════════════════════════════════════════════════════════
   NOTIFICHE — campanella + dropdown
   ═══════════════════════════════════════════════════════════════════ */

.cpm-notifiche-wrapper {
    position: relative;
}

/* ── Pulsante campanella ──────────────────────────────────────── */
.cpm-bell-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(45,212,191,0.08);
    border: 1px solid rgba(45,212,191,0.22);
    border-radius: 10px;
    cursor: pointer;
    color: var(--teal-400);
    transition: all 0.2s;
    position: relative;
    outline: none;
}

    .cpm-bell-btn:hover {
        background: rgba(45,212,191,0.14);
        border-color: var(--teal-500);
        color: #fff;
    }

    .cpm-bell-btn:active {
        transform: scale(0.94);
    }

    .cpm-bell-btn.has-alerts {
        background: rgba(45,212,191,0.15);
        border-color: var(--teal-500);
        color: #fff;
    }

        .cpm-bell-btn.has-alerts:hover {
            background: rgba(45,212,191,0.22);
        }

/* ── Badge contatore ──────────────────────────────────────────── */
.cpm-bell-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    background: var(--teal-500);
    color: #0a0f1e;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--navy-800);
    box-shadow: 0 0 0 2px rgba(20,184,166,0.25);
}

/* ── Backdrop scuro ───────────────────────────────────────────── */
.cpm-notifiche-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.25);
    z-index: 1000;
}

/* ── Dropdown ─────────────────────────────────────────────────── */
.cpm-notifiche-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 380px;
    max-height: 480px;
    background: var(--navy-700);
    border: 1px solid rgba(45,212,191,0.18);
    border-radius: 10px;
    z-index: 1001;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}

/* ── Header ───────────────────────────────────────────────────── */
.cpm-notifiche-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    font-size: 14px;
    font-weight: 600;
    color: var(--white);
}

.cpm-notifiche-header-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--teal-400);
    margin-left: 6px;
}

/* ── Body lista ───────────────────────────────────────────────── */
.cpm-notifiche-body {
    flex: 1;
    overflow-y: auto;
    max-height: 380px;
}

    .cpm-notifiche-body::-webkit-scrollbar {
        width: 4px;
    }

    .cpm-notifiche-body::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,0.08);
        border-radius: 4px;
    }

/* ── Vuoto ────────────────────────────────────────────────────── */
.cpm-notifiche-vuote {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 40px 16px;
}

    .cpm-notifiche-vuote .title {
        font-size: 14px;
        font-weight: 600;
        color: #e2e8f0;
    }

    .cpm-notifiche-vuote .sub {
        font-size: 12px;
        color: #64748b;
    }

/* ── Item notifica ────────────────────────────────────────────── */
.cpm-notifica-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 16px;
    cursor: pointer;
    transition: background 0.12s;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    border-left: 3px solid transparent;
}

    .cpm-notifica-item:hover {
        background: rgba(255,255,255,0.04);
    }

    .cpm-notifica-item.non-letta {
        background: rgba(45,212,191,0.04);
        border-left-color: var(--notify-color, var(--teal-500));
    }

        .cpm-notifica-item.non-letta:hover {
            background: rgba(45,212,191,0.08);
        }

.cpm-notifica-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.cpm-notifica-body {
    flex: 1;
    min-width: 0;
}

.cpm-notifica-titolo {
    font-size: 13px;
    font-weight: 600;
    color: var(--white);
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cpm-notifica-dot {
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--teal-500);
}

.cpm-notifica-desc {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    margin-top: 3px;
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.cpm-notifica-data {
    font-size: 11px;
    color: rgba(255,255,255,0.3);
    margin-top: 5px;
}

/* ── Footer ───────────────────────────────────────────────────── */
.cpm-notifiche-footer {
    padding: 8px 16px;
    border-top: 1px solid rgba(255,255,255,0.07);
    text-align: center;
}

    .cpm-notifiche-footer span,
    .cpm-notifiche-footer a {
        color: var(--teal-400);
        font-size: 12px;
        cursor: pointer;
        text-decoration: none;
    }

        .cpm-notifiche-footer span:hover,
        .cpm-notifiche-footer a:hover {
            color: var(--teal-300);
        }

/* ── Pulsante "segna lette" ──────────────────────────────────── */
.cpm-notifiche-marca {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    color: var(--teal-400);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s;
}

    .cpm-notifiche-marca:hover {
        color: var(--teal-300);
        background: rgba(45,212,191,0.08);
    }

/* User menu */
.cpm-user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(45,212,191,0.08);
    border: 1px solid rgba(45,212,191,0.2);
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    color: var(--white);
    font-size: 13px;
    transition: all 0.15s;
    position: relative;
}

    .cpm-user-btn:hover {
        background: rgba(45,212,191,0.14);
        border-color: rgba(45,212,191,0.35);
    }

.cpm-user-avatar {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--teal-500), #0891b2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

/* Dropdown user menu */
.cpm-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--navy-700);
    border: 1px solid rgba(45,212,191,0.15);
    border-radius: 10px;
    min-width: 180px;
    padding: 6px 0;
    z-index: 1000;
    display: none;
}

    .cpm-dropdown.open {
        display: block;
    }

.cpm-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    color: var(--gray-300);
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}

    .cpm-dropdown-item:hover {
        background: rgba(45,212,191,0.08);
        color: var(--white);
    }

    .cpm-dropdown-item svg {
        width: 15px;
        height: 15px;
        opacity: 0.7;
    }

.cpm-dropdown-divider {
    height: 1px;
    background: rgba(45,212,191,0.1);
    margin: 4px 0;
}

.cpm-dropdown-item.danger {
    color: #f87171;
}

    .cpm-dropdown-item.danger:hover {
        background: rgba(248,113,113,0.08);
    }

/* Contenuto pagina */
.cpm-content {
    flex: 1;
    overflow-y: auto;
    padding: 28px;
    background: var(--navy-950);
}

    .cpm-content::-webkit-scrollbar {
        width: 6px;
    }

    .cpm-content::-webkit-scrollbar-track {
        background: transparent;
    }

    .cpm-content::-webkit-scrollbar-thumb {
        background: var(--gray-500);
        border-radius: 3px;
    }

/* === DASHBOARD CARDS === */
.cpm-kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.cpm-kpi-card {
    background: var(--navy-800);
    border-radius: 12px;
    padding: 20px 24px;
    border: 1px solid rgba(148,163,184,0.12);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    .cpm-kpi-card:hover {
        border-color: rgba(45,212,191,0.25);
        background: var(--navy-700);
    }

.cpm-kpi-value {
    font-size: 36px;
    font-weight: 600;
    color: var(--white);
    line-height: 1;
}

    .cpm-kpi-value.cpm-kpi-alert {
        color: #fca5a5;
    }

.cpm-kpi-label {
    font-size: 13px;
    color: var(--gray-400);
}

.cpm-kpi-icon {
    width: 36px;
    height: 36px;
    background: rgba(20,184,166,0.12);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

    .cpm-kpi-icon svg {
        width: 18px;
        height: 18px;
        color: var(--teal-500);
    }

/* === SEZIONI DASHBOARD === */
.cpm-section {
    background: var(--navy-800);
    border-radius: 12px;
    border: 1px solid rgba(148,163,184,0.12);
    margin-bottom: 20px;
    overflow: hidden;
}

.cpm-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(148,163,184,0.10);
    font-size: 15px;
    font-weight: 500;
    color: var(--white);
}

    .cpm-section-header svg {
        width: 18px;
        height: 18px;
        color: var(--teal-500);
    }

.cpm-section-body {
    padding: 16px 20px;
}

.cpm-empty {
    font-size: 14px;
    color: var(--gray-400);
    padding: 8px 0;
}

/* Tabella alert costi */
.cpm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

    .cpm-table th {
        text-align: left;
        padding: 8px 12px;
        color: var(--gray-400);
        font-weight: 500;
        border-bottom: 1px solid rgba(148,163,184,0.10);
    }

    .cpm-table td {
        padding: 10px 12px;
        color: var(--gray-300);
        border-bottom: 1px solid rgba(148,163,184,0.06);
    }

    .cpm-table tr:last-child td {
        border-bottom: none;
    }

.cpm-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 500;
}

    .cpm-badge.warning {
        background: rgba(251,191,36,0.15);
        color: #fde68a;
    }

    .cpm-badge.danger {
        background: rgba(248,113,113,0.15);
        color: #fca5a5;
    }

/* Benvenuto header */
.cpm-welcome {
    margin-bottom: 24px;
}

    .cpm-welcome h1 {
        font-size: 22px;
        font-weight: 600;
        color: var(--white);
        margin: 0 0 4px;
    }

    .cpm-welcome p {
        font-size: 14px;
        color: var(--gray-400);
        margin: 0;
    }

    .cpm-welcome strong {
        color: var(--teal-400);
    }

/* Responsive */
@media (max-width: 1200px) {
    .cpm-kpi-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .cpm-sidebar {
        display: none;
    }

    .cpm-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* === PAGE HEADER === */
.cpm-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.cpm-page-title-h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--white);
    margin: 0 0 2px;
}

.cpm-page-subtitle {
    font-size: 13px;
    color: var(--gray-400);
}

.cpm-page-header-right {
    display: flex;
    gap: 10px;
}

/* === BUTTONS === */
.cpm-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
    font-family: 'DM Sans', sans-serif;
}

.cpm-btn-primary {
    background: linear-gradient(135deg, #14b8a6 0%, #0891b2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(20,184,166,0.25);
}

    .cpm-btn-primary:hover {
        box-shadow: 0 4px 14px rgba(20,184,166,0.4);
        transform: translateY(-1px);
    }

.cpm-btn-secondary {
    background: var(--navy-700);
    color: var(--gray-300);
    border: 1px solid rgba(148,163,184,0.15);
}

    .cpm-btn-secondary:hover {
        background: var(--navy-700);
        border-color: var(--gray-300);
    }

.cpm-btn-sm {
    background: var(--navy-700);
    color: var(--gray-300);
    border: 1px solid rgba(148,163,184,0.15);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}

    .cpm-btn-sm:hover {
        background: var(--navy-600);
        color: var(--white);
    }

    .cpm-btn-sm.danger:hover {
        background: rgba(239,68,68,0.15);
        border-color: rgba(239,68,68,0.4);
        color: #fca5a5;
    }

    .cpm-btn-sm.cpm-btn-teal {
        background: rgba(20,184,166,0.15);
        border-color: rgba(20,184,166,0.3);
        color: var(--teal-400);
    }

        .cpm-btn-sm.cpm-btn-teal:hover {
            background: rgba(20,184,166,0.25);
            color: var(--teal-300);
        }

.cpm-badge.success {
    background: rgba(20,184,166,0.15);
    color: var(--teal-300);
}

.cpm-badge.active {
    background: rgba(59,130,246,0.15);
    color: #93c5fd;
}

/* Select e input small */
.cpm-select, .cpm-input {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(148,163,184,0.18);
    background: var(--navy-700);
    color: var(--white);
    font-size: 13px;
    font-family: inherit;
    width: 100%;
    outline: none;
    transition: border-color 0.15s;
}

    .cpm-select:focus, .cpm-input:focus {
        border-color: var(--teal-400);
    }

.cpm-input-sm {
    padding: 5px 8px;
    font-size: 12px;
}

.cpm-btn-danger {
    background: #f87171;
    color: white;
}

    .cpm-btn-danger:hover {
        background: #ef4444;
        transform: translateY(-1px);
    }

.cpm-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* === CARD === */
.cpm-card {
    background: var(--navy-800);
    border-radius: 12px;
    border: 1px solid rgba(148,163,184,0.12);
    overflow: hidden;
}

/* === GRID ACTIONS === */
.cpm-grid-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.cpm-icon-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

    .cpm-icon-btn.edit {
        background: rgba(20,184,166,0.1);
        color: #14b8a6;
    }

        .cpm-icon-btn.edit:hover {
            background: rgba(20,184,166,0.2);
        }

    .cpm-icon-btn.delete {
        background: rgba(248,113,113,0.1);
        color: #f87171;
    }

        .cpm-icon-btn.delete:hover {
            background: rgba(248,113,113,0.2);
        }

/* === DIALOG === */
.cpm-dialog-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--white);
}

    .cpm-dialog-header.danger {
        color: #ef4444;
    }

.cpm-dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 4px 0;
}

/* === FORM === */
.cpm-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cpm-form-row {
    display: flex;
    gap: 14px;
    align-items: flex-end;
}

.cpm-form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

    .cpm-form-group label {
        font-size: 12px;
        font-weight: 500;
        color: var(--gray-400);
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

.cpm-form-error {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(248,113,113,0.08);
    border: 1px solid rgba(248,113,113,0.25);
    border-radius: 8px;
    font-size: 13px;
    color: #ef4444;
}

/* === SPINNER === */
.cpm-spinner {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

/* === SYNCFUSION OVERRIDE === */
.cpm-grid .e-gridheader {
    background: var(--navy-700) !important;
    border-bottom: 1px solid rgba(148,163,184,0.15) !important;
}

.cpm-grid .e-headercell {
    font-size: 12px !important;
    font-weight: 600 !important;
    color: var(--gray-400) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
}

.cpm-grid .e-rowcell {
    font-size: 13px !important;
    color: var(--gray-300) !important;
    border-bottom: 1px solid rgba(148,163,184,0.10) !important;
}

.cpm-grid .e-row:hover .e-rowcell {
    background: rgba(45,212,191,0.06) !important;
}

/* Bottone costo orario */
.cpm-icon-btn.costo {
    background: rgba(99,102,241,0.1);
    color: #6366f1;
}

    .cpm-icon-btn.costo:hover {
        background: rgba(99,102,241,0.2);
    }

/* Badge inline attivo/inattivo */
.cpm-badge-inline {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 500;
}

    .cpm-badge-inline.active {
        background: rgba(20,184,166,0.15);
        color: var(--teal-300);
    }

    .cpm-badge-inline.inactive {
        background: rgba(100,116,139,0.15);
        color: var(--gray-400);
    }

/* Badge contatore (richieste, utenti connessi) */
.cpm-badge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 99px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

/* Separatore sezione nel dialog */
.cpm-section-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0;
    color: var(--gray-400);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

    .cpm-section-divider::before,
    .cpm-section-divider::after {
        content: '';
        flex: 1;
        height: 1px;
        background: rgba(148,163,184,0.20);
    }

/* === LOGO UPLOAD === */
.cpm-logo-upload {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cpm-logo-preview {
    display: flex;
    align-items: center;
    gap: 12px;
}

    .cpm-logo-preview img {
        height: 60px;
        max-width: 180px;
        object-fit: contain;
        border-radius: 8px;
        border: 1px solid rgba(148,163,184,0.15);
        padding: 4px;
        background: var(--navy-700);
    }

.cpm-file-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid rgba(148,163,184,0.15);
    border-radius: 8px;
    background: rgba(148,163,184,0.10);
    font-size: 13px;
    color: var(--gray-300);
}

.cpm-file-preview span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cpm-file-input {
    font-size: 13px;
    color: var(--gray-400);
}

.cpm-file-hint {
    font-size: 11px;
    color: var(--gray-500);
}

/* === SCHEDULE === */
.cpm-schedule-wrap {
    padding: 0;
    overflow: hidden;
}

.cpm-filter-dd {
    min-width: 180px;
}

.cpm-event-template {
    padding: 2px 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
    font-weight: 500;
    color: white;
}

/* Editor dialog personalizzato */
.cpm-editor {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 4px 0;
}

.cpm-editor-section {
    background: var(--navy-700);
    border: 1px solid rgba(148,163,184,0.15);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cpm-editor-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 4px;
}

    .cpm-editor-section-title svg {
        color: var(--teal-500);
    }

/* Override Syncfusion Schedule */
.e-schedule .e-header-bar {
    background: var(--navy-800) !important;
    color: white !important;
}

    .e-schedule .e-header-bar .e-navigate-arrow,
    .e-schedule .e-header-bar .e-date-range {
        color: white !important;
    }

.e-schedule .e-toolbar-items .e-active-view .e-tbar-btn {
    background: var(--teal-500) !important;
    color: white !important;
    border-radius: 6px !important;
}

.e-schedule .e-today-button {
    color: var(--teal-500) !important;
}

.e-schedule .e-appointment {
    border-radius: 4px !important;
    border: none !important;
}

/* Forza trasparenza sul wrapper Syncfusion per far vedere il nostro colore */
.e-schedule .e-appointment {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

    .e-schedule .e-appointment .e-appointment-details {
        padding: 0 !important;
        height: 100% !important;
    }

    .e-schedule .e-appointment .e-subject {
        display: none !important;
    }

/* === COLOR PALETTE === */
.cpm-color-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    background: var(--navy-700);
    border: 1px solid rgba(148,163,184,0.15);
    border-radius: 10px;
}

.cpm-color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.08);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, box-shadow 0.15s;
    flex-shrink: 0;
    padding: 0;
}

    .cpm-color-swatch:hover {
        transform: scale(1.15);
        box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    }

    .cpm-color-swatch.selected {
        border: 2px solid white;
        box-shadow: 0 0 0 3px rgba(0,0,0,0.25);
        transform: scale(1.1);
    }

.cpm-dropdown-item.disabled {
    pointer-events: none;
    opacity: 0.5;
    cursor: default;
}

/* ── Toolbar ───────────────────────────── */
.prev-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.prev-filter-drop {
    min-width: 200px;
}

.prev-btn-nuovo {
    margin-left: auto;
}

/* ── Griglia ───────────────────────────── */
.prev-grid {
    border-radius: 8px;
    overflow: hidden;
}

.prev-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.stato-1 {
    background: #e3eeff;
    color: #1a5fc8;
}
/* Da compilare */
.stato-2 {
    background: #fff4e0;
    color: #b86e00;
}
/* In preparazione */
.stato-3 {
    background: #edf4ff;
    color: #0066cc;
}
/* Compilato */
.stato-4 {
    background: #e6f9ed;
    color: #1a7a3c;
}
/* Accettato */
.stato-5 {
    background: #f2f2f2;
    color: #666;
}
/* Chiuso */

.prev-check {
    color: #1a7a3c;
    font-weight: bold;
    font-size: 16px;
}

/* ── Drawer ────────────────────────────── */
.prev-drawer {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    padding: 0;
}

.prev-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
}

.prev-drawer-id {
    font-size: 12px;
    color: #888;
    display: block;
}

.prev-drawer-header h4 {
    margin: 4px 0 0;
    font-size: 18px;
}

.prev-drawer-section {
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
}

.prev-field-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

    .prev-field-row label {
        font-size: 13px;
        font-weight: 600;
        color: #444;
    }

/* ── Tipo immobile cards ────────────────── */
.prev-tipo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.prev-tipo-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all .18s ease;
    background: #fafafa;
}

    .prev-tipo-card:hover {
        border-color: #4f8ef7;
        background: #f0f5ff;
    }

    .prev-tipo-card.selected {
        border-color: #1a5fc8;
        background: #e3eeff;
    }

.prev-tipo-icon {
    font-size: 28px;
}

.prev-tipo-nome {
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    color: #333;
}

/* ── Checklist sezioni ──────────────────── */
.prev-section-title {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 16px;
    color: #222;
}

.prev-sezione {
    margin-bottom: 20px;
}

.prev-sezione-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #888;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid #f0f0f0;
}

.prev-domanda {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.prev-domanda-label {
    font-size: 13px;
    color: #333;
}

.prev-required {
    color: #e53935;
    margin-left: 3px;
}

.prev-input {
    width: 100%;
}

/* ── Footer drawer ──────────────────────── */
.prev-drawer-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    position: sticky;
    bottom: 0;
    background: #fff;
}

/* ── Wizard container ───────────────────── */
.wiz-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.wiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: #1a5fc8;
    color: #fff;
}

    .wiz-header h4 {
        margin: 0;
        font-size: 18px;
        color: #fff;
    }

.wiz-close {
    color: #fff !important;
    font-size: 18px;
}

.wiz-stepper {
    padding: 20px 24px 12px;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
}

.wiz-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.wiz-step-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e3eeff;
    color: #1a5fc8;
}

/* ── Campi form ─────────────────────────── */
.wiz-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}

    .wiz-field label {
        font-size: 13px;
        font-weight: 600;
        color: #333;
    }

.wiz-required {
    color: #e53935;
    margin-left: 2px;
}

.wiz-textarea .e-multi-line-input {
    min-height: 80px;
}

.wiz-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ── Sezioni checklist ──────────────────── */
.wiz-sezione {
    margin-bottom: 24px;
}

.wiz-sezione-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #999;
    margin-bottom: 14px;
    padding-bottom: 6px;
    border-bottom: 1px solid #f0f0f0;
}

.wiz-empty {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 40px 0;
}

/* ── Calcolo costi ──────────────────────── */
.wiz-costi-grid {
    margin-bottom: 16px;
}

.wiz-costo-row {
    display: grid;
    grid-template-columns: 1fr 160px 40px;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 14px;
    color: #333;
}

.wiz-costo-unit {
    font-size: 12px;
    color: #888;
}

/* ── Blocco preventivo inviato ──────────── */
.wiz-blocco-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: #fff8e1;
    border-bottom: 1px solid #ffe082;
    font-size: 13px;
    color: #6d4c00;
}

.wiz-blocco-icon {
    font-size: 22px;
    flex-shrink: 0;
}

.wiz-blocco-text {
    flex: 1;
}

.wiz-btn-duplica {
    font-size: 12px !important;
    padding: 5px 14px !important;
    white-space: nowrap;
    background: #1a5fc8 !important;
    color: #fff !important;
    border-radius: 6px !important;
}

/* ── Totale ─────────────────────────────── */
.wiz-totale {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: #e3eeff;
    border-radius: 8px;
    margin-top: 8px;
    font-weight: 700;
    font-size: 15px;
}

.wiz-totale-valore {
    font-size: 22px;
    color: #1a5fc8;
}

/* ── Riepilogo ──────────────────────────── */
.wiz-riepilogo {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
}

.wiz-riepilogo-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 16px;
    font-size: 14px;
    border-bottom: 1px solid #f5f5f5;
}

    .wiz-riepilogo-row:last-child {
        border-bottom: none;
    }

    .wiz-riepilogo-row span {
        color: #666;
    }

    .wiz-riepilogo-row strong {
        color: #111;
    }

/* ── Footer ─────────────────────────────── */
.wiz-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-top: 2px solid #e5e7eb;
    background: #fff;
}

.wiz-footer-right {
    display: flex;
    gap: 10px;
}

/* Bottone Avanti */
.wiz-btn-avanti {
    background: #1a5fc8 !important;
    color: #fff !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    padding: 7px 20px !important;
    border-radius: 6px !important;
    min-width: 100px;
}

.wiz-btn-indietro {
    background: #f0f0f0 !important;
    color: #333 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    padding: 7px 18px !important;
    border-radius: 6px !important;
    border: 1px solid #ccc !important;
    min-width: 90px;
}

.wiz-btn-salva {
    background: #1a7a3c !important;
    color: #fff !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    padding: 7px 20px !important;
    border-radius: 6px !important;
    min-width: 80px;
}

/* ── Step 3: Prestazioni / Macchinari griglia ── */
.wiz-pm-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

    .wiz-pm-container h6 {
        font-size: 13px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .07em;
        color: #1a5fc8;
        margin: 0 0 12px;
        padding-bottom: 6px;
        border-bottom: 2px solid #e3eeff;
    }

.wiz-pm-tabella {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

    .wiz-pm-tabella thead th {
        background: #f8faff;
        color: #555;
        font-weight: 700;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: .05em;
        padding: 8px 10px;
        border-bottom: 2px solid #e3eeff;
        text-align: left;
    }

    .wiz-pm-tabella tbody td {
        padding: 8px 10px;
        border-bottom: 1px solid #f0f0f0;
        color: #333;
    }

    .wiz-pm-tabella tbody tr:hover {
        background: #f5f9ff;
    }

    .wiz-pm-tabella tbody tr.wiz-pm-riga-selected {
        background: #e3eeff;
    }

.wiz-pm-tabella-check {
    width: 60px;
    text-align: center !important;
}

.cpm-dashboard-row {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    margin-bottom: 20px;
}

.cpm-section-wide {
    margin-bottom: 0;
}

.cpm-section-narrow {
    margin-bottom: 0;
}

.cpm-chart-body {
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Donut "Preventivi per Stato" */
.cpm-donut-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.cpm-donut-wrap {
    position: relative;
    width: 200px;
    height: 200px;
}

.cpm-donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
}

.cpm-donut-total {
    font-size: 28px;
    font-weight: 700;
    color: var(--white);
    line-height: 1;
}

.cpm-donut-label {
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.cpm-donut-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    .cpm-donut-legend li {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 13px;
        color: var(--white);
    }

.cpm-donut-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.cpm-donut-legend-label {
    flex: 1;
    color: var(--gray-400);
}

.cpm-donut-legend-value {
    font-weight: 600;
}

@media (max-width: 900px) {
    .cpm-dashboard-row {
        grid-template-columns: 1fr;
    }
}

/* ── Report ──────────────────────────────── */
.report-header {
    margin-bottom: 1.5rem;
}

    .report-header h2 {
        font-family: 'DM Sans', sans-serif;
        font-size: 1.4rem;
        color: var(--teal-400);
        margin: 0 0 0.25rem;
    }

.report-subtitle {
    color: var(--gray-400);
    font-size: 0.9rem;
    margin: 0;
}

.report-filtri {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.filtro-date-range {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 0.75rem;
}

.filtro-date-sep {
    color: var(--gray-400);
    font-size: 1rem;
    padding-bottom: 0.5rem;
    line-height: 1;
}

.filtro-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

    .filtro-group label {
        font-size: 0.78rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: #6b7280;
    }

    /* forza larghezza fissa sui datepicker dentro filtro-group */
    .filtro-group .e-date-wrapper {
        width: 160px !important;
    }

.filtro-actions {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    align-items: flex-end;
}

.report-loading,
.report-empty {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
    font-style: italic;
}
/* ── Galleria foto clienti ──────────────────────────────────────────── */
.gal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.gal-card {
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

.gal-img-wrap {
    aspect-ratio: 4/3;
    overflow: hidden;
    cursor: pointer;
    background: #f3f4f6;
}

.gal-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .2s ease;
}

.gal-img-wrap:hover .gal-img {
    transform: scale(1.04);
}

.gal-card-body {
    padding: 10px 12px;
    flex: 1;
}

.gal-card-cliente {
    font-weight: 700;
    font-size: 13px;
    color: #111827;
}

.gal-card-desc {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.gal-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 6px;
}

.gal-card-footer {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
    padding: 6px 10px;
    border-top: 1px solid #f3f4f6;
    background: #fafafa;
}

/* Lightbox */
.gal-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.gal-lightbox-inner {
    position: relative;
    max-width: 900px;
    width: 100%;
    background: #1f2937;
    border-radius: 16px;
    overflow: hidden;
}

.gal-lightbox-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: rgba(255,255,255,.15);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 16px;
    cursor: pointer;
    z-index: 1;
}

.gal-lightbox-img {
    display: block;
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.gal-lightbox-info {
    padding: 12px 16px;
    color: #f3f4f6;
    font-size: 14px;
}

.gal-lightbox-meta {
    display: block;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
}

/* === TEMA CHIARO — superfici leggibili per utilizzo prolungato === */
.cpm-sidebar {
    border-right: 1px solid #e2e8f0;
    box-shadow: 4px 0 18px rgba(15, 23, 42, 0.025);
}

.cpm-logo,
.cpm-sidebar-footer,
.cpm-topbar {
    border-color: #e2e8f0;
}

.cpm-nav-item,
.cpm-nav-group-header {
    color: #475569;
}

    .cpm-nav-item:hover,
    .cpm-nav-group-header:hover {
        background: #eaf7f5;
        color: #0f766e;
    }

    .cpm-nav-item.active {
        background: #dff5f1;
        color: #0f766e;
        border-left-color: #0f766e;
        font-weight: 600;
    }

.cpm-submenu-item {
    color: #64748b;
}

    .cpm-submenu-item:hover {
        color: #0f766e;
        background: #f0fdfa;
    }

    .cpm-submenu-item.active {
        color: #0f766e;
        font-weight: 600;
    }

.cpm-page-title,
.cpm-welcome h1,
.cpm-page-title-h2,
.cpm-section-header,
.cpm-kpi-value {
    color: #0f172a;
}

.cpm-logo-text .manager {
    color: #0f172a;
}

.cpm-user-btn,
.cpm-bell-btn {
    background: #ffffff;
    border-color: #dbe4ea;
    color: #0f766e;
}

    .cpm-user-btn:hover,
    .cpm-bell-btn:hover {
        background: #f0fdfa;
        border-color: #99d8d1;
        color: #0f766e;
    }

.cpm-user-avatar {
    background: #0f766e;
}

.cpm-kpi-card,
.cpm-section,
.cpm-dropdown,
.cpm-notifiche-dropdown {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

    .cpm-kpi-card:hover {
        background: #ffffff;
        border-color: #99d8d1;
        box-shadow: 0 10px 28px rgba(15, 118, 110, 0.09);
    }

.cpm-section-header,
.cpm-table th,
.cpm-table td,
.cpm-notifiche-header,
.cpm-dropdown-item,
.cpm-notifica-item {
    border-color: #e2e8f0;
}

.cpm-table td,
.cpm-dropdown-item,
.cpm-notifica-titolo {
    color: #334155;
}

.cpm-table th,
.cpm-notifica-desc,
.cpm-notifica-data {
    color: #64748b;
}

.cpm-dropdown-item:hover,
.cpm-notifica-item:hover {
    background: #f8fafc;
    color: #0f766e;
}

.cpm-notifica-item.non-letta {
    background: #f0fdfa;
}

.cpm-btn-primary {
    background: #0f766e;
    box-shadow: 0 2px 8px rgba(15, 118, 110, 0.18);
}

.cpm-btn-secondary,
.cpm-btn-sm {
    background: #ffffff;
    color: #334155;
    border-color: #dbe4ea;
}

.cpm-badge.warning {
    background: #fef3c7;
    color: #92400e;
}

.cpm-badge.danger {
    background: #fee2e2;
    color: #b91c1c;
}

/* Form, tabelle, agenda e componenti Syncfusion: stessa superficie chiara. */
.cpm-card,
.cpm-editor-section,
.cpm-color-palette {
    background: #ffffff;
    border-color: #e2e8f0;
}

.cpm-dialog-header,
.cpm-editor-section-title,
.cpm-donut-total,
.cpm-donut-legend li {
    color: #0f172a;
}

.cpm-select,
.cpm-input {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}

    .cpm-select:focus,
    .cpm-input:focus {
        border-color: #0f766e;
        box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.10);
    }

.cpm-grid .e-gridheader,
.e-schedule .e-header-bar {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

.cpm-grid .e-headercell {
    color: #64748b !important;
}

.cpm-grid .e-rowcell {
    color: #334155 !important;
    border-color: #e2e8f0 !important;
}

.cpm-grid .e-row:hover .e-rowcell {
    background: #f0fdfa !important;
}

.e-schedule,
.e-schedule .e-work-cells,
.e-schedule .e-work-days,
.e-schedule .e-alternate-cells,
.e-schedule .e-date-header-wrap table td,
.e-schedule .e-time-cells-wrap table td {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    color: #334155 !important;
}

    .e-schedule .e-header-bar .e-navigate-arrow,
    .e-schedule .e-header-bar .e-date-range {
        color: #0f172a !important;
    }

    .e-schedule .e-today-button {
        color: #0f766e !important;
    }

.cpm-dashboard-hero {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 26px;
    margin-bottom: 24px;
    background: linear-gradient(120deg, #ffffff 0%, #f0fdfa 100%);
    border: 1px solid #d5eee9;
    border-radius: 16px;
}

    .cpm-dashboard-hero h1 {
        margin-top: 4px;
    }

.cpm-eyebrow {
    display: block;
    color: #0f766e;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.cpm-dashboard-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

/* Dashboard: prima la fotografia commerciale, poi la gestione delle eccezioni. */
.cpm-dashboard-body {
    display: flex;
    flex-direction: column;
}

    .cpm-dashboard-body .cpm-kpi-grid {
        order: 1;
    }

    .cpm-dashboard-body .cpm-dashboard-row {
        order: 2;
    }

.cpm-dashboard-priorities {
    order: 3;
}

.cpm-dashboard-body .cpm-kpi-grid {
    grid-template-columns: 1fr 1fr 1.25fr 1fr 1.35fr;
    gap: 16px;
    margin-bottom: 20px;
}

.cpm-kpi-card {
    min-height: 150px;
    justify-content: space-between;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

    .cpm-kpi-card:hover {
        transform: translateY(-2px);
    }

.cpm-kpi-sales {
    border-color: #cce9e4;
}

.cpm-kpi-revenue {
    background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
    border-color: #0f766e;
}

    .cpm-kpi-revenue .cpm-kpi-value,
    .cpm-kpi-revenue .cpm-kpi-label {
        color: #ffffff;
    }

    .cpm-kpi-revenue .cpm-kpi-icon {
        background: rgba(255,255,255,.16);
    }

        .cpm-kpi-revenue .cpm-kpi-icon svg {
            color: #ffffff;
        }

.cpm-kpi-meta {
    font-size: 11px;
    color: #64748b;
    margin-top: -2px;
}

.cpm-kpi-revenue .cpm-kpi-meta {
    color: rgba(255,255,255,.76);
}

/* Agenda: controlli operativi, compatti ma immediatamente leggibili. */
.cpm-agenda-control {
    margin: 0 0 20px;
    padding: 16px 18px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.cpm-agenda-control-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #0f172a;
}

.cpm-agenda-control-count {
    padding: 4px 8px;
    border-radius: 999px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 11px;
    font-weight: 700;
}

.cpm-agenda-control-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.cpm-agenda-control-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
}

    .cpm-agenda-control-item strong,
    .cpm-agenda-control-item span:not(.cpm-agenda-control-icon) {
        display: block;
    }

    .cpm-agenda-control-item strong {
        color: #334155;
        font-size: 13px;
    }

    .cpm-agenda-control-item span:not(.cpm-agenda-control-icon) {
        color: #64748b;
        font-size: 12px;
        margin-top: 2px;
    }

.cpm-agenda-control-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 800;
}

.cpm-agenda-control-item.conflict {
    border-color: #fecaca;
    background: #fffafa;
}

    .cpm-agenda-control-item.conflict .cpm-agenda-control-icon {
        background: #fee2e2;
        color: #b91c1c;
    }

.cpm-agenda-control-item.unassigned {
    border-color: #fde68a;
    background: #fffdf6;
}

    .cpm-agenda-control-item.unassigned .cpm-agenda-control-icon {
        background: #fef3c7;
        color: #92400e;
    }

.cpm-agenda-control-item.overload {
    border-color: #ddd6fe;
    background: #fafaff;
}

    .cpm-agenda-control-item.overload .cpm-agenda-control-icon {
        background: #ede9fe;
        color: #6d28d9;
    }

/* Scheda cliente: dati essenziali per rispondere senza cercare in quattro pagine. */
.cpm-back-link {
    display: inline-block;
    margin-bottom: 8px;
    color: #0f766e;
    font-size: 13px;
    text-decoration: none;
}

.cpm-customer-overview {
    margin-bottom: 20px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
}

.cpm-customer-overview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid #e2e8f0;
    color: #0f172a;
}

.cpm-customer-overview-body {
    display: grid;
    grid-template-columns: 1fr 1.1fr 1fr;
    gap: 0;
}

.cpm-customer-info-block {
    padding: 18px;
    border-right: 1px solid #e2e8f0;
}

    .cpm-customer-info-block strong, .cpm-customer-info-block span {
        display: block;
    }

.cpm-customer-info-label {
    color: #0f766e;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.cpm-customer-info-block strong {
    color: #0f172a;
    margin: 6px 0 4px;
    font-size: 14px;
}

.cpm-customer-info-block > span:not(.cpm-customer-info-label) {
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
}

.cpm-customer-note {
    margin-top: 7px;
    color: #475569 !important;
    font-style: italic;
}

.cpm-customer-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
}

.cpm-customer-stat {
    background: #f0fdfa;
    border-color: #cce9e4;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.cpm-customer-stats .cpm-customer-stat {
    border: 0;
    border-radius: 0;
    padding: 18px;
}

    .cpm-customer-stats .cpm-customer-stat + .cpm-customer-stat {
        border-left: 1px solid #cce9e4;
    }

.cpm-customer-stat span {
    color: #0f766e;
    font-size: 12px;
}

.cpm-customer-stat strong {
    color: #0f172a;
    font-size: 24px;
    margin-top: 10px;
}

.cpm-customer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

    .cpm-customer-grid .cpm-section {
        margin: 0;
    }

.cpm-table-muted {
    color: #64748b;
    font-size: 11px;
}

.cpm-document-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

    .cpm-document-list li {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        padding: 9px 0;
        border-bottom: 1px solid #e2e8f0;
        color: #334155;
        font-size: 13px;
    }

        .cpm-document-list li:last-child {
            border-bottom: none;
        }

    .cpm-document-list span {
        color: #64748b;
        font-size: 11px;
        white-space: nowrap;
    }

.cpm-icon-btn.view {
    background: #dff5f1;
    color: #0f766e;
}

    .cpm-icon-btn.view:hover {
        background: #c8ebe5;
    }

@media (max-width: 900px) {
    .cpm-customer-overview-body, .cpm-customer-grid {
        grid-template-columns: 1fr;
    }

    .cpm-customer-info-block {
        border-right: 0;
        border-bottom: 1px solid #e2e8f0;
    }
}

.cpm-dashboard-priorities {
    margin-top: 4px;
    border-color: #f1d8a7;
}

    .cpm-dashboard-priorities .cpm-section-header {
        background: #fffbeb;
        color: #78350f;
    }

        .cpm-dashboard-priorities .cpm-section-header svg {
            color: #b45309;
        }

@media (max-width: 1200px) {
    .cpm-dashboard-body .cpm-kpi-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Finiture trasversali per finestre, report e immagini. */
.cpm-editor-section-title,
.cpm-dialog-header,
.report-header h2 {
    color: #0f172a;
}

.cpm-dialog,
.e-dialog,
.e-dlg-content,
.e-dlg-header-content {
    background: #ffffff !important;
    color: #334155 !important;
}

    .e-dialog .e-dlg-header,
    .e-dialog .e-btn {
        color: #0f172a !important;
    }

    .e-dialog .e-footer-content {
        border-color: #e2e8f0 !important;
    }

.gal-lightbox-inner {
    background: #ffffff;
}

.gal-lightbox-info {
    color: #334155;
}

.gal-lightbox-meta {
    color: #64748b;
}

@media (max-width: 768px) {
    .cpm-content {
        padding: 18px;
    }

    .cpm-page-header {
        align-items: flex-start;
        gap: 12px;
        flex-direction: column;
    }
}

@media (max-width: 700px) {
    .cpm-dashboard-hero {
        align-items: flex-start;
        flex-direction: column;
        padding: 20px;
    }

    .cpm-dashboard-actions {
        width: 100%;
    }

        .cpm-dashboard-actions .cpm-btn {
            flex: 1;
            justify-content: center;
        }
}