/* ========================================
   FLOTTA & RINNOVI - CSS
   Design System: Dark Theme + Gold Accents
   Matching "Mappa Attivazioni" style
======================================== */

/* CSS Variables */
:root {
    /* Colors */
    --gold: #FFC107;
    --gold-light: #FFD54F;
    --gold-dark: #FF9800;
    --dark-bg: #0a0a0a;
    --dark-bg-secondary: #1a1a1a;
    --dark-bg-tertiary: #252525;
    --white: #ffffff;
    --gray-light: #e0e0e0;
    --gray: #a0a0a0;
    --gray-dark: #666666;

    /* Semantic Colors */
    --success: #22c55e;
    --success-light: rgba(34, 197, 94, 0.15);
    --warning: #fbbf24;
    --warning-light: rgba(251, 191, 36, 0.15);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.15);
    --info: #3b82f6;
    --info-light: rgba(59, 130, 246, 0.15);

    /* Provider Colors */
    --leasys: #0066cc;
    --arval: #dc3545;
    --ald: #28a745;
    --ayvens: #17a2b8;

    /* Typography */
    --font-primary: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Spacing */
    --header-height: 70px;
    --sidebar-width: 300px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-gold: 0 4px 20px rgba(255, 193, 7, 0.3);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background: #0c0c0f;
    color: var(--white);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Subtle gradient background - ProcessGrid Style */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 0% 0%, rgba(255, 193, 7, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 100%, rgba(59, 130, 246, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Remove animation for cleaner look */
@keyframes liquidMove {
    0%, 100% { opacity: 1; }
}

/* Loading Screen */
.auth-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    z-index: 99999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.auth-loading.hidden {
    opacity: 0;
    visibility: hidden;
}

.auth-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 193, 7, 0.2);
    border-top: 3px solid var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.auth-loading p {
    color: var(--gray);
    font-size: 0.95rem;
}

/* ========================================
   HEADER - ProcessGrid Style
======================================== */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    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(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem;
    z-index: 100;
}

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

.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: var(--gold);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.logo-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15) 0%, rgba(255, 193, 7, 0.05) 100%);
    border-radius: 10px;
    font-size: 1.25rem;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.01em;
}

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

/* Search box in header */
.header-search {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 0.5rem 1rem;
    gap: 0.5rem;
    transition: all 0.25s ease;
}

.header-search:focus-within {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 193, 7, 0.2);
}

.header-search input {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    width: 180px;
    outline: none;
}

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

.header-search-icon {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.9rem;
}

.btn-sync, .btn-export-all {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-sync {
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-sync:hover {
    background: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.2);
    color: var(--gold);
}

.btn-export-all {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(34, 197, 94, 0.1) 100%);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.btn-export-all:hover {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.3) 0%, rgba(34, 197, 94, 0.15) 100%);
    border-color: rgba(34, 197, 94, 0.3);
}

/* User avatar in header */
.header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.2) 0%, rgba(255, 193, 7, 0.1) 100%);
    border: 1px solid rgba(255, 193, 7, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
}

.header-avatar:hover {
    border-color: rgba(255, 193, 7, 0.4);
}

/* ========================================
   SIDEBAR - ProcessGrid Style
======================================== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99;
}

.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: linear-gradient(180deg, rgba(18, 18, 22, 0.98) 0%, rgba(12, 12, 16, 0.99) 100%);
    backdrop-filter: blur(30px);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 50;
    transition: transform var(--transition-normal);
    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(255, 193, 7, 0.2);
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 193, 7, 0.4);
}

.sidebar-nav {
    padding: 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    /* Non cresce - rimane in alto */
}

/* Spacer per spingere tutto in alto */
.sidebar-spacer {
    flex: 1;
    min-height: 100px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    margin: 0 1rem;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--gold);
    border-radius: 0 3px 3px 0;
    transition: height 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.85);
}

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

.nav-item.active {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.12) 0%, rgba(255, 193, 7, 0.04) 100%);
    color: var(--gold);
}

.nav-item.active::before {
    height: 60%;
    box-shadow: 0 0 12px rgba(255, 193, 7, 0.4);
}

.nav-icon {
    font-size: 1.15rem;
    width: 24px;
    height: 24px;
    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: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: var(--white);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    min-width: 22px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.nav-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    margin: 0.875rem 1.5rem;
}

.nav-external {
    color: rgba(59, 130, 246, 0.7);
}

