﻿:root {
    --bg0: #080A0D;
    --bg1: #0C0F14;
    --card: #0F141B;
    --stroke: rgba(255,255,255,.08);
    --stroke2: rgba(255,255,255,.12);
    --text: rgba(255,255,255,.92);
    --muted: rgba(255,255,255,.70);
    --muted2: rgba(255,255,255,.55);
    --accent: #C9A227; /* gold premium */
    --accent2: #2BD4C6; /* teal tech */
    --ok: #23c55e;
    --warn: #f59e0b;
    --bad: #ef4444;
    --radius: 18px;
    --shadow: 0 12px 40px rgba(0,0,0,.35);
}

.fmz-body {
    background: radial-gradient(1200px 600px at 20% -10%, rgba(201,162,39,.12), transparent 55%), radial-gradient(900px 500px at 95% 0%, rgba(43,212,198,.10), transparent 55%), linear-gradient(180deg, var(--bg0), var(--bg1));
    color: var(--text);
}

.fmz-container {
    animation: fadeUp .45s ease both;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

a {
    color: inherit;
    text-decoration: none;
}

.text-muted-2 {
    color: var(--muted2) !important;
}


.fmz-link {
    color: rgba(255,255,255,.80) !important;
}

    .fmz-link:hover {
        color: rgba(255,255,255,.95) !important;
    }

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(201,162,39,.22), rgba(43,212,198,.16));
    border: 1px solid var(--stroke2);
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
    font-weight: 900;
    letter-spacing: .5px;
}

.brand-text {
    font-weight: 800;
    letter-spacing: .3px;
}

.fmz-user {
    color: rgba(255,255,255,.90);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--stroke);
    background: rgba(255,255,255,.02);
}

    .fmz-user:hover {
        border-color: var(--stroke2);
    }

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(201,162,39,.25), rgba(43,212,198,.18));
    border: 1px solid var(--stroke2);
    font-weight: 900;
}

.fmz-hero {
    border-radius: var(--radius);
    border: 1px solid var(--stroke);
    background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
    box-shadow: var(--shadow);
    padding: 22px;
}

.fmz-hero-inner {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    position: relative;
}

.kicker {
    color: var(--muted2);
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: .72rem;
}

.display-title {
    margin: 6px 0 6px;
    font-weight: 900;
    letter-spacing: .2px;
}

.subtitle {
    color: var(--muted);
    margin: 0;
    max-width: 70ch;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid var(--stroke);
    background: rgba(255,255,255,.02);
    color: rgba(255,255,255,.82);
    font-weight: 700;
    font-size: .82rem;
}

.fmz-hero-kpis {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.kpi {
    border-radius: 16px;
    border: 1px solid var(--stroke);
    background: rgba(255,255,255,.02);
    padding: 12px 14px;
    min-width: 170px;
}

.kpi-label {
    color: var(--muted2);
    font-size: .85rem;
}

.kpi-value {
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: .2px;
}

.kpi-suffix {
    color: var(--muted2);
    font-weight: 800;
    margin-left: 4px;
}

.fmz-card {
    border-radius: var(--radius);
    border: 1px solid var(--stroke);
    background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
    box-shadow: var(--shadow);
}

.fmz-card-header {
    padding: 16px 16px 12px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--stroke);
}

    .fmz-card-header .title {
        font-weight: 900;
        font-size: 1.05rem;
    }

    .fmz-card-header .muted {
        color: var(--muted2);
        font-size: .9rem;
    }

.fmz-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid var(--stroke);
    background: rgba(255,255,255,.02);
    color: rgba(255,255,255,.82);
    font-weight: 800;
}

.fmz-grid {
    padding: 14px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 12px;
}

/* ✅ più densa per stare su uno schermo */
.fmz-grid-dense {
    padding: 10px 12px 2px;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 10px;
}

@media (max-width: 1200px) {
    .fmz-grid-dense {
        grid-template-columns: repeat(3, minmax(0,1fr));
    }
}

@media (max-width: 900px) {
    .fmz-grid-dense {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }
}

@media (max-width: 520px) {
    .fmz-grid-dense {
        grid-template-columns: repeat(1, minmax(0,1fr));
    }
}

.fmz-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 2px 2px;
}

.fmz-section-title {
    font-weight: 950;
    letter-spacing: .02em;
}

.fmz-section-meta {
    color: var(--muted2);
    font-weight: 800;
    font-size: .92rem;
}

.fmz-divider {
    height: 1px;
    background: var(--stroke);
    margin: 12px 0;
}

