:root {
    --primary-color: #FFB020;
    --primary-dark: #e69d1a;
    --primary-light: #ffc24d;
    --secondary-color: #9AA7B2;
    --success-color: #2EE59D;
    --danger-color: #ef4444;
    --warning-color: #FFB020;
    --info-color: #2EE59D;
    --background: #0B0F1A;
    --surface: #121A2A;
    --surface-elevated: #1a2435;
    --border: #1a2435;
    --border-light: #121A2A;
    --text-primary: #E7EEF8;
    --text-secondary: #E7EEF8;
    --text-muted: #9AA7B2;
    --sidebar-width: 260px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    position: relative;
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.sidebar-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    letter-spacing: -0.02em;
}

.sidebar-header h3 i {
    font-size: 1.5rem;
    background: linear-gradient(135deg, #FFB020, #ffc24d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar.collapsed + .main-content {
    margin-left: 0;
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1.5rem;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
    font-weight: 500;
    margin: 0.25rem 0.75rem;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 176, 32, 0.2), rgba(255, 194, 77, 0.2));
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

.nav-item:hover::before,
.nav-item.active::before {
    width: 100%;
}

.nav-item:hover {
    color: white;
    transform: translateX(4px);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(255, 176, 32, 0.15), rgba(255, 194, 77, 0.1));
    color: white;
    border-left-color: #FFB020;
    box-shadow: 0 2px 8px rgba(255, 176, 32, 0.2);
}

.nav-item i {
    font-size: 1.3rem;
    position: relative;
    z-index: 1;
}

.nav-item span {
    position: relative;
    z-index: 1;
}

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.content-header {
    background: var(--surface);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 72px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
}

.content-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: -0.02em;
}

.content-header h1 i {
    font-size: 1.75rem;
    color: var(--primary-color);
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.header-actions .btn {
    height: auto;
    padding: 0.75rem 1.5rem;
    display: inline-flex;
    align-items: center;
}

.account-select {
    min-width: 250px;
    max-width: 300px;
    background-color: var(--surface);
    color: var(--text-primary);
    border: 2px solid var(--border);
    padding: 0.75rem 1rem;
    height: auto;
    line-height: 1.5;
}

.account-select:focus {
    background-color: var(--surface);
    color: var(--text-primary);
    border-color: var(--primary-color);
}

.account-select option {
    background-color: var(--surface);
    color: var(--text-primary);
}

.user-menu {
    display: flex;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
}

.logout-form {
    margin: 0;
}

.auth-links {
    display: flex;
    gap: 0.75rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: var(--background);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 176, 32, 0.3);
}

.btn-outline-secondary {
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
    background: transparent;
}

.btn-outline-secondary:hover {
    background: var(--secondary-color);
    color: white;
}

.sidebar-toggle-floating {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: white;
    border: none;
    padding: 1rem 0.75rem;
    border-radius: 0 12px 12px 0;
    cursor: pointer;
    z-index: 999;
    box-shadow: var(--shadow-xl);
    display: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-toggle-floating:hover {
    background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
    transform: translateY(-50%) scale(1.05);
}

.sidebar-toggle-floating i {
    font-size: 1.25rem;
}

/* Menu Grid */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem;
}

.menu-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.menu-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #FFB020, #ffc24d);
    transform: scaleX(0);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-card:hover::before {
    transform: scaleX(1);
}

.menu-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.card-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #FFB020, #ffc24d);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 16px rgba(255, 176, 32, 0.3);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-card:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
}

.card-icon i {
    font-size: 2.25rem;
    color: white;
}

.menu-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.menu-card p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

/* Login/Register Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Allineato allo sfondo generale dell'app */
    background: var(--background);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.auth-container::before {
    /* Disabilitato effetto pattern per la pagina di login/register */
    content: none;
}

@keyframes move {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.auth-card {
    /* Card pienamente bianca per massima leggibilità */
    background: #ffffff;
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    padding: 3rem;
    width: 100%;
    max-width: 450px;
    position: relative;
    z-index: 1;
    backdrop-filter: none;
}

.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-header h1 {
    font-size: 2.25rem;
    font-weight: 800;
    /* Testo molto scuro su sfondo bianco */
    color: #111827;
    margin-bottom: 0.75rem;
    letter-spacing: -0.03em;
}

.auth-header p {
    color: #4b5563;
    font-size: 1.05rem;
}

/* Input e testo all'interno della card auth: colori scuri su sfondo bianco */
.auth-card .form-control {
    background-color: #ffffff;
    color: #111827;
    border-color: #d1d5db;
}

.auth-card .form-control::placeholder {
    color: #9ca3af;
}

.auth-card .form-check-input {
    accent-color: var(--primary-color);
    background-color: #ffffff;
    border-color: #d1d5db;
}

.auth-card .form-label,
.auth-card .form-check-label,
.auth-card p {
    color: #374151;
}

.auth-card a.btn-link {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

.auth-card a.btn-link:hover {
    text-decoration: underline;
}
.form-group {
    margin-bottom: 1.75rem;
}

.form-label {
    display: block;
    margin-bottom: 0.625rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1.25rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--surface);
    color: var(--text-primary);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    background-color: var(--surface);
    color: var(--text-primary);
}

select.form-control option {
    background-color: var(--surface);
    color: var(--text-primary);
}

textarea.form-control {
    background-color: var(--surface);
    color: var(--text-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(255, 176, 32, 0.1);
    transform: translateY(-2px);
}

.btn {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, #FFB020, #ffc24d);
    color: var(--background);
    width: 100%;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(255, 176, 32, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 176, 32, 0.4);
}

.btn-link {
    background: none;
    color: var(--primary-color);
    text-decoration: none;
    padding: 0;
    font-weight: 600;
}

.btn-link:hover {
    color: var(--primary-dark);
}

.text-danger {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: block;
    font-weight: 500;
}

.text-center {
    text-align: center;
}

.mt-3 {
    margin-top: 1rem;
}

/* Navbar adjustments for dashboard */
.navbar {
    display: none;
}

/* Footer */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 1.5rem 2rem;
    text-align: center;
    color: var(--text-secondary);
    margin-left: var(--sidebar-width);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .main-content {
        margin-left: 0;
    }

    .menu-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 1.5rem;
    }

    .content-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .sidebar-toggle-floating {
        display: block;
    }
}