.nav-external:hover {
    color: var(--gold);
    background: rgba(255, 193, 7, 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 - ProcessGrid Style
======================================== */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 1.75rem 2rem;
    min-height: calc(100vh - var(--header-height));
    background: transparent;
}

.content-section {
    display: none;
    animation: fadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.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: rgba(255, 255, 255, 0.8);
    margin: 1.75rem 0 1rem;
    letter-spacing: 0.01em;
}

/* Period Selector - ProcessGrid Style */
.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.05);
}

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

.period-btn:hover {
    color: rgba(255, 255, 255, 0.75);
    background: rgba(255, 255, 255, 0.04);
}

.period-btn.active {
    background: rgba(255, 193, 7, 0.12);
    color: var(--gold);
}

/* ========================================
   KPI CARDS - ProcessGrid Style
======================================== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.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%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-height: 130px;
}

/* Subtle glow effect */
.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at top left, rgba(255, 193, 7, 0.03) 0%, transparent 60%);
    pointer-events: none;
}

/* Accent line */
.kpi-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1.5rem;
    right: 1.5rem;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
}

.kpi-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05);
}

.kpi-card.kpi-primary {
    background: linear-gradient(145deg, rgba(35, 30, 22, 0.95) 0%, rgba(22, 20, 18, 0.98) 100%);
    border-color: rgba(255, 193, 7, 0.15);
}

.kpi-card.kpi-primary::before {
    background: radial-gradient(ellipse at top left, rgba(255, 193, 7, 0.08) 0%, transparent 50%);
}

.kpi-card.kpi-primary:hover {
    border-color: rgba(255, 193, 7, 0.25);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(255, 193, 7, 0.08);
}

.kpi-card.kpi-success {
    border-color: rgba(34, 197, 94, 0.12);
}

.kpi-card.kpi-success::before {
    background: radial-gradient(ellipse at top left, rgba(34, 197, 94, 0.06) 0%, transparent 50%);
}

.kpi-card.kpi-success:hover {
    border-color: rgba(34, 197, 94, 0.2);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(34, 197, 94, 0.06);
}

.kpi-card.kpi-warning {
    border-color: rgba(251, 191, 36, 0.12);
}

.kpi-card.kpi-warning::before {
    background: radial-gradient(ellipse at top left, rgba(251, 191, 36, 0.06) 0%, transparent 50%);
}

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

.kpi-card.kpi-danger {
    border-color: rgba(239, 68, 68, 0.12);
}

.kpi-card.kpi-danger::before {
    background: radial-gradient(ellipse at top left, rgba(239, 68, 68, 0.06) 0%, transparent 50%);
}

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

/* KPI Anno/Year - Blue accent */
.kpi-card.kpi-year {
    border-color: rgba(59, 130, 246, 0.12);
}

.kpi-card.kpi-year::before {
    background: radial-gradient(ellipse at top left, rgba(59, 130, 246, 0.06) 0%, transparent 50%);
}

.kpi-card.kpi-year:hover {
    border-color: rgba(59, 130, 246, 0.2);
}

.kpi-card.kpi-year .kpi-value {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* KPI Scaduti - Orange/Amber accent */
.kpi-card.kpi-expired {
    border-color: rgba(251, 146, 60, 0.12);
}

.kpi-card.kpi-expired::before {
    background: radial-gradient(ellipse at top left, rgba(251, 146, 60, 0.06) 0%, transparent 50%);
}

.kpi-card.kpi-expired:hover {
    border-color: rgba(251, 146, 60, 0.2);
}

.kpi-card.kpi-expired .kpi-value {
    background: linear-gradient(135deg, #fb923c 0%, #fdba74 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.kpi-subtitle {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
}

.kpi-icon {
    font-size: 1.75rem;
    opacity: 0.85;
    filter: saturate(0.9);
}

.kpi-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kpi-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    justify-content: flex-end;
}

.kpi-value {
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.kpi-card.kpi-primary .kpi-value {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

/* Optional trend indicator */
.kpi-trend {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    background: rgba(34, 197, 94, 0.12);
    color: var(--success);
}

.kpi-trend.down {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
}

/* ========================================
   CHARTS - ProcessGrid Style
======================================== */

/* Full width chart card for scadenze */
.chart-card-full {
    margin-bottom: 1.75rem;
}

.chart-body-scadenze {
    height: 280px;
}

.chart-year-selector {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.year-btn {
    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);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.year-btn:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

.year-display {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: #60a5fa;
    min-width: 50px;
    text-align: center;
}

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

.chart-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: 20px;
    padding: 1.5rem;
    position: relative;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.chart-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at top right, rgba(255, 193, 7, 0.02) 0%, transparent 50%);
    pointer-events: none;
    border-radius: 20px;
}

.chart-card:hover {
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.03);
}

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

.chart-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.01em;
}

