/**
 * GESTIONE MES EVENTI - Stile Responsive
 * Design elegante e moderno
 */

/* === VARIABILI CSS === */
:root {
    --primary: #003d7a;
    --primary-dark: #002855;
    --secondary: #0066cc;
    --accent: #00a8e8;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --light: #f8f9fa;
    --dark: #212529;
    --gray: #6c757d;
    --gray-light: #e9ecef;
    --white: #ffffff;
    
    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-monospace: 'Courier New', monospace;
    
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --box-shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.6;
    color: var(--dark);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 0;
}

/* === CONTAINER === */
.container {
    max-width: 900px;
    padding: 2rem 1rem;
    margin-top: 0;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow-lg);
    overflow: hidden;
}

/* === HEADER === */
.app-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 2rem;
    text-align: center;
}

.logo-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.logo-section i {
    font-size: 3rem;
    color: var(--accent);
}

.app-header h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.app-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* === NAVIGATION MENU === */
.main-nav {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-radius: 0 0 12px 12px;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 60px;
}

.nav-brand a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--white);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: var(--transition);
}

.nav-brand i {
    font-size: 1.5rem;
    color: var(--accent);
}

.nav-brand a:hover {
    opacity: 0.9;
}

.brand-text {
    display: inline-block;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    gap: 0.25rem;
}

.hamburger {
    width: 25px;
    height: 3px;
    background: var(--white);
    border-radius: 3px;
    transition: var(--transition);
}

.nav-toggle.active .hamburger:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.nav-toggle.active .hamburger:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active .hamburger:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    color: var(--white);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}

.nav-link i {
    font-size: 1.1rem;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
}

.nav-item.active .nav-link {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-link-cta {
    background: var(--accent);
    color: var(--white);
    font-weight: 600;
}

.nav-link-cta:hover {
    background: #009dd6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 168, 232, 0.4);
}

/* === MAIN CONTENT === */
.main-content {
    padding: 2rem;
}

/* === ALERTS === */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

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

.alert-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

/* === CARDS === */
.form-card, .qr-display-card, .info-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
    padding: 2rem;
    margin-bottom: 2rem;
}

.info-card {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left: 4px solid var(--secondary);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.info-card i {
    font-size: 1.5rem;
    color: var(--secondary);
    margin-top: 0.25rem;
}

.info-card p {
    margin: 0;
    line-height: 1.6;
}

/* === FORM HEADER === */
.form-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-light);
}

.form-header i {
    font-size: 2rem;
    color: var(--primary);
}

.form-header h2 {
    font-size: 1.75rem;
    color: var(--primary);
    font-weight: 600;
}

/* === FORM SECTIONS === */
.form-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--light);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--secondary);
}

.form-section h3 {
    font-size: 1.25rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.form-section h3 i {
    color: var(--secondary);
}

/* === FORM GROUPS === */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

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

.form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark);
    font-size: 0.95rem;
}

.required {
    color: var(--danger);
    margin-left: 0.25rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-light);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--white);
}

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

.form-hint {
    font-size: 0.85rem;
    color: var(--gray);
    margin-top: 0.25rem;
}

/* === BUTTONS === */
.btn {
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    justify-content: center;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(0, 61, 122, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 61, 122, 0.4);
}

.btn-secondary {
    background: var(--gray);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--dark);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
    transform: translateY(-2px);
}

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

/* === FORM ACTIONS === */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--gray-light);
    flex-wrap: wrap;
}

/* === SUCCESS MESSAGE === */
.success-message {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-radius: var(--border-radius-lg);
    margin-bottom: 2rem;
}

.success-message i {
    font-size: 4rem;
    color: var(--success);
    margin-bottom: 1rem;
}

.success-message h2 {
    font-size: 2rem;
    color: var(--success);
    margin-bottom: 0.5rem;
}

.success-message p {
    color: var(--dark);
    font-size: 1.1rem;
}

/* === QR DISPLAY === */
.qr-display-card {
    text-align: center;
}

.qr-header {
    margin-bottom: 2rem;
}

