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

body {
    font-family: var(--font-sans);
    background: var(--gradient-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Hero Section */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--gradient-primary);
    overflow: hidden;
}

/* Hero Section Small (per pagine interne) */
.hero-section-small {
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--gradient-primary);
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('/UI/images/hero-background.svg') no-repeat center;
    background-size: cover;
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 2;
    color: white;
    max-width: 800px;
    padding: 0 20px;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: var(--font-weight-black);
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.hero-title-small {
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: var(--font-weight-black);
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.hero-subtitle {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    margin-bottom: 2rem;
    opacity: 0.9;
    line-height: 1.4;
}

.hero-subtitle-small {
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    margin-bottom: 2rem;
    opacity: 0.9;
    line-height: 1.4;
}

.hero-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 3rem;
}



/* Content Section (per pagine interne) */
.content-section {
    padding: 50px 0 100px;
    background: var(--bg-hero-card);
    position: relative;
    min-height: 50vh;
}

/* .content-container - DEPRECATO: usa .container-responsive per larghezza responsive */
/* .content-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
} */

/* Services Section */
.services-section {
    padding: 100px 0;
    background: var(--bg-hero-card);
    position: relative;
}

.services-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-header {
    text-align: center;
    margin-bottom: 80px;
}

.section-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    background: var(--gradient-primary-alt);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.3rem;
    color: var(--text-muted-dark);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* .services-grid - delegato a .grid-feature (centralizzato) */

.service-card {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: var(--shadow-lg);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary-90);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card:hover {
    transform: translateY(-15px);
    box-shadow: var(--shadow-xl);
}

.service-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
}

.service-icon::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.5s;
    opacity: 0;
}

.service-card:hover .service-icon::after {
    animation: shine 0.5s ease-in-out;
    opacity: 1;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.service-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.service-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary-dark);
    margin: 0;
}

.status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-online {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.status-offline {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.status-unknown {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.service-description {
    color: var(--text-muted-dark);
    line-height: 1.6;
    margin-bottom: 25px;
    font-size: 1rem;
}

.service-button {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 14px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
}

.service-button:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.service-button::after {
    content: '→';
    transition: transform 0.3s ease;
}

.service-button:hover::after {
    transform: translateX(4px);
}

/* Form Cards */
.form-card {
    background: white;
    border-radius: 25px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.1);
    margin-bottom: 40px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255,255,255,0.1);
}

.form-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 70px rgba(0,0,0,0.15);
}

.form-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(120deg, #667eea, #764ba2, #667eea);
    background-size: 200% 200%;
    color: #fff;
    border-radius: 16px 16px 0 0;
    padding: 18px 28px 12px 24px;
    min-height: 56px;
    position: relative;
    z-index: 1;
    box-shadow: none;
}

.form-card-icon {
    font-size: 2.1rem;
    margin-right: 0;
    margin-left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.13);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(102,126,234,0.07);
}

.form-card-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: #fff;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.form-card-header p {
    font-size: 0.98rem;
    font-weight: 400;
    margin: 0 0 0 2px;
    color: #e0e7ff;
    line-height: 1.2;
}

.form-card-body {
    padding: 30px;
}



/* Modern Forms */
.modern-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    margin-bottom: 10px;
}

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

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary-dark);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

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

.form-control-modern {
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
    color: var(--text-primary-dark);
}

.form-control-modern:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.form-control-modern::placeholder {
    color: #94a3b8;
}

.text-muted {
    color: #94a3b8;
}

.form-hint {
    color: var(--text-muted-dark);
    font-size: 0.85rem;
    margin-top: 5px;
    font-style: italic;
}

/* Custom Checkbox */
.form-check-modern {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.form-check-input-modern {
    display: none;
}

.form-check-label-modern {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary-dark);
    -webkit-user-select: none;
    user-select: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
}

.form-check-input-modern:checked + .form-check-label-modern .checkmark {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: #667eea;
}