.chart-actions {
    display: flex;
    gap: 0.5rem;
}

.chart-action-btn {
    padding: 0.4rem 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chart-action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
}

.chart-body {
    height: 260px;
    position: relative;
}

/* ========================================
   PROVIDER CARDS - ProcessGrid Style
======================================== */
.provider-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.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: 16px;
    padding: 1.25rem;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.provider-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: 4px 0 0 4px;
    transition: all 0.3s ease;
}

.provider-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.provider-card.provider-leasys::before {
    background: linear-gradient(180deg, var(--leasys), #0099ff);
}

.provider-card.provider-arval::before {
    background: linear-gradient(180deg, var(--arval), #ff6b6b);
}

.provider-card.provider-ald::before {
    background: linear-gradient(180deg, var(--ald), #51cf66);
}

.provider-card:hover::before {
    width: 5px;
    box-shadow: 0 0 15px currentColor;
}

.provider-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.875rem;
}

.provider-name {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.provider-count {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--white);
}

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

.provider-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.provider-leasys .provider-bar-fill {
    background: linear-gradient(90deg, var(--leasys), #0099ff);
    box-shadow: 0 0 10px rgba(0, 102, 204, 0.4);
}

.provider-arval .provider-bar-fill {
    background: linear-gradient(90deg, var(--arval), #ff6b6b);
    box-shadow: 0 0 10px rgba(220, 53, 69, 0.4);
}

.provider-ald .provider-bar-fill {
    background: linear-gradient(90deg, var(--ald), #51cf66);
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.4);
}

/* ========================================
   TABLES - ProcessGrid Style
======================================== */
.table-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: 20px;
    overflow: hidden;
    margin-bottom: 1.75rem;
}

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

.table-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.01em;
}

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

.btn-view-all:hover {
    background: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.2);
    color: var(--gold);
}

.table-scroll-container {
    overflow-x: auto;
    max-height: 500px;
    overflow-y: auto;
}

.table-scroll-container::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.table-scroll-container::-webkit-scrollbar-track {
    background: transparent;
}

.table-scroll-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.table-scroll-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

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

.data-table th {
    position: sticky;
    top: 0;
    background: rgba(18, 18, 24, 0.98);
    color: rgba(255, 255, 255, 0.45);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    white-space: nowrap;
    z-index: 10;
}

.data-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.75);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.data-table tbody tr {
    transition: all 0.2s ease;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.data-table tbody tr:hover td {
    color: rgba(255, 255, 255, 0.9);
}

.data-table .sticky-col {
    position: sticky;
    left: 0;
    background: rgba(22, 22, 28, 0.98);
    z-index: 5;
}

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

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

/* ========================================
   STATUS BADGES
======================================== */
.status-badge {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.success {
    background: var(--success-light);
    color: var(--success);
}

.status-badge.warning {
    background: var(--warning-light);
    color: var(--warning);
}

.status-badge.danger {
    background: var(--danger-light);
    color: var(--danger);
}

.status-badge.info {
    background: var(--info-light);
    color: var(--info);
}

.status-badge.neutral {
    background: rgba(255, 255, 255, 0.1);
    color: var(--gray);
}

/* ========================================
   FILTERS BAR
======================================== */
.filters-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid rgba(255, 193, 7, 0.2);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(30, 30, 30, 0.8);
    border: 1px solid rgba(255, 193, 7, 0.2);
    border-radius: 25px;
    padding: 0.6rem 1rem;
    flex: 1;
    min-width: 250px;
    max-width: 400px;
}

.search-box input {
    background: none;
    border: none;
    color: var(--white);
    font-size: 0.9rem;
    width: 100%;
    outline: none;
}

.search-box input::placeholder {
    color: var(--gray);
}

.search-icon {
    opacity: 0.6;
}

.filter-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-select {
    background: rgba(30, 30, 30, 0.8);
    border: 1px solid rgba(255, 193, 7, 0.2);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    color: var(--white);
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
    min-width: 140px;
}

.filter-select:focus {
    border-color: var(--gold);
}

.filter-select option {
    background: var(--dark-bg-secondary);
}

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

.btn-filter-reset {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-normal);
}

