/* Reset e variabili CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #f59e0b;
    --primary-dark: #fed7aa;
    --secondary-color: #64748b;
    --success-color: #ef4444;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --background-color: #f8fafc;
    --surface-color: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem 0;
    gap: 3rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.header-center {
    text-align: center;
}

.header-right {
    display: flex;
    align-items: center;
}

.company-logo {
    display: flex;
    align-items: center;
}

.dogre-logo {
    height: 3rem;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.city-logo {
    display: flex;
    align-items: center;
    flex-direction: column;
    text-align: center;
}

.city-emblem {
    height: 3rem;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    margin-bottom: 0.2rem;
}

.city-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Times New Roman', 'serif';
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo i {
    font-size: 2rem;
    color: #f59e0b;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fbbf24, #f97316);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    margin-top: 0.5rem;
}

.guide-link {
    display: inline-block;
    background: #f59e0b;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.guide-link:hover {
    background: #d97706;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.guide-link i {
    margin-right: 0.5rem;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #f59e0b;
    background: rgba(251, 191, 36, 0.1);
}

/* Main Content */
.main-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.calculator-container {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* Form Sections */
.form-section {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
}

.form-section h2 i {
    color: var(--primary-color);
}

/* Form Groups */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group-inline {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--surface-color);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Radio Groups */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
    background: var(--surface-color);
}

.radio-label:hover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.02);
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.radio-label input[type="radio"]:checked + .radio-custom {
    border-color: var(--primary-color);
    background: var(--primary-color);
}

.radio-label input[type="radio"]:checked + .radio-custom::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
}

.radio-label input[type="radio"]:checked ~ span {
    color: var(--primary-color);
    font-weight: 500;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    justify-content: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    width: 100%;
}

/* Info and Warning Notes */
.info-note,
.warning-note {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem;
    border-radius: var(--border-radius);
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

.info-note {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #1e40af;
}

.warning-note {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #92400e;
}

.info-note i,
.warning-note i {
    margin-top: 0.1rem;
    flex-shrink: 0;
}

/* Info Display */
.info-display {
    margin-top: 0.75rem;
    padding: 0.875rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--border-radius);
    color: #047857;
    font-weight: 500;
}

/* Results */
.results-container {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    margin-top: 2rem;
    overflow: hidden;
}

.results-container h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 2rem 2rem 1rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.results-container h2 i {
    color: var(--success-color);
}

.results-actions {
    padding: 1rem 2rem 2rem;
    display: flex;
    gap: 1rem;
}

/* Preventivo Content */
.preventivo-details {
    padding: 0 2rem;
}

.preventivo-summary {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin: 1rem 0;
}

.preventivo-header {
    text-align: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.preventivo-number {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
}

.preventivo-date {
    color: var(--text-secondary);
    margin-top: 0.25rem;
    font-size: 0.85rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-row:last-child {
    border-bottom: none;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--success-color);
}

.detail-label {
    color: var(--text-secondary);
}

.detail-value {
    font-weight: 500;
    color: var(--text-primary);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1.3rem;
}

.close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.close:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

/* Admin Dashboard */
.admin-header {
    background: var(--primary-color);
    color: white;
    padding: 1rem 0;
}

.admin-header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-header h1 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.admin-section {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    margin-bottom: 2rem;
}

.admin-section h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.file-upload-section {
    margin-bottom: 2rem;
}

.file-upload-section h3 {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.file-upload-section input[type="file"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    background: var(--background-color);
    cursor: pointer;
    transition: var(--transition);
}

.file-upload-section input[type="file"]:hover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.02);
}

.file-status {
    margin-top: 0.5rem;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 500;
}

