/* ═══════════════════════════════════════════════
   Fast10 — Design System
   ═══════════════════════════════════════════════ */

:root {
    --f10-primary: #1e3a6e;
    --f10-primary-dark: #0d1f3c;
    --f10-accent: #4a90d9;
    --f10-bg: #f0f4fa;
    --f10-surface: #ffffff;
    --f10-border: #e2e8f2;
    --f10-text: #1e293b;
    --f10-text-muted: #64748b;
    --f10-radius: 10px;
    --f10-shadow-sm: 0 1px 4px rgba(30, 58, 110, 0.08);
    --f10-shadow-md: 0 4px 16px rgba(30, 58, 110, 0.12);
    --f10-shadow-lg: 0 8px 32px rgba(30, 58, 110, 0.15);
    /* Touch tokens — landing e pagine touch-first (tablet Windows, dita grosse) */
    --f10-touch-target: 56px;
    --f10-touch-target-lg: 72px;
    --f10-touch-gap: 16px;
    --f10-touch-radius: 14px;
    --f10-touch-font: 1.15rem;
    --f10-touch-font-lg: 1.5rem;
}

/* ─── Base ─── */

html, body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--f10-bg);
    color: var(--f10-text);
    margin: 0;
}

h1:focus {
    outline: none;
}

/* ═══════════════════════════════════════════════
   MudBlazor sidebar — brand + nav overrides
   ═══════════════════════════════════════════════ */

/* Brand link nel drawer header */
.f10-brand-header {
    padding: 0 !important;
}

.f10-brand-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-decoration: none !important;
}