.btn-filter-reset:hover {
    background: rgba(239, 68, 68, 0.2);
}

.results-count {
    color: var(--gray);
    font-size: 0.85rem;
}

.filter-btn {
    padding: 0.6rem 1.2rem;
    background: rgba(255, 193, 7, 0.1);
    color: var(--gold);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-normal);
}

.filter-btn:hover {
    background: rgba(255, 193, 7, 0.2);
}

.filter-btn.active {
    background: var(--gold);
    color: var(--dark-bg);
    border-color: var(--gold);
}

/* ========================================
   SCADENZE
======================================== */
.scadenze-filters {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.scadenza-filter-btn {
    padding: 0.7rem 1.5rem;
    background: rgba(255, 193, 7, 0.1);
    color: var(--gold);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
}

.scadenza-filter-btn:hover {
    background: rgba(255, 193, 7, 0.2);
}

.scadenza-filter-btn.active {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: var(--dark-bg);
    border-color: var(--gold);
}

.scadenze-timeline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.scadenza-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.25rem 1.5rem;
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid rgba(255, 193, 7, 0.2);
    border-radius: 12px;
    transition: var(--transition-normal);
}

.scadenza-item:hover {
    border-color: var(--gold);
    transform: translateX(5px);
}

.scadenza-item.urgent {
    border-left: 4px solid var(--danger);
}

.scadenza-item.warning {
    border-left: 4px solid var(--warning);
}

.scadenza-item.normal {
    border-left: 4px solid var(--success);
}

.scadenza-date {
    min-width: 100px;
    text-align: center;
}

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

.scadenza-date-month {
    font-size: 0.8rem;
    color: var(--gray);
    text-transform: uppercase;
}

.scadenza-info {
    flex: 1;
}

.scadenza-cliente {
    font-weight: 600;
    color: var(--white);
    margin-bottom: 0.25rem;
}

.scadenza-veicolo {
    font-size: 0.9rem;
    color: var(--gray);
}

.scadenza-actions {
    display: flex;
    gap: 0.5rem;
}

/* ========================================
   FORMS
======================================== */
.form-contratto {
    max-width: 1000px;
}

.form-section {
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid rgba(255, 193, 7, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-section-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 193, 7, 0.2);
}

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

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

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

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    background: rgba(30, 30, 30, 0.8);
    border: 1px solid rgba(255, 193, 7, 0.2);
    border-radius: 10px;
    padding: 0.9rem 1rem;
    color: var(--white);
    font-size: 0.95rem;
    font-family: var(--font-primary);
    outline: none;
    transition: var(--transition-normal);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.1);
}

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

.form-group select option {
    background: var(--dark-bg-secondary);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

/* ========================================
   BUTTONS
======================================== */
.btn-primary {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: var(--dark-bg);
    border: none;
    border-radius: 25px;
    padding: 0.9rem 2rem;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-normal);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-gold);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    padding: 0.9rem 2rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-add {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: var(--dark-bg);
    border: none;
    border-radius: 25px;
    padding: 0.7rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-normal);
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-gold);
}

.btn-action {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    color: var(--gold);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition-normal);
}

.btn-action:hover {
    background: rgba(255, 193, 7, 0.2);
}

.btn-action.btn-success {
    background: var(--success-light);
    border-color: rgba(34, 197, 94, 0.3);
    color: var(--success);
}

.btn-action.btn-danger {
    background: var(--danger-light);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

/* ========================================
   PAGINATION
======================================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.pagination-btn {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    color: var(--gold);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-normal);
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(255, 193, 7, 0.2);
}

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

.pagination-info {
    color: var(--gray);
    font-size: 0.9rem;
}

/* ========================================
   CONSULENTI
======================================== */
.consulenti-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.consulente-card {
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid rgba(255, 193, 7, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    transition: var(--transition-normal);
}

.consulente-card:hover {
    border-color: var(--gold);
    transform: translateY(-3px);
}

.consulente-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.consulente-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

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

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

.consulente-stat {
    text-align: center;
    padding: 0.75rem;
    background: rgba(30, 30, 30, 0.5);
    border-radius: 8px;
}

.consulente-stat-value {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gold);
}

.consulente-stat-label {
    font-size: 0.75rem;
    color: var(--gray);
    text-transform: uppercase;
}

/* ========================================
   MODALS
======================================== */
.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: var(--transition-normal);
}

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

