.topbar{
    position: sticky;
    top: 0;
    z-index: 100;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;

    padding: 10px 14px;
    background: rgba(15,26,48,.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.topbar-left,
.topbar-right{
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex-wrap: wrap;
}

.topbar-right{
    margin-left: auto;
    justify-content: flex-end;
}

.topbar-sections{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    max-width: 100%;
}

.brand{
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #e7eefc;
    font-size: 15px;
}

.brand-dot{
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #42C5F4;
    box-shadow: 0 0 0 6px rgba(66,197,244,.15);
}

.brand-sub{
    font-size: 12px;
    color: #a8b4d6;
}

.user{
    font-size: 13px;
    color: #a8b4d6;
    white-space: nowrap;
}

.btn{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    padding: 7px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.05);
    color: #e7eefc;
    text-decoration: none;
    font-size: 13px;

    transition: background .15s ease, border-color .15s ease, transform .08s ease;
}

.btn:hover{
    background: rgba(255,255,255,.10);
    border-color: rgba(255,255,255,.18);
}

.btn:active{
    transform: translateY(1px);
}

.btn-home{
    font-size: 15px;
    width: 36px;
    padding: 7px 0;
}

.btn-section{
    width: 36px;
    padding: 7px 0;
}

.btn-logout{
    color: #ffb3b3;
    border-color: rgba(255,107,107,.35);
    width: 36px;
    padding: 7px 0;
    font-size: 15px;
}

.btn-logout:hover{
    background: rgba(255,107,107,.15);
    border-color: rgba(255,107,107,.6);
}

.scrollbar-dark,
html,
body,
.mbs-notify-body,
.mbs-quick-modal-body,
.topbar-right,
.mbs-topbar-right,
.topbar-sections,
.mbs-topbar-sections,
.andamento-drilldown-table-wrap,
.gr-table-wrap,
.mbs-modal-body,
.view-menu,
.table-wrap,
.mul-table-scroll,
.mw-table-wrap,
.tabbar,
.filters-modal-body,
.event-results{
    scrollbar-width: thin;
    scrollbar-color: rgba(66,197,244,.45) rgba(255,255,255,.06);
}

/* Utility scrollbar dark theme, reusable via .scrollbar-dark */
.scrollbar-dark::-webkit-scrollbar,
html::-webkit-scrollbar,
body::-webkit-scrollbar,
.mbs-notify-body::-webkit-scrollbar,
.mbs-quick-modal-body::-webkit-scrollbar,
.topbar-right::-webkit-scrollbar,
.mbs-topbar-right::-webkit-scrollbar,
.topbar-sections::-webkit-scrollbar,
.mbs-topbar-sections::-webkit-scrollbar,
.andamento-drilldown-table-wrap::-webkit-scrollbar,
.gr-table-wrap::-webkit-scrollbar,
.mbs-modal-body::-webkit-scrollbar,
.view-menu::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar,
.mul-table-scroll::-webkit-scrollbar,
.mw-table-wrap::-webkit-scrollbar,
.tabbar::-webkit-scrollbar,
.filters-modal-body::-webkit-scrollbar,
.event-results::-webkit-scrollbar{
    width: 10px;
    height: 10px;
}

.scrollbar-dark::-webkit-scrollbar-track,
html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
.mbs-notify-body::-webkit-scrollbar-track,
.mbs-quick-modal-body::-webkit-scrollbar-track,
.topbar-right::-webkit-scrollbar-track,
.mbs-topbar-right::-webkit-scrollbar-track,
.topbar-sections::-webkit-scrollbar-track,
.mbs-topbar-sections::-webkit-scrollbar-track,
.andamento-drilldown-table-wrap::-webkit-scrollbar-track,
.gr-table-wrap::-webkit-scrollbar-track,
.mbs-modal-body::-webkit-scrollbar-track,
.view-menu::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track,
.mul-table-scroll::-webkit-scrollbar-track,
.mw-table-wrap::-webkit-scrollbar-track,
.tabbar::-webkit-scrollbar-track,
.filters-modal-body::-webkit-scrollbar-track,
.event-results::-webkit-scrollbar-track{
    background: rgba(255,255,255,.06);
    border-radius: 999px;
}

.scrollbar-dark::-webkit-scrollbar-thumb,
html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
.mbs-notify-body::-webkit-scrollbar-thumb,
.mbs-quick-modal-body::-webkit-scrollbar-thumb,
.topbar-right::-webkit-scrollbar-thumb,
.mbs-topbar-right::-webkit-scrollbar-thumb,
.topbar-sections::-webkit-scrollbar-thumb,
.mbs-topbar-sections::-webkit-scrollbar-thumb,
.andamento-drilldown-table-wrap::-webkit-scrollbar-thumb,
.gr-table-wrap::-webkit-scrollbar-thumb,
.mbs-modal-body::-webkit-scrollbar-thumb,
.view-menu::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb,
.mul-table-scroll::-webkit-scrollbar-thumb,
.mw-table-wrap::-webkit-scrollbar-thumb,
.tabbar::-webkit-scrollbar-thumb,
.filters-modal-body::-webkit-scrollbar-thumb,
.event-results::-webkit-scrollbar-thumb{
    background: linear-gradient(180deg, rgba(66,197,244,.55), rgba(66,197,244,.32));
    border-radius: 999px;
    border: 2px solid rgba(15,26,48,.55);
}

.scrollbar-dark::-webkit-scrollbar-thumb:hover,
html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover,
.mbs-notify-body::-webkit-scrollbar-thumb:hover,
.mbs-quick-modal-body::-webkit-scrollbar-thumb:hover,
.topbar-right::-webkit-scrollbar-thumb:hover,
.mbs-topbar-right::-webkit-scrollbar-thumb:hover,
.topbar-sections::-webkit-scrollbar-thumb:hover,
.mbs-topbar-sections::-webkit-scrollbar-thumb:hover,
.andamento-drilldown-table-wrap::-webkit-scrollbar-thumb:hover,
.gr-table-wrap::-webkit-scrollbar-thumb:hover,
.mbs-modal-body::-webkit-scrollbar-thumb:hover,
.view-menu::-webkit-scrollbar-thumb:hover,
.table-wrap::-webkit-scrollbar-thumb:hover,
.mul-table-scroll::-webkit-scrollbar-thumb:hover,
.mw-table-wrap::-webkit-scrollbar-thumb:hover,
.tabbar::-webkit-scrollbar-thumb:hover,
.filters-modal-body::-webkit-scrollbar-thumb:hover,
.event-results::-webkit-scrollbar-thumb:hover{
    background: linear-gradient(180deg, rgba(66,197,244,.7), rgba(66,197,244,.42));
}

.scrollbar-dark::-webkit-scrollbar-corner,
html::-webkit-scrollbar-corner,
body::-webkit-scrollbar-corner,
.mbs-notify-body::-webkit-scrollbar-corner,
.mbs-quick-modal-body::-webkit-scrollbar-corner,
.topbar-right::-webkit-scrollbar-corner,
.mbs-topbar-right::-webkit-scrollbar-corner,
.topbar-sections::-webkit-scrollbar-corner,
.mbs-topbar-sections::-webkit-scrollbar-corner,
.andamento-drilldown-table-wrap::-webkit-scrollbar-corner,
.gr-table-wrap::-webkit-scrollbar-corner,
.mbs-modal-body::-webkit-scrollbar-corner,
.view-menu::-webkit-scrollbar-corner,
.table-wrap::-webkit-scrollbar-corner,
.mul-table-scroll::-webkit-scrollbar-corner,
.mw-table-wrap::-webkit-scrollbar-corner,
.tabbar::-webkit-scrollbar-corner,
.filters-modal-body::-webkit-scrollbar-corner,
.event-results::-webkit-scrollbar-corner{
    background: rgba(255,255,255,.06);
}

/* Mobile */
@media (max-width: 600px){
    .topbar{
        padding: 8px 10px;
        gap: 6px;
        flex-wrap: nowrap;
    }
    .topbar-right{
        justify-content: flex-end;
        gap: 6px;
        flex-wrap: nowrap;
        min-width: 0;
    }
    .brand-sub{
        display: none;
    }
    .user{
        display: none; /* resta solo Home + Logout */
    }
    .topbar-sections{
        gap: 4px;
        flex-wrap: nowrap;
        min-width: 0;
    }
}

/* ===== MBS UI (isolato, evita conflitti con .btn ecc.) ===== */

:root{
    --mbs-bg:#0b1220;
    --mbs-card:#0f1a30;
    --mbs-text:#e7eefc;
    --mbs-muted:#a8b4d6;
    --mbs-line:rgba(255,255,255,.08);
    --mbs-accent:#42C5F4;
    --mbs-accent2:#6dbcce;
    --mbs-danger:#ff6b6b;
    --mbs-shadow:0 10px 30px rgba(0,0,0,.35);
    --mbs-radius:18px;
    color-scheme:dark;
}

::selection{
    background:rgba(66,197,244,.32);
    color:#fff;
}

:where(a, button, input, select, textarea):focus-visible{
    outline:2px solid rgba(113,220,255,.9);
    outline-offset:3px;
}

/* --- Select2 (tema MBS) --- */
/*.select2-container{*/
/*    width: 100% !important;*/
/*}*/
.select2-container--default .select2-selection--single{
    height: 38px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 10px;
    background: rgba(255,255,255,.04);
    color: #e7eefc;
}
.select2-container--default .select2-selection--single .select2-selection__rendered{
    line-height: 36px;
    color: #e7eefc;
    padding-left: 10px;
    padding-right: 28px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow{
    height: 36px;
    right: 8px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow b{
    border-color: #a8b4d6 transparent transparent transparent;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder{
    color: #a8b4d6;
}
.select2-container--default.select2-container--disabled .select2-selection--single{
    opacity: .65;
    cursor: not-allowed;
}
.select2-dropdown{
    background: #0f1a30;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 10px;
    overflow: hidden;
}
.select2-results__option{
    color: #e7eefc;
}
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable{
    background: rgba(66,197,244,.22);
    color: #e7eefc;
}
.select2-container--default .select2-results__option--selected{
    background: rgba(66,197,244,.14);
    color: #e7eefc;
}
.select2-search--dropdown .select2-search__field{
    background: rgba(255,255,255,.04);
    color: #e7eefc;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 8px;
    outline: none;
}

/* Se vuoi applicare background "app" alla home, usa body.mbs-page */
body.mbs-page{
    margin:0;
    min-height:100vh;
    background:
            radial-gradient(1200px 600px at 20% -10%, rgba(66,197,244,.25), transparent 55%),
            radial-gradient(900px 500px at 100% 0%, rgba(109,188,206,.20), transparent 55%),
            var(--mbs-bg);
    color: var(--mbs-text);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* --- Topbar --- */
.mbs-topbar{
    position: sticky;
    top: 0;
    z-index: 100;
    box-sizing: border-box;

    display:flex;
    align-items:center;
    justify-content:space-between;
    gap: 12px;

    padding: 11px 16px;
    background: linear-gradient(180deg, rgba(17,30,54,.96), rgba(13,23,43,.92));
    backdrop-filter: blur(16px) saturate(135%);
    border-bottom: 1px solid var(--mbs-line);
    width: 100%;
    box-shadow:0 8px 28px rgba(0,0,0,.14);
}

.mbs-topbar-left,
.mbs-topbar-right{
    display:flex;
    align-items:center;
    gap: 10px;
}

.mbs-topbar-sections{
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.mbs-section-menu{
    position: relative;
    display: inline-flex;
}

.mbs-brand{
    display:flex;
    align-items:center;
    gap: 10px;
    text-decoration:none;
    color: var(--mbs-text);
    font-size: 15px;
}

.mbs-brand-dot{
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--mbs-accent);
    box-shadow: 0 0 0 6px rgba(66,197,244,.15);
    animation:mbs-brand-pulse 3s ease-in-out infinite;
}

@keyframes mbs-brand-pulse{
    0%, 100%{ box-shadow:0 0 0 5px rgba(66,197,244,.12); }
    50%{ box-shadow:0 0 0 7px rgba(66,197,244,.19); }
}

.mbs-brand-sub{
    font-size: 12px;
    color: var(--mbs-muted);
}

.mbs-user{
    font-size: 13px;
    color: var(--mbs-muted);
    white-space: nowrap;
}

/* Bottoni topbar */
.mbs-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap: 6px;

    padding: 7px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.05);
    color: var(--mbs-text);
    text-decoration:none;
    font-size: 13px;
    line-height: 1;

    font-family:inherit;
    cursor:pointer;
    transition: background .16s ease, border-color .16s ease, color .16s ease, transform .12s ease, box-shadow .16s ease;
}

.mbs-btn:hover{
    background: rgba(255,255,255,.10);
    border-color: rgba(255,255,255,.18);
    transform:translateY(-1px);
    box-shadow:0 8px 18px rgba(0,0,0,.14);
}

.mbs-btn:active{ transform: translateY(1px); }

.mbs-btn-home{
    width: 36px;
    padding: 7px 0;
    font-size: 15px;
}

.mbs-btn-voice{
    width: 36px;
    padding: 7px 0;
    font-size: 15px;
    color: #9fe7ff;
    border-color: rgba(66,197,244,.32);
    background: rgba(66,197,244,.10);
}

.mbs-btn-voice:hover{
    background: rgba(66,197,244,.18);
    border-color: rgba(66,197,244,.44);
}

.mbs-btn-section{
    width: 36px;
    padding: 7px 0;
    font-size: 15px;
    position:relative;
}

.mbs-btn-section.is-active{
    color:#8fe4ff;
    border-color:rgba(66,197,244,.38);
    background:linear-gradient(180deg, rgba(66,197,244,.20), rgba(66,197,244,.10));
    box-shadow:inset 0 1px 0 rgba(255,255,255,.06), 0 8px 20px rgba(25,144,194,.10);
}

.mbs-btn-section.is-active::after{
    content:"";
    position:absolute;
    left:10px;
    right:10px;
    bottom:-12px;
    height:2px;
    border-radius:99px;
    background:#42c5f4;
    box-shadow:0 0 10px rgba(66,197,244,.7);
}

.mbs-section-submenu{
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    z-index: 160;
    min-width: 178px;
    padding: 6px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 8px;
    background: rgba(15,26,48,.98);
    box-shadow: 0 18px 42px rgba(0,0,0,.35);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .12s ease, transform .12s ease, visibility .12s ease;
}

.mbs-section-submenu::before{
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -9px;
    height: 9px;
}

.mbs-section-menu:hover .mbs-section-submenu,
.mbs-section-menu:focus-within .mbs-section-submenu{
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.mbs-section-menu:last-child .mbs-section-submenu{
    left:auto;
    right:0;
    transform:translateY(-4px);
}

.mbs-section-menu:last-child:hover .mbs-section-submenu,
.mbs-section-menu:last-child:focus-within .mbs-section-submenu{
    transform:translateY(0);
}

.mbs-section-submenu-link{
    display: block;
    padding: 9px 10px;
    border-radius: 6px;
    color: var(--mbs-text);
    text-decoration: none;
    font-size: 13px;
    line-height: 1.15;
    white-space: nowrap;
}

.mbs-section-submenu-link:hover,
.mbs-section-submenu-link:focus{
    background: rgba(66,197,244,.16);
    color: #fff;
    outline: none;
}

.mbs-btn-notify{
    position: relative;
    width: 36px;
    padding: 7px 0;
    font-size: 15px;
    cursor: pointer;
}

.mbs-notify-badge{
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ff6b6b;
    color: #fff;
    border: 1px solid rgba(11, 18, 32, 0.9);
    font-size: 10px;
    font-weight: 800;
    line-height: 16px;
    text-align: center;
    box-sizing: border-box;
}

.mbs-btn-logout{
    color: #ffb3b3;
    border-color: rgba(255,107,107,.35);
    width: 36px;
    padding: 7px 0;
    font-size: 15px;
}

.mbs-btn-logout:hover{
    background: rgba(255,107,107,.15);
    border-color: rgba(255,107,107,.6);
}

/* --- Home card --- */
.mbs-wrap{
    max-width: 780px;
    margin: 18px auto;
    padding: 0 12px;
}

.mbs-card{
    background: linear-gradient(145deg, rgba(255,255,255,.065), transparent 38%), rgba(15,26,48,.94);
    border:1px solid rgba(255,255,255,.105);
    border-radius: var(--mbs-radius);
    box-shadow:0 22px 55px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.035);
    padding: 22px;
}

.mbs-title{
    font-size:22px;
    font-weight:800;
    letter-spacing:.3px;
    margin-bottom:6px;
}

.mbs-subtitle{
    font-size:13px;
    color: var(--mbs-muted);
    margin-bottom:18px;
}

.mbs-home-tabs{
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}
.mbs-home-tab{
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.04);
    color: var(--mbs-text);
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition:background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}
.mbs-home-tab:hover{
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.24);
}
.mbs-home-tab.active{
    background: rgba(66,197,244,.18);
    border-color: rgba(66,197,244,.42);
    color:#a9ebff;
    box-shadow:inset 0 0 0 1px rgba(66,197,244,.08), 0 6px 18px rgba(25,144,194,.10);
}
.mbs-home-panel{
    display: none;
}
.mbs-home-panel.active{
    display: block;
}

