:root {
    --dashboard-bg: #f4f7fb;
    --dashboard-ink: #0f172a;
    --dashboard-muted: #64748b;
    --dashboard-card-border: rgba(15, 23, 42, 0.08);
    --dashboard-shadow: 0 18px 45px rgba(15, 23, 42, 0.10);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-width: 0;
    overflow-x: hidden;
}

body.dashboard-page,
body.login-page {
    min-height: 100vh;
    color: var(--dashboard-ink);
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.14), transparent 34rem),
        radial-gradient(circle at top right, rgba(79, 70, 229, 0.10), transparent 30rem),
        linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
}

.dashboard-shell {
    max-width: 1320px;
}

.dashboard-hero,
.login-card {
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 1.5rem;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--dashboard-shadow);
    backdrop-filter: blur(12px);
}

.dashboard-hero {
    overflow: hidden;
    position: relative;
}

.dashboard-hero::after {
    position: absolute;
    inset: auto -4rem -6rem auto;
    width: 18rem;
    height: 18rem;
    content: "";
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.10);
}

.dashboard-logo {
    display: block;
    width: min(100%, 320px);
    max-height: 118px;
    object-fit: contain;
}

.dashboard-eyebrow,
.login-eyebrow {
    color: #2563eb;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .16em;
}

.dashboard-title,
.login-title {
    font-weight: 800;
    letter-spacing: -.03em;
}

.dashboard-subtitle,
.login-subtitle,
.module-card-text,
.dashboard-version-label {
    color: var(--dashboard-muted);
}

.dashboard-actions {
    position: relative;
    z-index: 1;
}

.dashboard-user-pill {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    max-width: 100%;
    padding: .55rem .8rem;
    border: 1px solid var(--dashboard-card-border);
    border-radius: 999px;
    background: #fff;
    color: #334155;
    font-weight: 600;
}

.module-card {
    position: relative;
    overflow: hidden;
    min-height: 100%;
    border: 1px solid var(--dashboard-card-border);
    border-left: 6px solid var(--module-color, #2563eb);
    border-radius: 1.25rem;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.module-card:hover,
.module-card:focus-within {
    transform: translateY(-4px);
    border-color: rgba(15, 23, 42, 0.16);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.13);
}

.module-card-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.module-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    border: 1px solid color-mix(in srgb, var(--module-color, #2563eb) 26%, transparent);
    border-radius: 1rem;
    background: color-mix(in srgb, var(--module-color, #2563eb) 10%, white);
    color: var(--module-color, #2563eb);
    font-size: 1.5rem;
}

.module-card-title {
    margin: 0;
    color: var(--dashboard-ink);
    font-size: 1.1rem;
    font-weight: 800;
}

.module-card-text {
    margin: .35rem 0 0;
    font-size: .96rem;
    line-height: 1.5;
}

.module-card-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: 2.75rem;
    font-weight: 700;
}

.spesa-module { --module-color: #2563eb; }
.sm-module { --module-color: #f59e0b; }
.trading-module { --module-color: #16a34a; }
.utenti-module { --module-color: #0f766e; }
.progress-module { --module-color: #4f46e5; }
.docs-module { --module-color: #111827; }

.login-shell {
    min-height: 100vh;
    padding: 2rem 1rem;
}

.login-card {
    width: min(100%, 430px);
}

.login-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 1.1rem;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #fff;
    font-size: 1.65rem;
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.28);
}

.login-card .form-control {
    min-height: 3rem;
    border-radius: .85rem;
}

.login-card .btn {
    min-height: 3rem;
    border-radius: .85rem;
    font-weight: 700;
}

.login-card .alert {
    border-radius: 1rem;
}

@media (max-width: 575.98px) {
    .dashboard-shell {
        padding-top: 1rem !important;
        padding-bottom: 1.5rem !important;
    }

    .dashboard-hero,
    .login-card,
    .module-card {
        border-radius: 1rem;
    }

    .dashboard-hero {
        text-align: center;
    }

    .dashboard-logo {
        width: min(100%, 250px);
        margin: 0 auto;
    }

    .dashboard-actions,
    .dashboard-actions .btn,
    .module-card-link {
        width: 100%;
    }

    .dashboard-user-pill {
        justify-content: center;
        width: 100%;
    }

    .module-card-body {
        padding: 1.15rem !important;
    }

    .module-card-link,
    .login-card .btn,
    .login-card .form-control {
        min-height: 3.1rem;
    }
}