.modal-container {
    background: linear-gradient(180deg, rgba(25, 25, 25, 0.98) 0%, rgba(15, 15, 15, 0.98) 100%);
    border: 1px solid rgba(255, 193, 7, 0.3);
    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: var(--transition-normal);
    box-shadow: var(--shadow-lg), 0 0 40px rgba(255, 193, 7, 0.1);
}

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

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

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

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

.modal-close {
    background: none;
    border: none;
    color: var(--gray);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition-normal);
}

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

.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(255, 193, 7, 0.2);
}

/* ========================================
   TOAST NOTIFICATIONS
======================================== */
.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, 25, 0.95);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    min-width: 300px;
}

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

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

.toast.info {
    border-left: 4px solid var(--info);
}

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

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

/* ========================================
   SEZIONE RINNOVI - Nuova UI
======================================== */

/* Search Box Rinnovi */
.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 cubic-bezier(0.4, 0, 0.2, 1);
}

.rinnovi-search-box:focus-within {
    border-color: rgba(255, 193, 7, 0.4);
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.1);
}

.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: 1.1rem;
    font-family: var(--font-primary);
    outline: none;
}

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

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

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

.search-results-info {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    padding-left: 0.5rem;
}

/* Filter Tabs */
.rinnovi-filters {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.filter-tabs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.filter-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

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

.filter-tab.active {
    background: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.3);
    color: var(--gold);
}

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

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

.filter-tab.active .tab-count {
    background: rgba(255, 193, 7, 0.2);
    color: var(--gold);
}

.filter-options {
    display: flex;
    gap: 0.75rem;
}

.filter-select-small {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    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;
}

.filter-select-small:hover,
.filter-select-small:focus {
    border-color: rgba(255, 193, 7, 0.3);
    outline: none;
}

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

/* Cliente Card */
.cliente-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;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 1.25rem;
    align-items: center;
}

.cliente-card:hover {
    border-color: rgba(255, 193, 7, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.cliente-card.status-si {
    border-left: 3px solid var(--success);
}

.cliente-card.status-no {
    border-left: 3px solid var(--danger);
}

.cliente-card.status-altro {
    border-left: 3px solid var(--warning);
}

.cliente-card.status-scaduto {
    border-left: 3px solid #fb923c;
}

.cliente-card.status-pending {
    border-left: 3px solid rgba(255, 255, 255, 0.3);
}

.cliente-avatar {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15) 0%, rgba(255, 193, 7, 0.05) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

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

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

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

.cliente-dettaglio {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

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

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

.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.5rem;
    min-width: 120px;
}

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

.status-badge-large.success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

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

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

.status-badge-large.expired {
    background: rgba(251, 146, 60, 0.15);
    color: #fb923c;
}

.status-badge-large.neutral {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
}

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

/* Modal Profilo XL */
.modal-container.modal-xl {
    max-width: 900px;
    max-height: 90vh;
}

.profilo-body {
    padding: 0;
}

/* Profilo Cliente Header */
.profilo-header {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(145deg, rgba(255, 193, 7, 0.05) 0%, transparent 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.profilo-avatar {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.2) 0%, rgba(255, 193, 7, 0.05) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.profilo-info {
    flex: 1;
}

.profilo-nome {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.5rem;
}

.profilo-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.profilo-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.profilo-meta-item a {
    color: var(--gold);
    text-decoration: none;
}

.profilo-meta-item a:hover {
    text-decoration: underline;
}

/* Profilo Sections */
.profilo-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: rgba(255, 255, 255, 0.06);
}

.profilo-section {
    padding: 1.25rem;
    background: rgba(15, 15, 20, 0.95);
}

.profilo-section.full-width {
    grid-column: 1 / -1;
}

.profilo-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gold);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 193, 7, 0.2);
}

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

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

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

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

.profilo-field-value.highlight {
    color: var(--gold);
    font-weight: 600;
}

/* Rinnovo Form nel Profilo */
.rinnovo-form-section {
    background: rgba(255, 193, 7, 0.03);
    border: 1px solid rgba(255, 193, 7, 0.1);
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1rem;
}

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

.rinnovo-form-grid .form-group {
    margin: 0;
}

