/* Madist Backoffice — stili consolidati (tema MudBlazor in MadistMudTheme.cs) */

:root {
    --madist-primary: #4a705a;
    --madist-primary-dark: #345c48;
    --madist-primary-deep: #1a2a22;
    --madist-primary-deeper: #121a16;
    --madist-accent: #6b9580;
    --madist-text-primary: #1a2a22;
    --madist-text-secondary: #4a6058;
    --madist-bg: #f3f6f4;
    --madist-surface: #ffffff;
    --madist-border: rgba(26, 42, 34, 0.12);
    --madist-shadow: 0 8px 32px rgba(18, 26, 22, 0.16);
    --madist-radius: 12px;
}

/* ── Login shell (split layout) ─────────────────────────────────────────── */

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr;
}

@media (min-width: 900px) {
    .login-shell {
        grid-template-columns: minmax(280px, 42%) 1fr;
    }
}

.login-shell__brand {
    display: none;
    position: relative;
    overflow: hidden;
    background: linear-gradient(155deg, var(--madist-primary-deeper) 0%, var(--madist-primary-deep) 50%, var(--madist-primary-dark) 100%);
    color: #ecf8f1;
    padding: 3rem 2.5rem;
}

@media (min-width: 900px) {
    .login-shell__brand {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}

.login-shell__brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(107, 149, 128, 0.14) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 40%);
    pointer-events: none;
}

.login-shell__brand-content {
    position: relative;
    z-index: 1;
    max-width: 22rem;
}

.login-shell__logo {
    display: block;
    margin-bottom: 1.5rem;
}

.login-shell__logo.bo-logo--brand {
    width: min(11rem, 72vw);
    max-height: 11rem;
}

.login-shell__tagline {
    font-size: 1.125rem;
    font-weight: 400;
    line-height: 1.6;
    color: rgba(232, 237, 233, 0.85);
    margin: 0 0 2rem;
}

.login-shell__features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.login-shell__features li {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.9rem;
    color: rgba(197, 212, 204, 0.8);
}

.login-shell__features li::before {
    content: "";
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--madist-accent);
}

.login-shell__main {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(160deg, #e8eeea 0%, var(--madist-bg) 40%, #eef2f0 100%);
}

@media (min-width: 900px) {
    .login-shell__main {
        background: var(--madist-bg);
    }
}

/* ── Login card ─────────────────────────────────────────────────────────── */

.login-card {
    width: 100%;
    max-width: 420px;
    border-radius: var(--madist-radius) !important;
    box-shadow: var(--madist-shadow) !important;
}

.login-card__header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.login-card__logo {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.login-card__logo .bo-logo--card {
    width: 5rem;
    max-height: 5rem;
}

.login-card__title {
    font-weight: 700 !important;
    letter-spacing: 0.03em;
    color: var(--madist-primary-deep) !important;
}

.login-card__subtitle {
    margin-top: 0.25rem;
}

.login-card__divider {
    margin: 1.5rem 0 !important;
}

/* ── Login form ─────────────────────────────────────────────────────────── */

.login-form .login-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.login-form .login-field label {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--madist-text-secondary);
}

.login-form .login-field input[type="email"],
.login-form .login-field input[type="password"],
.login-form .login-field input[type="text"] {
    width: 100%;
    height: 2.75rem;
    padding: 0 0.875rem;
    font: inherit;
    font-size: 0.9375rem;
    color: var(--madist-text-primary);
    background: var(--madist-surface);
    border: 1.5px solid var(--madist-border);
    border-radius: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-form .login-field input:hover {
    border-color: rgba(74, 112, 90, 0.35);
}

.login-form .login-field input:focus {
    outline: none;
    border-color: var(--madist-primary);
    box-shadow: 0 0 0 3px rgba(74, 112, 90, 0.15);
}

.login-form .login-field input::placeholder {
    color: rgba(74, 96, 88, 0.5);
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--madist-text-secondary);
    cursor: pointer;
    user-select: none;
}

.login-remember input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--madist-primary);
    cursor: pointer;
}