.mbs-actions{
    display:grid;
    grid-template-columns:1fr;
    gap: 14px;
}

@media (min-width: 760px){
    .mbs-actions{
        grid-template-columns:repeat(2, minmax(0, 1fr));
    }
}

.mbs-tile{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap: 12px;
    min-width: 0;

    padding: 16px 18px;
    border-radius: 16px;
    text-decoration:none;
    color: var(--mbs-text);
    border:1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.04);
    transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.mbs-tile:hover{
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.16);
    transform:translateY(-2px);
    box-shadow:0 12px 26px rgba(0,0,0,.16);
}

.mbs-tile:active{ transform: translateY(1px); }
.mbs-tile-btn{
    width: 100%;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.mbs-tile-left{
    display:flex;
    align-items:center;
    gap: 14px;
    min-width: 0;
}

.mbs-tile-left > div:last-child{
    min-width: 0;
}

.mbs-icon{
    width:44px;
    height:44px;
    border-radius:14px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:20px;
    background: rgba(66,197,244,.15);
    color: var(--mbs-accent);
    box-shadow: 0 0 0 6px rgba(66,197,244,.10);
}

.mbs-icon-2{
    background: rgba(109,188,206,.18);
    color: var(--mbs-accent2);
    box-shadow: 0 0 0 6px rgba(109,188,206,.12);
}

.mbs-label{ font-size:16px; font-weight:700; }
.mbs-label-with-badges{
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.mbs-home-badge{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: #ff4d5a;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 0 0 2px rgba(255,77,90,.16);
}
.mbs-home-badge[hidden]{
    display: none;
}
.mbs-home-badge-warn{
    background: #f0b429;
    color: #1b2437;
    box-shadow: 0 0 0 2px rgba(240,180,41,.16);
}
.mbs-desc{
    font-size:12px;
    color: var(--mbs-muted);
    margin-top:2px;
    overflow-wrap: anywhere;
}
.mbs-arrow{
    font-size:18px;
    opacity:.6;
    transition:opacity .16s ease, transform .16s ease;
}

.mbs-tile:hover .mbs-arrow{
    opacity:1;
    transform:translateX(3px);
}

.material-symbols-outlined{
    font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
    font-size: 20px;
    line-height: 1;
    vertical-align: middle;
}

.btn-home .material-symbols-outlined,
.mbs-btn-home .material-symbols-outlined{
    font-size: 20px;
}

.mbs-arrow .material-symbols-outlined{
    font-size: 18px;
    opacity: .75;
}

.mbs-notify-modal{
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1200;
}

.mbs-notify-modal.open{
    display: block;
}

.mbs-notify-backdrop{
    border: 0;
    padding: 0;
    margin: 0;
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.mbs-notify-dialog{
    position: relative;
    width: min(880px, calc(100% - 24px));
    max-height: calc(100vh - 44px);
    margin: 22px auto;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.12);
    background: linear-gradient(180deg, rgba(255,255,255,.04), transparent 28%), #0f1a30;
    box-shadow: 0 24px 40px rgba(0,0,0,.45);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.mbs-notify-head{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,.10);
}

.mbs-notify-title{
    font-size: 16px;
    font-weight: 700;
    color: var(--mbs-text);
}

.mbs-notify-close{
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.06);
    color: var(--mbs-text);
    border-radius: 10px;
    width: 34px;
    height: 34px;
    line-height: 30px;
    font-size: 22px;
    cursor: pointer;
}

.mbs-notify-close:hover{
    background: rgba(255,255,255,.14);
}

.mbs-notify-body{
    padding: 12px 14px 16px;
    overflow: auto;
    display: grid;
    gap: 12px;
}

.mbs-quick-modal{
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1250;
}

.mbs-quick-modal.open{
    display: block;
}

.mbs-quick-modal-backdrop{
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.mbs-quick-modal-dialog{
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(560px, calc(100% - 24px));
    max-height: calc(100vh - 24px);
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.12);
    background: linear-gradient(180deg, rgba(255,255,255,.05), transparent 30%), #0f1a30;
    box-shadow: 0 24px 40px rgba(0,0,0,.45);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.mbs-quick-modal-head{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,.10);
}

.mbs-quick-modal-title{
    font-size: 16px;
    font-weight: 700;
    color: var(--mbs-text);
}

.mbs-quick-modal-close{
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.06);
    color: var(--mbs-text);
    border-radius: 10px;
    width: 34px;
    height: 34px;
    line-height: 30px;
    font-size: 22px;
    cursor: pointer;
}