.rinnovo-form-grid label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.35rem;
    display: block;
}

.rinnovo-form-grid input,
.rinnovo-form-grid select,
.rinnovo-form-grid textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    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;
}

.rinnovo-form-grid textarea {
    resize: vertical;
    min-height: 60px;
}

/* Empty State */
.rinnovi-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: rgba(255, 255, 255, 0.4);
}

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

.rinnovi-empty-text {
    font-size: 1.1rem;
}

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

@media (max-width: 1200px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

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

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

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        z-index: 1001;
    }

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

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

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

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .kpi-grid,
    .kpi-grid-3,
    .kpi-grid-4 {
        grid-template-columns: 1fr;
    }

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: none;
    }

    .filter-group {
        flex-direction: column;
    }

    .filter-actions {
        margin-left: 0;
        justify-content: space-between;
    }

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

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

    .modal-container {
        width: 95%;
        max-height: 95vh;
    }

    .modal-footer {
        flex-direction: column;
    }

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

    .header-right {
        gap: 0.5rem;
    }

    .btn-sync span,
    .btn-export-all span {
        display: none;
    }

    .btn-sync,
    .btn-export-all {
        padding: 0.6rem;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 0 1rem;
    }

    .logo-text {
        font-size: 1.2rem;
    }

    .main-content {
        padding: 1rem;
    }

    .kpi-card {
        padding: 1rem;
    }

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

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

    .period-selector {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    .scadenze-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
    }

    .scadenza-filter-btn {
        white-space: nowrap;
    }
}

/* ========================================
   ITALY MAP SECTION
======================================== */
.map-container {
    display: grid;
    grid-template-columns: 1fr 250px;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.map-wrapper {
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid rgba(255, 193, 7, 0.2);
    border-radius: 16px;
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.map-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--info));
    border-radius: 16px 16px 0 0;
}

.italy-map {
    width: 100%;
    height: 550px;
    border-radius: 12px;
    background: rgba(15, 15, 15, 0.8);
}

/* Leaflet Dark Theme Override */
.leaflet-container {
    background: rgba(15, 15, 15, 0.9) !important;
    font-family: var(--font-primary);
}

.leaflet-popup-content-wrapper {
    background: rgba(25, 25, 25, 0.98) !important;
    border: 1px solid rgba(255, 193, 7, 0.3) !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5) !important;
}

.leaflet-popup-content {
    color: var(--white) !important;
    margin: 12px 16px !important;
}

.leaflet-popup-tip {
    background: rgba(25, 25, 25, 0.98) !important;
    border: 1px solid rgba(255, 193, 7, 0.3) !important;
}

.leaflet-popup-close-button {
    color: var(--gray) !important;
}

.leaflet-popup-close-button:hover {
    color: var(--gold) !important;
}

.leaflet-control-zoom {
    border: none !important;
    box-shadow: var(--shadow-md) !important;
}

.leaflet-control-zoom a {
    background: rgba(25, 25, 25, 0.95) !important;
    color: var(--gold) !important;
    border: 1px solid rgba(255, 193, 7, 0.3) !important;
}

.leaflet-control-zoom a:hover {
    background: rgba(35, 35, 35, 0.95) !important;
    color: var(--gold-light) !important;
}

.leaflet-control-zoom-in {
    border-radius: 8px 8px 0 0 !important;
}

.leaflet-control-zoom-out {
    border-radius: 0 0 8px 8px !important;
}

/* Map Legend */
.map-legend {
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid rgba(255, 193, 7, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    height: fit-content;
}

.map-legend h4 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 193, 7, 0.2);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: var(--gray-light);
}

.legend-marker {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.legend-marker.marker-high {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
}

.legend-marker.marker-medium {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.legend-marker.marker-low {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.legend-marker.marker-minimal {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.5);
}

/* Custom Marker Popup */
.map-popup {
    min-width: 200px;
}

.map-popup-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 193, 7, 0.2);
}

.map-popup-stat {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    font-size: 0.85rem;
}

.map-popup-stat-label {
    color: var(--gray);
}

.map-popup-stat-value {
    color: var(--white);
    font-weight: 600;
}

.map-popup-stat-value.highlight {
    color: var(--gold);
}

.map-popup-btn {
    display: block;
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.6rem;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: var(--dark-bg);
    border: none;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: var(--transition-normal);
}

.map-popup-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