.qr-header h3 {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.unique-code {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    border-radius: var(--border-radius-lg);
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-monospace);
    box-shadow: var(--box-shadow-lg);
    letter-spacing: 2px;
}

.unique-code i {
    font-size: 2rem;
}

.qr-image-container {
    padding: 2rem;
    background: var(--light);
    border-radius: var(--border-radius-lg);
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.qr-image {
    max-width: 350px;
    width: 100%;
    height: auto;
    border: 4px solid var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
    background: var(--white);
}

.qr-error {
    text-align: center;
    color: var(--danger);
    padding: 2rem;
}

.qr-error i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* === USER INFO SUMMARY === */
.user-info-summary {
    background: var(--light);
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    margin-bottom: 2rem;
    text-align: left;
}

.user-info-summary h4 {
    font-size: 1.25rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-grid {
    display: grid;
    gap: 1rem;
}

.info-item {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--white);
    border-radius: var(--border-radius);
    border-left: 3px solid var(--secondary);
}

.info-label {
    font-weight: 600;
    color: var(--gray);
}

.info-value {
    color: var(--dark);
    word-break: break-word;
}

/* === QR ACTIONS === */
.qr-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* === FOOTER === */
.app-footer {
    background: var(--dark);
    color: var(--white);
    padding: 1.5rem 2rem;
    text-align: center;
    font-size: 0.9rem;
}

.app-footer p {
    margin: 0;
    opacity: 0.8;
}

/* === RESPONSIVE === */
/* Schermi medi - Riduci padding link */
@media (max-width: 1300px) and (min-width: 1101px) {
    .nav-link {
        padding: 0.75rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .nav-menu {
        gap: 0.25rem;
    }
}

@media (max-width: 1100px) {
    /* Navigation Mobile */
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--primary-dark);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

    .nav-menu.active {
        max-height: 500px;
    }

    .nav-item {
        width: 100%;
    }

    .nav-link {
        padding: 1rem 1.5rem;
        border-radius: 0;
        justify-content: flex-start;
    }

    .nav-link:hover,
    .nav-item.active .nav-link {
        background: rgba(255, 255, 255, 0.1);
    }

    .nav-link-cta {
        background: var(--accent);
    }

    .brand-text {
        font-size: 0.95rem;
    }

    body {
        padding: 1rem 0.5rem;
    }
    
    .container {
        border-radius: 0;
    }
    
    .app-header {
        padding: 1.5rem 1rem;
    }
    
    .logo-section i {
        font-size: 2.5rem;
    }
    
    .app-header h1 {
        font-size: 1.5rem;
    }
    
    .main-content {
        padding: 1.5rem 1rem;
    }
    
    .form-card, .qr-display-card {
        padding: 1.5rem;
    }
    
    .form-section {
        padding: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .info-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .info-label {
        font-size: 0.85rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .qr-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .unique-code {
        font-size: 1.2rem;
        padding: 0.75rem 1.5rem;
        letter-spacing: 1px;
    }
    
    .qr-image {
        max-width: 280px;
    }
}

@media (max-width: 480px) {
    .app-header h1 {
        font-size: 1.25rem;
    }
    
    .app-subtitle {
        font-size: 0.9rem;
    }
    
    .form-header h2 {
        font-size: 1.5rem;
    }
    
    .form-section h3 {
        font-size: 1.1rem;
    }
    
    .unique-code {
        font-size: 1rem;
        padding: 0.75rem 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .brand-text {
        display: none;
    }

    .nav-container {
        padding: 0 1rem;
    }
}

/* === LISTA UTENTI - STATISTICHE === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--box-shadow-lg);
}

.stat-icon {
    font-size: 2.5rem;
    opacity: 0.9;
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 0.25rem;
}

/* === BARRA RICERCA === */
.search-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: center;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper i {
    position: absolute;
    left: 1rem;
    color: var(--gray);
    font-size: 1.1rem;
}

#searchInput {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    border: 2px solid var(--gray-light);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

#searchInput:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

#searchInput.active {
    border-color: var(--accent);
    background: #f0f9ff;
}

/* === TABELLA DESKTOP === */
.table-container {
    overflow-x: auto;
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
    margin-bottom: 1rem;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table thead {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
}

.users-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.users-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-light);
}

.users-table tbody tr {
    transition: var(--transition);
}

.users-table tbody tr:hover {
    background: var(--light);
}

.desktop-only {
    display: block !important;
}

.mobile-only {
    display: none !important;
}

/* === CARD MOBILE === */
.users-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.user-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: var(--transition);
    border-left: 4px solid var(--secondary);
}

.user-card:hover {
    box-shadow: var(--box-shadow-lg);
    transform: translateY(-2px);
}

.user-card-header {
    background: linear-gradient(135deg, var(--light) 0%, #e3f2fd 100%);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    border-bottom: 1px solid var(--gray-light);
}

.user-card-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--gray);
}

