html,
body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    height: auto !important;
    scroll-behavior: smooth;
}

/* AppBar background gradient moved from inline style */
.appbar-gradient {
    color: #fff;
}

/* Utente in AppBar, desktop */
.appbar-user {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    white-space: nowrap;
}

    .appbar-user .mud-avatar {
        box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
    }

.scroll-button {
    margin-bottom: 1rem;
}

/* Inactive navigation tab — same color, just dimmed */
.menu-tab-inactive {
    opacity: 0.6;
    transition: opacity 0.15s ease, filter 0.15s ease;
}

.menu-tab-inactive:hover {
    opacity: 1;
    filter: brightness(0.85);
}

.scroll-to-top-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
}

.scroll-to-bottom-btn {
    position: fixed;
    bottom: 24px;
    right: 88px; /* 24px + 56px (FAB width) + 8px gap */
    z-index: 9999;
}

/* Modern custom scrollbar (WebKit) */
::-webkit-scrollbar {
    width: 14px;
    height: 14px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.06);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--mud-palette-primary, #594ae2), var(--mud-palette-secondary, #ff4081));
    border-radius: 10px;
    border: 3px solid transparent;
    background-clip: content-box;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--mud-palette-secondary, #ff4081), var(--mud-palette-primary, #594ae2));
    background-clip: content-box;
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* Firefox */
* {
    scrollbar-width: auto;
    scrollbar-color: var(--mud-palette-primary, #594ae2) rgba(0, 0, 0, 0.06);
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 70px;
}

h1:focus {
    outline: none;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA9NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ7IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* Hide Blazor infrastructure error UI */
#blazor-error-ui {
    display: none !important;
}

/* Connection indicator - completely hidden for production */
#connection-indicator {
    display: none !important;
}

/* Media query per mobile */
@media (max-width: 640px) {
    #connection-indicator {
        display: none !important;
    }
}

/* Fix MudBlazor popover provider creating unwanted space */
.mud-popover-provider {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 0 !important;
    height: 0 !important;
    overflow: visible !important;
    pointer-events: none !important;
    z-index: 1400 !important;
}

.mud-popover-provider > * {
    pointer-events: auto !important;
}

/* Hide empty popovers that create layout space */
.mud-popover[data-ticks="0"] {
    display: none !important;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Layout */
.page {
    display: flex;
    flex-direction: row;
    min-height: calc(100vh - 3.5rem);
}

main {
    flex: 1;
}

.mud-appbar.top-row {
    border-bottom: 1px solid #d6d5d5;
    min-height: 3.5rem;
}

    .mud-appbar.top-row .mud-toolbar {
        min-height: 3.5rem;
    }

.top-row .mud-typography {
    color: #fff !important;
}

.appbar-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    margin-right: 0.5rem;
    cursor: pointer;
}

    .appbar-hamburger .mud-icon-root {
        color: #fff;
    }