.f10-brand-logo {
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

/* Etichette di sezione nel nav (sidebar scura — entrambi i temi) */
.f10-nav-section {
    display: block;
    font-size: 0.65rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em !important;
    color: rgba(255, 255, 255, 0.38) !important;
    padding: 0.9rem 1.25rem 0.25rem !important;
}

/* Separatore nav */
.f10-nav-divider {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* MudNavGroup per sezioni modulo collassabili */
.f10-nav-module-group .mud-nav-group-title {
    color: rgba(255, 255, 255, 0.82) !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    margin: 0.1rem 0.65rem !important;
}

    .f10-nav-module-group .mud-nav-group-title:hover {
        background: rgba(255, 255, 255, 0.10) !important;
        color: #ffffff !important;
    }

.f10-nav-module-group .mud-expand-icon {
    color: rgba(255, 255, 255, 0.5) !important;
}

.f10-nav-module-group .mud-collapse-container > .mud-navlink {
    padding-left: 2rem !important;
}

/* MudNavGroup annidato per sotto-categorie (livello 2) */
.f10-nav-category-group {
    margin: 0.05rem 0 !important;
}

    .f10-nav-category-group > .mud-nav-group-title {
        color: rgba(255, 255, 255, 0.72) !important;
        font-size: 0.8125rem !important;
        font-weight: 500 !important;
        padding-left: 2rem !important;
        border-radius: 8px !important;
        margin: 0.05rem 0.65rem !important;
    }

        .f10-nav-category-group > .mud-nav-group-title:hover {
            background: rgba(255, 255, 255, 0.08) !important;
            color: #ffffff !important;
        }

    .f10-nav-category-group .mud-expand-icon {
        color: rgba(255, 255, 255, 0.4) !important;
        font-size: 0.9rem !important;
    }

    /* Link di livello 3 dentro una sotto-categoria — indentazione maggiore */
    .f10-nav-category-group .mud-collapse-container .mud-navlink {
        padding-left: 3rem !important;
        font-size: 0.8125rem !important;
    }

/* MudNavLink su sfondo scuro del drawer */
.mud-drawer {
    overflow-x: hidden !important;
}

.mud-nav-link {
    color: rgba(255, 255, 255, 0.82) !important;
    border-radius: 8px !important;
    margin: 0.1rem 0.65rem !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    transition: background 0.15s, color 0.15s !important;
    border-left: 3px solid transparent !important;
}

    .mud-nav-link .mud-nav-link-text {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mud-nav-link:hover {
        background: rgba(255, 255, 255, 0.10) !important;
        color: #ffffff !important;
    }

    .mud-nav-link.active {
        background: rgba(255, 255, 255, 0.14) !important;
        color: #ffffff !important;
        border-left-color: var(--mud-palette-primary) !important;
    }

    /* Icona nel MudNavLink (svg Material Icon) */
    .mud-nav-link .mud-icon-root {
        color: rgba(255, 255, 255, 0.65) !important;
    }

    .mud-nav-link.active .mud-icon-root,
    .mud-nav-link:hover .mud-icon-root {
        color: #ffffff !important;
    }

/* ═══════════════════════════════════════════════
   Dashboard — stat card icons
   ═══════════════════════════════════════════════ */

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .stat-card-icon.blue {
        background: #dbeafe;
    }

    .stat-card-icon.green {
        background: #dcfce7;
    }

    .stat-card-icon.orange {
        background: #ffedd5;
    }

    .stat-card-icon.purple {
        background: #f3e8ff;
    }

.stat-card-label {
    font-size: 0.72rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    font-weight: 600 !important;
    margin-bottom: 0.1rem !important;
}

.stat-card-value {
    font-size: 1.55rem !important;
    font-weight: 700 !important;
    line-height: 1 !important;
}

/* ═══════════════════════════════════════════════
   Home page
   ═══════════════════════════════════════════════ */

.home-hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 3rem 1rem 2rem;
}

.home-card {
    max-width: 360px !important;
    width: 100%;
    border-radius: 14px !important;
}

.home-brand-logo {
    display: block;
    width: 60%;
    max-width: 220px;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
}

.home-subtitle {
    margin-top: 0.25rem;
}

.home-features {
    max-width: none;
    width: 100%;
}

/* Outer grid per le sezioni modulo nella home */
.home-sections-grid {
    width: 100%;
    max-width: 1200px;
}

.home-sections-5col {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    width: 100%;
    max-width: 1500px;
    align-items: start;
}

@media (max-width: 1200px) {
    .home-sections-5col {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .home-sections-5col {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .home-sections-5col {
        grid-template-columns: 1fr;
    }
}

.home-tiles-5col {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
}

@media (max-width: 900px) {
    .home-tiles-5col {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .home-tiles-5col {
        grid-template-columns: repeat(2, 1fr);
    }
}

.home-module-header {
    padding: 0.15rem 0.6rem;
    margin-bottom: 0.5rem;
    border-radius: 2px;
}

.home-feature-card {
    border-radius: var(--f10-radius) !important;
    transition: transform 0.15s, box-shadow 0.15s;
    text-align: center;
}

/* Public landing (utente non autorizzato) */
.landing-shell {
    width: 100%;
    max-width: 1200px;
}

.landing-hero {
    border-radius: 20px !important;
    background: linear-gradient(135deg, #ffffff 0%, #f5f8ff 65%, #edf6ff 100%);
    border: 1px solid var(--f10-border);
    box-shadow: var(--f10-shadow-md);
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1.5rem;
}

.landing-chip {
    font-weight: 600;
    margin-bottom: 0.8rem;
}

.landing-mascot-hero {
    margin-bottom: 0.35rem;
}


.landing-title {
    font-weight: 800 !important;
    letter-spacing: -0.03em;
    color: var(--f10-primary);
    margin-bottom: 0.85rem;
}

.landing-subtitle {
    color: var(--f10-text-muted);
    max-width: 58ch;
}

.landing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.3rem;
}

.landing-proof {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-top: 1.2rem;
    color: var(--f10-text);
    font-size: 0.95rem;
}

    .landing-proof .mud-icon-root {
        font-size: 1rem;
        color: #0f9d58;
        margin-right: 0.35rem;
        vertical-align: middle;
    }

.landing-preview {
    border-radius: 14px !important;
    border: 1px solid var(--f10-border);
    background: #ffffff;
}

.landing-mascot {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 0.9rem;
}

.landing-mascot-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    flex-wrap: wrap;
    margin-bottom: 0.9rem;
}

/* Per-variant scaling to compensate for different intrinsic
   canvas/padding in each PNG so the visible mascot is uniform. */
.landing-mascot-row .mascot-icon          { transform-origin: center; }
.landing-mascot-row .mascot-icon--default { transform: scale(1.20); }
.landing-mascot-row .mascot-icon--happy   { transform: scale(1.35); }
.landing-mascot-row .mascot-icon--thinking{ transform: scale(1.00); }
.landing-mascot-row .mascot-icon--phone   { transform: scale(1.20); }
.landing-mascot-row .mascot-icon--wink    { transform: scale(1.25); }


.landing-mascot-bubble {
    background: #f5f9ff;
    border: 1px solid #dce9ff;
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    font-size: 0.82rem;
    color: var(--f10-text-muted);
}

.landing-preview-title {
    font-weight: 700 !important;
    color: var(--f10-primary);
    margin-bottom: 0.9rem;
}

.landing-metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 0.7rem;
}

.landing-metric-card {
    background: #f7faff;
    border: 1px solid #deebff;
    border-radius: 12px;
    padding: 0.85rem;
}

    .landing-metric-card span {
        display: block;
        font-size: 0.8rem;
        color: var(--f10-text-muted);
        margin-bottom: 0.15rem;
    }

    .landing-metric-card strong {
        font-size: 1.2rem;
        color: var(--f10-primary);
    }

@media (max-width: 960px) {
    .landing-hero {
        grid-template-columns: 1fr;
    }
}

/* Focused landing (anonymous + ?modules=...) */
.landing-focused-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
    align-content: start;
}

.landing-focused-card {
    border-radius: 14px !important;
    border: 1px solid var(--f10-border);
    background: #ffffff;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

    .landing-focused-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--f10-shadow-md) !important;
    }

.landing-focused-card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.45rem;
}