.file-status.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.file-status.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: var(--background-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.stat-card h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.stat-card p {
    color: var(--text-secondary);
    font-weight: 500;
}

/* File Upload Grid */
.file-upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.file-upload-card {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
}

.file-upload-card:hover {
    box-shadow: var(--shadow-md);
}

.file-upload-header {
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-upload-header h3 {
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.file-count {
    font-size: 0.9rem;
    opacity: 0.9;
}

.file-upload-body {
    padding: 1.5rem;
}

.file-upload-body input[type="file"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    background: var(--surface-color);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 1rem;
}

.file-upload-body input[type="file"]:hover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.02);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Configuration Grid */
.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.config-card {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
}

.config-card h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.config-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* Activity Log */
.activity-log {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
}

.log-container {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.log-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.log-item:hover {
    background: rgba(37, 99, 235, 0.05);
}

.log-item:last-child {
    border-bottom: none;
}

.log-time {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.log-message {
    color: var(--text-primary);
}

/* Modal Large */
.modal-large .modal-content {
    max-width: 800px;
    max-height: 80vh;
}

/* Data Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.data-table th,
.data-table td {
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    text-align: left;
}

.data-table th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.data-table tr:nth-child(even) {
    background: var(--background-color);
}

.data-table tr:hover {
    background: rgba(37, 99, 235, 0.05);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        padding: 0 1rem;
    }
    
    .logo {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .admin-trigger {
        position: static;
        margin: 1rem auto 0;
    }
    
    .main-content {
        padding: 2rem 1rem;
    }
    
    .form-section {
        padding: 1.25rem 1.5rem;
    }
    
    .form-group-inline {
        grid-template-columns: 1fr;
    }
    
    .radio-group {
        gap: 0.75rem;
    }
    
    .radio-label {
        padding: 0.75rem;
    }
    
    .results-actions {
        flex-direction: column;
    }
    
    .admin-header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .admin-container {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stili per visualizzazione compatta risultati */
.dettagli-compatti {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.sezione-base, .sezione-calcolo {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.75rem;
    box-shadow: var(--shadow-sm);
}

.sezione-base h4, .sezione-calcolo h4 {
    color: var(--primary-color);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    padding-bottom: 0.35rem;
    border-bottom: 2px solid var(--primary-color);
}

.grid-dettagli, .grid-calcolo {
    display: grid;
    gap: 0.35rem;
}

.detail-item, .calc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.85rem;
}

.detail-item:last-child, .calc-item:last-child {
    border-bottom: none;
}

.detail-item .label, .calc-item .label {
    font-weight: 500;
    color: var(--text-secondary);
    flex: 1;
}

.detail-item .value, .calc-item .value {
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}

.calc-item.base .value {
    color: var(--primary-color);
}

.calc-item.maggiorazione .value {
    color: var(--warning-color);
}

.calc-item.riduzione .value {
    color: var(--success-color);
}

.calc-item.arrotondamento .value {
    color: var(--secondary-color);
    font-size: 0.85rem;
    font-style: italic;
}

.preventivo-totale {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: var(--border-radius);
    padding: 1rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    margin-top: 1rem;
}

.totale-finale {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.label-totale {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
}

.value-totale {
    color: white;
    font-size: 1.8rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Stili PDF ottimizzati */
@media print {
    * { 
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        box-sizing: border-box !important;
    }
    
    @page {
        size: A4;
        margin: 15mm;
        padding: 0;
    }
    
    html, body { 
        margin: 0 !important; 
        padding: 0 !important;
        width: 100% !important;
        height: auto !important;
        font-family: 'Inter', Arial, sans-serif !important;
        font-size: 11px !important;
        line-height: 1.3 !important;
        background: white !important;
        color: black !important;
        overflow: visible !important;
    }
    
    /* Nascondi tutto TRANNE il contenuto del preventivo */
    body > *:not(#risultati) {
        display: none !important;
    }
    
    #risultati {
        display: block !important;
        visibility: visible !important;
    }
    
    .preventivo-details {
        display: block !important;
        visibility: visible !important;
        position: static !important;
        width: 100% !important;
        height: auto !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        page-break-inside: avoid !important;
    }
    
    .preventivo-details * {
        display: block !important;
        visibility: visible !important;
    }
    
    .pdf-header-official {
        display: block !important;
        text-align: center;
        margin-bottom: 15px;
        padding-bottom: 10px;
        border-bottom: 2px solid #000;
        page-break-after: avoid !important;
    }
    
    .pdf-header-top {
        display: flex !important;
        justify-content: space-between;
        margin-bottom: 10px;
        font-weight: bold;
        font-size: 11px;
    }
    
    .pdf-left, .pdf-right {
        display: inline-block !important;
        font-weight: bold;
    }
    
    .pdf-title-main {
        display: block !important;
        font-size: 15px;
        font-weight: bold;
        margin-bottom: 4px;
        text-align: center;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .pdf-subtitle {
        display: block !important;
        font-size: 13px;
        font-weight: bold;
        margin-bottom: 10px;
        text-align: center;
        text-transform: uppercase;
    }
    
    .pdf-numero-data {
        display: flex !important;
        justify-content: space-between;
        font-size: 9px;
        margin-top: 8px;
    }
    
    .pdf-numero, .pdf-data-ora {
        display: inline-block !important;
    }
    
    .pdf-content-body {
        display: block !important;
        margin-top: 12px;
    }
    
    .pdf-dettagli {
        display: block !important;
        margin-bottom: 12px;
    }
    
    .pdf-sezione {
        display: block !important;
        margin-bottom: 8px;
        page-break-inside: avoid !important;
    }
    
    .pdf-sezione h4 {
        display: block !important;
        font-size: 11px;
        font-weight: bold;
        color: #000;
        margin: 0 0 4px 0;
        padding-bottom: 2px;
        border-bottom: 1px solid #ccc;
    }
    
    .pdf-grid {
        display: block !important;
        margin-bottom: 6px;
    }
    
    .pdf-item {
        display: flex !important;
        justify-content: space-between;
        padding: 1px 0;
        font-size: 9px;
        border-bottom: none;
        margin: 0;
    }
    
    .pdf-item .label, .pdf-item .value {
        display: inline-block !important;
    }
    
    .pdf-item .label {
        flex: 1;
        font-weight: 500;
    }
    
    .pdf-item .value {
        font-weight: 600;
        text-align: right;
        min-width: 70px;
    }
    
    .pdf-totale-sezione {
        display: block !important;
        margin-top: 12px;
        text-align: center;
        padding: 6px;
        border: 2px solid #000;
        border-radius: 3px;
        background-color: #f5f5f5 !important;
        page-break-inside: avoid !important;
    }
    
    .pdf-totale-finale {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
    }
    
    .pdf-totale-label, .pdf-totale-value {
        display: inline-block !important;
    }
    
    .pdf-totale-label {
        font-size: 13px;
        font-weight: bold;
        color: #000;
    }
    
    .pdf-totale-value {
        font-size: 15px;
        font-weight: bold;
        color: #000;
    }
    
    /* Nascondi elementi non necessari */
    .results-actions,
    button,
    .btn,
    header,
    .main-header,
    form,
    .calculator-container,
    .main-content,
    .preventivo-header:not(.pdf-header-official) {
        display: none !important;
        visibility: hidden !important;
    }
}

/* Responsive per mobile */
@media (max-width: 768px) {
    .dettagli-compatti {
        gap: 1rem;
    }
    
    .sezione-base, .sezione-calcolo {
        padding: 0.75rem;
    }
    
    .grid-dettagli, .grid-calcolo {
        gap: 0.5rem;
    }
    
    .detail-item, .calc-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        padding: 0.75rem 0;
    }
    
    .detail-item .value, .calc-item .value {
        text-align: left;
        font-size: 1rem;
    }
    
    .totale-finale {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .value-totale {
        font-size: 2rem;
    }
}

/* Stili per la nota importante */
.nota-importante {
    background: #fff8dc;
    border: 1px solid #f59e0b;
    border-radius: var(--border-radius);
    padding: 0.6rem;
    margin-top: 0.75rem;
    box-shadow: var(--shadow-sm);
}

.nota-importante h4 {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.825rem;
    font-weight: 600;
    color: #d97706;
    margin-bottom: 0.4rem;
}

.nota-importante h4 i {
    color: #f59e0b;
    font-size: 0.9rem;
}

.nota-importante p {
    font-size: 0.75rem;
    line-height: 1.35;
    color: #92400e;
    margin: 0;
    text-align: justify;
    font-weight: 400;
}

/* Responsive per nota importante */
@media (max-width: 768px) {
    .nota-importante {
        padding: 0.6rem;
        margin-top: 0.8rem;
    }
    
    .nota-importante h4 {
        font-size: 0.85rem;
    }
    
    .nota-importante p {
        font-size: 0.75rem;
        line-height: 1.3;
    }
}

/* Footer Credits */
.footer-credits {
    background: #1e293b;
    color: #e2e8f0;
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 3px solid var(--primary-color);
}

.footer-credits .container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
}

.credits-content {
    text-align: center;
}

.credits-content p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.credits-content p:first-child {
    font-weight: 600;
    font-size: 1rem;
}

/* Responsive per footer */
@media (max-width: 768px) {
    .footer-credits {
        padding: 1.5rem 0;
        margin-top: 2rem;
    }
    
    .footer-credits .container {
        padding: 0 1rem;
    }
    
    .credits-content p {
        font-size: 0.8rem;
    }
    
    .credits-content p:first-child {
        font-size: 0.9rem;
    }
}