@media (min-width: 641px) {
    .appbar-hamburger {
        display: none !important;
    }
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (min-width: 641px) {
    .page {
        flex-direction: row;
    }

    .sidebar {
        width: 250px;
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
        position: sticky;
        top: 3.5rem;
        height: calc(100vh - 3.5rem);
        z-index: 10;
    }

    .top-row {
        position: sticky;
        top: 0;
    }

    .top-row,
    article {
        padding-left: 2rem !important;
        padding-right: 1.5rem !important;
    }
}

/* Contenitore scrollabile */
@media (min-width: 641px) {
    .nav-scrollable {
        display: block;
        height: 100%;
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        box-sizing: border-box;
        padding-bottom: 1rem;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.ep-table .mud-table-container {
    overflow-x: hidden;
}

/* Prompt output display */
.prompt-output {
    border-radius: 4px;
    padding: 16px;
    max-height: 600px;
    overflow-y: auto;
}

.prompt-output pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.875rem;
    margin: 0;
    line-height: 1.5;
}

.ep-table table {
    table-layout: fixed;
    width: 100%;
}

.ep-table th,
.ep-table td {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    vertical-align: top;
}

.ep-table .col-course {
    width: 15%;
}

.ep-table .col-keyword {
    width: 12%;
}

.ep-table .col-metadata {
    width: 42%;
}

.ep-table .col-headings {
    width: auto;
}

/* JSON Dialog Styling */
.dialog-no-smooth-scroll {
    scroll-behavior: auto !important;
}

.json-dialog-content {
    max-height: 60vh;
    overflow-y: auto;
    overflow-x: auto;
    background-color: #1e1e1e;
    border-radius: 4px;
    padding: 1rem;
}

.json-pre {
    margin: 0;
    padding: 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #d4d4d4;
    white-space: pre;
    word-wrap: normal;
    overflow-wrap: normal;
}

[data-theme="light"] .json-dialog-content {
    background-color: #f5f5f5;
}

[data-theme="light"] .json-pre {
    color: #333333;
}

.break-word {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    vertical-align: top;
}

.headings-col {
    width: 20%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.mud-nav-item {
    margin-bottom: 0.4rem;
}

/* CHIP TITOLO MULTIRIGA E A LARGHEZZA PIENA */
.title-chip.mud-chip {
    height: auto !important;
    min-height: 32px;
    max-width: 100%;
    width: 100%;
    padding-top: 6px;
    padding-bottom: 6px;
    white-space: normal;
    display: inline-flex;
    align-items: flex-start;
}

.title-chip .mud-chip-content {
    display: block;
    white-space: normal;
    word-break: break-word;
    overflow: visible;
    text-overflow: clip;
    flex: 1 1 auto;
}

.title-chip a {
    white-space: normal;
}

.title-chip .mud-icon-root {
    margin-top: 2px;
}

/* Link articoli pubblicati - light mode */
.title-chip.done a,
.title-chip.done a:visited {
    color: #0d6efd !important;
    text-decoration: none !important;
    font-weight: 600 !important;
}

    .title-chip.done a:hover,
    .title-chip.done a:focus,
    .title-chip.done a:active {
        color: #0b5ed7 !important;
        text-decoration: underline !important;
        font-weight: 700 !important;
    }

/* Dark mode - articoli pubblicati con colore brillante */
[data-theme="dark"] .title-chip.done a,
[data-theme="dark"] .title-chip.done a:visited {
    color: #5eb3ff !important;
    text-decoration: none !important;
    font-weight: 600 !important;
}

    [data-theme="dark"] .title-chip.done a:hover,
    [data-theme="dark"] .title-chip.done a:focus,
    [data-theme="dark"] .title-chip.done a:active {
        color: #8fcdff !important;
        text-decoration: underline !important;
        font-weight: 700 !important;
    }

/* Link articoli NON pubblicati - light mode */
.title-chip:not(.done) a,
.title-chip:not(.done) a:visited {
    color: #6c757d !important;
    text-decoration: none !important;
    font-weight: 600 !important;
}

    .title-chip:not(.done) a:hover,
    .title-chip:not(.done) a:focus,
    .title-chip:not(.done) a:active {
        color: #495057 !important;
        text-decoration: underline !important;
        font-weight: 700 !important;
    }

/* Dark mode - articoli NON pubblicati più evidenti */
[data-theme="dark"] .title-chip:not(.done) a,
[data-theme="dark"] .title-chip:not(.done) a:visited {
    color: #ffb84d !important;
    text-decoration: none !important;
    font-weight: 600 !important;
}

    [data-theme="dark"] .title-chip:not(.done) a:hover,
    [data-theme="dark"] .title-chip:not(.done) a:focus,
    [data-theme="dark"] .title-chip:not(.done) a:active {
        color: #ffd699 !important;
        text-decoration: underline !important;
        font-weight: 700 !important;
    }

/* Link URL esterni - light mode */
.mud-link[target="_blank"] {
    color: #0d6efd !important;
    font-weight: 500 !important;
}

    .mud-link[target="_blank"]:hover {
        color: #0b5ed7 !important;
        text-decoration: underline !important;
    }

/* Dark mode - URL esterni più vivaci */
[data-theme="dark"] .mud-link[target="_blank"] {
    color: #66ccff !important;
    font-weight: 500 !important;
}

    [data-theme="dark"] .mud-link[target="_blank"]:hover {
        color: #99ddff !important;
        text-decoration: underline !important;
    }

/* Dark mode - Link nelle celle LabelValue */
[data-theme="dark"] .ep-table .mud-paper .mud-link {
    color: #66ccff !important;
}

    [data-theme="dark"] .ep-table .mud-paper .mud-link:hover {
        color: #99ddff !important;
    }

.title-chip a .mud-typography {
    color: inherit !important;
}

/* NavMenu */
.navbar-toggler {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    border: 0;
    white-space: nowrap;
}

.navbar-brand {
    font-size: 1.1rem;
}

.bi {
    display: inline-block;
    position: relative;
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
    top: -1px;
    background-size: cover;
}

.bi-house-door-fill-nav-menu {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-house-door-fill' viewBox='0 0 16 16'%3E%3Cpath d='M6.5 14.5v-3.505c0-.245.25-.495.5-.495h2c.25 0 .5.25.5.5v3.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5Z'/%3E%3C/svg%3E");
}

.bi-plus-square-fill-nav-menu {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-plus-square-fill' viewBox='0 0 16 16'%3E%3Cpath d='M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2zm6.5 4.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3a.5.5 0 0 1 1 0z'/%3E%3C/svg%3E");
}

.bi-list-nested-nav-menu {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-list-nested' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M4.5 11.5A.5.5 0 0 1 5 11h10a.5.5 0 0 1 0 1H5a.5.5 0 0 1-.5-.5zm-2-4A.5.5 0 0 1 3 7h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm-2-4A.5.5 0 0 1 1 3h10a.5.5 0 0 1 0 1H1a.5.5 0 0 1-.5-.5z'/%3E%3C/svg%3E");
}

.nav-item {
    font-size: 0.9rem;
    padding-bottom: 0.5rem;
}

    .nav-item:first-of-type {
        padding-top: 1rem;
    }

    .nav-item:last-of-type {
        padding-bottom: 1rem;
    }

    .nav-item .nav-link {
        background: none;
        border: none;
        border-radius: 4px;
        height: 3rem;
        display: flex;
        align-items: center;
        line-height: 3rem;
        width: 100%;
    }

.nav-scrollable {
    display: none;
}

.navbar-toggler:checked ~ .nav-scrollable {
    display: block;
}

@media (min-width: 641px) {
    .nav-scrollable {
        display: block;
        height: 100%;
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        box-sizing: border-box;
        padding-bottom: 1rem;
    }
}

.thumbnail {
    display: inline-block;
    height: 80px;
    width: auto;
    max-width: 100%;
    object-fit: cover;
    border-radius: 8px !important;
    border: 3px solid transparent;
    margin: 4px;
    vertical-align: middle;
    box-sizing: border-box;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
}

.highlighted-image::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 8px;
    pointer-events: none;
}

.highlighted-image:hover {
    transform: scale(1.03);
}

/* =========================
   LAYOUT PRINCIPALE 
   ========================= */

.mud-appbar.appbar-gradient {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1300;
    height: 56px;
}

/* MudAppBar invisibile (placeholder per il sistema MudLayout):
   viene coperto dalla ThemeBar custom che sta sopra (z-index 1300 vs 1100 di MudAppBar) */
.mud-appbar-fixed-top {
    z-index: 1100 !important;
}

/* ThemeBar custom sovrapposta al MudAppBar placeholder */
.theme-bar {
    z-index: 1400 !important;
}

/* Main content: padding già gestito da MudBlazor via --mud-appbar-height.
   Aggiunge solo min-height */
.mud-main-content.main-content {
    min-height: 100vh;
}

.mud-drawer .drawer-header {
    background: transparent;
    padding: 0;
    margin: 0;
}

.mud-drawer .mud-drawer-content {
    background: transparent;
    padding-top: 0;
}

/* =========================
   NAVIGATION MENU 
   ========================= */

.nav-menu-container {
    height: 100%;
    overflow-y: auto;
}

.mud-nav-menu-custom {
    padding: 0;
}

    .mud-nav-menu-custom .mud-nav-link {
        border-radius: 4px;
        padding-left: 1rem;
    }

        .mud-nav-menu-custom .mud-nav-link .mud-icon-root {
            color: inherit;
        }

/* =========================
   APPBAR USER INFO 
   ========================= */

.appbar-user {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding-right: 1rem;
}

    .appbar-user .mud-avatar {
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    }

/* =========================
   CONTENT WRAPPER 
   ========================= */

.content-wrapper {
    padding: 0;
    max-width: 100%;
    margin: 0;
}

/* Add padding only to direct MudPaper children for content */
.content-wrapper > .mud-paper {
    margin: 1.5rem;
}

@media (min-width: 960px) {
    .content-wrapper {
        padding: 0;
    }
    
    .content-wrapper > .mud-paper {
        margin: 2rem;
    }
}

/* Menu bar should have small top margin for breathing room */
.menu-bar {
    margin-top: 1rem !important;
    margin-left: 1.5rem !important;
    margin-right: 1.5rem !important;
}

@media (min-width: 960px) {
    .menu-bar {
        margin-top: 1rem !important;
        margin-left: 2rem !important;
        margin-right: 2rem !important;
    }
}

/* =========================
   RESPONSIVE ADJUSTMENTS 
   ========================= */

@media (max-width: 959px) {
    .mud-drawer {
        position: fixed !important;
        top: 56px !important;
    }
}

@media (min-width: 960px) {
    .mud-drawer {
        position: fixed !important;
        top: 56px !important;
        height: calc(100vh - 56px) !important;
    }

    .mud-main-content.main-content {
        margin-left: 256px;
        padding-top: 56px;
    }
}

.mud-link:hover .text-white {
    color: #fff !important;
    --mud-ripple-color: #fff !important;
    -webkit-text-decoration: none;
    text-decoration: none;
}

.mud-paper {
    border-radius: 18px !important;
    padding: 2rem !important;
    transition: all .3s ease !important;
}

    .mud-paper::before {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: 18px;
        padding: 1px;
        -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
        -webkit-mask-composite: xor;
        mask-composite: exclude;
        pointer-events: none;
    }

.mud-link.mud-link-underline-hover {
    text-decoration: none !important;
}

ul > li {
    font-size: 1rem;
}

.five-col {
    flex: 0 0 20%;
    max-width: 20%;
    padding: 8px;
    display: flex;
}

.card-fill {
    display: flex;
    flex-direction: column;
    height: 100%;
}

@media (max-width: 1024px) {
    .five-col {
        flex: 0 0 33.33%;
        max-width: 33.33%;
    }
}

@media (max-width: 600px) {
    .five-col {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

.mud-list-item.clickable {
    cursor: pointer;
    transition: background 0.15s;
}

.mud-postbar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    padding: 0.5rem 0;
}

/* MudTabs badge fix */
.mud-tabs .mud-badge-content {
    min-width: 2.2em;
    font-size: 1.1em;
    padding: 0 0.5em;
    box-sizing: border-box;
}

.mud-badge.mud-badge-top.right {
    inset: -18px 0px calc(100% - 14px) calc(100% - 4px) !important;
}

/* Theme Switcher Styles */
.theme-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1300;
    background-color: var(--appbar-background, #e25100);
    color: var(--appbar-text, #fff);
    height: 56px;
}

.theme-bar-container {
    display: flex;
    align-items: center;
    padding: 0.5rem 1.5rem;
    gap: 1rem;
    height: 100%;
}

.theme-bar-logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.theme-bar-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.theme-bar-brand {
    display: flex;
    flex-direction: column;
}

.theme-bar-title {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.2;
}

.theme-bar-subtitle {
    font-size: 0.75rem;
    opacity: 0.9;
    line-height: 1.2;
}

.theme-bar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-switch {
    margin: 0;
}

.theme-bar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-bar-username {
    margin: 0;
    font-size: 0.875rem;
}

@media (max-width: 640px) {
    .theme-bar-container {
        padding: 0.5rem 1rem;
    }

    .theme-bar-logo {
        width: 32px;
        height: 32px;
    }

    .theme-bar-title {
        font-size: 1rem;
    }

    .theme-bar-subtitle {
        display: none;
    }

    .theme-bar-username {
        display: none;
    }
}

.flex-grow-1 {
    flex-grow: 1;
}

/* Dialog JSON - scrollabile senza smooth scroll automatico */
.json-dialog-content {
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: auto;
    background-color: var(--mud-palette-dark, #1e1e1e) !important;
    border-radius: 8px;
}

.json-pre {
    margin: 0;
    padding: 1rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--mud-palette-text-primary, #e0e0e0);
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Previeni smooth scroll nel dialog */
.mud-dialog-container {
    scroll-behavior: auto !important;
}

.mud-dialog .mud-paper {
    scroll-behavior: auto !important;
}

.code-box {
    background-color: #f5f5f5;
    max-height: 600px;
    overflow-y: auto;
}

    .code-box pre {
        color: #fff;
        margin: 0;
        white-space: pre-wrap;
        word-wrap: break-word;
        font-family: 'Courier New', monospace;
        font-size: 13px;
    }

/* =========================
   SOCIAL POSTS KANBAN
   ========================= */

.social-kanban-column {
    height: calc(100vh - 320px);
}

.social-kanban-dropzone {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 80px;
}

.social-post-card {
    cursor: grab;
    background: rgba(0, 0, 0, 0.05);
    padding: 14px !important;
}

.social-stats-bar {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 4px 0;
}

.social-stat-card {
    flex: 1;
    min-width: 140px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px !important;
    border-radius: 14px !important;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    border: 2px solid transparent;
}

    .social-stat-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    }

.social-context-menu-caption {
    opacity: 0.6;
}

.mud-menu-item .mud-menu-item-text {
    font-size: 0.8rem;
}

.social-posts-table .mud-table-row {
    cursor: pointer;
}

/* ─── Login Page (lp-*) ─────────────────────────────────────── */

.lp-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #111111;
    padding: 2rem 1rem;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

[data-theme="light"] .lp-wrap {
    background: #f0f0f0;
}

/* Logo above the card */
.lp-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 2rem;
}

.lp-logo__icon {
    font-size: 1.6rem;
    color: #e25100;
}

.lp-logo__text {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: #e25100;
}

/* Card */
.lp-card {
    width: 100%;
    max-width: 440px;
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 2rem 2rem 2.5rem;
}

[data-theme="light"] .lp-card {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

/* Tabs */
.lp-tabs {
    display: flex;
    background: #2a2a2a;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 1.75rem;
    gap: 4px;
}

[data-theme="light"] .lp-tabs {
    background: #f0f0f0;
}

.lp-tab {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 7px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: background 0.15s, color 0.15s;
}

.lp-tab--active {
    background: #3a3a3a;
    color: #ffffff;
}

[data-theme="light"] .lp-tab--active {
    background: #ffffff;
    color: #212121;
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

.lp-tab--inactive {
    background: transparent;
    color: #777;
    cursor: default;
}

/* Title & subtitle */
.lp-title {
    margin: 0 0 0.3rem 0;
    font-size: 1.6rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

[data-theme="light"] .lp-title {
    color: #111111;
}

.lp-subtitle {
    margin: 0 0 1.5rem 0;
    font-size: 0.9rem;
    color: #888;
    line-height: 1.5;
}

[data-theme="light"] .lp-subtitle {
    color: #555;
}

.lp-subtitle strong {
    color: #bbb;
    font-weight: 600;
}

[data-theme="light"] .lp-subtitle strong {
    color: #333;
}

/* Label */
.lp-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #aaa;
    margin-bottom: 0.4rem;
    letter-spacing: 0.02em;
}

[data-theme="light"] .lp-label {
    color: #555;
}

/* Input */
.lp-input-wrap {
    position: relative;
    margin-bottom: 1rem;
}

.lp-input-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: #555;
    font-size: 0.9rem;
    pointer-events: none;
}

[data-theme="light"] .lp-input-icon {
    color: #999;
}

.lp-input {
    width: 100%;
    padding: 0.75rem 0.9rem 0.75rem 2.5rem;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 10px;
    color: #ffffff;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
    font-family: inherit;
    -moz-appearance: textfield;
}

.lp-input::-webkit-outer-spin-button,
.lp-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

[data-theme="light"] .lp-input {
    background: #f7f7f7;
    border-color: #ddd;
    color: #111;
}

.lp-input::placeholder {
    color: #555;
}

[data-theme="light"] .lp-input::placeholder {
    color: #aaa;
}

.lp-input:focus {
    border-color: #e25100;
    box-shadow: 0 0 0 3px rgba(226, 81, 0, 0.18);
}

.lp-input--code {
    letter-spacing: 0.15em;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Error */
.lp-error {
    background: rgba(211, 47, 47, 0.1);
    border: 1px solid rgba(211, 47, 47, 0.35);
    border-radius: 8px;
    color: #ef9a9a;
    font-size: 0.85rem;
    padding: 0.6rem 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

[data-theme="light"] .lp-error {
    color: #c62828;
    background: rgba(211, 47, 47, 0.06);
}

/* Primary button */
.lp-btn {
    width: 100%;
    padding: 0.85rem 1rem;
    background: #e25100;
    border: none;
    border-radius: 10px;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background 0.15s, transform 0.1s;
    font-family: inherit;
    margin-top: 0.25rem;
}

.lp-btn:hover:not(:disabled) {
    background: #c84600;
}

.lp-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.lp-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Spinner inside button */
.lp-btn__spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lp-spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes lp-spin {
    to { transform: rotate(360deg); }
}

/* Hint below button */
.lp-hint {
    margin: 0.9rem 0 0;
    font-size: 0.82rem;
    color: #666;
    text-align: center;
}

[data-theme="light"] .lp-hint {
    color: #999;
}

/* Back link */
.lp-back {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: transparent;
    border: none;
    color: #666;
    font-size: 0.875rem;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.15s;
}

.lp-back:hover {
    color: #aaa;
}

[data-theme="light"] .lp-back {
    color: #999;
}

[data-theme="light"] .lp-back:hover {
    color: #555;
}

/* ─── MagicCallback card reuse ──────────────────────────────── */
.login-callback-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem 0;
}

.login-callback-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.login-callback-icon--error {
    color: #ef9a9a;
}

[data-theme="light"] .login-callback-icon--error {
    color: #c62828;
}