.mbs-quick-modal-close:hover{
    background: rgba(255,255,255,.14);
}

.mbs-quick-modal-body{
    padding: 14px;
    display: grid;
    gap: 12px;
    overflow: auto;
}

.mbs-quick-field{
    display: grid;
    gap: 6px;
}

.mbs-quick-label{
    font-size: 12px;
    color: var(--mbs-muted);
    font-weight: 700;
}

.mbs-quick-input{
    width: 100%;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.04);
    color: var(--mbs-text);
    padding: 9px 10px;
    outline: none;
    font: inherit;
}

.mbs-quick-input[type="number"]{
    appearance: textfield;
    -moz-appearance: textfield;
}
.mbs-quick-input[type="number"]::-webkit-outer-spin-button,
.mbs-quick-input[type="number"]::-webkit-inner-spin-button{
    -webkit-appearance: none;
    margin: 0;
}

select.mbs-quick-input{
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    color-scheme: dark;
    padding-right: 34px;
    background-image:
        linear-gradient(45deg, transparent 50%, #a8b4d6 50%),
        linear-gradient(135deg, #a8b4d6 50%, transparent 50%);
    background-position:
        calc(100% - 17px) calc(50% - 3px),
        calc(100% - 11px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

select.mbs-quick-input option{
    background-color: #0f1a30;
    color: var(--mbs-text);
}

.mbs-quick-input:focus{
    border-color: rgba(66,197,244,.55);
    box-shadow: 0 0 0 3px rgba(66,197,244,.16);
}

.mbs-quick-status{
    min-height: 18px;
    font-size: 13px;
    color: var(--mbs-muted);
}

.mbs-quick-status.ok{
    color: #8be6b9;
}

.mbs-quick-status.err{
    color: #ff9ea7;
}

.mbs-quick-modal-foot{
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    padding: 12px 14px 14px;
    border-top: 1px solid rgba(255,255,255,.10);
}

.mbs-quick-submit{
    border-color: rgba(66,197,244,.40);
    background: rgba(66,197,244,.16);
}

.mbs-notify-status{
    color: var(--mbs-muted);
    font-size: 13px;
}

.mbs-notify-section{
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 12px;
    background: rgba(255,255,255,.03);
    padding: 10px;
}

.mbs-notify-section-head{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.mbs-notify-section-title{
    color: #dce7ff;
    font-size: 13px;
    font-weight: 700;
}

.mbs-notify-link{
    color: #8fd8ff;
    font-size: 12px;
    text-decoration: none;
}

.mbs-notify-link:hover{
    text-decoration: underline;
}

.mbs-notify-ul{
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
}

.mbs-notify-ul li{
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.03);
    border-radius: 10px;
    padding: 8px;
}

.mbs-notify-main{
    color: var(--mbs-text);
    font-size: 13px;
}

.mbs-notify-sub{
    color: var(--mbs-muted);
    font-size: 12px;
    margin-top: 2px;
}

.mbs-notify-empty{
    color: var(--mbs-muted);
    font-size: 12px;
}

body.mbs-notify-open{
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce){
    *, *::before, *::after{
        scroll-behavior:auto !important;
        animation-duration:.01ms !important;
        animation-iteration-count:1 !important;
        transition-duration:.01ms !important;
    }
}

@media (max-width: 600px){
    .mbs-topbar{
        padding: 8px 10px;
        gap: 6px;
        flex-wrap: nowrap;
        justify-content: center;
    }
    .mbs-topbar-left{
        display: none;
    }
    .mbs-topbar-right{
        justify-content: center;
        gap: 6px;
        flex-wrap: nowrap;
        min-width: 0;
        margin: 0 auto;
    }
    .mbs-brand-sub{ display:none; }
    .mbs-user{ display:none; }
    .mbs-topbar-sections{
        gap: 4px;
        flex-wrap: nowrap;
        min-width: 0;
    }
}

@media (max-width: 600px){
    .topbar-right,
    .mbs-topbar-right{
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .topbar-sections,
    .mbs-topbar-sections{
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 2px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
}

@media (max-width: 700px){
    .mbs-notify-dialog{
        width: calc(100% - 12px);
        margin: 6px auto;
        max-height: calc(100vh - 12px);
    }
}

/* ===== Mobile app shell / PWA ===== */
.mbs-mobile-nav,
.mbs-mobile-more{
    display:none;
}

@media (max-width: 700px){
    html{
        background:#0b1220;
        overscroll-behavior-y:none;
    }

    body.mbs-page:not(.login-page):not(.mbs-embed){
        padding-top:env(safe-area-inset-top, 0px);
        padding-bottom:calc(78px + env(safe-area-inset-bottom, 0px));
    }

    body.mbs-mobile-sheet-open,
    body.mbs-notify-open{
        overflow:hidden;
        touch-action:none;
    }

    .mbs-topbar{
        display:none;
    }

    .mbs-mobile-nav{
        position:fixed;
        left:0;
        right:0;
        bottom:0;
        z-index:980;
        display:grid;
        grid-template-columns:repeat(5, minmax(0, 1fr));
        min-height:68px;
        padding:6px max(6px, env(safe-area-inset-right, 0px)) max(6px, env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px));
        border-top:1px solid rgba(255,255,255,.11);
        background:rgba(10,18,33,.92);
        box-shadow:0 -12px 36px rgba(0,0,0,.28);
        backdrop-filter:blur(22px) saturate(150%);
        -webkit-backdrop-filter:blur(22px) saturate(150%);
    }

    .mbs-mobile-nav-item{
        position:relative;
        min-width:0;
        min-height:54px;
        display:flex;
        flex-direction:column;
        align-items:center;
        justify-content:center;
        gap:4px;
        padding:4px 2px;
        border:0;
        border-radius:15px;
        background:transparent;
        color:#8491af;
        text-decoration:none;
        font:650 10px/1 system-ui,-apple-system,"Segoe UI",sans-serif;
        -webkit-tap-highlight-color:transparent;
        cursor:pointer;
    }

    .mbs-mobile-nav-item .material-symbols-outlined{
        font-size:24px;
        transition:transform .16s ease;
    }

    .mbs-mobile-nav-item.is-active{
        color:#85e3ff;
        background:linear-gradient(180deg, rgba(66,197,244,.15), rgba(66,197,244,.06));
    }

    .mbs-mobile-nav-item.is-active::before{
        content:"";
        position:absolute;
        top:-6px;
        width:30px;
        height:3px;
        border-radius:0 0 4px 4px;
        background:#42c5f4;
        box-shadow:0 0 12px rgba(66,197,244,.7);
    }

    .mbs-mobile-nav-item:active .material-symbols-outlined{
        transform:scale(.88);
    }

    .mbs-mobile-more{
        position:fixed;
        inset:0;
        z-index:1100;
    }

    .mbs-mobile-more.open{
        display:block;
    }

    .mbs-mobile-more-backdrop{
        position:absolute;
        inset:0;
        width:100%;
        border:0;
        padding:0;
        background:rgba(2,7,16,.65);
        backdrop-filter:blur(3px);
        -webkit-backdrop-filter:blur(3px);
    }

    .mbs-mobile-more-sheet{
        position:absolute;
        left:0;
        right:0;
        bottom:0;
        max-height:calc(90dvh - env(safe-area-inset-top, 0px));
        overflow:auto;
        padding:8px 18px calc(18px + env(safe-area-inset-bottom, 0px));
        border:1px solid rgba(255,255,255,.13);
        border-bottom:0;
        border-radius:26px 26px 0 0;
        background:linear-gradient(145deg, rgba(255,255,255,.07), transparent 34%), #0f1a30;
        box-shadow:0 -24px 70px rgba(0,0,0,.48);
        animation:mbs-sheet-in .22s cubic-bezier(.2,.8,.2,1);
    }

    @keyframes mbs-sheet-in{
        from{ transform:translateY(22px); opacity:.65; }
        to{ transform:translateY(0); opacity:1; }
    }

    .mbs-mobile-more-handle{
        width:40px;
        height:4px;
        margin:0 auto 13px;
        border-radius:99px;
        background:rgba(255,255,255,.2);
    }

    .mbs-mobile-more-head{
        display:flex;
        align-items:center;
        justify-content:space-between;
        gap:14px;
        margin-bottom:18px;
    }

    .mbs-mobile-more-title{
        font-size:20px;
        font-weight:850;
        letter-spacing:-.02em;
    }

    .mbs-mobile-more-user{
        margin-top:3px;
        color:var(--mbs-muted);
        font-size:12px;
    }

    .mbs-mobile-more-close{
        width:44px;
        height:44px;
        display:grid;
        place-items:center;
        flex:0 0 auto;
        padding:0;
        border:1px solid rgba(255,255,255,.1);
        border-radius:14px;
        background:rgba(255,255,255,.06);
        color:var(--mbs-text);
    }

    .mbs-mobile-more-grid{
        display:grid;
        grid-template-columns:repeat(2, minmax(0, 1fr));
        gap:10px;
    }

    .mbs-mobile-more-action{
        position:relative;
        min-width:0;
        min-height:88px;
        display:flex;
        flex-direction:column;
        align-items:flex-start;
        justify-content:space-between;
        gap:12px;
        padding:14px;
        border:1px solid rgba(255,255,255,.1);
        border-radius:18px;
        background:rgba(255,255,255,.04);
        color:var(--mbs-text);
        text-align:left;
        text-decoration:none;
        font:700 13px/1.2 system-ui,-apple-system,"Segoe UI",sans-serif;
        cursor:pointer;
    }

    .mbs-mobile-more-action.is-active{
        border-color:rgba(66,197,244,.38);
        background:rgba(66,197,244,.12);
        color:#a5ebff;
    }

    .mbs-mobile-more-action > .material-symbols-outlined,
    .mbs-mobile-more-icon-wrap > .material-symbols-outlined{
        color:#85e3ff;
        font-size:25px;
    }

    .mbs-mobile-more-icon-wrap{
        position:relative;
        display:inline-flex;
    }

    .mbs-mobile-more-icon-wrap .mbs-notify-badge{
        top:-8px;
        right:-12px;
    }

    .mbs-mobile-logout{
        min-height:50px;
        margin-top:12px;
        display:flex;
        align-items:center;
        justify-content:center;
        gap:9px;
        border:1px solid rgba(255,107,107,.28);
        border-radius:16px;
        background:rgba(255,107,107,.08);
        color:#ffb7b7;
        text-decoration:none;
        font-size:14px;
        font-weight:750;
    }

    .mbs-wrap{
        width:100%;
        margin:10px auto;
        padding:0 10px;
    }

    .mbs-card{
        padding:18px 14px;
        border-radius:22px;
    }

    .mbs-home-tabs{
        padding:4px;
        border-radius:14px;
        background:rgba(255,255,255,.035);
    }

    .mbs-home-tab{
        flex:1;
        min-height:40px;
        border-radius:11px;
    }

    .mbs-actions{
        gap:10px;
    }

    .mbs-tile{
        min-height:72px;
        padding:13px 14px;
        border-radius:17px;
    }

    .mbs-tile:hover{
        transform:none;
        box-shadow:none;
    }

    .mbs-tile:active{
        transform:scale(.985);
        background:rgba(255,255,255,.09);
    }

    .mbs-notify-dialog{
        position:absolute;
        left:0;
        right:0;
        bottom:0;
        width:100%;
        max-height:calc(92dvh - env(safe-area-inset-top, 0px));
        margin:0;
        padding-bottom:env(safe-area-inset-bottom, 0px);
        border-radius:26px 26px 0 0;
        border-bottom:0;
        animation:mbs-sheet-in .22s cubic-bezier(.2,.8,.2,1);
    }

    .mbs-notify-head{
        min-height:58px;
        padding:12px 16px;
    }

    .mbs-notify-close{
        width:44px;
        height:44px;
    }

    .mbs-notify-body{
        padding:12px 12px 18px;
    }

    .mbs-quick-modal-dialog{
        left:0;
        right:0;
        top:auto;
        bottom:0;
        transform:none;
        width:100%;
        max-height:calc(92dvh - env(safe-area-inset-top, 0px));
        padding-bottom:env(safe-area-inset-bottom, 0px);
        border-radius:26px 26px 0 0;
        border-bottom:0;
        animation:mbs-sheet-in .22s cubic-bezier(.2,.8,.2,1);
    }

    input,
    select,
    textarea{
        scroll-margin-bottom:120px;
    }

    @supports (-webkit-touch-callout: none){
        input,
        select,
        textarea{
            font-size:16px !important;
        }
    }
}
