/* Life Manager - Neon Green on Graphite | Glass UI */

:root {
    /* ===== BRAND: NEON GREEN ===== */
    --primary: #00ff88;
    --primary-dark: #00cc6d;
    --primary-light: #7dffc0;
    --primary-glow: rgba(0, 255, 136, 0.32);
    --primary-soft: rgba(0, 255, 136, 0.10);
    --primary-contrast: #04140c;

    --accent: #00e5c0;
    --accent-glow: rgba(0, 229, 192, 0.28);

    /* ===== SEMANTIC ===== */
    --success: #00ff88;
    --success-glow: rgba(0, 255, 136, 0.22);
    --danger: #ff4d6d;
    --danger-glow: rgba(255, 77, 109, 0.22);
    --warning: #ffb020;
    --info: #38bdf8;

    /* ===== GRAPHITE SURFACES ===== */
    --bg-dark: #0a0b0b;
    --bg-primary: #101211;
    --bg-card: #181a19;
    --bg-card-hover: #202322;
    --bg-elevated: #262a28;
    --bg-input: #1b1e1d;

    /* ===== GLASS ===== */
    --glass-bg: rgba(24, 26, 25, 0.72);
    --glass-bg-strong: rgba(20, 22, 21, 0.86);
    --glass-border: rgba(255, 255, 255, 0.09);
    --glass-border-lit: rgba(0, 255, 136, 0.22);
    --glass-blur: blur(22px) saturate(160%);
    --glass-sheen: linear-gradient(160deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.02) 38%, rgba(255, 255, 255, 0) 65%);

    /* ===== TEXT ===== */
    --text-primary: #e9ecea;
    --text-secondary: #9aa39e;
    --text-muted: #6d7671;
    --text-dim: #4d5651;

    /* ===== BORDERS & SHADOWS ===== */
    --border-color: rgba(255, 255, 255, 0.07);
    --border-light: rgba(255, 255, 255, 0.12);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.45);
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 40px var(--primary-glow);

    /* ===== RADIUS ===== */
    --radius: 20px;
    --radius-sm: 14px;
    --radius-xs: 10px;
    --radius-full: 9999px;

    /* ===== LAYOUT ===== */
    --header-height: 64px;
    --bottom-nav-height: 80px;
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --sidebar-width: 250px;
    --content-max: 1240px;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}


* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    height: 100%;
    background: var(--bg-dark);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background:
        radial-gradient(ellipse 70% 55% at 12% 0%, rgba(0, 255, 136, 0.05) 0%, transparent 60%),
        radial-gradient(ellipse 55% 45% at 92% 12%, rgba(0, 229, 192, 0.03) 0%, transparent 62%),
        radial-gradient(ellipse 80% 40% at 50% 100%, rgba(0, 255, 136, 0.022) 0%, transparent 65%),
        var(--bg-primary);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100%;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== GLASSMORPHISM HEADER ===== */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    z-index: 100;
    padding: 0 20px;
    display: flex;
    align-items: center;
}

.header-content {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.02em;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.header-btn {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-xs);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
}

.header-btn:hover, .header-btn:active {
    background: var(--primary);
    color: var(--primary-contrast);
    border-color: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
    transform: scale(1.05);
}