.login-form .mud-button-root {
    margin-top: 0.25rem;
    font-weight: 600 !important;
    letter-spacing: 0.03em;
    text-transform: none !important;
    height: 2.75rem !important;
}

.login-card__footer {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.75rem;
    color: var(--madist-text-secondary);
    opacity: 0.8;
}

/* ── Logo Madist ────────────────────────────────────────────────────────── */

.bo-logo {
    display: block;
    width: auto;
    /* Mai mostrare il PNG a risoluzione nativa (1368px) se manca un modificatore. */
    max-width: 12rem;
    max-height: 12rem;
    height: auto;
    object-fit: contain;
}

.bo-logo--appbar {
    width: 2.25rem;
    max-height: 2.25rem;
}

.bo-appbar-light {
    border-bottom: 1px solid var(--madist-border) !important;
    color: var(--madist-text-primary) !important;
}

.bo-appbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: inherit;
    text-decoration: none;
}

.bo-appbar-brand:hover {
    color: inherit;
}

.bo-appbar-brand:hover .bo-appbar-brand__title {
    opacity: 0.92;
}

.bo-appbar-brand__title {
    font-weight: 600 !important;
    letter-spacing: 0.01em;
    color: var(--madist-text-primary) !important;
}

.bo-appbar-user {
    color: var(--madist-text-secondary) !important;
}

/* ── Main layout ────────────────────────────────────────────────────────── */

.bo-main-content {
    background: var(--madist-bg);
    min-height: calc(100vh - 48px);
    /* pa-* sovrascrive padding-top di .mud-main-content: offset esplicito per AppBar dense */
    padding-top: calc(var(--mud-appbar-height, 48px) * 0.875 + 16px) !important;
}

@media (min-width: 960px) {
    .bo-main-content {
        padding-top: calc(var(--mud-appbar-height, 48px) * 0.875 + 24px) !important;
    }
}

.bo-page-title {
    margin-bottom: 1.25rem !important;
    font-weight: 600 !important;
}

.bo-stat-tile {
    border-radius: var(--madist-radius) !important;
    height: 100%;
    border: 1px solid var(--madist-border);
}

.bo-stat-tile__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.bo-stat-tile__icon {
    color: var(--madist-primary) !important;
    font-size: 1.35rem !important;
}

.bo-stat-tile__value {
    font-weight: 700 !important;
    color: var(--madist-primary-deep) !important;
    line-height: 1.2 !important;
    margin-bottom: 0.35rem !important;
}

.bo-stat-tile__loader {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 4.5rem;
    padding: 0.5rem 0;
}

.bo-stat-tile__subvalue {
    color: var(--madist-text-secondary);
}

.bo-stat-tile--compact .bo-stat-tile__value {
    font-size: 1.35rem !important;
    margin-bottom: 0.15rem !important;
}

.bo-simulation-match-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.bo-simulation-match-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    min-width: 9.5rem;
    max-width: 14rem;
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--madist-border);
    border-radius: 8px;
    background: var(--madist-surface);
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.bo-simulation-match-tile:hover {
    border-color: rgba(74, 112, 90, 0.45);
    box-shadow: 0 2px 8px rgba(18, 26, 22, 0.08);
}

.bo-simulation-match-tile--selected {
    border-color: var(--madist-primary);
    background: rgba(74, 112, 90, 0.08);
    box-shadow: 0 0 0 1px var(--madist-primary);
}

.bo-simulation-match-tile__league {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--madist-text-secondary);
    line-height: 1.2;
}

.bo-simulation-match-tile__teams {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--madist-primary-deep);
    line-height: 1.25;
}

.bo-simulation-match-tile__vs {
    font-weight: 400;
    color: var(--madist-text-secondary);
    margin: 0 0.2rem;
}

.bo-simulation-match-tile__score {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--madist-primary);
}

.bo-simulation-match-tile__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.1rem;
}