.asset {
    border-radius: 16px;
    border: 1px solid var(--stroke);
    background: rgba(10,13,18,.55);
    padding: 14px;
    transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
    position: relative;
    overflow: hidden;
}

    .asset::before {
        content: "";
        position: absolute;
        inset: -2px;
        background: radial-gradient(420px 160px at 20% 0%, rgba(201,162,39,.12), transparent 55%), radial-gradient(420px 160px at 95% 30%, rgba(43,212,198,.10), transparent 60%);
        opacity: 0;
        transition: opacity .25s ease;
        pointer-events: none;
    }

    .asset:hover {
        transform: translateY(-2px);
        border-color: var(--stroke2);
    }

        .asset:hover::before {
            opacity: 1;
        }

.asset-link {
    display: block;
}

.asset-go {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid var(--stroke);
    background: rgba(255,255,255,.03);
    color: rgba(255,255,255,.85);
    transform: translateX(4px);
    opacity: .65;
    transition: transform .25s ease, opacity .25s ease, border-color .25s ease;
}

.asset:hover .asset-go {
    transform: translateX(0);
    opacity: 1;
    border-color: var(--stroke2);
}

.asset-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.asset-code {
    font-weight: 900;
    letter-spacing: .06em;
    color: rgba(255,255,255,.75);
    font-size: .82rem;
}

.asset-name {
    font-weight: 900;
    font-size: 1.02rem;
    margin-bottom: 8px;
}

.asset-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.meta {
    color: var(--muted2);
    font-size: .88rem;
}

.badge-soft {
    border: 1px solid var(--stroke);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: .78rem;
    color: rgba(255,255,255,.78);
    background: rgba(255,255,255,.02);
    font-weight: 800;
}

.status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,.80);
    font-weight: 900;
    letter-spacing: .03em;
    font-size: .78rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    border: 1px solid var(--stroke2);
}

    .status-dot.on {
        background: var(--ok);
        box-shadow: 0 0 0 0 rgba(35,197,94,.55);
        animation: pulse 1.35s infinite;
    }

    .status-dot.off {
        background: rgba(255,255,255,.18);
    }

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(35,197,94,.35);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(35,197,94,0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(35,197,94,0);
    }
}

/* ✅ Qui le "piccole accortezze" richieste:
   - ferme rosse
   - in uso verde più marcato */
.asset.asset-on {
    border-color: rgba(35,197,94,.62) !important;
    box-shadow: 0 0 0 1px rgba(35,197,94,.18), 0 18px 48px rgba(0,0,0,.35);
}

.asset.asset-off {
    border-color: rgba(239,68,68,.62) !important;
    box-shadow: 0 0 0 1px rgba(239,68,68,.16), 0 18px 48px rgba(0,0,0,.35);
}

.mini-bar {
    height: 10px;
    border-radius: 999px;
    border: 1px solid var(--stroke);
    background: rgba(255,255,255,.02);
    overflow: hidden;
}

.mini-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(201,162,39,.55), rgba(43,212,198,.45));
    filter: saturate(1.1);
    animation: sheen 2.4s ease-in-out infinite;
}

@keyframes sheen {
    0% {
        transform: translateX(-2%);
        opacity: .85;
    }

    50% {
        transform: translateX(2%);
        opacity: 1;
    }

    100% {
        transform: translateX(-2%);
        opacity: .85;
    }
}

.mini-bar-label {
    margin-top: 6px;
    font-size: .78rem;
    color: var(--muted2);
    font-weight: 800;
}

/* Footer */
.fmz-footer {
    background: transparent !important;
    border-top: 1px solid var(--stroke) !important;
}

/* ===== LOGIN ===== */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    position: relative;
    overflow: hidden;
}

.login-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

    .login-bg .grid {
        position: absolute;
        inset: -40px;
        background: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
        background-size: 48px 48px;
        opacity: .22;
        transform: rotate(-6deg) scale(1.1);
        mask-image: radial-gradient(60% 45% at 50% 45%, black 60%, transparent 100%);
    }

    .login-bg .blob {
        position: absolute;
        width: 520px;
        height: 520px;
        filter: blur(28px);
        opacity: .85;
        border-radius: 999px;
        animation: floaty 9s ease-in-out infinite;
    }

    .login-bg .b1 {
        left: -140px;
        top: -180px;
        background: radial-gradient(circle at 30% 30%, rgba(201,162,39,.55), transparent 60%), radial-gradient(circle at 70% 70%, rgba(43,212,198,.35), transparent 55%);
    }

    .login-bg .b2 {
        right: -180px;
        bottom: -220px;
        background: radial-gradient(circle at 40% 40%, rgba(43,212,198,.55), transparent 60%), radial-gradient(circle at 75% 55%, rgba(201,162,39,.30), transparent 55%);
        animation-delay: -3.2s;
    }

@keyframes floaty {
    0% {
        transform: translate3d(0,0,0) scale(1);
    }

    50% {
        transform: translate3d(18px, -14px, 0) scale(1.03);
    }

    100% {
        transform: translate3d(0,0,0) scale(1);
    }
}