.landing-focused-card-title {
    font-weight: 700 !important;
    color: var(--f10-primary);
}

.landing-focused-card-desc {
    color: var(--f10-text-muted);
    margin-bottom: 0.6rem;
    min-height: 2.6em;
}

.landing-focused-card-cta {
    padding-left: 0 !important;
}

@media (max-width: 960px) {
    .landing-focused-grid {
        grid-template-columns: 1fr;
    }
}


.home-feature-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--f10-shadow-md) !important;
}

.home-tile-icon {
    font-size: 2rem;
    margin-bottom: 0.3rem;
}

/* ═══════════════════════════════════════════════
   Dashboard — module cards
   ═══════════════════════════════════════════════ */

.module-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--f10-shadow-md) !important;
}

/* ═══════════════════════════════════════════════
   Blazor error UI
   ═══════════════════════════════════════════════ */

#blazor-error-ui {
    background: #fff3cd;
    border-top: 1px solid #ffc107;
    bottom: 0;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    color: #000000;
    display: none;
    left: 0;
    padding: 0.65rem 1.5rem 0.75rem;
    position: fixed;
    width: 100%;
    z-index: 9999;
    font-size: 0.875rem;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

/* ═══════════════════════════════════════════════
   Campi bloccati (disabled) con sfondo grigio
   ═══════════════════════════════════════════════ */

.f10-field-locked .mud-input {
    background-color: #e9ecef !important;
}

/* ═══════════════════════════════════════════════
   Riga selezionata nelle tabelle
   ═══════════════════════════════════════════════ */

.f10-row-selected {
    background-color: #d0e6f9 !important;
    color: #000000 !important;
}

    .f10-row-selected td,
    .f10-row-selected td * {
        color: #000000 !important;
    }

/* Riga filtri per-colonna nelle tabelle (sotto il titolo, dentro lo stesso th).
   Layout: titolo in alto + banda filtri allineata sotto. La banda "filter"
   ha altezza minima fissa cosi' tutte le colonne si allineano anche se
   non hanno un filtro. Sfondo leggermente piu' chiaro per separare. */