.bo-simulation-match-tile__state {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 0.12rem 0.4rem;
    border-radius: 999px;
    border: 1px solid var(--madist-border);
    color: var(--madist-text-secondary);
    background: rgba(26, 42, 34, 0.04);
}

.bo-simulation-match-tile__state--live {
    border-color: rgba(74, 112, 90, 0.45);
    color: var(--madist-primary-dark);
    background: rgba(74, 112, 90, 0.1);
}

.bo-simulation-match-tile__state--info {
    border-color: rgba(33, 150, 243, 0.35);
    color: #1565c0;
    background: rgba(33, 150, 243, 0.08);
}

.bo-simulation-match-tile__minute {
    font-size: 0.62rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 0.12rem 0.4rem;
    border-radius: 999px;
    color: var(--madist-text-secondary);
}

.bo-simulation-match-tile__minute--live {
    color: #fff;
    background: var(--madist-primary);
}

.bo-panel {
    border-radius: var(--madist-radius) !important;
}

.bo-panel + .bo-panel {
    margin-top: 1rem;
}

.bo-resource-tile-wrap {
    cursor: pointer;
    height: 100%;
    border-radius: var(--madist-radius);
    transition: box-shadow 0.15s ease, outline-color 0.15s ease;
}

.bo-resource-tile-wrap:hover .bo-resource-tile {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.bo-resource-tile-wrap--active .bo-resource-tile {
    outline: 2px solid var(--madist-primary);
    outline-offset: 1px;
}

.bo-resource-tile-wrap--warn .bo-resource-tile {
    outline: 2px solid var(--mud-palette-warning);
    outline-offset: 1px;
}

.bo-resource-tile-wrap--alert .bo-resource-tile {
    outline: 2px solid var(--mud-palette-error);
    outline-offset: 1px;
}

.bo-resource-tile {
    height: 100%;
}

.bo-container-row--down td {
    background: color-mix(in srgb, var(--mud-palette-error) 12%, transparent);
}

.bo-signal-tile {
    padding: 0.5rem 0;
}

/* Trade — classifiche (ranking bars al posto di MudChart) */
.bo-rank-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.bo-rank-card__title {
    font-weight: 600 !important;
    letter-spacing: -0.01em;
    color: var(--madist-text-primary);
    line-height: 1.25 !important;
}

.bo-rank-card__subtitle {
    display: block;
    margin-top: 0.15rem;
    color: var(--madist-text-secondary) !important;
}

.bo-rank-card__chip {
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    color: var(--madist-primary-dark);
    background: rgba(74, 112, 90, 0.12);
}

.bo-rank-card__chip--flop {
    color: #8a3b2f;
    background: rgba(180, 72, 56, 0.12);
}

.bo-rank-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.bo-rank-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: bo-rank-in 0.45s ease both;
    animation-delay: calc(var(--rank-i, 0) * 35ms);
}

@keyframes bo-rank-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.bo-rank-row__badge {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--madist-text-secondary);
    background: rgba(26, 42, 34, 0.06);
}

.bo-rank-list--top .bo-rank-row__badge[data-rank="1"] {
    color: #5c4810;
    background: linear-gradient(145deg, #f5e6a8, #e0c45a);
}

.bo-rank-list--top .bo-rank-row__badge[data-rank="2"] {
    color: #3d4550;
    background: linear-gradient(145deg, #e8ecf0, #b8c0c8);
}

.bo-rank-list--top .bo-rank-row__badge[data-rank="3"] {
    color: #5a3a28;
    background: linear-gradient(145deg, #edc9a8, #c88858);
}

.bo-rank-list--flop .bo-rank-row__badge[data-rank="1"],
.bo-rank-list--flop .bo-rank-row__badge[data-rank="2"],
.bo-rank-list--flop .bo-rank-row__badge[data-rank="3"] {
    color: #6b2e24;
    background: linear-gradient(145deg, #f0c4ba, #d47868);
}

.bo-rank-row__body {
    flex: 1;
    min-width: 0;
}

.bo-rank-row__meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.28rem;
}

.bo-rank-row__label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--madist-text-primary);
}

.bo-rank-row__value {
    flex-shrink: 0;
    font-size: 0.8125rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--madist-primary-dark);
}

