/* ========================================
   AREA CONSULENTE - CSS Dedicato
   Dashboard personale per consulenti
======================================== */

/* ========================================
   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(255, 193, 7, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(59, 130, 246, 0.03) 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(255, 255, 255, 0.06);
    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(255, 193, 7, 0.4);
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.1);
}

.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;
}

.demo-mode {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.demo-divider {
    text-align: center;
    margin-bottom: 1.25rem;
}

.demo-divider span {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.select-consulente {
    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;
    cursor: pointer;
}

.btn-demo {
    width: 100%;
    padding: 0.875rem;
    margin-top: 1rem;
}

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

/* ========================================
   CONSULENTE APP LAYOUT
======================================== */
.consulente-app {
    min-height: 100vh;
    background: #0c0c0f;
}

/* Header */
.consulente-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(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 100;
}

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

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

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

.consulente-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.25rem;
    background: rgba(255, 193, 7, 0.08);
    border: 1px solid rgba(255, 193, 7, 0.15);
    border-radius: 50px;
}

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

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

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

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

.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;
}

.btn-icon:hover {
    background: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 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);
}

/* Main Content */
.consulente-main {
    padding: 90px 2rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Welcome Banner */
.welcome-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.08) 0%, rgba(255, 193, 7, 0.02) 100%);
    border: 1px solid rgba(255, 193, 7, 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 {
    color: var(--gold);
}

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

.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;
}

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

.kpi-card-cons {
    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-cons:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.1);
}

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

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

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

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

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

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

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

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

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

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

.kpi-card-cons.kpi-expired {
    border-color: rgba(245, 158, 11, 0.2);
}
.kpi-card-cons.kpi-expired .kpi-number {
    color: #f59e0b;
}

/* 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-box.alert-expired {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.alert-box.alert-expired .alert-text strong {
    color: #f59e0b;
}

.alert-box.alert-expired .alert-btn {
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.4);
    color: #f59e0b;
}

.alert-box.alert-expired .alert-btn:hover {
    background: rgba(245, 158, 11, 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(255, 193, 7, 0.3);
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.08);
}

.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-cons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-tab-cons {
    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-cons:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

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

.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-cons.active .tab-badge {
    background: rgba(255, 193, 7, 0.2);
}

/* Filter Options (Dropdown) */
.filter-options-cons {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.filter-select-cons {
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    min-width: 160px;
}

.filter-select-cons:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.filter-select-cons:focus {
    outline: none;
    border-color: rgba(255, 193, 7, 0.3);
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.08);
}

.filter-select-cons option {
    background: #1a1a1f;
    color: white;
}

/* Clienti Section */
.clienti-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-cons {
    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-cons h2 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--white);
}

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

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

/* Cliente Card */
.cliente-card-cons {
    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;
    cursor: pointer;
    transition: all 0.25s ease;
}

.cliente-card-cons:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 193, 7, 0.2);
    transform: translateX(4px);
}

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

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

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

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

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

.cliente-avatar-cons {
    width: 48px;
    height: 48px;
    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.25rem;
}

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

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

.cliente-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;
}

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

.veicolo-provider {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gold);
}

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

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

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

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

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

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

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