/* Responsive Map */
@media (max-width: 1024px) {
    .map-container {
        grid-template-columns: 1fr;
    }

    .map-legend {
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .map-legend h4 {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .legend-item {
        margin-bottom: 0;
    }
}

@media (max-width: 768px) {
    .italy-map {
        height: 400px;
    }
}

@media (max-width: 480px) {
    .italy-map {
        height: 350px;
    }
}

/* KPI Value Small for tables */
.kpi-value-small {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold);
}

/* Custom Leaflet Tooltip */
.custom-tooltip {
    background: rgba(25, 25, 25, 0.95) !important;
    border: 1px solid rgba(255, 193, 7, 0.3) !important;
    border-radius: 8px !important;
    color: var(--white) !important;
    padding: 8px 12px !important;
    font-family: var(--font-primary) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4) !important;
}

.custom-tooltip::before {
    border-top-color: rgba(255, 193, 7, 0.3) !important;
}

/* Table row hover for clickable rows */
#tbodyRegioni tr:hover {
    background: rgba(255, 193, 7, 0.1) !important;
    cursor: pointer;
}

#tbodyRegioni tr:hover td {
    color: var(--white);
}

/* ========================================
   IMPORT CSV SECTION
======================================== */
.import-container {
    max-width: 900px;
    margin: 0 auto;
}

.upload-area {
    background: rgba(20, 20, 20, 0.9);
    border: 2px dashed rgba(255, 193, 7, 0.3);
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    transition: var(--transition-normal);
    cursor: pointer;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--gold);
    background: rgba(255, 193, 7, 0.05);
}

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

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

.upload-area p {
    color: var(--gray);
    margin-bottom: 0.5rem;
}

.upload-area .upload-hint {
    font-size: 0.8rem;
    color: var(--gray-dark);
    margin-bottom: 1.5rem;
}

.btn-upload {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
}

/* Import Progress */
.import-progress {
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid rgba(255, 193, 7, 0.2);
    border-radius: 16px;
    padding: 2rem;
    margin-top: 1.5rem;
}

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold) 0%, var(--gold-light) 100%);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    color: var(--gray);
    text-align: center;
    font-size: 0.9rem;
}

/* Validation Results */
.validation-results {
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid rgba(255, 193, 7, 0.2);
    border-radius: 16px;
    padding: 2rem;
    margin-top: 1.5rem;
}

.validation-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 193, 7, 0.2);
}

.validation-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.summary-stat {
    background: rgba(30, 30, 30, 0.8);
    border-radius: 12px;
    padding: 1.2rem;
    text-align: center;
}

.summary-stat .stat-value {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--gold);
    display: block;
}

.summary-stat .stat-label {
    font-size: 0.8rem;
    color: var(--gray);
    margin-top: 0.3rem;
}

.summary-stat.success .stat-value {
    color: var(--success);
}

.summary-stat.warning .stat-value {
    color: var(--warning);
}

.summary-stat.danger .stat-value {
    color: var(--danger);
}

/* Validation Details */
.validation-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.validation-section {
    background: rgba(30, 30, 30, 0.6);
    border-radius: 12px;
    padding: 1rem;
}

.validation-section h4 {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gold);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 193, 7, 0.1);
}

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

.validation-table th {
    text-align: left;
    color: var(--gray);
    font-weight: 500;
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.validation-table td {
    padding: 0.4rem 0.5rem;
    color: var(--white);
}

.validation-table .status-ok {
    color: var(--success);
}

.validation-table .status-warn {
    color: var(--warning);
}

.validation-table .status-error {
    color: var(--danger);
}

/* Validation Actions */
.validation-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 193, 7, 0.1);
}

/* Current Data Info */
.current-data-info {
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid rgba(255, 193, 7, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.current-data-info h4 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--gold);
    margin-bottom: 1rem;
}

.data-stats {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

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

.data-stat .stat-value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    display: block;
}

.data-stat .stat-label {
    font-size: 0.8rem;
    color: var(--gray);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: var(--white);
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-small {
    font-size: 0.85rem;
    padding: 0.5rem 0.8rem;
}

/* Responsive Import */
@media (max-width: 768px) {
    .upload-area {
        padding: 2rem 1rem;
    }

    .upload-area .upload-icon {
        font-size: 3rem;
    }

    .validation-details {
        grid-template-columns: 1fr;
    }

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

    .validation-actions button {
        width: 100%;
    }
}
