/* ========================================
   AREA LEADERSHIP - CSS Dedicato
   Dashboard per CEO e Team Leader
   Purple Theme: #6366f1 / #8b5cf6
   Sidebar Layout
======================================== */

/* ========================================
   1. LOGIN SCREEN
======================================== */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0c0c0f;
    padding: 2rem;
}

.login-screen::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.login-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo .logo-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.75rem;
}

.login-logo h1 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.25rem;
}

.login-logo p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

.login-card {
    background: linear-gradient(145deg, rgba(28, 28, 35, 0.95) 0%, rgba(20, 20, 26, 0.98) 100%);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 20px;
    padding: 2rem;
}

.login-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-header h2 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

.login-form .form-group {
    margin-bottom: 1.25rem;
}

.login-form label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.login-form input,
.login-form select {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--white);
    font-size: 0.95rem;
    transition: all 0.25s ease;
}

.login-form input:focus,
.login-form select:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.login-form input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.btn-login-submit {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 0.5rem;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-login-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.btn-login-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.login-error {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #ef4444;
    font-size: 0.85rem;
    text-align: center;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
}

.login-footer a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

.login-footer a:hover {
    color: #8b5cf6;
}

/* ========================================
   2. LEADER APP LAYOUT (with sidebar)
======================================== */
.leader-app {
    min-height: 100vh;
    background: #0c0c0f;
}

/* --- Header (fixed top, full width) --- */
.leader-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: linear-gradient(180deg, rgba(18, 18, 22, 0.98) 0%, rgba(14, 14, 18, 0.95) 100%);
    backdrop-filter: blur(30px);
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-left .logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-left .logo-icon {
    font-size: 1.5rem;
}

.header-left .logo-text {
    display: flex;
    flex-direction: column;
}

.header-left .logo-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-left .logo-subtitle {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Mobile menu toggle (hamburger) */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover span {
    background: #8b5cf6;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}
.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Header center */
.header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.leader-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.25rem;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 50px;
}

.leader-avatar {
    font-size: 1.25rem;
}

.leader-details {
    display: flex;
    flex-direction: column;
}

.leader-name {
    font-weight: 600;
    color: var(--white);
    font-size: 0.9rem;
}

.leader-role {
    font-size: 0.7rem;
    color: #8b5cf6;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Header right */
.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 10px;
    color: #ef4444;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
}

/* --- Sidebar --- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 199;
}

.sidebar-overlay.active {
    display: block;
}

.sidebar {
    position: fixed;
    top: 70px;
    left: 0;
    width: 240px;
    height: calc(100vh - 70px);
    background: linear-gradient(180deg, rgba(18, 18, 22, 0.98), rgba(12, 12, 15, 0.99));
    border-right: 1px solid rgba(99, 102, 241, 0.1);
    z-index: 200;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

/* Custom scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.2);
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.4);
}

.sidebar-nav {
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-spacer {
    flex: 1;
    min-height: 50px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.25s ease;
    cursor: pointer;
    border: 1px solid transparent;
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: #8b5cf6;
    border-radius: 0 3px 3px 0;
    transition: height 0.25s ease;
}

.nav-item:hover {
    background: rgba(99, 102, 241, 0.08);
    color: rgba(255, 255, 255, 0.9);
}

.nav-item:hover::before {
    height: 50%;
}

.nav-item.active {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.nav-item.active::before {
    height: 60%;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.nav-icon {
    font-size: 1.1rem;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: all 0.25s ease;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
    opacity: 1;
    transform: scale(1.05);
}

.nav-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-badge {
    margin-left: auto;
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}

.nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 0.5rem 0;
}

.nav-external {
    color: rgba(99, 102, 241, 0.7);
}

.nav-external:hover {
    color: #a5b4fc;
    background: rgba(99, 102, 241, 0.06);
}

.nav-arrow {
    margin-left: auto;
    opacity: 0.4;
    font-size: 0.85rem;
    transition: all 0.25s ease;
}

.nav-external:hover .nav-arrow {
    opacity: 0.8;
    transform: translateX(3px);
}

/* --- Main Content --- */
.main-content {
    margin-left: 240px;
    padding: 90px 2rem 2rem;
    min-height: 100vh;
}

.content-section {
    display: none;
    animation: fadeInSection 0.35s ease;
}

.content-section.active {
    display: block;
}

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

/* Legacy layout support: leader-main (non-sidebar layout) */
.leader-main {
    padding: 90px 2rem 2rem;
    max-width: 1600px;
    margin: 0 auto;
}


/* ========================================
   3. DASHBOARD SECTION STYLES
======================================== */

/* Section Header */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--white);
    letter-spacing: -0.01em;
}

.section-subtitle {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.9rem;
    font-weight: 400;
    margin-top: 0.25rem;
}

.subsection-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: #a5b4fc;
    margin: 1.75rem 0 1rem;
    letter-spacing: 0.01em;
}

/* Period Selector */
.period-selector {
    display: flex;
    gap: 0.25rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.25rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.period-btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
}

.period-btn:hover {
    color: rgba(255, 255, 255, 0.8);
}