.bo-rank-list--flop .bo-rank-row__value {
    color: #a34436;
}

.bo-rank-row__track {
    height: 0.45rem;
    border-radius: 999px;
    background: rgba(26, 42, 34, 0.06);
    overflow: hidden;
}

.bo-rank-row__fill {
    height: 100%;
    width: var(--rank-pct, 0%);
    border-radius: inherit;
    background: linear-gradient(90deg, var(--madist-primary) 0%, var(--madist-accent) 100%);
    box-shadow: 0 0 0 1px rgba(74, 112, 90, 0.08);
    transform-origin: left center;
    animation: bo-rank-fill 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: calc(var(--rank-i, 0) * 35ms + 80ms);
}

.bo-rank-list--flop .bo-rank-row__fill {
    background: linear-gradient(90deg, #c45c4a 0%, #e08a6e 100%);
    box-shadow: 0 0 0 1px rgba(196, 92, 74, 0.1);
}

@keyframes bo-rank-fill {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .bo-rank-row,
    .bo-rank-row__fill {
        animation: none;
    }
}

/* Simulazione — controlli stile registratore */
.bo-simulation-panel {
    border-left: 4px solid var(--madist-primary);
}

.bo-firestore-monitor-panels__item {
    display: flex;
}

.bo-firestore-monitor-panels__item .bo-panel {
    flex: 1;
    width: 100%;
}

.bo-firestore-connection-panel {
    border-left: 4px solid rgba(74, 112, 90, 0.35);
}

.bo-recorder {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(26, 42, 34, 0.05);
}

.bo-recorder__play {
    border-radius: 50% !important;
    width: 3rem !important;
    height: 3rem !important;
}

.bo-recorder__stop {
    border-radius: 8px !important;
    width: 2.5rem !important;
    height: 2.5rem !important;
}

.bo-match-card {
    border-radius: var(--madist-radius) !important;
    height: 100%;
}

.bo-match-card__teams {
    font-weight: 600 !important;
    line-height: 1.35 !important;
}

/* Firestore monitor — switch vista partite / giocatori */
.bo-firestore-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.bo-firestore-switch--stacked {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    gap: 0.75rem;
}

.bo-firestore-switch--stacked .bo-firestore-switch__btn {
    flex: 1;
    min-height: 4.25rem;
    justify-content: flex-start;
    padding: 1rem 1.25rem;
}

.bo-firestore-switch--stacked .bo-firestore-switch__count {
    margin-left: auto;
}

.bo-firestore-switch__btn {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 0;
    padding: 0.625rem 1rem;
    border: 2px solid var(--madist-border);
    border-radius: var(--madist-radius);
    background: var(--madist-surface);
    color: var(--madist-text-primary);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    font: inherit;
}

.bo-firestore-switch__btn:hover {
    border-color: rgba(74, 112, 90, 0.45);
    box-shadow: 0 4px 16px rgba(18, 26, 22, 0.08);
}

.bo-firestore-switch__btn--active {
    border-color: var(--madist-primary);
    background: rgba(74, 112, 90, 0.08);
    box-shadow: 0 4px 20px rgba(74, 112, 90, 0.14);
}

.bo-firestore-switch__label {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
}

.bo-firestore-switch__count {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--madist-text-secondary);
    line-height: 1;
}

/* Drawer scuro coerente col brand */
.bo-drawer.mud-drawer {
    height: 100%;
}

.bo-drawer .mud-drawer-content {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 100%;
    box-sizing: border-box;
    /* Spazio per la versione fissata in basso. */
    padding-bottom: 2.75rem !important;
}