/* ===== BOTTOM NAVIGATION - PREMIUM ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
    padding-bottom: var(--safe-area-bottom);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
}

.bottom-nav .nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
    text-decoration: none;
    color: var(--text-dim);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.bottom-nav .nav-item i {
    font-size: 1.6rem;
    margin-bottom: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bottom-nav .nav-item span {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    opacity: 0.8;
}

.bottom-nav .nav-item.active {
    color: var(--primary);
}

.bottom-nav .nav-item.active i {
    transform: scale(1.15) translateY(-2px);
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.bottom-nav .nav-item.active span {
    opacity: 1;
}

.bottom-nav .nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 0 0 4px 4px;
    box-shadow: 0 0 12px var(--primary-glow);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    min-height: 100vh;
    padding: 20px;
    background: transparent;
}

.main-content.authenticated {
    padding-top: calc(var(--header-height) + 20px);
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom) + 24px);
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    top: calc(var(--header-height) + 16px);
    left: 16px;
    right: 16px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.app-toast {
    padding: 16px 18px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 14px;
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-toast i {
    font-size: 1.3rem;
}

.app-toast.toast-success { border-left: 4px solid var(--success); }
.app-toast.toast-success i { color: var(--success); filter: drop-shadow(0 0 8px var(--success-glow)); }
.app-toast.toast-danger { border-left: 4px solid var(--danger); }
.app-toast.toast-danger i { color: var(--danger); filter: drop-shadow(0 0 8px var(--danger-glow)); }
.app-toast.toast-warning { border-left: 4px solid var(--warning); }
.app-toast.toast-warning i { color: var(--warning); }
.app-toast.toast-info { border-left: 4px solid var(--info); }
.app-toast.toast-info i { color: var(--info); }

@keyframes slideIn {
    from { transform: translateY(-30px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

/* ===== GLASS CARDS ===== */
.card {
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    margin-bottom: 18px;
    overflow: hidden;
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

/* riflesso obliquo: e' quello che fa leggere la superficie come vetro */
.card::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: var(--glass-sheen);
}

.card > * {
    position: relative;
    z-index: 1;
}

.card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 18px 20px;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.card-body {
    padding: 20px;
}

/* ===== PREMIUM BUTTONS ===== */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    padding: 14px 24px;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    font-size: 0.95rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--primary-contrast);
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover, .btn-primary:active {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--primary-glow);
    filter: brightness(1.1);
    color: var(--primary-contrast);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), var(--primary-dark));
    color: var(--primary-contrast);
    box-shadow: 0 4px 15px var(--success-glow);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
}

.btn-outline-primary {
    border: 2px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: var(--primary-contrast);
    box-shadow: 0 0 20px var(--primary-glow);
}

.btn-outline-secondary {
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    background: var(--bg-elevated);
}

.btn-outline-secondary:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.btn-light {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-light:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.btn-sm {
    padding: 10px 16px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 18px 32px;
    font-size: 1rem;
}

/* ===== FLOATING ACTION BUTTON ===== */
.fab {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom) + 20px);
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--primary-contrast);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: 0 8px 30px var(--primary-glow);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 50;
}

.fab:hover, .fab:active {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 12px 40px var(--primary-glow);
    color: var(--primary-contrast);
}

/* ===== PREMIUM FORMS ===== */
.form-control, .form-select {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    font-size: 1rem;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-control::placeholder {
    color: var(--text-dim);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
    background: var(--bg-elevated);
    outline: none;
}

.form-label {
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-size: 0.875rem;
    letter-spacing: 0.02em;
}

.form-check-input {
    width: 24px;
    height: 24px;
    background: var(--bg-input);
    border: 2px solid var(--border-light);
    border-radius: 6px;
    cursor: pointer;
}

.form-check-input:checked {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
}

.form-check-label {
    color: var(--text-secondary);
}

/* ===== STAT CARDS: VETRO CON ACCENTO NEON ===== */
.stat-card {
    position: relative;
    overflow: hidden;
    padding: 26px 28px;
    margin-bottom: 18px;
    border-radius: var(--radius);
    color: var(--text-primary);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* barra neon sul bordo sinistro: l'accento senza inondare di verde */
.stat-card::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--primary), var(--accent));
    box-shadow: 0 0 18px var(--primary-glow);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -60%;
    right: -25%;
    width: 70%;
    height: 180%;
    pointer-events: none;
    background: radial-gradient(circle, var(--primary-soft) 0%, transparent 68%);
}

