/* IIS Primo Levi - Ultra Minimal Design System */
:root {
    --primary-blue: #124B7E;
    --primary-blue-light: #3a6ba5;
    --primary-blue-dark: #0d3a63;
    --dark-gray: #333333;
    --light-gray: #f8f9fa;
    --white: #ffffff;
    --black: #000000;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;
    --border-light: #e9ecef;
    --text-muted: #6c757d;
}

/* Base Styles - Ultra Readable */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--white);
    font-size: 18px; /* Larger base font for better readability */
    line-height: 1.6;
    color: var(--dark-gray);
    padding-top: 80px; /* Account for fixed navbar */
}

/* Headings - Clear Hierarchy */
h1, h2, h3, h4, h5, h6 {
    color: var(--dark-gray);
    font-weight: 600;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

/* Custom Bootstrap Colors */
.bg-primary-blue {
    background-color: var(--primary-blue) !important;
}

.text-primary-blue {
    color: var(--primary-blue) !important;
}

.text-primary-light {
    color: #ffffff !important;
}

/* Beautiful Blue Navigation */
.navbar {
    background-color: var(--primary-blue) !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 0.75rem 0;
    min-height: 80px;
}

/* Logo e Brand */
.navbar-brand {
    color: var(--white) !important;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.navbar-brand:hover {
    color: var(--white) !important;
}

.logo-placeholder {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.logo-placeholder:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.brand-text {
    line-height: 1.2;
}

.brand-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
}

.brand-subtitle {
    font-size: 0.9rem;
    font-weight: 400;
    opacity: 0.9;
    margin: 0;
}

/* Forza specificamente i link della navbar ad essere bianchi */
.navbar .navbar-nav .nav-link,
.navbar .navbar-brand,
.navbar .dropdown-toggle {
    color: #ffffff !important;
}

/* Navigation Links */
.navbar-nav .nav-link {
    font-weight: 500;
    color: var(--white) !important;
    transition: all 0.3s ease;
    padding: 0.75rem 1rem !important;
    border-radius: 6px;
    margin: 0 0.25rem;
    display: flex;
    align-items: center;
    height: 48px; /* Altezza fissa per tutte le voci */
    line-height: 1.2;
}

/* Icone nel menù - allineamento perfetto */
.navbar-nav .nav-link i {
    width: 1.2rem;
    text-align: center;
    margin-right: 0.5rem;
    font-size: 1rem;
    flex-shrink: 0; /* Impedisce alle icone di rimpicciolirsi */
}

/* Testo del menù */
.navbar-nav .nav-link span,
.navbar-nav .nav-link {
    white-space: nowrap; /* Impedisce al testo di andare a capo */
}

.navbar-nav .nav-link:hover {
    color: var(--white) !important;
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Dropdown utente - allineamento */
.navbar-nav .dropdown-toggle {
    height: 48px; /* Stessa altezza degli altri link */
    display: flex;
    align-items: center;
}

/* Dropdown */
.dropdown-menu {
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    margin-top: 0.5rem;
}

.dropdown-header {
    padding: 0.75rem 1rem;
    background-color: var(--light-gray);
    border-bottom: 1px solid var(--border-light);
}

.dropdown-item {
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background-color: var(--primary-blue);
    color: var(--white);
}

/* Bottone Registrati nella navbar */
.navbar-nav .btn-outline-light {
    border: 2px solid rgba(255, 255, 255, 0.8);
    color: var(--white) !important;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.navbar-nav .btn-outline-light:hover {
    background-color: var(--white);
    color: var(--primary-blue) !important;
    border-color: var(--white);
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

/* Beautiful Blue Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: var(--white);
    padding: 80px 0;
    margin-top: -80px;
    padding-top: 160px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--white);
}

.hero-subtitle {
    font-size: 1.25rem;
    font-weight: 300;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Call-to-Action per laboratori esterni */
.hero-section .bg-white.bg-opacity-10 {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: pulse-glow 2s ease-in-out infinite alternate;
}

@keyframes pulse-glow {
    from {
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    }
    to {
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    }
}

/* Ultra Simple Cards */
.card {
    border: 2px solid var(--border-light);
    border-radius: 16px;
    box-shadow: none;
    transition: all 0.3s ease;
    background-color: var(--white);
}

.card:hover {
    border-color: var(--primary-blue);
    box-shadow: 0 4px 20px rgba(18, 75, 126, 0.1);
}

.card-header {
    background-color: var(--primary-blue);
    color: var(--white);
    border-radius: 14px 14px 0 0 !important;
    font-weight: 600;
    font-size: 1.2rem;
    padding: 1.5rem;
}

/* User Type Cards */
.user-type-card {
    text-align: center;
    padding: 2rem;
    height: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-type-card:hover {
    background-color: var(--primary-blue);
    color: var(--white);
}

.user-type-card .card-icon {
    font-size: 3rem;
    color: var(--primary-blue);
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.user-type-card:hover .card-icon {
    color: var(--white);
}

.user-type-card h5 {
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Ultra Simple, Large Buttons */
.btn {
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 1rem 2rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    text-decoration: none;
    display: inline-block;
}

.btn-primary-blue {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
    color: var(--white);
}

.btn-primary-blue:hover {
    background-color: var(--primary-blue-dark);
    border-color: var(--primary-blue-dark);
    color: var(--white);
    transform: translateY(-1px);
}

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

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

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

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

.btn-lg {
    padding: 1.25rem 2.5rem;
    font-size: 1.3rem;
}

/* Large, Accessible Forms */
.form-control {
    border-radius: 12px;
    border: 2px solid var(--border-light);
    padding: 1rem 1.25rem;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 0.2rem rgba(18, 75, 126, 0.15);
    outline: none;
}

.form-label {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--dark-gray);
    margin-bottom: 0.75rem;
}

/* Dashboard Cards */
.dashboard-card {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dashboard-card h6 {
    color: var(--primary-blue);
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Stats Cards */
.stat-card {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--dark-gray);
    font-weight: 500;
}

/* Enhanced Mobile Experience */
@media (max-width: 768px) {
    body {
        font-size: 16px;
        padding-top: 80px;
    }

    /* Navbar Mobile */
    .navbar {
        padding: 0.5rem 0;
    }

    .brand-title {
        font-size: 1.2rem;
    }

    .brand-subtitle {
        font-size: 0.8rem;
    }

    .logo-placeholder {
        width: 40px;
        height: 40px;
    }

    .navbar-nav .nav-link {
        padding: 0.75rem 1rem !important;
        margin: 0.25rem 0;
        text-align: center;
    }

    .navbar-nav .btn-outline-light {
        margin-top: 0.5rem;
        text-align: center;
    }

    /* Hero Section Mobile */
    .hero-title {
        font-size: 2.2rem;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    /* Cards Mobile */
    .user-type-card {
        margin-bottom: 1.5rem;
        padding: 2rem 1.5rem;
    }

    .user-type-card .card-icon {
        font-size: 3.5rem;
    }

    .user-type-card h5 {
        font-size: 1.3rem;
    }

    .btn-lg {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }
}

/* Extra Large Screens - Better spacing */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }

    .hero-section {
        padding: 5rem 0;
    }

    .user-type-card {
        padding: 3.5rem 2.5rem;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Loading Spinner */
.spinner-border-primary {
    color: var(--primary-blue);
}

/* Alert Customizations */
.alert {
    border-radius: 8px;
    border: none;
}

/* Footer */
footer {
    margin-top: auto;
}

/* ===== ADMIN DASHBOARD STYLES ===== */

/* Admin Header */
.admin-header-card {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-light) 100%);
    border-radius: 16px;
    padding: 2rem;
    color: white;
    box-shadow: 0 8px 32px rgba(18, 75, 126, 0.15);
    margin-bottom: 2rem;
}

.admin-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: white;
}

.admin-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 0;
}

.admin-info small {
    opacity: 0.8;
}

.system-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-end;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-online {
    background: #28a745;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.6);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 8px rgba(40, 167, 69, 0.6); }
    50% { box-shadow: 0 0 12px rgba(40, 167, 69, 0.8); }
    100% { box-shadow: 0 0 8px rgba(40, 167, 69, 0.6); }
}

/* Enhanced Stat Cards */
.stat-card {
    background: white;
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: none;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.stat-card-body {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-card-primary .stat-icon {
    background: rgba(18, 75, 126, 0.1);
    color: var(--primary-blue);
}

.stat-card-warning .stat-icon {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.stat-card-success .stat-icon {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.stat-card-info .stat-icon {
    background: rgba(23, 162, 184, 0.1);
    color: var(--info);
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    line-height: 1;
}

.stat-card-primary .stat-number {
    color: var(--primary-blue);
}

.stat-card-warning .stat-number {
    color: #ffc107;
}

.stat-card-success .stat-number {
    color: var(--success);
}

.stat-card-info .stat-number {
    color: var(--info);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0;
    font-weight: 500;
}

.stat-badge {
    margin-top: 0.5rem;
}

/* Admin Tabs */
.admin-tabs-container {
    margin-bottom: 2rem;
}

.admin-nav-pills {
    background: white;
    padding: 0.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: none;
}

.admin-nav-pills .nav-link {
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    color: var(--text-muted);
    border: none;
    transition: all 0.3s ease;
    position: relative;
}

.admin-nav-pills .nav-link:hover {
    background: rgba(18, 75, 126, 0.05);
    color: var(--primary-blue);
}

.admin-nav-pills .nav-link.active {
    background: var(--primary-blue);
    color: white;
    box-shadow: 0 2px 8px rgba(18, 75, 126, 0.3);
}

.admin-nav-pills .nav-link .badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
}

.admin-nav-pills .nav-link.loading {
    position: relative;
    pointer-events: none;
}

.admin-nav-pills .nav-link.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 1rem;
    width: 12px;
    height: 12px;
    margin-top: -6px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Admin Tab Content */
.admin-tab-content {
    min-height: 400px;
}

/* Admin Section Cards */
.admin-section-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 2rem;
}

.admin-section-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: 0;
    flex: 1;
}

.admin-section-badge {
    background: var(--primary-blue);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.admin-section-badge-warning {
    background: #ffc107;
    color: var(--dark-gray);
}

.admin-section-badge-info {
    background: var(--info);
}

.admin-section-body {
    padding: 2rem;
}

/* Admin Tables */
.admin-table-container {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.admin-table {
    margin-bottom: 0;
    background: white;
}

.admin-table thead th {
    background: var(--primary-blue);
    color: white;
    font-weight: 600;
    border: none;
    padding: 1rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-table-row {
    transition: all 0.2s ease;
}

.admin-table-row:hover {
    background: rgba(18, 75, 126, 0.02);
}

.admin-table-row.expired-row {
    background: rgba(108, 117, 125, 0.1);
    opacity: 0.7;
}

.admin-table td {
    padding: 1rem;
    vertical-align: middle;
    border-color: var(--border-light);
}

/* User Info in Tables */
.user-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.user-name {
    font-weight: 600;
    color: var(--dark-gray);
    font-size: 0.95rem;
}

.user-email {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.request-reason {
    font-size: 0.8rem;
    color: var(--info);
    margin-top: 0.25rem;
}

/* User Type Badges */
.user-type-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.user-type-docente {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.user-type-studente {
    background: rgba(23, 162, 184, 0.1);
    color: var(--info);
}

.user-type-rappresentante {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

/* Request Details */
.request-date {
    font-weight: 500;
    color: var(--dark-gray);
}

.request-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-item {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Schedule Info */
.schedule-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.schedule-date {
    font-weight: 600;
    color: var(--dark-gray);
}

.schedule-day {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

.schedule-type-badge {
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.schedule-type-rimuovi {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger);
}

.schedule-type-aggiungi {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.schedule-type-modifica {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

/* Schedule Time */
.schedule-time {
    font-weight: 500;
}

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

.time-modified {
    color: var(--primary-blue);
    font-weight: 600;
}

.time-added {
    color: var(--success);
    font-weight: 600;
}

/* Urgency Badges */
.urgency-badge .badge {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.urgency-expired {
    background: var(--dark-gray) !important;
}

.urgency-today {
    background: var(--danger) !important;
    animation: pulse 2s infinite;
}

.urgency-tomorrow {
    background: var(--danger) !important;
}

.urgency-critical {
    background: var(--danger) !important;
}

.urgency-warning {
    background: var(--warning) !important;
    color: var(--dark-gray) !important;
}

.urgency-normal {
    background: var(--success) !important;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.action-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--success);
    margin-bottom: 1rem;
}

.empty-state-title {
    color: var(--dark-gray);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state-text {
    color: var(--text-muted);
    margin-bottom: 0;
}

/* Info Form */
.info-form-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.info-form-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: 1rem;
}

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

.info-form .form-control,
.info-form .form-select {
    border-radius: 8px;
    border: 2px solid var(--border-light);
    padding: 0.75rem;
    transition: all 0.3s ease;
}

.info-form .form-control:focus,
.info-form .form-select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 0.2rem rgba(18, 75, 126, 0.15);
}

/* Info Tabs */
.info-tabs-container {
    margin-top: 2rem;
}

.info-nav-tabs {
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 1.5rem;
}

.info-nav-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.info-nav-tabs .nav-link:hover {
    border-bottom-color: var(--primary-blue-light);
    color: var(--primary-blue);
}

.info-nav-tabs .nav-link.active {
    border-bottom-color: var(--primary-blue);
    color: var(--primary-blue);
    background: none;
}

.info-tab-content {
    min-height: 300px;
}

/* Management Cards */
.management-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    height: 100%;
}

.management-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-light);
}

/* Management Actions */
.management-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.management-action-btn {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: white;
    border: 2px solid var(--border-light);
    border-radius: 12px;
    text-decoration: none;
    color: var(--dark-gray);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.management-action-btn:hover {
    border-color: var(--primary-blue);
    background: rgba(18, 75, 126, 0.02);
    color: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(18, 75, 126, 0.1);
}

.action-icon {
    width: 50px;
    height: 50px;
    background: rgba(18, 75, 126, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--primary-blue);
    margin-right: 1rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.management-action-btn:hover .action-icon {
    background: var(--primary-blue);
    color: white;
}

.action-content {
    flex: 1;
    text-align: left;
}

.action-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.action-description {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

.action-badge {
    margin-top: 0.25rem;
}

.action-arrow {
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.management-action-btn:hover .action-arrow {
    color: var(--primary-blue);
    transform: translateX(4px);
}

/* System Settings */
.system-settings {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(18, 75, 126, 0.02);
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

.setting-info {
    flex: 1;
}

.setting-title {
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: 0.25rem;
}

.setting-description {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

.setting-control {
    margin-left: 1rem;
}

.setting-control .form-check-input {
    width: 3rem;
    height: 1.5rem;
}

.setting-control .form-check-input:checked {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
}

/* Responsive Design for Admin Dashboard */
@media (max-width: 768px) {
    .admin-header-card {
        padding: 1.5rem;
        text-align: center;
    }

    .admin-title {
        font-size: 2rem;
    }

    .stat-card-body {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }

    /* Nuovi stili responsive per statistiche moderne */
    .stats-section-title {
        font-size: 1.25rem;
        text-align: center;
    }

    .stats-section-subtitle {
        text-align: center;
        font-size: 0.9rem;
    }

    .modern-stat-card {
        padding: 1.25rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .stat-icon-wrapper {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    /* Tab responsive */
    .admin-tabs-header {
        margin-bottom: 1.5rem;
    }

    .admin-tabs-title {
        font-size: 1.5rem;
    }

    .admin-tabs-subtitle {
        font-size: 1rem;
    }

    .admin-nav-pills {
        flex-direction: column;
        gap: 0.25rem;
    }

    .admin-nav-pills .nav-link {
        text-align: left;
        padding: 1rem;
    }

    .tab-content-wrapper {
        justify-content: flex-start;
    }

    .tab-text {
        align-items: flex-start;
    }

    .admin-section-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .admin-section-body {
        padding: 1rem;
    }

    .admin-table-container {
        overflow-x: auto;
    }

    .action-buttons {
        flex-direction: column;
    }

    .management-action-btn {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }

    .action-icon {
        margin-right: 0;
    }

    .setting-item {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }

    .setting-control {
        margin-left: 0;
    }

    /* Contenitori scrollabili responsive */
    .scrollable-table-container {
        max-height: 350px;
    }

    .scrollable-notifications-container {
        max-height: 300px;
    }

    /* Scrollbar più sottile su mobile */
    .scrollable-table-container::-webkit-scrollbar,
    .scrollable-notifications-container::-webkit-scrollbar {
        width: 4px;
    }

    /* Pagine admin responsive */
    .admin-page-header {
        padding: 1.5rem;
        text-align: center;
    }

    .admin-page-title {
        font-size: 1.5rem;
    }

    .admin-page-subtitle {
        font-size: 1rem;
    }

    .admin-page-actions {
        flex-direction: column;
        gap: 1rem;
        margin-top: 1rem;
    }

    .stats-badge-group {
        flex-direction: column;
        gap: 0.5rem;
    }

    .stats-badge-item {
        text-align: center;
    }

    /* Cards responsive */
    .admin-quick-actions-card .card-body,
    .admin-filters-card .card-body,
    .admin-chart-card .card-body,
    .admin-details-card .card-body {
        padding: 1.5rem;
    }

    .admin-users-header,
    .admin-stats-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .admin-users-body,
    .admin-stats-body {
        padding: 1rem;
    }

    /* Contenitori scrollabili responsive */
    .scrollable-users-container {
        max-height: 300px;
    }

    .scrollable-users-container.large {
        max-height: 350px;
    }

    .scrollable-stats-container {
        max-height: 250px;
    }

    /* Scrollbar più sottile su mobile */
    .scrollable-users-container::-webkit-scrollbar,
    .scrollable-stats-container::-webkit-scrollbar {
        width: 4px;
    }

    /* Stats link responsive */
    .stats-link {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .stats-value {
        margin-left: 0;
    }

    /* Table details responsive */
    .date-info,
    .teacher-info,
    .student-info {
        text-align: center;
    }

    .time-badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    /* Header grafici responsive */
    .chart-header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .chart-title-section {
        text-align: left;
        width: 100%;
    }

    /* Controlli grafici responsive */
    .chart-controls {
        flex-direction: row;
        gap: 1rem;
        align-items: center;
        width: 100%;
        justify-content: flex-start;
    }

    .chart-controls .form-check-label {
        font-size: 0.85rem;
    }

    .legend-color {
        width: 14px;
        height: 14px;
    }

    /* Sezione argomenti responsive */
    .topics-header {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1.5rem;
    }

    .topics-summary {
        gap: 1rem;
        justify-content: center;
    }

    .summary-item {
        padding: 0.75rem;
        min-width: 70px;
    }

    .summary-number {
        font-size: 1.5rem;
    }

    .topics-content {
        padding: 1.5rem;
    }

    .topics-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .topic-card {
        padding: 1.25rem;
    }

    .topic-header {
        gap: 0.75rem;
    }

    .topic-icon {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .topic-name {
        font-size: 1rem;
    }

    .topics-main-title {
        font-size: 1.25rem;
    }

    .topics-empty-state {
        padding: 3rem 1.5rem;
    }

    .empty-icon {
        font-size: 3rem;
    }
}

/* Notifica Cards */
.notifica-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.notifica-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.notifica-header {
    padding: 1rem 1.25rem 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
}

.notifica-type-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.notifica-type-info {
    background: rgba(23, 162, 184, 0.1);
    color: var(--info);
}

.notifica-type-warning {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.notifica-type-success {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.notifica-type-danger {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger);
}

.notifica-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.notifica-content {
    padding: 1rem 1.25rem;
    flex: 1;
}

.notifica-text {
    margin-bottom: 0;
    color: var(--dark-gray);
    line-height: 1.5;
}

.notifica-actions {
    padding: 0.75rem 1.25rem;
    background: rgba(248, 249, 250, 0.5);
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notifica-toggle .form-check-input {
    width: 2.5rem;
    height: 1.25rem;
}

.notifica-toggle .form-check-input:checked {
    background-color: var(--success);
    border-color: var(--success);
}

.notifica-toggle .form-check-label {
    font-size: 0.85rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

.notifica-delete-btn {
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.notifica-delete-btn:hover {
    transform: scale(1.05);
}

/* Accessibility Improvements */
.btn:focus,
.form-control:focus,
.user-type-card:focus {
    outline: 3px solid var(--primary-blue);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border-width: 3px;
    }

    .btn {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-blue);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

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

/* Utility Classes */
.text-muted-light {
    color: #6c757d !important;
}

.bg-light-blue {
    background-color: rgba(18, 75, 126, 0.1) !important;
}

.border-primary-blue {
    border-color: var(--primary-blue) !important;
}

/* ===== NUOVI STILI DASHBOARD ADMIN MIGLIORATA ===== */

/* Sezione Statistiche Migliorata */
.stats-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-gray);
    margin-bottom: 0.5rem;
}

.stats-section-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 0;
}

/* Modern Stat Cards */
.modern-stat-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.modern-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* Bordi colorati usando border-top invece di pseudo-elementi */
.modern-stat-card {
    border-top: 4px solid var(--primary-blue);
}

.stat-users {
    border-top-color: #4f46e5;
}

.stat-pending {
    border-top-color: #f59e0b;
}

.stat-teachers {
    border-top-color: #10b981;
}

.stat-students {
    border-top-color: #3b82f6;
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.stat-icon-wrapper {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-users .stat-icon-wrapper { background: linear-gradient(135deg, #4f46e5, #7c3aed); }
.stat-pending .stat-icon-wrapper { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.stat-teachers .stat-icon-wrapper { background: linear-gradient(135deg, #10b981, #059669); }
.stat-students .stat-icon-wrapper { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }

.stat-trend, .stat-alert {
    font-size: 1.2rem;
}

.stat-trend { color: #10b981; }
.stat-alert { color: #ef4444; }

.stat-card-content {
    margin-bottom: 1rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--dark-gray);
    margin-bottom: 0.25rem;
    line-height: 1;
}

.stat-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.stat-description {
    margin-bottom: 0;
}

.stat-card-footer {
    margin-top: 1rem;
}

.stat-progress {
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.stat-progress .progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-blue), var(--primary-blue-light));
    border-radius: 2px;
    transition: width 0.6s ease;
}

.stat-users .stat-progress .progress-bar { background: linear-gradient(90deg, #4f46e5, #7c3aed); }
.stat-pending .stat-progress .progress-bar { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.stat-teachers .stat-progress .progress-bar { background: linear-gradient(90deg, #10b981, #059669); }
.stat-students .stat-progress .progress-bar { background: linear-gradient(90deg, #3b82f6, #1d4ed8); }

/* Tab Header Migliorato */
.admin-tabs-header {
    text-align: center;
    margin-bottom: 2rem;
}

.admin-tabs-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark-gray);
    margin-bottom: 0.5rem;
}

.admin-tabs-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 0;
}

/* Tab Content Wrapper */
.tab-content-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.25rem 0;
}

.tab-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.tab-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
}

.tab-title {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2;
}

.tab-subtitle {
    font-size: 0.75rem;
    opacity: 0.8;
    line-height: 1;
    margin-top: 2px;
}

.tab-badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    flex-shrink: 0;
}

/* Sistema Status */
.system-status-info {
    padding: 0.5rem 0;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.status-item:last-child {
    border-bottom: none;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-indicator.status-online {
    background: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.status-indicator.status-warning {
    background: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.status-indicator.status-error {
    background: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.status-details {
    flex: 1;
}

.status-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--dark-gray);
    margin-bottom: 2px;
}

.status-description {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ===== CONTENITORI SCROLLABILI ===== */

/* Contenitore scrollabile per tabelle */
.scrollable-table-container {
    max-height: 500px;
    overflow-y: auto;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: white;
}

.scrollable-table-container::-webkit-scrollbar {
    width: 8px;
}

.scrollable-table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.scrollable-table-container::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 4px;
    opacity: 0.7;
}

.scrollable-table-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-blue-dark);
    opacity: 1;
}

/* Contenitore scrollabile per notifiche */
.scrollable-notifications-container {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
}

.scrollable-notifications-container::-webkit-scrollbar {
    width: 6px;
}

.scrollable-notifications-container::-webkit-scrollbar-track {
    background: transparent;
}

.scrollable-notifications-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.scrollable-notifications-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.4);
}

/* Sticky header per tabelle scrollabili */
.scrollable-table-container .admin-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Pseudo-elementi rimossi per evitare bug della riga bianca */

/* ===== STILI PAGINE ADMIN MIGLIORATI ===== */

/* Header pagine admin */
.admin-page-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.admin-page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-gray);
    margin-bottom: 0.5rem;
}

.admin-page-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 0;
}

.admin-page-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Stats badge group */
.stats-badge-group {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.stats-badge-item {
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--dark-gray);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Card migliorati */
.admin-quick-actions-card,
.admin-filters-card,
.admin-chart-card,
.admin-details-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.admin-quick-actions-card .card-header,
.admin-filters-card .card-header,
.admin-chart-card .card-header,
.admin-details-card .card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-quick-actions-card .card-body,
.admin-filters-card .card-body,
.admin-chart-card .card-body,
.admin-details-card .card-body {
    padding: 2rem;
}

/* Users cards */
.admin-users-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
    height: 100%;
}

.admin-users-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-users-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: 0;
}

.admin-users-count {
    background: var(--primary-blue);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.admin-users-body {
    padding: 1.5rem;
    height: calc(100% - 80px);
    display: flex;
    flex-direction: column;
}

/* Contenitori scrollabili per utenti */
.scrollable-users-container {
    max-height: 400px;
    overflow-y: auto;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.scrollable-users-container.large {
    max-height: 500px;
}

.scrollable-users-container::-webkit-scrollbar {
    width: 8px;
}

.scrollable-users-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.scrollable-users-container::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 4px;
    opacity: 0.7;
}

.scrollable-users-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-blue-dark);
    opacity: 1;
}

/* Tabella utenti */
.admin-users-table {
    margin-bottom: 0;
    background: white;
}

.admin-users-table thead th {
    background: var(--primary-blue);
    color: white;
    font-weight: 600;
    border: none;
    padding: 1rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.admin-users-table td {
    padding: 1rem;
    vertical-align: middle;
    border-color: rgba(0, 0, 0, 0.05);
}

/* User info styles */
.user-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.user-name {
    font-weight: 600;
    color: var(--dark-gray);
    font-size: 0.95rem;
}

.user-type,
.user-email {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.user-email {
    font-family: monospace;
}

/* Status badges */
.user-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-active {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.status-inactive {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.status-deleted {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

/* Class badges */
.class-badge {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--primary-blue);
    color: white;
}

.class-badge.no-class {
    background: #6b7280;
}

/* Empty states */
.empty-users-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-users-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-users-state p {
    margin-bottom: 0;
    font-size: 1.1rem;
}

/* Stats cards */
.admin-stats-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
    height: 100%;
}

.admin-stats-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-stats-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: 0;
}

.admin-stats-body {
    padding: 1.5rem;
    height: calc(100% - 80px);
    display: flex;
    flex-direction: column;
}

/* Contenitori scrollabili per statistiche */
.scrollable-stats-container {
    max-height: 350px;
    overflow-y: auto;
    flex: 1;
}

.scrollable-stats-container::-webkit-scrollbar {
    width: 6px;
}

.scrollable-stats-container::-webkit-scrollbar-track {
    background: transparent;
}

.scrollable-stats-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.scrollable-stats-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.4);
}

/* Stats list */
.stats-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.stats-item {
    margin-bottom: 0.5rem;
}

.stats-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.stats-link:hover {
    background: #e9ecef;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    color: inherit;
}

.stats-info {
    flex: 1;
}

.stats-name {
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: 0.25rem;
}

.stats-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.stats-value {
    margin-left: 1rem;
}

.stats-badge {
    background: var(--primary-blue);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Empty stats state */
.empty-stats-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.empty-stats-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-stats-state p {
    margin-bottom: 0;
    font-size: 1.1rem;
}

/* Dettagli tabelle */
.date-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.date-main {
    font-weight: 600;
    color: var(--dark-gray);
}

.date-day {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

.time-badge {
    background: #e9ecef;
    color: var(--dark-gray);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: monospace;
}

.teacher-info,
.student-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.teacher-name,
.student-name {
    font-weight: 600;
    color: var(--dark-gray);
    font-size: 0.95rem;
}

.teacher-type,
.student-type {
    font-size: 0.8rem;
    color: var(--text-muted);
}

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

/* Presence badges */
.presence-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.presence-presente {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.presence-assente {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.presence-unknown {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

/* Stats metrics per media/mediana */
.stats-metrics {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
}

.metric-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 60px;
}

.metric-item small {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.metric-item strong {
    font-size: 1.1rem;
    color: var(--primary-blue);
    font-weight: 700;
}

/* Miglioramenti per i riquadri Media/Mediana */
.stats-metrics {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    align-items: center;
}

.metric-item {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid rgba(18, 75, 126, 0.1);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    min-width: 65px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.metric-item:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: rgba(18, 75, 126, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.metric-item small {
    font-size: 0.65rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
    margin-bottom: 0;
    margin-right: 0.25rem;
    white-space: nowrap;
}

.metric-item strong {
    font-size: 1.1rem;
    color: var(--primary-blue);
    font-weight: 700;
    white-space: nowrap;
}

/* Miglioramenti per gli stats-item nelle sezioni media/mediana */
.stats-item .stats-info .stats-name {
    font-weight: 600;
    color: var(--dark-gray);
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.stats-item .stats-meta {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
}

.stats-item .stats-meta i {
    color: var(--primary-blue);
    opacity: 0.7;
}

/* Hover effects per stats-item */
.stats-item {
    background: white;
    border: 1px solid #f1f3f4;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

.stats-item:hover {
    background: #f8f9fa;
    border-color: rgba(18, 75, 126, 0.15);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.stats-item:last-child {
    margin-bottom: 0;
}

/* Header grafici migliorato */
.chart-header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    width: 100%;
}

.chart-title-section {
    flex: 1;
}

.chart-title-section h5 {
    color: var(--dark-gray);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.chart-title-section small {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Controlli grafici */
.chart-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-shrink: 0;
}

.chart-controls .form-check {
    margin-bottom: 0;
}

.chart-controls .form-check-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--dark-gray); /* Colore scuro per leggibilità */
    padding: 0.25rem 0;
}

.legend-color {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.form-check-input:checked + .form-check-label .legend-color {
    opacity: 1;
}

.form-check-input:not(:checked) + .form-check-label .legend-color {
    opacity: 0.3;
}

.form-check-input:not(:checked) + .form-check-label {
    opacity: 0.6;
}

/* ===== SEZIONE ARGOMENTI MIGLIORATA ===== */

.topics-analytics-section {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-top: 2rem;
}

.topics-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
}

.topics-title-group {
    flex: 1;
}

.topics-main-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-gray);
    margin-bottom: 0.5rem;
}

.topics-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 0;
}

.topics-summary {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.summary-item {
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-width: 80px;
}

.summary-number {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary-blue);
    line-height: 1;
}

.summary-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

.topics-content {
    padding: 2rem;
}

.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.topic-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.topic-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    background: white;
}

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

.topic-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-blue);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.topic-info {
    flex: 1;
}

.topic-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.topic-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topic-count {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.topic-percentage {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-blue);
}

.topic-progress {
    margin: 1rem 0;
}

.progress-track {
    height: 6px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-blue), var(--primary-blue-light));
    border-radius: 3px;
    transition: width 0.6s ease;
}

.topic-footer {
    display: flex;
    justify-content: center;
}

.topic-rank {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.rank-text {
    font-style: italic;
}

/* Empty state per argomenti */
.topics-empty-state {
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.3;
}

.empty-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: 1rem;
}

.empty-description {
    font-size: 1rem;
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Azione pericolosa reset piattaforma */
.danger-action {
    border: 2px solid #dc3545 !important;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe6e6 100%) !important;
    cursor: pointer;
}

.danger-action:hover {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%) !important;
    border-color: #c82333 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.2);
}

.danger-action .action-icon {
    background: #dc3545;
    color: white;
}

.danger-action .action-title {
    color: #dc3545;
    font-weight: 700;
}

.danger-action .action-description {
    color: #721c24;
    font-weight: 500;
}

.danger-action .action-arrow {
    color: #dc3545;
}

/* Print Styles */
@media print {
    .navbar,
    footer,
    .btn {
        display: none !important;
    }

    body {
        padding-top: 0;
        font-size: 12pt;
        color: black;
        background: white;
    }

    .card {
        border: 1px solid black;
        box-shadow: none;
    }
}
