:root {
    --primary: #0a2f44;      /* Blu petrolio - colore principale */
    --primary-light: #1e4a66;
    --accent: #00b894;        /* Verde menta per accenti */
    --bg-light: #f8fafc;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    margin: 0;
    padding: 0;
}

header {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: var(--shadow);
}

header h1 {
    margin: 0;
    font-size: 2.5rem;
}

header p {
    margin: 0.5rem 0 0;
    opacity: 0.9;
}

.courses {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    padding: 3rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.course-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 16px;
    width: 320px;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(0,0,0,0.05);
}

.course-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}

.course-card h2 {
    color: var(--primary);
    margin-top: 0;
    font-size: 1.4rem;
}

.course-card a {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.6rem 1.2rem;
    background-color: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.course-card a:hover {
    background-color: var(--primary-light);
}

footer {
    text-align: center;
    padding: 2rem;
    background-color: var(--white);
    color: var(--text-light);
    border-top: 1px solid #e2e8f0;
}

.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-light);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background-color: var(--primary);
    color: white;
}

:root {
    --primary: #0a2f44;
    --primary-light: #1e4a66;
    --primary-gradient: linear-gradient(135deg, #0a2f44 0%, #1e4a66 100%);
    --accent: #00b894;
    --accent-light: #6c5ce7;
    --accent-gradient: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
    --bg-dark: #0f172a;
    --bg-card: #ffffff;
    --bg-sidebar: #1e293b;
    --text-light: #f8fafc;
    --text-dark: #1e293b;
    --text-muted: #94a3b8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --border-light: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-dark);
    min-height: 100vh;
}

/* HEADER AGGIORNATO */
header {
    background: var(--primary-gradient);
    color: white;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.1" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,154.7C960,171,1056,181,1152,165.3C1248,149,1344,107,1392,85.3L1440,64L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    background-size: cover;
    opacity: 0.1;
    pointer-events: none;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
    position: relative;
}

/* DASHBOARD LAYOUT */
.dashboard-container {
    display: flex;
    min-height: calc(100vh - 160px);
    background: #f1f5f9;
}

/* SIDEBAR */
.sidebar {
    width: 280px;
    background: var(--bg-sidebar);
    color: var(--text-light);
    box-shadow: var(--shadow-xl);
    position: relative;
    z-index: 10;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.25rem;
}

.sidebar-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.sidebar-nav {
    padding: 1.5rem 0;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 0.5rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
    gap: 0.75rem;
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left: 4px solid var(--accent);
}

.sidebar-nav a.active {
    background: rgba(255,255,255,0.15);
    color: white;
    border-left: 4px solid var(--accent);
}

.sidebar-nav i {
    width: 24px;
    font-size: 1.2rem;
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    padding: 2rem;
    background: #f8fafc;
    overflow-y: auto;
}

.content-header {
    margin-bottom: 2rem;
}

.content-header h2 {
    font-size: 2rem;
    color: var(--primary);
    font-weight: 700;
}

.content-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* CARDS MODERNE */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent-gradient);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.stat-icon i {
    font-size: 1.5rem;
    color: white;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0.5rem 0;
}

.stat-change {
    font-size: 0.9rem;
    color: var(--success);
}

.stat-change.negative {
    color: var(--danger);
}

/* CARDS CORSI/ROBOTS */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.card-item {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.05);
}

.card-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.card-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
}

.card-header h3 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.card-header p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.card-body {
    padding: 1.5rem;
}

.card-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.card-info-item {
    text-align: center;
}

.card-info-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.card-info-value {
    font-weight: 600;
    color: var(--primary);
}

.card-footer {
    padding: 1rem 1.5rem;
    background: #f8fafc;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-card {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
    text-decoration: none;
    font-size: 0.9rem;
}

.btn-card:hover {
    background: var(--primary);
    color: white;
}

/* PROFILO UTENTE */
.profile-section {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-light);
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    font-weight: 600;
}

.profile-info h3 {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.profile-info p {
    color: var(--text-muted);
}

.profile-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 12px;
}

.detail-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.detail-content label {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
}

.detail-content span {
    font-weight: 600;
    color: var(--text-dark);
}

/* BOTTONI */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(10, 47, 68, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(10, 47, 68, 0.4);
}

.btn-accent {
    background: var(--accent-gradient);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

/* TABELLE */
.table-container {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1rem;
    background: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
}

tr:hover td {
    background: #f8fafc;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fed7aa;
    color: #92400e;
}

/* FOOTER */
footer {
    background: var(--primary);
    color: white;
    text-align: center;
    padding: 1.5rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .profile-details {
        grid-template-columns: 1fr;
    }
}

/* ANIMAZIONI */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* STRUTTURA PER FOOTER SEMPRE IN FONDO */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    flex-shrink: 0;
}

.dashboard-container {
    flex: 1 0 auto;
    display: flex;
    min-height: 0;  /* Importante per flexbox */
}

.main-content {
    flex: 1;
    overflow-y: auto;
}

footer {
    flex-shrink: 0;
    background: var(--primary);
    color: white;
    text-align: center;
    padding: 1.5rem;
    font-size: 0.9rem;
    opacity: 0.9;
    width: 100%;
    margin-top: auto;  /* Spinge il footer in fondo */
}