.login-card {
    width: min(520px, 100%);
    border-radius: 22px;
    border: 1px solid var(--stroke2);
    background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.015));
    box-shadow: 0 22px 70px rgba(0,0,0,.55);
    position: relative;
    overflow: hidden;
    animation: pop .45s ease both;
}

@keyframes pop {
    from {
        opacity: 0;
        transform: translateY(10px) scale(.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-card::before {
    content: "";
    position: absolute;
    inset: -2px;
    background: radial-gradient(420px 220px at 15% 0%, rgba(201,162,39,.14), transparent 60%), radial-gradient(520px 240px at 95% 40%, rgba(43,212,198,.12), transparent 60%);
    opacity: 1;
    pointer-events: none;
}

.login-head {
    position: relative;
    padding: 18px 18px 12px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--stroke);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.login-title {
    font-weight: 950;
    letter-spacing: .3px;
    font-size: 1.25rem;
    line-height: 1.05;
}

.login-sub {
    font-size: .92rem;
}

.login-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid var(--stroke);
    background: rgba(255,255,255,.02);
    color: rgba(255,255,255,.82);
    font-weight: 850;
    font-size: .8rem;
    white-space: nowrap;
}

.login-body {
    position: relative;
    padding: 18px;
}

.login-alert {
    border: 1px solid rgba(239,68,68,.35);
    background: rgba(239,68,68,.10);
    color: rgba(255,255,255,.92);
    border-radius: 16px;
    padding: 10px 12px;
    font-weight: 800;
    margin-bottom: 14px;
}

.fmz-input {
    background: rgba(255,255,255,.03) !important;
    border: 1px solid var(--stroke) !important;
    border-radius: 14px !important;
    color: var(--text) !important;
    padding: 12px 12px !important;
}

    .fmz-input:focus {
        box-shadow: 0 0 0 4px rgba(201,162,39,.10) !important;
        border-color: rgba(201,162,39,.35) !important;
    }

.fmz-check {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,.82);
    font-weight: 800;
    user-select: none;
}

.btn-fmz {
    background: linear-gradient(90deg, rgba(201,162,39,.95), rgba(43,212,198,.85));
    border: 0;
    color: #081015;
    font-weight: 950;
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: 0 18px 44px rgba(0,0,0,.35);
}

    .btn-fmz:hover {
        filter: saturate(1.08) brightness(1.02);
        transform: translateY(-1px);
    }

    .btn-fmz:active {
        transform: translateY(0);
    }

.login-foot {
    position: relative;
    padding: 14px 18px 18px;
    border-top: 1px solid var(--stroke);
    text-align: center;
    font-weight: 800;
    font-size: .85rem;
}

/* ===== USER DROPDOWN (SOLIDO + CARD) ===== */
.fmz-nav {
    position: sticky;
    top: 0;
    z-index: 1200;
}

.fmz-user-btn {
    border: 1px solid var(--stroke);
    background: rgba(255,255,255,.03);
}

.fmz-dd {
    --bs-dropdown-padding-x: 10px;
    --bs-dropdown-padding-y: 10px;
    background: var(--card) !important; /* SOLIDO */
    border: 1px solid rgba(255,255,255,.14) !important;
    border-radius: 16px !important;
    box-shadow: 0 22px 70px rgba(0,0,0,.70) !important;
    min-width: 260px;
    z-index: 3000;
    backdrop-filter: none !important;
}

.fmz-dd-head {
    padding: 10px 10px 8px;
}

.fmz-dd-name {
    font-weight: 950;
    letter-spacing: .2px;
}

.fmz-dd-role {
    color: var(--muted2);
    font-weight: 800;
    font-size: .85rem;
    margin-top: 2px;
}

.fmz-dd-div {
    border-top: 1px solid var(--stroke) !important;
    opacity: 1;
    margin: 8px 6px;
}

.fmz-dd-item {
    border-radius: 12px;
    padding: 10px 12px;
    font-weight: 900;
    color: rgba(255,255,255,.90) !important;
}

    .fmz-dd-item:hover {
        background: rgba(255,255,255,.06) !important;
    }



/* ============================================================
   ASSET DETAIL - layout pulito e compatto
   ============================================================ */

.fmz-hero-detail {
    padding: 22px;
}

    .fmz-hero-detail .fmz-hero-inner {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
        gap: 24px;
        align-items: stretch;
    }

.detail-head {
    min-height: 260px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.detail-badge {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.detail-code {
    font-weight: 950;
    letter-spacing: .08em;
    color: rgba(255,255,255,.90);
}

.detail-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--stroke);
    background: rgba(255,255,255,.025);
    color: rgba(255,255,255,.78);
    font-size: .78rem;
    font-weight: 850;
}

    .detail-chip.subtle {
        color: var(--muted2);
    }

.detail-status {
    margin-top: 20px;
}

.status-big {
    display: flex;
    align-items: center;
    gap: 12px;
}

    .status-big .status-dot {
        width: 14px;
        height: 14px;
    }

.status-big-title {
    font-weight: 950;
    font-size: 1rem;
    letter-spacing: .04em;
}

/* KPI laterali dettaglio */
.detail-kpis {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-content: start;
}

    .detail-kpis .kpi {
        width: 100%;
        min-width: 0;
    }

.mini-chart-card {
    border-radius: 16px;
    border: 1px solid var(--stroke);
    background: rgba(255,255,255,.02);
    padding: 12px 14px;
    min-height: 132px;
}

.mini-chart-title {
    color: rgba(255,255,255,.86);
    font-weight: 900;
    font-size: .92rem;
    margin-bottom: 8px;
}

/* ============================================================
   TIMELINE DETTAGLIO
   ============================================================ */

.timeline {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 6px;
}

    .timeline::-webkit-scrollbar {
        width: 8px;
    }

    .timeline::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,.14);
        border-radius: 999px;
    }