.form-check-input-modern:checked + .form-check-label-modern .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Modern Buttons */
.btn-modern {
    padding: 16px 32px;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-primary-modern {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-primary-modern:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.btn-success-modern {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

.btn-success-modern:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(16, 185, 129, 0.4);
}

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

/* Loading States */
.loading-modern {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: var(--bg-hero-card);
    border-radius: 12px;
    margin-top: 20px;
    color: var(--text-muted-dark);
}

.spinner-modern {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.loading-content {
    background: white;
    padding: 50px;
    border-radius: 25px;
    text-align: center;
    box-shadow: 0 25px 70px rgba(0,0,0,0.3);
    max-width: 400px;
}

.spinner-large {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 25px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-content h3 {
    color: var(--text-primary-dark);
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.loading-content p {
    color: var(--text-muted-dark);
    margin: 0;
}

/* Result Cards */
.result-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-top: 25px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.result-card-large {
    background: white;
    border-radius: 25px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.1);
    margin-top: 40px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.result-header {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    padding: 20px 25px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--text-primary-dark);
}

.result-header-large {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 25px 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.2rem;
}

.result-icon {
    font-size: 1.2rem;
}

.result-content {
    padding: 25px;
}

.result-content-large {
    padding: 30px;
}

/* Alerts */
.alert-success-modern {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    border: 1px solid #10b981;
    color: #065f46;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.alert-error-modern {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border: 1px solid #ef4444;
    color: #991b1b;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

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

/* Result Details */
.result-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.detail-item {
    padding: 15px;
    background: var(--bg-hero-card);
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.image-result {
    margin: 25px 0;
    text-align: center;
}

.image-result h5 {
    color: var(--text-primary-dark);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.generated-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.summary-section {
    background: var(--bg-hero-card);
    padding: 25px;
    border-radius: 15px;
    margin-top: 25px;
}

.summary-section h5 {
    color: var(--text-primary-dark);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.error-details {
    background: var(--bg-hero-card);
    padding: 20px;
    border-radius: 10px;
    margin-top: 15px;
}

.json-response {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 10px;
    font-size: 0.9rem;
    line-height: 1.5;
    overflow-x: auto;
}

/* Info Section */
.info-section {
    background: white;
    border-radius: 30px;
    padding: 50px;
    margin-top: 50px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.info-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #667eea, #764ba2, #667eea);
    background-size: 200% 100%;
    animation: gradient-flow 3s ease infinite;
}

@keyframes gradient-flow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.info-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 50px;
    align-items: start;
}

.info-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary-dark);
    margin-bottom: 20px;
}

.info-list {
    list-style: none;
    padding: 0;
}

.info-list li {
    margin-bottom: 15px;
    padding-left: 30px;
    position: relative;
    color: #475569;
    line-height: 1.6;
}

.info-list li::before {
    content: '✦';
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
}

.info-list strong {
    color: var(--text-primary-dark);
}

.api-section {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
}

.api-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 20px;
}

/* Footer */

.footer {
    background: #1e293b;
    color: white;
    text-align: center;
    padding: 50px 0;
    margin-top: 50px;
}

/* Link nel copyright footer (es. Iperverse) stesso colore del testo - override Bootstrap */
.footer .footer-content p a,
.footer .footer-content p a:link,
.footer .footer-content p a:visited {
    color: rgba(255, 255, 255, 0.9) !important;
    text-decoration: none !important;
}
.footer .footer-content p a:hover,
.footer .footer-content p a:focus {
    color: #fff !important;
    text-decoration: underline !important;
}

/* Floating Elements */
.floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.floating-element {
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.floating-element:nth-child(1) { top: 20%; left: 10%; animation-delay: 0s; }
.floating-element:nth-child(2) { top: 40%; left: 80%; animation-delay: 1s; }
.floating-element:nth-child(3) { top: 70%; left: 20%; animation-delay: 2s; }
.floating-element:nth-child(4) { top: 30%; left: 70%; animation-delay: 3s; }
.floating-element:nth-child(5) { top: 80%; left: 60%; animation-delay: 4s; }

@keyframes float {
    0%, 100% { transform: translateY(0px) scale(1); opacity: 0.7; }
    50% { transform: translateY(-20px) scale(1.2); opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    /* .services-grid - delegato a .grid-feature (centralizzato) */
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .hero-nav {
        flex-direction: column;
        align-items: center;
    }
    
    .info-section {
        padding: 30px 20px;
    }
    
    .service-card {
        padding: 30px 20px;
    }

    .service-card:hover {
        transform: translateY(-5px);
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .form-card-body {
        padding: 25px;
    }
    
    .form-card-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px 12px 8px 12px;
        min-height: 44px;
    }
    
    .form-card-icon {
        margin-bottom: 4px;
        width: 32px;
        height: 32px;
        font-size: 1.5rem;
    }
    
    .form-card-header h3 {
        font-size: 1.05rem;
    }
    
    .content-container {
        padding: 0 15px;
    }
    
    .loading-content {
        margin: 20px;
        padding: 30px;
    }
}

/* Loading Animation */
.pulse {
    animation: pulse-glow 2s ease-in-out infinite alternate;
}

@keyframes pulse-glow {
    from { box-shadow: 0 0 20px rgba(102, 126, 234, 0.4); }
    to { box-shadow: 0 0 30px rgba(102, 126, 234, 0.8); }
}

/* ========================================
   Global Layout Utilities (centralized)
   ======================================== */

/* ========================================
   CONTAINER RESPONSIVE CENTRALIZZATO
   ======================================== */
/* 
   Per modificare la larghezza di TUTTE le pagine:
   - Cambia il valore di max-width e width (es. 80vw, 85vw, 95vw)
   - Tutte le pagine che usano .container-responsive si aggiornano automaticamente
   - Non serve modificare ogni singola pagina!
*/
.container-responsive {
    max-width: 90vw !important;  /* ← Modifica qui per cambiare larghezza globale */
    width: 90vw !important;      /* ← Deve essere uguale a max-width */
    margin: 0 auto !important;
    padding: 0 2rem !important;
}

/* ========================================
   SISTEMA CENTRALIZZATO CARD GRID
   ======================================== */

/* GRID FEATURE - Medium (default) - per Agenti/Services */
.grid-feature {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)) !important;
    gap: 2rem !important;
    margin-bottom: 4rem !important;
}

/* GRID LARGE - per Admin/Dashboard con card più grandi */
.grid-large {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)) !important;
    gap: 2rem !important;
    margin-bottom: 4rem !important;
}

/* GRID SMALL - per card compatte */
.grid-small {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
    gap: 1.5rem !important;
    margin-bottom: 3rem !important;
}

/* RESPONSIVE BREAKPOINTS - Medium */
@media (max-width: 1400px) {
    .grid-feature {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 1.5rem !important;
    }
}

@media (max-width: 1200px) {
    .grid-feature {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem !important;
    }
}

@media (max-width: 768px) {
    .grid-feature {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
}

/* Mobile stretto: riduce padding container e gap griglia */
@media (max-width: 480px) {
    .container-responsive {
        padding: 0 1rem !important;
    }

    .grid-feature {
        gap: 1rem !important;
        margin-bottom: 2rem !important;
    }

    .grid-large {
        gap: 1rem !important;
        margin-bottom: 2rem !important;
    }

    .page-header {
        border-radius: 16px;
    }
}

/* RESPONSIVE BREAKPOINTS - Large */
@media (max-width: 1600px) {
    .grid-large {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 2rem !important;
    }
}

@media (max-width: 1200px) {
    .grid-large {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem !important;
    }
}

@media (max-width: 768px) {
    .grid-large {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
}

/* RESPONSIVE BREAKPOINTS - Small */
@media (max-width: 1200px) {
    .grid-small {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 1.5rem !important;
    }
}

@media (max-width: 900px) {
    .grid-small {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 1.25rem !important;
    }
}

@media (max-width: 600px) {
    .grid-small {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }
}

@media (max-width: 480px) {
    .grid-small {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
}

/* Page Header standard basato sui tokens */
.page-header {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding:20px;
    margin-bottom:15px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

/* Varianti di sezione per page-header */
.admin-admin-section {
    --bg-card: var(--admin-surface, #ffffff);
    --border-color: var(--admin-border, #e2e8f0);
    --gradient-primary: var(--admin-gradient, linear-gradient(135deg, #dc2626 0%, #f59e0b 100%));
}

.admin-llm-section {
    --bg-card: var(--llm-surface, #ffffff);
    --border-color: var(--llm-border, #e2e8f0);
    --gradient-primary: var(--llm-gradient, linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%));
}

.admin-monitor-section {
    --bg-card: var(--monitor-surface, #ffffff);
    --border-color: var(--monitor-border, #e2e8f0);
    --gradient-primary: var(--monitor-gradient, linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%));
}

.admin-obs-section {
    --bg-card: var(--obs-surface, #ffffff);
    --border-color: var(--obs-border, #e2e8f0);
    --gradient-primary: var(--obs-gradient, linear-gradient(135deg, #06b6d4 0%, #0891b2 100%));
}

.tools-section {
    --bg-card: var(--tools-surface, #ffffff);
    --border-color: var(--tools-border, #e2e8f0);
    --gradient-primary: var(--tools-gradient, linear-gradient(135deg, #10b981 0%, #059669 100%));
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
}

.page-title {
    font-size: 2rem;
    font-weight: 800;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0 auto;
    line-height: 1.5;
}

/* Header Fisso
   ============================================
   RIMOSSO (2026-01-25): Stili legacy in conflitto con toolbar centralizzata.
   Fonte unica per header/toolbar: UI/css/header-responsive.css
   ============================================ */

/* .main-header, .header-container, .header-logo - ora in header-responsive.css */




/* Padding per il contenuto sotto header fisso */


.form-card:first-child {
    margin-top: 0;
}

@media (max-width: 900px) {
    /* .header-container, .header-logo - ora in header-responsive.css */

    .with-header {
        padding-top: 70px !important;
    }
}

@media (max-width: 600px) {
    /* .header-container, .header-nav - ora in header-responsive.css */

    .with-header {
        padding-top: 60px !important;
    }
}

/* Risposta Testuale */
.plain-response {
  background: #f8fafc;
  color: #222;
  font-size: 1.08em;
  padding: 18px 20px;
  border-radius: 10px;
  margin: 10px 0;
  font-family: 'Fira Mono', 'Consolas', 'Menlo', monospace;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 2px 8px #0001;
}

/* KB News Dashboard - Form Utilities */
.search-input-group {
    display: flex;
    gap: 8px;
}

.search-input-flex {
    flex: 1;
}

.search-btn-inline {
    padding: 14px 20px;
}

.actions-row-centered {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 8px;
}

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

.synthesis-modal-header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.synthesis-modal-title-clean {
    margin: 0;
}

.translation-select-header {
    width: auto;
    min-width: 140px;
    font-size: 0.875rem;
}

/* Quick Navigation Component */
.quick-nav-section {
    margin-bottom: 2rem;
}

.quick-nav-container {
    background: var(--card-bg);
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.quick-nav-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.quick-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.quick-nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-muted-dark);
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-width: 100px;
    justify-content: center;
}

.quick-nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea, #764ba2);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.quick-nav-item:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.quick-nav-item:hover::before {
    opacity: 1;
}

.quick-nav-item.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.quick-nav-item.active::before {
    opacity: 1;
}

.quick-nav-item i {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.quick-nav-item:hover i {
    transform: scale(1.1);
}

.quick-nav-item span {
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Quick Nav Mobile */
@media (max-width: 768px) {
    .quick-nav {
        flex-direction: column;
        gap: 0.25rem;
    }

    .quick-nav-item {
        width: 100%;
        justify-content: flex-start;
        min-width: auto;
    }
}

/* Compact Search Bar */
.compact-search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    background: var(--card-bg);
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    margin-bottom: 15px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
}

.search-select {
    min-width: 120px;
    max-width: 140px;
}

.search-input-main {
    flex: 1;
    min-width: 300px;
}

.btn-icon-only {
    padding: 14px;
    border-radius: 12px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    position: relative;
}

.btn-icon-only.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-icon-only.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.btn-icon-only.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

.btn-icon-only.btn-success:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(16, 185, 129, 0.4);
}

.bookmark-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
}

/* Responsive Compact Search */
@media (max-width: 768px) {
    .compact-search-bar {
        flex-direction: column;
        gap: 12px;
    }
    
    .search-select,
    .search-input-main {
        width: 100%;
        min-width: auto;
        max-width: none;
    }
    
    .btn-icon-only {
        padding: 12px;
    }
}