.bo-drawer__inner {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.bo-drawer__nav {
    width: 100%;
}

.bo-drawer__version {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    padding: 0.75rem 1rem 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: rgba(197, 212, 204, 0.55);
    font-variant-numeric: tabular-nums;
    background: linear-gradient(180deg, transparent 0%, rgba(18, 26, 22, 0.92) 35%);
    pointer-events: none;
}

.mud-drawer-dark .mud-nav-link.active {
    background: rgba(107, 149, 128, 0.14) !important;
    border-radius: 8px;
}

.mud-drawer-dark .mud-nav-link:hover:not(.active) {
    background: rgba(255, 255, 255, 0.06) !important;
    border-radius: 8px;
}

/* ── User detail dialog ─────────────────────────────────────────────────── */

.bo-user-dialog .mud-dialog-title {
    padding: 1rem 1.25rem 0.5rem !important;
}

.bo-user-dialog__header {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.bo-user-dialog__avatar {
    flex-shrink: 0;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.bo-private-league-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── Private league avatar uploader ─────────────────────────────────────── */

.bo-pl-avatar-uploader-host {
    display: block;
    width: 100%;
}

.bo-pl-avatar-uploader-host .mud-file-upload,
.bo-pl-avatar-uploader-host .mud-input-control {
    margin: 0 !important;
}

.bo-pl-avatar-uploader__native-input {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
}

.bo-pl-avatar-uploader {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1.1rem;
    width: 100%;
    min-height: 6.5rem;
    padding: 0.9rem 1.1rem;
    border: 1.5px dashed rgba(74, 112, 90, 0.35);
    border-radius: var(--madist-radius);
    background:
        linear-gradient(145deg, rgba(243, 246, 244, 0.95) 0%, rgba(255, 255, 255, 0.98) 55%),
        var(--madist-surface);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.bo-pl-avatar-uploader:hover,
.bo-pl-avatar-uploader:focus-visible {
    border-color: var(--madist-primary);
    box-shadow: 0 0 0 3px rgba(74, 112, 90, 0.12);
    outline: none;
}

.bo-pl-avatar-uploader--busy {
    cursor: progress;
    opacity: 0.85;
    pointer-events: none;
}

.bo-pl-avatar-uploader__preview {
    position: relative;
    flex-shrink: 0;
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    overflow: hidden;
    background: var(--madist-bg);
    box-shadow: 0 4px 14px rgba(18, 26, 22, 0.14);
    border: 2px solid rgba(255, 255, 255, 0.95);
}

.bo-pl-avatar-uploader__img {
    width: 100% !important;
    height: 100% !important;
}

.bo-pl-avatar-uploader__overlay,
.bo-pl-avatar-uploader__busy {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(26, 42, 34, 0.42);
    color: #ecf8f1;
    opacity: 0;
    transition: opacity 0.16s ease;
}

.bo-pl-avatar-uploader:hover .bo-pl-avatar-uploader__overlay,
.bo-pl-avatar-uploader:focus-visible .bo-pl-avatar-uploader__overlay,
.bo-pl-avatar-uploader__busy {
    opacity: 1;
}

.bo-pl-avatar-uploader__copy {
    min-width: 0;
    flex: 1;
}

.bo-pl-avatar-uploader__title {
    color: var(--madist-primary-deep) !important;
    font-weight: 600 !important;
    margin-bottom: 0.15rem !important;
}

.bo-pl-avatar-uploader__hint {
    color: var(--madist-text-secondary) !important;
    line-height: 1.35 !important;
}

.bo-user-dialog__header-text {
    min-width: 0;
    flex: 1;
}

.bo-user-dialog__name {
    font-weight: 600 !important;
    color: var(--madist-primary-deep) !important;
}

.bo-user-dialog__enrolled {
    white-space: nowrap;
}

.bo-user-dialog__tabs .mud-tabs-tabbar .mud-tabs-tabbar-inner {
    min-height: 2.25rem !important;
}

.bo-user-dialog__tabs .mud-tabs-tabbar .mud-tab {
    min-height: 2.25rem !important;
    width: auto !important;
    flex-grow: 0 !important;
    padding: 0.2rem 0.65rem !important;
    line-height: 1.25 !important;
    white-space: nowrap !important;
}

.bo-user-dialog__tabs .mud-tabs-tabbar .mud-tab .mud-tab-icon-text {
    margin-right: 0.35rem !important;
    margin-inline-end: 0.35rem !important;
    font-size: 1.125rem !important;
}

.bo-user-dialog__tabs .mud-tab-panel {
    padding: 0.75rem 0.875rem;
}

.bo-user-dialog__content {
    padding-top: 0 !important;
}

.bo-user-dialog__stats .bo-stat-tile__header {
    margin-bottom: 0.35rem;
}

.bo-user-dialog__stats .bo-stat-tile__icon {
    font-size: 1rem !important;
}

.bo-user-dialog__stats .bo-stat-tile__value {
    font-size: 1.05rem !important;
    margin-bottom: 0 !important;
}

.bo-user-dialog__details {
    border-radius: var(--madist-radius) !important;
}

.bo-user-dialog__detail {
    min-width: 0;
}

.bo-user-dialog__detail-label {
    display: block;
    margin-bottom: 0.15rem;
    letter-spacing: 0.03em;
    font-weight: 600;
}

.bo-user-dialog__detail-value {
    line-height: 1.35;
}

.bo-user-dialog__detail-select {
    margin-top: 0;
    max-width: 12rem;
}

.bo-user-dialog__section-label {
    display: block;
    margin-bottom: 0.5rem;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.bo-user-dialog__fields {
    border-radius: var(--madist-radius) !important;
    overflow: hidden;
}

.bo-user-dialog__field {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--madist-border);
}

.bo-user-dialog__field:nth-last-child(-n+2) {
    border-bottom: none;
}

@media (min-width: 600px) {
    .bo-user-dialog__field:nth-child(odd) {
        border-right: 1px solid var(--madist-border);
    }
}

.bo-user-dialog__field-label {
    display: block;
    margin-bottom: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.bo-user-dialog__field-value--mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8125rem;
    word-break: break-all;
}

.bo-user-dialog__referrer {
    border-radius: var(--madist-radius) !important;
    background: rgba(74, 112, 90, 0.04);
}

.bo-user-dialog__table-wrap {
    border-radius: var(--madist-radius) !important;
    overflow: hidden;
}

.bo-user-dialog__table-wrap .mud-table-root {
    background: transparent;
}

.bo-user-dialog__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 2.5rem 1rem;
    text-align: center;
    border: 1px dashed var(--madist-border);
    border-radius: var(--madist-radius);
    background: rgba(74, 112, 90, 0.03);
}

.bo-user-dialog__actions {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    padding: 0.75rem 0 0.25rem;
    border-top: 1px solid var(--madist-border);
}

/* ── Simulazione gioco ─────────────────────────────────────────────────── */

.bo-points-positive {
    color: var(--mud-palette-success);
    font-weight: 600;
}

.bo-points-negative {
    color: var(--mud-palette-error);
    font-weight: 600;
}

.bo-points-neutral {
    color: var(--mud-palette-text-secondary);
}

.bo-simulation-open-positions,
.bo-simulation-players,
.bo-simulation-ranking tbody tr {
    cursor: pointer;
}

.bo-simulation-player-chart-dialog {
    max-width: 26rem;
}

.bo-simulation-player-chart-dialog__content {
    margin: -0.25rem 0 0;
}

.bo-simulation-player-chart-dialog .mud-dialog-actions {
    padding-top: 0;
}

.bo-simulation-player-chart-dialog__subtitle {
    color: var(--mud-palette-text-secondary);
}

.bo-simulation-player-chart-dialog__meta {
    margin-top: 0.5rem;
}

.bo-simulation-player-chart-panel {
    background: #000;
    border-radius: 8px;
    padding: 0.5rem 0.35rem 0.25rem;
    overflow: hidden;
}

.bo-simulation-player-chart-panel .mud-chart-line {
    max-width: 100%;
}

.bo-simulation-player-chart-panel .mud-chart-line path {
    stroke: #22c55e !important;
}

.bo-simulation-player-chart-panel .mud-chart-line circle,
.bo-simulation-player-chart-panel .mud-chart-line .mud-chart-marker {
    fill: #22c55e !important;
    stroke: #22c55e !important;
}

.bo-simulation-player-chart-panel .mud-chart-axis-label {
    fill: rgba(255, 255, 255, 0.55) !important;
}

.bo-simulation-player-chart-panel .mud-charts-xaxis line,
.bo-simulation-player-chart-panel .mud-charts-yaxis line {
    stroke: rgba(255, 255, 255, 0.12) !important;
}

.bo-simulation-player-chart-dialog__title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.bo-open-position-chart-block__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.15rem;
}

.bo-open-position-chart-block__header .bo-open-position-chart-block__title {
    margin: 0;
    min-width: 0;
}

.bo-simulation-open-positions-charts-dialog .mud-dialog-content {
    max-height: min(75vh, 780px);
    overflow-y: auto;
}

.bo-open-positions-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.bo-open-positions-header__chart-all {
    flex-shrink: 0;
}

.bo-open-positions-charts-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (max-width: 960px) {
    .bo-open-positions-charts-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .bo-open-positions-charts-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.bo-open-position-chart-block {
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--madist-border);
}

.bo-open-position-chart-block--compact {
    padding: 0.5rem;
    margin: 0;
    border: 1px solid var(--madist-border);
    border-radius: 8px;
    background: rgba(74, 112, 90, 0.03);
}

.bo-open-position-chart-block:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: none;
}

.bo-open-position-chart-block--compact:last-child {
    padding: 0.5rem;
    border-bottom: 1px solid var(--madist-border);
}

.bo-open-position-chart-block__title {
    font-weight: 600;
    line-height: 1.2;
}

.bo-open-position-chart-block__meta,
.bo-open-position-chart-block__footer {
    line-height: 1.2;
}

.bo-simulation-player-chart-panel--compact {
    padding: 0.35rem 0.25rem 0.15rem;
    margin-top: 0.35rem;
}

.bo-simulation-player-chart-panel .mud-chart-line path:nth-of-type(2) {
    stroke: #ef4444 !important;
}

.bo-simulation-trades-dialog {
    border-radius: var(--madist-radius);
    overflow: hidden;
}

.bo-simulation-ranking tbody tr:hover {
    background: rgba(74, 112, 90, 0.06);
}

.bo-live-rate {
    font-weight: 700;
    color: var(--madist-primary-dark);
}

.bo-stat-tile__dual-values {
    display: flex;
    gap: 1rem;
}

.bo-stat-tile__dual-value {
    flex: 1;
    min-width: 0;
}

.bo-stat-tile--compact .bo-stat-tile__dual-value .bo-stat-tile__value {
    font-size: 1.15rem;
    line-height: 1.2;
}

.bo-stat-tile--clickable {
    cursor: pointer;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.bo-stat-tile--clickable:hover {
    box-shadow: 0 4px 14px rgba(74, 112, 90, 0.18);
}

.bo-stat-tile--clickable:focus-visible {
    outline: 2px solid var(--madist-primary);
    outline-offset: 2px;
}

.bo-simulation-trades-table {
    width: 100%;
}

.bo-simulation-filters {
    border-radius: var(--madist-radius);
    background: rgba(74, 112, 90, 0.03);
}

.bo-sortable-th {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.bo-sortable-th--end {
    text-align: end;
}

.bo-sort-indicator {
    margin-left: 0.25rem;
    font-size: 0.75rem;
    opacity: 0.9;
}

.bo-sort-indicator--idle {
    opacity: 0.35;
}

/* ── Utility ────────────────────────────────────────────────────────────── */

.cursor-pointer {
    cursor: pointer;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 10000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}