.t-item {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--stroke);
    background: rgba(255,255,255,.018);
}

.t-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    margin-top: 6px;
    background: rgba(255,255,255,.22);
    border: 1px solid var(--stroke2);
}

.t-item.ok {
    border-color: rgba(35,197,94,.30);
}

    .t-item.ok .t-dot {
        background: var(--ok);
        box-shadow: 0 0 0 4px rgba(35,197,94,.10);
    }

.t-item.warn {
    border-color: rgba(245,158,11,.32);
}

    .t-item.warn .t-dot {
        background: var(--warn);
        box-shadow: 0 0 0 4px rgba(245,158,11,.10);
    }

.t-item.bad {
    border-color: rgba(239,68,68,.34);
}

    .t-item.bad .t-dot {
        background: var(--bad);
        box-shadow: 0 0 0 4px rgba(239,68,68,.10);
    }

.t-body {
    min-width: 0;
}

.t-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.t-title {
    font-weight: 950;
    color: rgba(255,255,255,.92);
}

.t-time {
    color: var(--muted2);
    font-size: .82rem;
    font-weight: 850;
    white-space: nowrap;
}

.t-sub {
    color: var(--muted);
    font-size: .88rem;
    margin-top: 2px;
}

/* ============================================================
   SIGNALS / SINTESI
   ============================================================ */

.signal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.signal {
    border-radius: 15px;
    border: 1px solid var(--stroke);
    background: rgba(255,255,255,.018);
    padding: 12px;
    min-width: 0;
}

.signal-label {
    color: var(--muted2);
    font-size: .82rem;
    font-weight: 850;
    margin-bottom: 4px;
}

.signal-value {
    font-size: 1.15rem;
    font-weight: 950;
    color: rgba(255,255,255,.94);
    line-height: 1.15;
}

    .signal-value .unit {
        color: var(--muted2);
        font-size: .78rem;
        font-weight: 800;
        margin-left: 3px;
    }

.signal-hint {
    margin-top: 4px;
    font-size: .8rem;
}

.insight {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 15px;
    border: 1px solid var(--stroke);
    background: rgba(255,255,255,.018);
}

    .insight + .insight {
        margin-top: 10px;
    }

.insight-title {
    color: var(--muted2);
    font-size: .83rem;
    font-weight: 850;
}

.insight-sub {
    margin-top: 2px;
    font-size: 1.05rem;
    font-weight: 950;
    color: rgba(255,255,255,.94);
}

.badge-soft.ok {
    border-color: rgba(35,197,94,.32);
    background: rgba(35,197,94,.10);
    color: rgba(190,255,210,.95);
}

.badge-soft.warn {
    border-color: rgba(245,158,11,.32);
    background: rgba(245,158,11,.10);
    color: rgba(255,225,170,.95);
}

.badge-soft.neutral {
    border-color: var(--stroke2);
    background: rgba(255,255,255,.035);
    color: rgba(255,255,255,.78);
}

/* Stato anomalia */
.asset.asset-stale {
    border-color: rgba(245,158,11,.62) !important;
    box-shadow: 0 0 0 1px rgba(245,158,11,.16), 0 18px 48px rgba(0,0,0,.35);
}

/* Responsive dettaglio */
@media (max-width: 1100px) {
    .fmz-hero-detail .fmz-hero-inner {
        grid-template-columns: 1fr;
    }

    .detail-head {
        min-height: auto;
    }

    .detail-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .mini-chart-card {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    .detail-kpis {
        grid-template-columns: 1fr;
    }

    .signal-grid {
        grid-template-columns: 1fr;
    }

    .timeline {
        max-height: 440px;
    }

    .t-top {
        flex-direction: column;
        gap: 2px;
    }
}