.user-card-date i {
    color: var(--secondary);
}

.user-card-body {
    padding: 1.25rem;
}

.user-card-name {
    font-size: 1.25rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.user-card-name i {
    color: var(--secondary);
    font-size: 1.1rem;
}

.user-card-company {
    color: var(--dark);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.user-card-company i {
    color: var(--accent);
}

.user-card-info {
    color: var(--dark);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.user-card-info i {
    color: var(--gray);
    width: 18px;
    text-align: center;
}

.user-card-info a {
    color: var(--secondary);
    text-decoration: none;
    transition: var(--transition);
}

.user-card-info a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.user-card-actions {
    padding: 1rem;
    background: var(--light);
    display: flex;
    gap: 0.75rem;
    border-top: 1px solid var(--gray-light);
}

.user-card-actions .btn {
    flex: 1;
    justify-content: center;
}

.code-badge-small {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    border-radius: var(--border-radius);
    font-family: var(--font-monospace);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.code-badge-small i {
    font-size: 1rem;
}

.text-muted {
    color: var(--gray);
    font-style: italic;
}

.actions-cell {
    display: flex;
    gap: 0.5rem;
    white-space: nowrap;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius);
    background: var(--secondary);
    color: var(--white);
    transition: var(--transition);
    text-decoration: none;
}

.btn-icon:hover {
    background: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-icon.btn-delete {
    background: var(--danger);
    border: none;
    cursor: pointer;
}

.btn-icon.btn-delete:hover {
    background: #c82333;
}

.btn-icon.btn-warning {
    background: #ffc107;
    color: #212529;
    border: none;
    cursor: pointer;
}

.btn-icon.btn-warning:hover {
    background: #e0a800;
}

.results-counter {
    text-align: center;
    padding: 1rem;
    background: var(--light);
    border-radius: var(--border-radius);
    color: var(--dark);
    font-size: 0.95rem;
}

/* === RESPONSIVE LISTA UTENTI === */
@media (max-width: 992px) {
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: flex !important;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

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

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

    .code-badge-small {
        font-size: 0.8rem;
        padding: 0.4rem 0.65rem;
    }
}

@media (max-width: 480px) {
    .user-card-name {
        font-size: 1.1rem;
    }

    .user-card-actions {
        flex-direction: column;
    }

    .user-card-actions .btn {
        width: 100%;
    }
}

/* === CONSULTA - CODE BADGE === */
.unique-code-display {
    text-align: center;
    margin-bottom: 2rem;
}

.code-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    border-radius: var(--border-radius-lg);
    font-family: var(--font-monospace);
    font-size: 1.5rem;
    font-weight: 700;
    box-shadow: var(--box-shadow-lg);
}

.code-badge i {
    font-size: 1.8rem;
}

/* === CONSULTA - DATA GRID === */
.data-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.data-item {
    background: var(--white);
    padding: 1.25rem;
    border-radius: var(--border-radius);
    border-left: 3px solid var(--secondary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.data-item.full-width {
    grid-column: 1 / -1;
}

.data-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-value {
    font-size: 1.1rem;
    color: var(--dark);
    word-break: break-word;
}

.data-value a {
    color: var(--secondary);
    text-decoration: none;
    transition: var(--transition);
}

.data-value a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.empty-value {
    color: var(--gray);
    font-style: italic;
}

@media (max-width: 768px) {
    .data-grid {
        grid-template-columns: 1fr;
    }

    .code-badge {
        font-size: 1.2rem;
        padding: 0.75rem 1.5rem;
    }
}

/* === ANIMATIONS === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-card, .qr-display-card, .info-card {
    animation: fadeIn 0.5s ease-out;
}

/* === STATUS BADGES === */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge i {
    font-size: 0.875rem;
}

.status-pending {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.status-validated {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

/* === STATISTICHE COLORATE === */
.stat-warning {
    border-left: 4px solid #ffc107;
}

.stat-warning .stat-icon {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
}

.stat-success {
    border-left: 4px solid #28a745;
}

.stat-success .stat-icon {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

/* === MODALE === */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: relative;
    background: white;
    margin: 3% auto;
    padding: 0;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 2rem;
    line-height: 1;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
    max-height: calc(85vh - 200px);
    overflow-y: auto;
}

.modal-actions {
    padding: 1.5rem;
    border-top: 1px solid var(--gray-light);
    background: var(--light);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* === USER DETAIL GRID === */
.user-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.detail-section {
    background: var(--light);
    padding: 1.25rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary);
}

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

.detail-section h3 {
    color: var(--primary);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-label {
    font-size: 0.875rem;
    color: var(--gray);
    font-weight: 600;
}

.detail-value {
    font-size: 1rem;
    color: var(--dark);
}

.code-highlight {
    font-family: var(--font-monospace);
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    font-size: 1.25rem;
    font-weight: bold;
    text-align: center;
}

/* === BTN SUCCESS === */
.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
}

.btn-success:hover {
    background: linear-gradient(135deg, #218838 0%, #17a589 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* === ANIMAZIONI === */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* === RESPONSIVE MODALE === */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 5% auto;
        max-height: 90vh;
    }
    
    .modal-header h2 {
        font-size: 1.25rem;
    }
    
    .modal-body {
        padding: 1.5rem;
        max-height: calc(90vh - 180px);
    }
    
    .user-detail-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions .btn {
        width: 100% !important;
    }
}

/* === PRINT STYLES === */
@media print {
    /* Reset base per stampa */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    body {
        background: white !important;
        padding: 1rem !important;
        margin: 0 !important;
    }
    
    /* Nascondi elementi non necessari */
    nav,
    .menu-toggle,
    .nav-menu,
    footer,
    .app-footer,
    .info-card,
    .success-message,
    .alert,
    .form-actions,
    .qr-actions,
    .btn,
    button,
    .app-header {
        display: none !important;
    }
    
    /* Container senza ombre */
    .container {
        max-width: 100% !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* Card QR ottimizzata per stampa */
    .qr-display-card {
        box-shadow: none !important;
        border: 2px solid #333 !important;
        page-break-after: avoid;
        page-break-inside: avoid;
        margin: 0 !important;
        width: 100% !important;
    }
    
    /* Ottimizza dimensioni QR Code */
    .qr-image-container {
        text-align: center;
        margin: 2rem 0;
    }
    
    .qr-image {
        max-width: 350px !important;
        width: 350px !important;
        height: auto;
        display: block;
        margin: 0 auto;
    }
    
    /* Stili header QR */
    .qr-header {
        text-align: center;
        border-bottom: 2px solid #333;
        padding-bottom: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .qr-header h3 {
        color: #000 !important;
        font-size: 1.5rem;
    }
    
    .unique-code {
        font-size: 1.5rem !important;
        font-weight: bold;
        color: #000 !important;
    }
    
    .unique-code i {
        color: #000 !important;
    }
    
    /* Informazioni utente ottimizzate */
    .user-info-summary {
        border-top: 2px solid #333;
        padding-top: 1.5rem;
        margin-top: 1.5rem;
    }
    
    .user-info-summary h4 {
        color: #000 !important;
        margin-bottom: 1rem;
        font-size: 1.2rem;
    }
    
    .info-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .info-item {
        border-bottom: 1px solid #ddd;
        padding: 0.5rem 0;
        display: flex;
        justify-content: space-between;
    }
    
    .info-label {
        font-weight: bold;
        color: #333 !important;
    }
    
    .info-value {
        color: #000 !important;
    }
}