.stat-card.warning::after { background: linear-gradient(180deg, var(--warning), #d97706); }
.stat-card.accent::after  { background: linear-gradient(180deg, var(--accent), var(--info)); }

.stat-card .stat-label {
    position: relative;
    z-index: 1;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.11em;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.stat-card .stat-value {
    position: relative;
    z-index: 1;
    font-size: 2.6rem;
    font-weight: 800;
    letter-spacing: -0.035em;
    color: var(--primary);
    text-shadow: 0 0 28px var(--primary-glow);
    font-variant-numeric: tabular-nums;
}

/* ===== PREMIUM LIST ITEMS ===== */
.list-item {
    display: flex;
    align-items: center;
    padding: 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.list-item:hover, .list-item:active {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
    transform: translateX(6px);
    box-shadow: var(--shadow);
    color: var(--text-primary);
}

.list-item-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--primary);
    margin-right: 16px;
    transition: all 0.3s;
}

.list-item:hover .list-item-icon {
    background: var(--primary);
    color: var(--primary-contrast);
    box-shadow: 0 0 20px var(--primary-glow);
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.list-item-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.list-item-value {
    font-weight: 700;
    font-size: 1.15rem;
}

.list-item-value.positive { color: var(--success); }
.list-item-value.negative { color: var(--danger); }

/* ===== PREMIUM BADGES ===== */
.badge {
    padding: 8px 14px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.badge-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s infinite;
}

.badge-online {
    color: var(--success);
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.badge-offline {
    color: var(--text-muted);
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
}
.badge-offline::before { animation: none; }
.badge-errore {
    color: var(--danger);
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.3);
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* ===== HABIT ITEMS ===== */
.habit-item {
    display: flex;
    align-items: center;
    padding: 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.habit-item:hover {
    border-color: var(--border-light);
}

.habit-checkbox {
    width: 30px;
    height: 30px;
    border: 2px solid var(--border-light);
    border-radius: 10px;
    margin-right: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    appearance: none;
    -webkit-appearance: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
}

.habit-checkbox:checked {
    background: linear-gradient(135deg, var(--success), var(--primary-dark));
    border-color: var(--success);
    box-shadow: 0 0 15px var(--success-glow);
}

.habit-checkbox:checked::after {
    content: '✓';
    color: var(--primary-contrast);
    font-size: 1.1rem;
    font-weight: bold;
}

.habit-item.completed {
    opacity: 0.5;
}

.habit-item.completed .habit-name {
    text-decoration: line-through;
    color: var(--text-muted);
}

/* ===== SECTION HEADER ===== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    margin-top: 8px;
}

.section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.01em;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 24px;
}

/* solo l'icona grande dello stato vuoto, non quelle dentro i pulsanti */
.empty-state > i {
    display: block;
    font-size: 4.5rem;
    color: var(--text-dim);
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
}

.empty-state h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-weight: 700;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 28px;
}

/* ===== PAGINA DI ACCESSO ===== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg-dark);
    position: relative;
    overflow: hidden;
}

.aurora-bg {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(ellipse 80% 50% at 20% 40%, rgba(0, 255, 136, 0.16) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 60%, rgba(0, 229, 192, 0.10) 0%, transparent 50%),
        radial-gradient(ellipse 50% 30% at 40% 80%, rgba(0, 229, 192, 0.05) 0%, transparent 50%);
    animation: aurora 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes aurora {
    0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
    25%      { transform: translate(-2%, 2%) rotate(45deg) scale(1.02); }
    50%      { transform: translate(-5%, -5%) rotate(90deg) scale(1.05); }
    75%      { transform: translate(2%, -2%) rotate(135deg) scale(1.02); }
}

/* Impianto: una colonna sul telefono, due sul desktop */
.login-split {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 460px;
    display: grid;
    gap: 40px;
    align-items: center;
}

/* Il pannello di presentazione ha senso solo dove c'e' spazio */
.login-hero { display: none; }

@keyframes cardAppear {
    from { opacity: 0; transform: translateY(26px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== LOGO ===== */
.login-logo {
    width: 76px;
    height: 76px;
    position: relative;
    margin-bottom: 26px;
}

.login-logo .logo-icon {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--radius-sm);
    display: grid;
    place-items: center;
    position: relative;
    z-index: 1;
    box-shadow: 0 8px 32px var(--primary-glow);
}

.login-logo .logo-icon i {
    font-size: 2.1rem;
    color: var(--primary-contrast);
}

.login-logo .logo-glow {
    position: absolute;
    inset: -8px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: calc(var(--radius-sm) + 8px);
    opacity: 0.4;
    filter: blur(20px);
    animation: logoGlow 3s ease-in-out infinite;
}

@keyframes logoGlow {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50%      { opacity: 0.6; transform: scale(1.1); }
}

.login-logo-sm {
    width: 52px;
    height: 52px;
    margin: 0 auto 18px;
}

.login-logo-sm .logo-icon i { font-size: 1.4rem; }

/* ===== TESTI DEL PANNELLO ===== */
.login-title {
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: -0.035em;
    color: var(--text-primary);
    margin: 0 0 12px;
}

.login-title span {
    font-weight: 300;
    color: var(--text-muted);
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.5;
    margin: 0 0 32px;
    max-width: 34ch;
}

.login-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login-features li {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.login-features i {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-xs);
    background: var(--primary-soft);
    border: 1px solid var(--glass-border-lit);
    color: var(--primary);
    font-size: 1rem;
}

/* ===== SCHEDA DEL MODULO ===== */
.login-card {
    width: 100%;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 36px 30px;
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    animation: cardAppear 0.55s var(--ease);
}

.login-card-head {
    text-align: center;
    margin-bottom: 28px;
}

.login-card-head h2 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin: 0 0 6px;
}

.login-card-head p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

.login-card .form-group { margin-bottom: 20px; }

.login-card .form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    margin-bottom: 8px;
}

.login-card .form-label i { color: var(--text-dim); }

.login-card .form-error {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.login-card .form-error::before {
    content: '!';
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    display: grid;
    place-items: center;
}

/* ===== PASSWORD: MOSTRA/NASCONDI E BLOC MAIUSC ===== */
.campo-password { position: relative; }

.campo-password .form-control { padding-right: 48px; }

.occhio {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: none;
    border-radius: var(--radius-xs);
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.occhio:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

.avviso-maiuscole {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 0.78rem;
    color: var(--warning);
    animation: fadeInUp 0.2s var(--ease);
}

.avviso-maiuscole[hidden] { display: none; }

/* ===== PULSANTE ===== */
.btn-glow { position: relative; overflow: hidden; }

.btn-glow::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.btn-glow:hover::before { transform: translateX(100%); }

.login-divider {
    display: flex;
    align-items: center;
    margin: 26px 0;
    color: var(--text-dim);
    font-size: 0.8rem;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.login-divider span { padding: 0 16px; }

.link-primary {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s var(--ease), text-shadow 0.3s var(--ease);
}

.link-primary:hover {
    color: var(--primary-light);
    text-shadow: 0 0 12px var(--primary-glow);
}

/* ===== DESKTOP: DUE COLONNE ===== */
@media (min-width: 900px) {
    .login-split {
        max-width: 940px;
        grid-template-columns: 1fr minmax(0, 400px);
        gap: 64px;
    }

    .login-hero {
        display: block;
        animation: cardAppear 0.55s var(--ease) 0.1s backwards;
    }

    /* sul desktop il logo grande sta nel pannello, non nella scheda */
    .login-card .login-logo-sm { display: none; }

    .login-card-head { text-align: left; }
}

/* ===== MODAL ===== */
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 22px 24px;
}

.modal-title {
    color: var(--text-primary);
    font-weight: 700;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 18px 24px;
}

.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
    opacity: 0.5;
}

.btn-close:hover {
    opacity: 1;
}

/* ===== CHARTS ===== */
.chart-container {
    position: relative;
    height: 200px;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

/* ===== UTILITIES ===== */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-info { color: var(--accent) !important; }

.bg-primary { background-color: var(--primary) !important; }
.bg-success { background-color: var(--success) !important; }
.bg-danger { background-color: var(--danger) !important; }
.bg-light { background-color: var(--bg-elevated) !important; color: var(--text-primary) !important; }

.rounded-lg { border-radius: var(--radius) !important; }

/* ===== TABLE ===== */
.table {
    color: var(--text-primary);
}

.table th {
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    border-bottom: 1px solid var(--border-color) !important;
    border-top: none !important;
    padding: 14px 12px;
}

.table td {
    vertical-align: middle;
    padding: 14px 12px;
    border-color: var(--border-color) !important;
}

.table-hover tbody tr:hover {
    background: var(--bg-card-hover);
}

/* ===== CODE BLOCKS ===== */
code, pre {
    background: var(--bg-dark) !important;
    color: var(--accent) !important;
    border-radius: var(--radius-xs);
}

pre {
    padding: 16px !important;
    border: 1px solid var(--border-color);
}

/* ===== ANIMAZIONI ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
    0%   { transform: scale(0.4); opacity: 0; }
    60%  { transform: scale(1.12); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes collapseOut {
    to { opacity: 0; transform: translateX(28px) scale(0.96); }
}

/* backwards: l'elemento resta invisibile PRIMA che parta il ritardo,
   altrimenti lampeggia e lo scaglionamento non si vede */
.card,
.list-item,
.stat-card,
.habit-item,
.task-item,
.mini-row,
.filter-chip {
    animation: fadeInUp 0.42s var(--ease) backwards;
}

/* Scaglionamento generico: vale per qualunque contenitore, non solo le liste */
.grid-auto > *:nth-child(1),  .kpi-row > *:nth-child(1)  { animation-delay: 0.02s; }
.grid-auto > *:nth-child(2),  .kpi-row > *:nth-child(2)  { animation-delay: 0.06s; }
.grid-auto > *:nth-child(3),  .kpi-row > *:nth-child(3)  { animation-delay: 0.10s; }
.grid-auto > *:nth-child(4)  { animation-delay: 0.14s; }
.grid-auto > *:nth-child(5)  { animation-delay: 0.18s; }
.grid-auto > *:nth-child(6)  { animation-delay: 0.22s; }
.grid-auto > *:nth-child(7)  { animation-delay: 0.26s; }
.grid-auto > *:nth-child(8)  { animation-delay: 0.30s; }
.grid-auto > *:nth-child(9)  { animation-delay: 0.34s; }
.grid-auto > *:nth-child(n+10) { animation-delay: 0.38s; }

.list-item:nth-child(1) { animation-delay: 0.04s; }
.list-item:nth-child(2) { animation-delay: 0.08s; }
.list-item:nth-child(3) { animation-delay: 0.12s; }
.list-item:nth-child(4) { animation-delay: 0.16s; }
.list-item:nth-child(5) { animation-delay: 0.20s; }

/* ===== RISPOSTA AL TOCCO ===== */
.btn,
.filter-chip,
.side-item,
.nav-item,
.header-btn,
.task-item,
.list-item,
.habit-item,
.mini-row,
.color-dot,
.fab {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.btn:active,
.filter-chip:active,
.header-btn:active,
.color-dot:active {
    transform: scale(0.96);
    transition-duration: 0.06s;
}

.fab:active { transform: scale(0.92); }

.task-item:active,
.habit-item:active,
.mini-row:active,
.list-item:active {
    transform: scale(0.992);
    transition-duration: 0.06s;
}

/* la spunta "scatta" invece di apparire */
.task-checkbox:checked::after,
.habit-checkbox:checked::after {
    animation: popIn 0.28s var(--ease);
}

/* task che esce dalla lista quando viene completato in una vista filtrata */
.task-item.leaving {
    animation: collapseOut 0.3s var(--ease) forwards;
    pointer-events: none;
}

/* ===== TRANSIZIONI TRA PAGINE ===== */
/* Chrome le applica alla navigazione fra documenti; gli altri browser ignorano
   la regola e vedono la navigazione normale, senza rotture. */
@view-transition {
    navigation: auto;
}

::view-transition-old(root) {
    animation: vtOut 0.18s var(--ease) forwards;
}

::view-transition-new(root) {
    animation: vtIn 0.26s var(--ease);
}

@keyframes vtOut {
    to { opacity: 0; transform: translateY(-6px); }
}

@keyframes vtIn {
    from { opacity: 0; transform: translateY(10px); }
}

/* la sidebar non deve partecipare alla transizione: e' un elemento persistente */
.side-nav { view-transition-name: sidebar; }
.top-header { view-transition-name: intestazione; }

::view-transition-group(sidebar),
::view-transition-group(intestazione) {
    animation: none;
}

/* ===== BOTTONI: STATO DI ATTESA ===== */
.btn.is-busy {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}

.btn.is-busy::after {
    content: '';
    width: 14px;
    height: 14px;
    margin-left: 9px;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-top-color: transparent;
    display: inline-block;
    vertical-align: -2px;
    animation: girello 0.6s linear infinite;
}

@keyframes girello {
    to { transform: rotate(360deg); }
}

/* ===== FULLCALENDAR DARK THEME ===== */
.fc {
    --fc-border-color: var(--border-color);
    --fc-button-bg-color: var(--bg-elevated);
    --fc-button-border-color: var(--border-color);
    --fc-button-text-color: var(--text-secondary);
    --fc-button-hover-bg-color: var(--primary);
    --fc-button-hover-border-color: var(--primary);
    --fc-button-active-bg-color: var(--primary-dark);
    --fc-page-bg-color: transparent;
    --fc-neutral-bg-color: var(--bg-elevated);
    --fc-today-bg-color: rgba(0, 255, 136, 0.10);
}

.fc .fc-toolbar-title {
    color: var(--text-primary);
}

.fc .fc-col-header-cell-cushion,
.fc .fc-daygrid-day-number {
    color: var(--text-secondary);
}

.fc .fc-daygrid-day.fc-day-today {
    background: rgba(0, 255, 136, 0.10) !important;
}

.fc-theme-standard td, .fc-theme-standard th {
    border-color: var(--border-color);
}

/* ===== DESKTOP SIDEBAR ===== */
.side-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    padding: 22px 14px;
    flex-direction: column;
    background: var(--glass-bg-strong);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--glass-border);
    z-index: 120;
}

.side-nav::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: var(--glass-sheen);
}

.side-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 10px 26px;
}

.side-brand-mark {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.1rem;
    color: var(--primary-contrast);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 6px 22px var(--primary-glow);
}

.side-brand-text {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.side-brand-text em {
    font-style: normal;
    font-weight: 400;
    color: var(--text-muted);
}

.side-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.side-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: var(--radius-xs);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.94rem;
    font-weight: 500;
    border: 1px solid transparent;
    transition: color 0.25s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease);
}

.side-item i {
    font-size: 1.2rem;
    transition: color 0.25s var(--ease), filter 0.25s var(--ease);
}

.side-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.side-item.active {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: var(--glass-border-lit);
}

.side-item.active i {
    filter: drop-shadow(0 0 10px var(--primary-glow));
}

.side-item.active::before {
    content: '';
    position: absolute;
    left: -14px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    border-radius: 0 3px 3px 0;
    background: var(--primary);
    box-shadow: 0 0 14px var(--primary-glow);
}

.side-foot {
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

.side-logout:hover {
    color: var(--danger);
    background: rgba(255, 77, 109, 0.08);
}

/* ===== FOCUS VISIBILE (accessibilita' da tastiera) ===== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.side-item:focus-visible,
.nav-item:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
    border-radius: var(--radius-xs);
}

/* ===== GRIGLIE RIUTILIZZABILI ===== */
.grid-auto {
    display: grid;
    gap: 18px;
    grid-template-columns: 1fr;
}

/* ===== RESPONSIVE: TABLET ===== */
@media (min-width: 768px) {
    .main-content {
        max-width: 720px;
        margin: 0 auto;
        padding: 24px;
    }

    .top-header .header-content {
        max-width: 720px;
        margin: 0 auto;
    }

    .bottom-nav {
        max-width: 520px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: var(--radius) var(--radius) 0 0;
        border-left: 1px solid var(--glass-border);
        border-right: 1px solid var(--glass-border);
    }

    .grid-auto {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ===== RESPONSIVE: DESKTOP ===== */
@media (min-width: 1024px) {
    .side-nav {
        display: flex;
    }

    .bottom-nav {
        display: none;
    }

    .top-header {
        left: var(--sidebar-width);
        height: 72px;
        padding: 0 40px;
    }

    .top-header .header-content {
        max-width: var(--content-max);
    }

    .header-title {
        font-size: 1.6rem;
    }

    .main-content {
        max-width: none;
        margin: 0;
        padding: 32px 40px 56px;
        padding-left: calc(var(--sidebar-width) + 40px);
    }

    .main-content.authenticated {
        padding-top: calc(72px + 32px);
        padding-bottom: 56px;
    }

    /* il contenuto reale resta leggibile e centrato nell'area utile */
    .main-content > * {
        max-width: var(--content-max);
        margin-left: auto;
        margin-right: auto;
    }

    .toast-container {
        left: calc(var(--sidebar-width) + 40px);
        right: 40px;
        top: 90px;
    }

    /* la FAB smette di galleggiare sul pollice e si ancora in basso a destra */
    .fab {
        bottom: 36px;
        right: 40px;
    }

    /* hover veri: sul desktop esiste il puntatore */
    .card:hover {
        border-color: var(--border-light);
        transform: translateY(-2px);
    }

    .list-item:hover {
        transform: translateX(4px);
    }
}

@media (min-width: 1440px) {
    .grid-auto {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ===== RISPETTA "RIDUCI MOVIMENTO" ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* ===== LAYOUT DASHBOARD ===== */
.dash-split {
    display: grid;
    gap: 20px;
    grid-template-columns: 1fr;
    margin-top: 26px;
}

.dash-col > .section-header:first-child {
    margin-top: 0;
}

@media (min-width: 1024px) {
    .dash-split {
        grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
        gap: 26px;
        align-items: start;
    }
}

/* ===== RIGA INDICATORI ===== */
.kpi-row {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}

.kpi-row .stat-card {
    margin-bottom: 0;
}

.kpi-row .stat-card:not(:first-child) .stat-value {
    font-size: 1.9rem;
}

.stat-card.kpi-out::after {
    background: linear-gradient(180deg, var(--danger), #dc2626);
    box-shadow: 0 0 18px var(--danger-glow);
}

.stat-card.kpi-out::before {
    background: radial-gradient(circle, rgba(255, 77, 109, 0.10) 0%, transparent 68%);
}

.stat-card.kpi-out .stat-value {
    color: var(--danger);
    text-shadow: 0 0 26px var(--danger-glow);
}

@media (min-width: 768px) {
    .kpi-row {
        grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr);
        gap: 18px;
    }
}

/* ===== TASK: BARRA FILTRI ===== */
.filter-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    margin-bottom: 16px;
    scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar { display: none; }

.filter-bar-sub {
    margin-top: -6px;
    margin-bottom: 22px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    padding: 9px 15px;
    border-radius: var(--radius-full);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.filter-chip i { font-size: 0.95rem; }

.filter-chip em {
    font-style: normal;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

.filter-chip:hover {
    color: var(--text-primary);
    border-color: var(--border-light);
}

.filter-chip.active {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: var(--glass-border-lit);
    box-shadow: 0 0 18px rgba(0, 255, 136, 0.10);
}

.filter-chip.active em {
    background: var(--primary);
    color: var(--primary-contrast);
}

/* ===== TASK: ELEMENTO ===== */
.task-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    border-radius: var(--radius-sm);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: border-color 0.25s var(--ease), opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

.task-item:hover { border-color: var(--border-light); }

.task-item.overdue {
    border-color: rgba(255, 77, 109, 0.35);
    box-shadow: inset 3px 0 0 var(--danger);
}

.task-item.completed { opacity: 0.5; }

.task-item.completed .task-title {
    text-decoration: line-through;
    color: var(--text-muted);
}

.task-checkbox {
    appearance: none;
    -webkit-appearance: none;
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    margin-top: 2px;
    border-radius: 7px;
    border: 2px solid var(--text-dim);
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.task-checkbox:hover { border-color: var(--primary); }

.task-checkbox:checked {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 14px var(--primary-glow);
}

.task-checkbox:checked::after {
    content: '\F26E';
    font-family: 'bootstrap-icons';
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 0.8rem;
    color: var(--primary-contrast);
}

.task-body { flex: 1; min-width: 0; }

.task-title {
    font-weight: 600;
    font-size: 0.96rem;
    color: var(--text-primary);
    line-height: 1.35;
    word-break: break-word;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    font-size: 0.76rem;
    color: var(--text-muted);
}

.task-meta .prio {
    padding: 2px 9px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.prio-alta   { background: rgba(255, 77, 109, 0.15); color: var(--danger); }
.prio-media  { background: rgba(255, 176, 32, 0.15); color: var(--warning); }
.prio-bassa  { background: rgba(255, 255, 255, 0.07); color: var(--text-muted); }

.task-prog, .task-due {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.task-due.late  { color: var(--danger); font-weight: 600; }
.task-due.today { color: var(--primary); font-weight: 600; }

.task-note {
    margin-top: 8px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.task-edit {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-xs);
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.task-edit:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

/* ===== PROGETTI ===== */
.project-card.archived { opacity: 0.55; }

.project-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.project-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: var(--radius-xs);
    display: grid;
    place-items: center;
    font-size: 1.1rem;
}

.project-name {
    flex: 1;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge-archived {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-muted);
    font-weight: 600;
}

.project-desc {
    margin: 12px 0 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.progress-line {
    margin-top: 16px;
    height: 6px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.07);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.4s var(--ease);
}

.project-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.76rem;
    color: var(--text-muted);
}

/* ===== SELETTORE COLORE ===== */
.color-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.color-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s var(--ease), border-color 0.2s var(--ease);
}

.color-dot:hover { transform: scale(1.12); }

.color-dot.selected {
    border-color: var(--text-primary);
    transform: scale(1.12);
}

/* ===== CONTENITORE FORM ===== */
.form-wrap {
    max-width: 620px;
    margin: 0 auto;
}

/* ===== DASHBOARD OGGI ===== */
.today-head {
    margin-bottom: 22px;
}

.today-date {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
    color: var(--text-muted);
}

.today-greet {
    margin: 6px 0 0;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.quiet-note {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.quiet-note i {
    font-size: 1.15rem;
    color: var(--text-dim);
}

.mini-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    margin-bottom: 8px;
    border-radius: var(--radius-xs);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    font-size: 0.86rem;
}

.mini-date {
    flex: 0 0 auto;
    font-weight: 600;
    font-size: 0.76rem;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

.mini-title {
    flex: 1;
    min-width: 0;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.habit-counter {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    background: var(--primary-soft);
    border: 1px solid var(--glass-border-lit);
}

/* ===== AGGIUNTA RAPIDA ===== */
.quick-add {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 6px 4px 18px;
    margin-bottom: 18px;
    border-radius: var(--radius-full);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.quick-add:focus-within {
    border-color: var(--glass-border-lit);
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.10);
}

.quick-add > i {
    color: var(--text-dim);
    font-size: 1rem;
    transition: color 0.25s var(--ease);
}

.quick-add:focus-within > i { color: var(--primary); }

.quick-add input {
    flex: 1;
    min-width: 0;
    padding: 13px 0;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.94rem;
    font-family: inherit;
}

.quick-add input::placeholder { color: var(--text-dim); }

.quick-add input:disabled { opacity: 0.5; }

.quick-add input.errore {
    animation: scuoti 0.4s var(--ease);
    color: var(--danger);
}

@keyframes scuoti {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-5px); }
    75%      { transform: translateX(5px); }
}

.quick-add-btn {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    color: var(--primary);
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.25s var(--ease), transform 0.15s var(--ease);
}

.quick-add-btn:hover {
    background: var(--primary);
    color: var(--primary-contrast);
}