.period-btn.active {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.kpi-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

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

.kpi-card {
    background: linear-gradient(145deg, rgba(28, 28, 35, 0.95) 0%, rgba(20, 20, 26, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.kpi-card.kpi-primary {
    border-color: rgba(99, 102, 241, 0.2);
}
.kpi-card.kpi-primary .kpi-value {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.kpi-card.kpi-warning {
    border-color: rgba(251, 191, 36, 0.2);
}
.kpi-card.kpi-warning .kpi-value {
    color: #fbbf24;
}

.kpi-card.kpi-success {
    border-color: rgba(34, 197, 94, 0.2);
}
.kpi-card.kpi-success .kpi-value {
    color: #22c55e;
}

.kpi-card.kpi-danger {
    border-color: rgba(239, 68, 68, 0.2);
}
.kpi-card.kpi-danger .kpi-value {
    color: #ef4444;
}

.kpi-card.kpi-year {
    border-color: rgba(59, 130, 246, 0.2);
}
.kpi-card.kpi-year .kpi-value {
    color: #3b82f6;
}

.kpi-card.kpi-expired {
    border-color: rgba(249, 115, 22, 0.2);
}
.kpi-card.kpi-expired .kpi-value {
    color: #f97316;
}

.kpi-icon {
    font-size: 1.5rem;
}

.kpi-value {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1.1;
}

.kpi-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.kpi-subtitle {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 0.15rem;
}

.kpi-data {
    display: flex;
    flex-direction: column;
}

/* Legacy KPI styles from old layout */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.kpi-card-leader {
    background: linear-gradient(145deg, rgba(28, 28, 35, 0.95) 0%, rgba(20, 20, 26, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.kpi-card-leader:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.1);
}

.kpi-icon-leader {
    font-size: 1.75rem;
}

.kpi-number {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1.1;
}

.kpi-label-leader {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.kpi-card-leader.kpi-total {
    border-color: rgba(99, 102, 241, 0.2);
}
.kpi-card-leader.kpi-total .kpi-number {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.kpi-card-leader.kpi-urgent {
    border-color: rgba(239, 68, 68, 0.2);
}
.kpi-card-leader.kpi-urgent .kpi-number {
    color: #ef4444;
}

.kpi-card-leader.kpi-pending {
    border-color: rgba(251, 191, 36, 0.2);
}
.kpi-card-leader.kpi-pending .kpi-number {
    color: #fbbf24;
}

.kpi-card-leader.kpi-progress {
    border-color: rgba(59, 130, 246, 0.2);
}
.kpi-card-leader.kpi-progress .kpi-number {
    color: #3b82f6;
}

.kpi-card-leader.kpi-success {
    border-color: rgba(34, 197, 94, 0.2);
}
.kpi-card-leader.kpi-success .kpi-number {
    color: #22c55e;
}

.kpi-card-leader.kpi-rate .kpi-number {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Chart Cards */
.chart-card {
    background: linear-gradient(145deg, rgba(28, 28, 35, 0.95) 0%, rgba(20, 20, 26, 0.98) 100%);
    border: 1px solid rgba(99, 102, 241, 0.08);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.chart-card:hover {
    border-color: rgba(99, 102, 241, 0.2);
}

.chart-card .chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem 0;
}

.chart-card .chart-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--white);
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.chart-body {
    padding: 1rem 1.5rem 1.5rem;
    height: 250px;
    position: relative;
}

.chart-body-scadenze {
    padding: 1rem 1.5rem 1.5rem;
    height: 300px;
    position: relative;
}

/* Provider Cards */
.provider-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.provider-card {
    background: linear-gradient(145deg, rgba(28, 28, 35, 0.95) 0%, rgba(20, 20, 26, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 1.25rem;
    transition: all 0.3s ease;
}

.provider-card:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.15);
}

.provider-card .provider-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 0.5rem;
}

.provider-card .provider-count {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.75rem;
}

.provider-bar {
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.provider-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

.provider-bar-fill.leasys {
    background: linear-gradient(90deg, #0066cc, #3399ff);
}
.provider-bar-fill.arval {
    background: linear-gradient(90deg, #dc3545, #ff6b7a);
}
.provider-bar-fill.ald {
    background: linear-gradient(90deg, #28a745, #5dd879);
}
.provider-bar-fill.ayvens {
    background: linear-gradient(90deg, #17a2b8, #4dd4e6);
}

/* Table Card */
.table-card {
    background: linear-gradient(145deg, rgba(28, 28, 35, 0.6) 0%, rgba(20, 20, 26, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.table-card .table-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-card .table-header h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--white);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table th {
    padding: 0.875rem 1.25rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.45);
    background: rgba(99, 102, 241, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: sticky;
    top: 0;
    z-index: 1;
}

.data-table td {
    padding: 0.875rem 1.25rem;
    color: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
}

.data-table tr:hover td {
    background: rgba(99, 102, 241, 0.04);
}

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


/* ========================================
   4. FLOTTA TABLE STYLES
======================================== */

/* Filters Bar */
.filters-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 0.6rem 1rem;
    flex: 1;
    min-width: 200px;
    transition: all 0.25s ease;
}

.search-box:focus-within {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-box .search-icon {
    font-size: 0.9rem;
    opacity: 0.5;
}

.search-box input {
    flex: 1;
    background: none;
    border: none;
    color: var(--white);
    font-size: 0.85rem;
    outline: none;
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
}

.filter-select {
    padding: 0.6rem 0.875rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: var(--white);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.25s ease;
    min-width: 120px;
}

.filter-select:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.filter-select option {
    background: #1c1c23;
    color: var(--white);
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

.btn-reset-filters {
    padding: 0.5rem 0.875rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-reset-filters:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.results-count {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Full Data Table (with horizontal scroll) */
.data-table-full {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table-full .data-table {
    min-width: 1200px;
}

.sticky-col {
    position: sticky;
    left: 0;
    z-index: 2;
    background: rgba(20, 20, 26, 0.98);
}

.data-table tr:hover .sticky-col {
    background: rgba(28, 28, 35, 0.98);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 0;
}

.pagination button,
.pagination-btn {
    padding: 0.5rem 0.875rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.25s ease;
}

.pagination button:hover:not(:disabled),
.pagination-btn:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
}

.pagination button.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    font-weight: 600;
}

.pagination button:disabled,
.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    padding: 0 0.5rem;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.status-badge.info {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.status-badge.success {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.status-badge.danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.status-badge.warning {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.status-badge.neutral {
    background: rgba(107, 114, 128, 0.15);
    color: #9ca3af;
}

.status-badge.expired {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
}

/* Provider Badge */
.provider-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.provider-badge.leasys {
    background: rgba(0, 102, 204, 0.15);
    color: #60a5fa;
}

.provider-badge.arval {
    background: rgba(220, 53, 69, 0.15);
    color: #f87171;
}

.provider-badge.ald {
    background: rgba(40, 167, 69, 0.15);
    color: #4ade80;
}

.provider-badge.ayvens {
    background: rgba(23, 162, 184, 0.15);
    color: #22d3ee;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.4rem;
}

.btn-action {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.btn-action:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
}

.btn-action.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}


/* ========================================
   5. SCADENZE STYLES
======================================== */

.scadenze-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.scadenza-filter-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
}

.scadenza-filter-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.scadenza-filter-btn.active {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
}

.scadenza-filter-btn .count {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.1rem 0.4rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.scadenza-filter-btn.active .count {
    background: rgba(99, 102, 241, 0.3);
}

/* Scadenze Timeline */
.scadenze-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.scadenza-item {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    border-left: 4px solid rgba(99, 102, 241, 0.3);
    transition: all 0.25s ease;
}

.scadenza-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(99, 102, 241, 0.15);
}

.scadenza-item.urgent {
    border-left-color: #ef4444;
}

.scadenza-item.warning {
    border-left-color: #fbbf24;
}

.scadenza-item.normal {
    border-left-color: #3b82f6;
}

.scadenza-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 56px;
    padding: 0.5rem;
    background: rgba(99, 102, 241, 0.08);
    border-radius: 10px;
}

.scadenza-date .day {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1;
}

.scadenza-date .month {
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.scadenza-item.urgent .scadenza-date {
    background: rgba(239, 68, 68, 0.1);
}

.scadenza-item.warning .scadenza-date {
    background: rgba(251, 191, 36, 0.1);
}

.scadenza-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.scadenza-info .client-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--white);
}

.scadenza-info .vehicle-info {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.scadenza-info .consulente-name {
    font-size: 0.75rem;
    color: rgba(99, 102, 241, 0.7);
}


/* ========================================
   6. RINNOVI STYLES
======================================== */

/* Search Container */
.rinnovi-search-container {
    margin-bottom: 1.5rem;
}

.rinnovi-search-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(145deg, rgba(28, 28, 35, 0.95) 0%, rgba(20, 20, 26, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1rem 1.5rem;
    transition: all 0.3s ease;
}

.rinnovi-search-box:focus-within {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.rinnovi-search-box .search-icon-large {
    font-size: 1.5rem;
    opacity: 0.6;
}

.rinnovi-search-box input {
    flex: 1;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1rem;
    outline: none;
}

.rinnovi-search-box input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* Rinnovi Filters */
.rinnovi-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.filter-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
}

.filter-tab:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.filter-tab.active {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
}

.filter-tab .tab-icon {
    font-size: 1rem;
}

.filter-tab .tab-label {
    white-space: nowrap;
}

.filter-tab .tab-count {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.1rem 0.4rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.filter-tab.active .tab-count {
    background: rgba(99, 102, 241, 0.3);
}

.filter-options {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

/* Rinnovi List */
.rinnovi-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Cliente Card */
.cliente-card {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 1.25rem;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 1rem 1.25rem;
    border-left: 4px solid rgba(99, 102, 241, 0.2);
    cursor: pointer;
    transition: all 0.25s ease;
}

.cliente-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(99, 102, 241, 0.15);
    transform: translateX(4px);
}

.cliente-card.status-si {
    border-left-color: #22c55e;
}

.cliente-card.status-no {
    border-left-color: #ef4444;
}

.cliente-card.status-altro {
    border-left-color: #fbbf24;
}

.cliente-card.status-pending {
    border-left-color: rgba(255, 255, 255, 0.2);
}

.cliente-card.status-scaduto {
    border-left-color: #f97316;
}

.cliente-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.08) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: #a5b4fc;
}

.cliente-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.cliente-info .nome {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cliente-info .dettagli {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.cliente-veicolo {
    text-align: right;
    min-width: 120px;
}

.cliente-veicolo .provider {
    font-size: 0.85rem;
    font-weight: 600;
    color: #8b5cf6;
}

.cliente-veicolo .modello {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.cliente-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4rem;
    min-width: 100px;
}

.status-badge-large {
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.status-badge-large.si {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.status-badge-large.no {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.status-badge-large.altro {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.status-badge-large.pending {
    background: rgba(107, 114, 128, 0.15);
    color: #9ca3af;
}

.status-badge-large.scaduto {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
}

.scadenza-info-text {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
}

/* Modal Profilo */
.profilo-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 1.25rem;
}

.profilo-header .avatar-large {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.1) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.profilo-info {
    flex: 1;
}

.profilo-info .nome {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--white);
}

.profilo-info .ruolo {
    font-size: 0.85rem;
    color: #8b5cf6;
}

.profilo-sections {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.profilo-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.25rem;
}

.profilo-section h4 {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    color: #a5b4fc;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.profilo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.profilo-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.profilo-field .field-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.profilo-field .field-value {
    font-size: 0.9rem;
    color: var(--white);
    font-weight: 500;
}

/* Rinnovo Form Section */
.rinnovo-form-section {
    background: rgba(99, 102, 241, 0.04);
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-radius: 12px;
    padding: 1.25rem;
    margin-top: 1rem;
}

.rinnovo-form-section h4 {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    color: #a5b4fc;
    margin-bottom: 1rem;
}

.rinnovo-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.rinnovo-form-grid .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.rinnovo-form-grid label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

.rinnovo-form-grid input,
.rinnovo-form-grid select,
.rinnovo-form-grid textarea {
    padding: 0.6rem 0.875rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--white);
    font-size: 0.85rem;
    transition: all 0.25s ease;
}

.rinnovo-form-grid input:focus,
.rinnovo-form-grid select:focus,
.rinnovo-form-grid textarea:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ========================================
   6b. ANALISI COMUNICAZIONE
======================================== */
#comunicazioniContainer {
    margin-bottom: 1rem;
}

.no-comunicazioni {
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
    font-size: 0.85rem;
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    margin: 0;
}

.comunicazione-row {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    animation: fadeInCom 0.2s ease;
}

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

.comunicazione-fields {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-group-inline {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 100px;
}

.form-group-inline.flex-grow {
    flex: 1;
    min-width: 150px;
}

.form-group-inline label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group-inline input,
.form-group-inline select {
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-size: 0.85rem;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.form-group-inline input:focus,
.form-group-inline select:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.4);
}

.form-group-inline select {
    cursor: pointer;
}

.btn-remove-comunicazione {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-remove-comunicazione:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
}

.btn-add-comunicazione {
    width: 100%;
    padding: 0.75rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px dashed rgba(99, 102, 241, 0.3);
    color: #6366f1;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-add-comunicazione:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.5);
}

.btn-add-comunicazione:disabled {
    cursor: not-allowed;
    color: rgba(99, 102, 241, 0.4);
}

.comunicazioni-hint {
    display: block;
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

/* ========================================
   6c. MONITORAGGIO COMUNICAZIONI
======================================== */
.comunicazioni-monitor-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.subsection-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.kpi-card.kpi-clickable {
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.kpi-card.kpi-clickable:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
}

.kpi-click-hint {
    font-size: 0.65rem;
    color: rgba(99, 102, 241, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.5rem;
    text-align: center;
}

.comunicazioni-details-panel {
    margin-top: 1.5rem;
    background: rgba(99, 102, 241, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 12px;
    overflow: hidden;
}

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

.comunicazioni-details-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: rgba(99, 102, 241, 0.1);
    border-bottom: 1px solid rgba(99, 102, 241, 0.15);
}

.comunicazioni-details-panel .panel-header h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--white);
}

.btn-close-panel {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.2s ease;
}

.btn-close-panel:hover {
    color: var(--white);
}

.comunicazioni-details-panel .panel-body {
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.badge-total {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ========================================
   7. CARING CALL STYLES
   (inherits from data-table above)
======================================== */

.caring-call-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.caring-call-filters {
    display: flex;
    gap: 0.5rem;
}

.caring-call-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.caring-call-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.caring-call-status .status-dot.done {
    background: #22c55e;
}

.caring-call-status .status-dot.pending {
    background: #fbbf24;
}

.caring-call-status .status-dot.missed {
    background: #ef4444;
}


/* ========================================
   8. MAPPA STYLES
======================================== */

.map-container {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.map-wrapper {
    flex: 1;
    height: 500px;
    background: linear-gradient(145deg, rgba(28, 28, 35, 0.95) 0%, rgba(20, 20, 26, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
}

.italy-map {
    width: 100%;
    height: 100%;
}

.italy-map svg {
    width: 100%;
    height: 100%;
}

.map-legend {
    width: 280px;
    background: linear-gradient(145deg, rgba(28, 28, 35, 0.95) 0%, rgba(20, 20, 26, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.map-legend h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 0.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.legend-marker {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    flex-shrink: 0;
}

.legend-marker.purple {
    background: #6366f1;
}

.legend-marker.green {
    background: #22c55e;
}

.legend-marker.red {
    background: #ef4444;
}

.legend-marker.amber {
    background: #fbbf24;
}

.legend-marker.blue {
    background: #3b82f6;
}

.legend-marker.orange {
    background: #f97316;
}

.legend-item .legend-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    flex: 1;
}

.legend-item .legend-value {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--white);
}


/* ========================================
   9. NUOVO CONTRATTO FORM
======================================== */

.form-contratto {
    max-width: 900px;
}

.form-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-section-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: #a5b4fc;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.form-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--white);
    font-size: 0.9rem;
    transition: all 0.25s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.form-group select option {
    background: #1c1c23;
    color: var(--white);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}


/* ========================================
   10. CONSULENTI STYLES
======================================== */

.consulenti-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.consulente-card {
    background: linear-gradient(145deg, rgba(28, 28, 35, 0.95) 0%, rgba(20, 20, 26, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.consulente-card:hover {
    transform: translateY(-3px);
    border-color: rgba(99, 102, 241, 0.2);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.consulente-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.consulente-header .avatar {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.1) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: #a5b4fc;
}

.consulente-header .name {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--white);
}

.consulente-header .team {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.consulente-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.consulente-stat {
    text-align: center;
}

.consulente-stat .value {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1.2;
}

.consulente-stat .value.primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.consulente-stat .value.success {
    color: #22c55e;
}

.consulente-stat .value.danger {
    color: #ef4444;
}

.consulente-stat .value.warning {
    color: #fbbf24;
}

.consulente-stat .label {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 0.2rem;
}

/* Nuovi stili per consulenti da consulenti_rinnovi */
.consulente-avatar {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.1) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.consulente-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.consulente-name {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--white);
}

.consulente-email {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.consulente-team-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: fit-content;
}

.consulente-team-badge.team-torino {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.consulente-team-badge.team-smart {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.consulente-stat-value {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1.2;
}

.consulente-stat-value.text-success {
    color: #22c55e;
}

.consulente-stat-value.text-danger {
    color: #ef4444;
}

.consulente-stat-label {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 0.2rem;
}

.consulente-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
}


/* ========================================
   11. IMPORT CSV STYLES
======================================== */

.import-container {
    max-width: 700px;
    margin: 0 auto;
}

.upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    background: rgba(255, 255, 255, 0.02);
    border: 2px dashed rgba(99, 102, 241, 0.2);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-height: 200px;
    margin-bottom: 1.5rem;
}

.upload-area:hover {
    background: rgba(99, 102, 241, 0.04);
    border-color: rgba(99, 102, 241, 0.4);
}

.upload-area.drag-over {
    background: rgba(99, 102, 241, 0.08);
    border-color: #6366f1;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
}

.upload-area .upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.upload-area h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 0.5rem;
}

.upload-area p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

.import-progress {
    margin-bottom: 1.5rem;
}

.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 4px;
    transition: width 0.4s ease;
    width: 0%;
}

.progress-text {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
}

.validation-results {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.validation-results h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 1rem;
}

.validation-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.validation-table th {
    padding: 0.75rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.validation-table td {
    padding: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.current-data-info {
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.current-data-info .info-icon {
    font-size: 1.5rem;
    opacity: 0.7;
}

.current-data-info .info-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.current-data-info .info-text strong {
    color: #60a5fa;
}


/* ========================================
   12. MODAL OVERRIDES (Purple accent)
======================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: linear-gradient(180deg, rgba(25, 25, 30, 0.98) 0%, rgba(15, 15, 20, 0.98) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 40px rgba(99, 102, 241, 0.08);
}

.modal-overlay.active .modal-container {
    transform: scale(1) translateY(0);
}

.modal-container.modal-large {
    max-width: 800px;
}

.modal-container.modal-xl {
    max-width: 1000px;
}

.modal-container.modal-contratto {
    max-width: 750px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: rgba(99, 102, 241, 0.05);
    border-bottom: 1px solid rgba(99, 102, 241, 0.15);
}

.modal-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--white);
}

.modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    transition: all 0.25s ease;
    padding: 0;
}

.modal-close:hover {
    color: #8b5cf6;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(99, 102, 241, 0.15);
}

/* Modal form inputs */
.modal-body .form-group input,
.modal-body .form-group select,
.modal-body .form-group textarea {
    padding: 0.7rem 0.875rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--white);
    font-size: 0.9rem;
    transition: all 0.25s ease;
}

.modal-body .form-group input:focus,
.modal-body .form-group select:focus,
.modal-body .form-group textarea:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.25rem;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--white);
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.25rem;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    color: #ef4444;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
}


/* ========================================
   13. TEAM FILTER & BADGE
======================================== */

/* Welcome Banner */
.welcome-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.04) 100%);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
}

.welcome-content h1 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.25rem;
}

.welcome-content h1 span {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-content p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.welcome-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.welcome-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

/* Team Filter (solo CEO) */
.team-filter {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.team-filter label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.team-select {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 8px;
    color: #fff;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.team-select:hover,
.team-select:focus {
    border-color: rgba(99, 102, 241, 0.6);
    outline: none;
}

.team-select option {
    background: #1c1c23;
}

/* Team Badge Section (per TL) */
.team-badge-section {
    margin-bottom: 1.5rem;
}

.team-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #a5b4fc;
}

.team-badge-icon {
    font-size: 1rem;
}


/* ========================================
   Existing leader layout elements
======================================== */

/* Alert Box */
.alert-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.alert-box.alert-urgent {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-icon {
    font-size: 1.25rem;
}

.alert-text {
    flex: 1;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
}

.alert-text strong {
    color: #ef4444;
}

.alert-btn {
    padding: 0.5rem 1rem;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 8px;
    color: #ef4444;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.alert-btn:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* Filters Section */
.filters-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.search-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.875rem 1.25rem;
    transition: all 0.25s ease;
}

.search-wrapper:focus-within {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-wrapper .search-icon {
    font-size: 1.1rem;
    opacity: 0.6;
}

.search-wrapper input {
    flex: 1;
    background: none;
    border: none;
    color: var(--white);
    font-size: 0.95rem;
    outline: none;
}

.search-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.search-clear {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.search-clear:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.filter-tabs-leader {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-tab-leader {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
}

.filter-tab-leader:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.filter-tab-leader.active {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
}

.tab-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.1rem 0.4rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.filter-tab-leader.active .tab-badge {
    background: rgba(99, 102, 241, 0.3);
}

/* Contratti Section */
.contratti-section {
    background: linear-gradient(145deg, rgba(28, 28, 35, 0.6) 0%, rgba(20, 20, 26, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 1.5rem;
}

.section-header-leader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.section-header-leader h2 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--white);
}

/* Contratti List */
.contratti-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Contratto Card */
.contratto-card {
    display: grid;
    grid-template-columns: auto 1fr auto auto auto;
    gap: 1.25rem;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: all 0.25s ease;
}

.contratto-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(99, 102, 241, 0.25);
    transform: translateX(4px);
}

.contratto-card.urgent {
    border-left: 3px solid #ef4444;
}

.contratto-card.pending {
    border-left: 3px solid #fbbf24;
}

.contratto-card.trattativa {
    border-left: 3px solid #3b82f6;
}

.contratto-card.confermato {
    border-left: 3px solid #22c55e;
}

.contratto-card.perso {
    border-left: 3px solid #6b7280;
}

.contratto-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.08) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.contratto-main-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}

.contratto-cliente {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contratto-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Consulente badge */
.contratto-consulente {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    min-width: 100px;
}

.consulente-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.6rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #a5b4fc;
}

.team-tag {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.contratto-veicolo-info {
    text-align: right;
    min-width: 120px;
}

.veicolo-provider {
    font-size: 0.85rem;
    font-weight: 600;
    color: #8b5cf6;
}

.veicolo-nome {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.contratto-status-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4rem;
    min-width: 130px;
}

.status-badge-leader {
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.status-badge-leader.urgent {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.status-badge-leader.pending {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.status-badge-leader.trattativa {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.status-badge-leader.confermato {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.status-badge-leader.perso {
    background: rgba(107, 114, 128, 0.15);
    color: #9ca3af;
}

.scadenza-text {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.1rem;
    color: var(--white);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

/* Pagination Leader */
.pagination-leader {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.pagination-btn-leader {
    padding: 0.6rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn-leader:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
}

.pagination-btn-leader:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-info-leader {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}


/* ========================================
   14. TOAST
======================================== */

.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 99999;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: rgba(25, 25, 30, 0.95);
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    animation: toastSlideIn 0.3s ease;
    min-width: 300px;
    max-width: 450px;
}

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

.toast.success {
    border-left: 4px solid #22c55e;
}

.toast.error {
    border-left: 4px solid #ef4444;
}

.toast.warning {
    border-left: 4px solid #fbbf24;
}

.toast.info {
    border-left: 4px solid #3b82f6;
}

.toast-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    color: var(--white);
    font-size: 0.9rem;
}

.toast-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease;
}

.toast-close:hover {
    color: var(--white);
}

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

.toast.removing {
    animation: toastFadeOut 0.3s ease forwards;
}


/* ========================================
   15. RESPONSIVE
======================================== */

/* --- Tablet landscape (max-width: 1200px) --- */
@media (max-width: 1200px) {
    .kpi-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .kpi-row {
        grid-template-columns: repeat(3, 1fr);
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

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

    .contratto-card {
        grid-template-columns: auto 1fr auto auto;
    }

    .contratto-consulente {
        display: none;
    }

    .map-container {
        flex-direction: column;
    }

    .map-legend {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }

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

/* --- Tablet portrait (max-width: 768px) --- */
@media (max-width: 768px) {
    /* Sidebar off-screen on mobile */
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 80px 1rem 1.5rem;
    }

    /* Mobile menu toggle visible */
    .mobile-menu-toggle {
        display: flex;
    }

    /* Header adjustments */
    .leader-header {
        padding: 0 0.75rem;
        height: 60px;
    }

    .header-center {
        display: none;
    }

    .logout-text {
        display: none;
    }

    .header-left .logo-text {
        display: none;
    }

    .header-left .logo-icon {
        font-size: 1.3rem;
    }

    .btn-icon {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .btn-logout {
        padding: 0.5rem 0.7rem;
        font-size: 0.8rem;
    }

    /* Legacy leader-main */
    .leader-main {
        padding: 72px 0.75rem 1rem;
    }

    /* KPI */
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }

    .kpi-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
        margin-bottom: 1rem;
    }

    .kpi-card-leader {
        padding: 1rem;
        border-radius: 12px;
    }

    .kpi-card {
        padding: 1rem;
        border-radius: 12px;
    }

    .kpi-icon-leader {
        font-size: 1.4rem;
    }

    .kpi-number {
        font-size: 1.4rem;
    }

    .kpi-value {
        font-size: 1.4rem;
    }

    .kpi-label-leader {
        font-size: 0.7rem;
    }

    /* Welcome */
    .welcome-banner {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        padding: 1.25rem 1rem;
        border-radius: 14px;
        margin-bottom: 1rem;
    }

    .welcome-right {
        flex-direction: column;
        gap: 0.75rem;
    }

    .team-filter {
        flex-direction: column;
        gap: 0.5rem;
    }

    .welcome-content h1 {
        font-size: 1.2rem;
    }

    .welcome-content p {
        font-size: 0.8rem;
    }

    .welcome-date {
        font-size: 0.8rem;
        padding: 0.4rem 0.75rem;
    }

    /* Alert box */
    .alert-box {
        padding: 0.75rem 1rem;
        gap: 0.75rem;
        border-radius: 10px;
        margin-bottom: 1rem;
    }

    .alert-text {
        font-size: 0.8rem;
    }

    .alert-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
        white-space: nowrap;
    }

    /* Filters */
    .filters-section {
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .filters-bar {
        flex-direction: column;
        gap: 0.75rem;
    }

    .search-wrapper {
        padding: 0.7rem 1rem;
        border-radius: 10px;
    }

    .search-wrapper input {
        font-size: 0.9rem;
    }

    .filter-tabs-leader {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .filter-tabs-leader::-webkit-scrollbar {
        display: none;
    }

    .filter-tab-leader {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Contratti section */
    .contratti-section {
        border-radius: 14px;
        padding: 1rem;
    }

    .section-header-leader {
        margin-bottom: 0.75rem;
        padding-bottom: 0.75rem;
    }

    .section-header-leader h2 {
        font-size: 1rem;
    }

    /* Contratto card: layout verticale */
    .contratto-card {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 0;
        border-radius: 12px;
        overflow: hidden;
    }

    .contratto-card:hover {
        transform: none;
    }

    .contratto-avatar {
        display: none;
    }

    .contratto-main-info {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        padding: 0.75rem 0.75rem 0.5rem;
    }

    .contratto-cliente {
        font-size: 0.9rem;
    }

    .contratto-meta {
        gap: 0.75rem;
        font-size: 0.75rem;
    }

    .contratto-veicolo-info {
        text-align: left;
        padding: 0 0.75rem;
        min-width: unset;
    }

    .veicolo-provider {
        font-size: 0.8rem;
    }

    .veicolo-nome {
        font-size: 0.75rem;
    }

    .contratto-status-col {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        min-width: unset;
        padding: 0.5rem 0.75rem 0.75rem;
        gap: 0.5rem;
    }

    .status-badge-leader {
        font-size: 0.7rem;
        padding: 0.25rem 0.6rem;
    }

    .scadenza-text {
        font-size: 0.7rem;
    }

    /* Pagination */
    .pagination-leader {
        gap: 0.5rem;
        margin-top: 1rem;
        padding-top: 1rem;
    }

    .pagination-btn-leader {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    .pagination-info-leader {
        font-size: 0.8rem;
    }

    /* Data table */
    .data-table {
        font-size: 0.8rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.6rem 0.75rem;
    }

    /* Scadenze */
    .scadenza-item {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    /* Rinnovi */
    .cliente-card {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .cliente-veicolo {
        text-align: left;
    }

    .cliente-status {
        flex-direction: row;
        align-items: center;
    }

    .profilo-grid {
        grid-template-columns: 1fr;
    }

    .rinnovo-form-grid {
        grid-template-columns: 1fr;
    }

    /* Form */
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-grid-3 {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions button {
        width: 100%;
        justify-content: center;
    }

    /* Consulenti */
    .consulenti-grid {
        grid-template-columns: 1fr;
    }

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

    /* Map */
    .map-container {
        flex-direction: column;
    }

    .map-wrapper {
        height: 350px;
    }

    .map-legend {
        width: 100%;
    }

    /* Import */
    .upload-area {
        padding: 2rem 1.5rem;
    }

    /* Modal */
    .modal-container {
        width: 95%;
        max-height: 85vh;
    }

    .modal-header {
        padding: 1rem 1.25rem;
    }

    .modal-body {
        padding: 1.25rem;
    }

    .modal-footer {
        padding: 0.875rem 1.25rem;
        flex-direction: column;
    }

    .modal-footer button {
        width: 100%;
        justify-content: center;
    }

    /* Login */
    .login-screen {
        padding: 1rem;
    }

    .login-card {
        padding: 1.5rem;
        border-radius: 16px;
    }

    .login-logo h1 {
        font-size: 1.4rem;
    }

    .login-logo .logo-icon {
        font-size: 2.5rem;
    }

    /* Toast */
    .toast-container {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }

    .toast {
        min-width: unset;
        max-width: 100%;
    }
}

/* --- Mobile small (max-width: 480px) --- */
@media (max-width: 480px) {
    .leader-header {
        height: 56px;
    }

    .main-content {
        padding: 72px 0.5rem 0.75rem;
    }

    .leader-main {
        padding: 64px 0.5rem 0.75rem;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .kpi-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .kpi-card-leader {
        padding: 0.75rem;
        gap: 0.6rem;
        border-radius: 10px;
    }

    .kpi-card {
        padding: 0.75rem;
        gap: 0.6rem;
        border-radius: 10px;
    }

    .kpi-icon-leader {
        font-size: 1.2rem;
    }

    .kpi-icon {
        font-size: 1.1rem;
    }

    .kpi-number {
        font-size: 1.2rem;
    }

    .kpi-value {
        font-size: 1.2rem;
    }

    .kpi-label-leader {
        font-size: 0.65rem;
    }

    .kpi-label {
        font-size: 0.65rem;
    }

    .welcome-banner {
        padding: 1rem 0.75rem;
        margin-bottom: 0.75rem;
    }

    .welcome-content h1 {
        font-size: 1.05rem;
    }

    .alert-box {
        flex-wrap: wrap;
        padding: 0.6rem 0.75rem;
    }

    .alert-btn {
        width: 100%;
        text-align: center;
        margin-top: 0.25rem;
    }

    .filter-tab-leader {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
        border-radius: 8px;
    }

    .tab-badge {
        font-size: 0.65rem;
        padding: 0.05rem 0.3rem;
    }

    .contratti-section {
        padding: 0.75rem;
        border-radius: 12px;
    }

    .contratto-card {
        border-radius: 10px;
    }

    .contratto-main-info {
        padding: 0.6rem 0.6rem 0.4rem;
    }

    .contratto-cliente {
        font-size: 0.85rem;
    }

    .contratto-meta {
        flex-wrap: wrap;
        gap: 0.5rem;
        font-size: 0.7rem;
    }

    .contratto-veicolo-info {
        padding: 0 0.6rem;
    }

    .contratto-status-col {
        padding: 0.4rem 0.6rem 0.6rem;
    }

    .search-wrapper {
        padding: 0.6rem 0.75rem;
    }

    .search-wrapper input {
        font-size: 0.85rem;
    }

    /* Consulenti */
    .consulenti-grid {
        grid-template-columns: 1fr;
    }

    .consulente-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .consulente-stat .value {
        font-size: 1rem;
    }

    /* Section title */
    .section-title {
        font-size: 1.2rem;
    }

    /* Scadenze */
    .scadenza-date .day {
        font-size: 1.25rem;
    }

    .scadenza-info .client-name {
        font-size: 0.85rem;
    }

    /* Login */
    .login-card {
        padding: 1.25rem;
    }

    .login-form input,
    .login-form select {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .btn-login-submit {
        padding: 0.85rem;
        font-size: 0.95rem;
    }

    /* Buttons */
    .btn-primary,
    .btn-secondary,
    .btn-danger {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
}

/* --- Touch devices --- */
@media (hover: none) and (pointer: coarse) {
    .filter-tab-leader {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .filter-tab {
        min-height: 44px;
    }

    .scadenza-filter-btn {
        min-height: 44px;
    }

    .btn-icon {
        min-width: 44px;
        min-height: 44px;
    }

    .btn-logout {
        min-height: 44px;
    }

    .btn-primary,
    .btn-secondary,
    .btn-danger {
        min-height: 44px;
    }

    .pagination-btn-leader {
        min-height: 44px;
        min-width: 44px;
    }

    .pagination button,
    .pagination-btn {
        min-height: 44px;
        min-width: 44px;
    }

    .alert-btn {
        min-height: 44px;
    }

    .btn-action {
        min-width: 44px;
        min-height: 44px;
    }

    .nav-item {
        min-height: 44px;
    }

    .contratto-card {
        min-height: 44px;
    }

    .cliente-card {
        min-height: 44px;
    }

    /* Disable hover effects on touch */
    .contratto-card:hover {
        transform: none;
        border-color: rgba(255, 255, 255, 0.05);
    }

    .kpi-card-leader:hover,
    .kpi-card:hover {
        transform: none;
    }

    .consulente-card:hover {
        transform: none;
    }

    .provider-card:hover {
        transform: none;
    }

    .btn-primary:hover {
        transform: none;
    }

    .btn-login-submit:hover {
        transform: none;
    }

    /* Active states for touch */
    .contratto-card:active {
        background: rgba(99, 102, 241, 0.08);
        border-color: rgba(99, 102, 241, 0.25);
    }

    .cliente-card:active {
        background: rgba(99, 102, 241, 0.08);
    }

    .filter-tab-leader:active {
        background: rgba(99, 102, 241, 0.1);
    }

    .kpi-card-leader:active,
    .kpi-card:active {
        transform: scale(0.98);
    }

    .consulente-card:active {
        transform: scale(0.98);
    }

    .nav-item:active {
        background: rgba(99, 102, 241, 0.12);
    }
}

/* --- Safe area for iPhone notch --- */
@supports (padding: env(safe-area-inset-bottom)) {
    .leader-header {
        padding-left: max(0.75rem, env(safe-area-inset-left));
        padding-right: max(0.75rem, env(safe-area-inset-right));
    }

    .main-content {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }

    .leader-main {
        padding-left: max(0.75rem, env(safe-area-inset-left));
        padding-right: max(0.75rem, env(safe-area-inset-right));
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }

    .sidebar {
        padding-bottom: env(safe-area-inset-bottom);
    }

    .toast-container {
        bottom: max(1rem, env(safe-area-inset-bottom));
        right: max(1rem, env(safe-area-inset-right));
    }

    .modal-container {
        margin-bottom: env(safe-area-inset-bottom);
    }
}

/* ============================================ */
/* MONITORAGGIO ASSEGNAZIONI - Assignment Card */
/* ============================================ */
.section-subtitle {
    color: var(--gray);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.assignment-overview {
    margin-bottom: 1.5rem;
}

.assignment-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 16px;
    padding: 1.5rem 2rem;
}

.assignment-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
}

.assignment-stat {
    text-align: center;
}

.assignment-stat .stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
}

.assignment-stat .stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--gray);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.assignment-stat.assigned .stat-number {
    color: #10b981;
}

.assignment-stat.pending .stat-number {
    color: #f59e0b;
}

.assignment-divider {
    font-size: 2rem;
    color: var(--gray);
    font-weight: 300;
}

.assignment-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.progress-bar-assignment {
    flex: 1;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill-assignment {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
    border-radius: 6px;
    transition: width 0.5s ease;
}

.progress-percent {
    font-size: 1.1rem;
    font-weight: 700;
    color: #10b981;
    min-width: 50px;
    text-align: right;
}

/* Responsive */
@media (max-width: 768px) {
    .assignment-card {
        padding: 1rem;
    }

    .assignment-stats {
        gap: 1rem;
    }

    .assignment-stat .stat-number {
        font-size: 1.8rem;
    }

    .assignment-divider {
        font-size: 1.5rem;
    }
}

/* Status Badges for Monitoraggio */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.badge-gray {
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
}