.status-badge-cons.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 */
.pagination-cons {
    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-cons {
    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-cons:hover:not(:disabled) {
    background: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.3);
    color: var(--gold);
}

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

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

/* Modal Cliente */
.modal-cliente {
    max-width: 700px;
}

/* Modal content classes */
.modal-profilo-header {
    display: flex;
    gap: 1.5rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5rem;
}

.modal-profilo-avatar {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    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: 1.75rem;
    flex-shrink: 0;
}

.modal-profilo-info {
    flex: 1;
    min-width: 0;
}

.modal-profilo-nome {
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.5rem;
}

.modal-profilo-contatti {
    display: flex;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    flex-wrap: wrap;
}

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

.modal-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.modal-section-box {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 1rem;
}

.modal-section-box.modal-section-highlight {
    background: rgba(255, 193, 7, 0.03);
    border: 1px solid rgba(255, 193, 7, 0.1);
}

.modal-section-title {
    color: var(--gold);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.modal-field-grid {
    display: grid;
    gap: 0.75rem;
}

.modal-field-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
}

.modal-field-value {
    color: #fff;
}

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

.modal-field-value.danger {
    color: #ef4444;
    font-weight: 600;
}

.modal-form-grid {
    display: grid;
    gap: 1rem;
}

.modal-form-group {
    margin: 0;
}

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

.modal-form-input {
    width: 100%;
    padding: 0.6rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.modal-form-input:focus {
    outline: none;
    border-color: rgba(255, 193, 7, 0.4);
}

.modal-textarea {
    resize: vertical;
    min-height: 80px;
}

.modal-note-section {
    margin-top: 1.5rem;
}

/* ========================================
   ANALISI COMUNICAZIONE
======================================== */
.modal-section-box.full-width {
    grid-column: 1 / -1;
    margin-top: 1rem;
}

#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: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    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(255, 193, 7, 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(255, 193, 7, 0.1);
    border: 1px dashed rgba(255, 193, 7, 0.3);
    color: #ffc107;
    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(255, 193, 7, 0.15);
    border-color: rgba(255, 193, 7, 0.5);
}

.btn-add-comunicazione:disabled {
    cursor: not-allowed;
    color: rgba(255, 193, 7, 0.4);
}

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

/* Responsive comunicazioni */
@media (max-width: 768px) {
    .comunicazione-fields {
        flex-direction: column;
        align-items: stretch;
    }

    .form-group-inline {
        min-width: 100%;
    }

    .btn-remove-comunicazione {
        align-self: flex-end;
        margin-top: -0.5rem;
    }
}

/* ========================================
   RESPONSIVE
======================================== */

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

/* --- Tablet portrait --- */
@media (max-width: 768px) {
    /* Header: compatta */
    .consulente-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;
    }

    /* Main content */
    .consulente-main {
        padding: 72px 0.75rem 1rem;
    }

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

    .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;
    }

    /* KPI: 2 colonne su tablet */
    .kpi-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
        margin-bottom: 1rem;
    }

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

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

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

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

    /* 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;
    }

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

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

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

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

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

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

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

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

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

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

    .cliente-card-cons:hover {
        transform: none;
    }

    .cliente-avatar-cons {
        display: none;
    }

    /* Top row: nome + status */
    .cliente-main-info {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        padding: 0.75rem 0.75rem 0.5rem;
    }

    .cliente-nome-cons {
        font-size: 0.9rem;
    }

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

    /* Veicolo + Status: affiancati sotto */
    .cliente-veicolo-info {
        text-align: left;
        padding: 0 0.75rem;
    }

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

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

    .cliente-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-cons {
        font-size: 0.7rem;
        padding: 0.25rem 0.6rem;
    }

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

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

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

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

    /* Modal consulente */
    .modal-cliente {
        max-width: 95vw;
        max-height: 90vh;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-title {
        font-size: 1rem;
    }

    .modal-body {
        padding: 1rem;
    }

    /* Modal griglia da 2 col a 1 col */
    .modal-grid-2col {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .modal-profilo-header {
        gap: 1rem;
        margin-bottom: 1rem;
    }

    .modal-profilo-avatar {
        width: 48px;
        height: 48px;
        font-size: 1.4rem;
    }

    .modal-profilo-nome {
        font-size: 1.1rem;
    }

    .modal-profilo-contatti {
        flex-direction: column;
        gap: 0.4rem;
        font-size: 0.8rem;
    }

    .modal-section-box {
        padding: 0.75rem;
    }

    .modal-note-section {
        margin-top: 1rem;
    }

    .modal-footer {
        padding: 0.75rem 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }

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

    /* 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;
    }
}

/* --- Mobile small (iPhone SE, etc.) --- */
@media (max-width: 480px) {
    .consulente-header {
        height: 56px;
    }

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

    /* KPI: 2 colonne compatte con numeri piu' piccoli */
    .kpi-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

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

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

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

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

    /* Welcome ancora piu' compatto */
    .welcome-banner {
        padding: 1rem 0.75rem;
        margin-bottom: 0.75rem;
    }

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

    /* Alert compatta */
    .alert-box {
        flex-wrap: wrap;
        padding: 0.6rem 0.75rem;
    }

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

    /* Filtri piu' piccoli */
    .filter-tab-cons {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
        border-radius: 8px;
    }

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

    /* Clienti section */
    .clienti-section {
        padding: 0.75rem;
        border-radius: 12px;
    }

    /* Cliente card mobile */
    .cliente-card-cons {
        border-radius: 10px;
    }

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

    .cliente-nome-cons {
        font-size: 0.85rem;
    }

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

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

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

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

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

    /* Login mobile */
    .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;
    }

    .select-consulente {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    /* Modal full screen su mobile piccolo */
    .modal-cliente {
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 12px 12px 0 0;
        margin-top: auto;
    }

    .modal-overlay {
        align-items: flex-end;
    }
}

/* --- Touch device optimizations --- */
@media (hover: none) and (pointer: coarse) {
    /* Tap target minimi 44px */
    .filter-tab-cons {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

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

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

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

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

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

    /* Rimuovi hover effects su touch */
    .cliente-card-cons:hover {
        transform: none;
        border-color: rgba(255, 255, 255, 0.05);
    }

    .kpi-card-cons:hover {
        transform: none;
    }

    /* Active state per feedback tattile */
    .cliente-card-cons:active {
        background: rgba(255, 193, 7, 0.06);
        border-color: rgba(255, 193, 7, 0.2);
    }

    .filter-tab-cons:active {
        background: rgba(255, 193, 7, 0.1);
    }

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

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

    .consulente-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));
    }

    .modal-footer {
        padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    }
}