.f10-col-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.f10-col-header-label {
    font-weight: 600;
}

.f10-col-header-filter {
    min-height: 44px;
    display: flex;
    align-items: center;
    background-color: #f8fafd;
    border-top: 1px solid var(--f10-border);
    margin: 0 -8px -8px -8px;
    padding: 4px 8px;
}

.massivo-row-valid {
    background-color: #e8f5e9 !important;
}

    .massivo-row-valid td {
        background-color: #e8f5e9 !important;
    }

/* ═══════════════════════════════════════════════
   Tema Fox Stocks Dashboard
   Palette: #6425FE (viola), #A6F7E2 (mint), #FFE5A5 (yellow), #9EC8FA (sky blue)
   Ispirato a https://www.figma.com/community/file/1202866913852978897/fox-stocks-dashboard
   ═══════════════════════════════════════════════ */

body.theme-fox-stocks {
    --f10-primary: #6425FE;
    --f10-primary-dark: #4a1bcc;
    --f10-accent: #9EC8FA;
    --f10-bg: #EDE8FF;
    --f10-shadow-sm: 0 1px 4px rgba(100, 37, 254, 0.08);
    --f10-shadow-md: 0 4px 16px rgba(100, 37, 254, 0.12);
    --f10-shadow-lg: 0 8px 32px rgba(100, 37, 254, 0.15);
}

    /* Stat card icons — Fox Stocks palette pastels */
    body.theme-fox-stocks .stat-card-icon.blue {
        background: rgba(158, 200, 250, 0.30);
    }

    body.theme-fox-stocks .stat-card-icon.green {
        background: rgba(166, 247, 226, 0.35);
    }

    body.theme-fox-stocks .stat-card-icon.orange {
        background: rgba(255, 229, 165, 0.50);
    }

    body.theme-fox-stocks .stat-card-icon.purple {
        background: rgba(100, 37, 254, 0.10);
    }

    /* Riga selezionata */
    body.theme-fox-stocks .f10-row-selected {
        background-color: #EDE8FF !important;
        color: #1A1033 !important;
    }

        body.theme-fox-stocks .f10-row-selected td,
        body.theme-fox-stocks .f10-row-selected td * {
            color: #1A1033 !important;
        }

/* ── UserMenu (top-bar dropdown: tema, lingua, tenant, logout) ── */
.f10-user-menu-activator {
    text-transform: none;
    font-weight: 500;
}

.f10-user-menu-popover {
    min-width: 280px;
    padding-top: 0.25rem !important;
    padding-bottom: 0.25rem !important;
}

    .f10-user-menu-popover .f10-user-menu-header {
        display: flex;
        align-items: center;
        gap: 0.875rem;
        padding: 1rem 1.5rem !important;
    }

.f10-user-menu-header-text {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}

.f10-user-menu-username {
    font-weight: 600;
    font-size: 0.925rem;
    color: var(--f10-text, #1e293b);
    line-height: 1.2;
    word-break: break-word;
}

.f10-user-menu-tenant {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.78rem;
    color: var(--f10-text-muted, #64748b);
    line-height: 1.2;
}

    .f10-user-menu-tenant .mud-icon-root {
        font-size: 0.95rem;
    }

.f10-user-menu-popover .f10-user-menu-section {
    display: block !important;
    padding: 0.75rem 1.5rem 0.375rem !important;
    color: var(--f10-text-muted, #64748b) !important;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.7rem;
    font-weight: 600;
}

.f10-user-menu-popover .mud-menu-item,
.f10-user-menu-popover .mud-list-item,
.f10-user-menu-popover a.mud-menu-item-clickable,
.f10-user-menu-popover button.mud-menu-item-clickable {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
}

.f10-user-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
}


.landing-mascot-variants {
    margin-top: 1rem;
    padding-top: 0.8rem;
    border-top: 1px dashed #d9e6ff;
    display: grid;
    grid-template-columns: repeat(4, minmax(40px, 1fr));
    gap: 0.45rem;
    justify-items: center;
}
