body, button, input, textarea, a, span, b {
    font-family: 'Titillium Web', sans-serif;
}

.mud-appbar::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
    pointer-events: none;
}

.auth-layout {
    background: linear-gradient(135deg, #1F4E79 0%, #0d47a1 50%, #311b92 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    width: 100%;
    max-width: 400px;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    padding: 0;
}

.login-header img {
    display: block;
    width: 100%;
    height: auto;
}

.login-content {
    padding: 2rem;
}

.login-button {
    background-color: #1F4E79 !important;
    color: white !important;
    border-radius: 25px !important;
    padding: 0.75rem 1rem !important;
    font-weight: 600;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease-in-out;
}

    .login-button:hover {
        background-color: #0d47a1 !important;
        transform: translateY(-2px);
        box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
    }

.login-links {
    margin-top: 2rem;
    text-align: center;
}

.link-forgot,
.link-register {
    display: inline-flex;
    align-items: center;
    color: #1F4E79;
    text-decoration: none;
    transition: color 0.2s;
}

    .link-forgot:hover,
    .link-register:hover {
        color: #0d47a1;
        text-decoration: underline;
    }

.divider {
    margin: 1rem 0;
    position: relative;
    text-align: center;
    color: #666;
}

    .divider::before,
    .divider::after {
        content: "";
        position: absolute;
        top: 50%;
        width: 40%;
        height: 1px;
        background-color: #ccc;
    }

    .divider::before {
        left: 0;
    }

    .divider::after {
        right: 0;
    }

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.loading-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #f8f9fa;
}

.ecg-printer-loader {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f8fafc;
    font-family: 'Titillium Web', system-ui, sans-serif;
}

.printer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    position: relative;
}

.printer-body {
    width: 180px;
    height: 100px;
    background: #dee2e6;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 2;
}

.printer-top {
    position: absolute;
    top: -20px;
    left: 20px;
    width: 140px;
    height: 20px;
    background: #adb5bd;
    border-radius: 6px 6px 0 0;
}

.printer-slot {
    position: absolute;
    bottom: -12px;
    left: 0;
    width: 100%;
    height: 12px;
    background: #495057;
    border-radius: 0 0 6px 6px;
}

.paper {
    position: absolute;
    top: 100px;
    width: 320px;
    height: 80px;
    background: #fff;
    border: 1px solid #ccc;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    animation: print 4s linear infinite;
}

    .paper svg {
        margin: 8px;
    }

    .paper.delay1 {
        animation-delay: 1.3s;
    }

    .paper.delay2 {
        animation-delay: 2.6s;
    }

@keyframes print {
    0% {
        transform: translateY(0);
        opacity: 1;
    }

    80% {
        transform: translateY(220px);
        opacity: 1;
    }

    100% {
        transform: translateY(260px);
        opacity: 0;
    }
}

.printer-text {
    margin-top: 280px;
    font-size: 22px;
    color: #334155;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #334155;
    display: inline-block;
    animation: blink 1.2s infinite;
}

    .dot:nth-child(2) {
        animation-delay: 0.3s;
    }

    .dot:nth-child(3) {
        animation-delay: 0.6s;
    }

@keyframes blink {
    0% {
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

.loader-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(255,255,255,0.8);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 32px;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 8px 28px rgba(0,0,0,.08);
    font-family: 'Titillium Web', system-ui, sans-serif;
}

    .loader-card.wide {
        width: 80%;
        max-width: 1200px;
    }

.loader-text {
    font-size: 20px;
    color: #334155;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.loader-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #334155;
    display: inline-block;
    animation: loader-blink 1.2s infinite;
}

    .loader-dot:nth-child(2) {
        animation-delay: 0.3s;
    }

    .loader-dot:nth-child(3) {
        animation-delay: 0.6s;
    }

@keyframes loader-blink {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

@media (max-width: 520px) {
    .loader-card svg {
        width: 92vw;
        height: auto;
    }

    .loader-text {
        font-size: 16px;
    }
}

.ksd-topnav {
    flex: 1;
    padding: 0 8px;
}

.ksd-nav-btn {
    border-radius: 6px;
    padding: 6px 14px;
    transition: background 0.2s;
    color: rgba(255,255,255,0.85) !important;
    text-transform: none !important;
    font-weight: 500 !important;
}

    .ksd-nav-btn:hover {
        background: rgba(255,255,255,0.12) !important;
        color: white !important;
    }

    .ksd-nav-btn.active {
        background: rgba(255,255,255,0.18) !important;
        border-bottom: 2px solid white;
    }

.mud-appbar .mud-button-text.mud-button-text-inherit {
    color: rgba(255, 255, 255, 0.85);
}

    .mud-appbar .mud-button-text.mud-button-text-inherit:hover {
        color: white;
    }

.ksd-hero {
    background: linear-gradient(135deg, #1F4E79 0%, #1565C0 100%);
    border-radius: 12px;
    padding: 24px 32px;
    color: white;
}

.ksd-cta-btn {
    background: #2E7D32 !important;
    color: white !important;
    font-weight: 600;
}

    .ksd-cta-btn:hover {
        background: #1B5E20 !important;
    }

.dashboard-shell {
    padding: 16px;
    background: rgba(255,255,255,0.8);
    color: #1e293b;
}

.glassy-light {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.top-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 16px 24px;
}

.ksd-app-name {
    color: #1F4E79;
    font-weight: 600;
}

.kpi-card.uniform {
    height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.kpi-main {
    text-align: center;
    margin-top: 8px;
}

.panel {
    padding: 16px;
}

.section-hero-root {
    padding: 3rem 1rem;
    color: #1F4E79;
    max-height: 280px !important;
}

.hero-title {
    font-family: 'Titillium Web', sans-serif;
    font-weight: 700;
    color: #1F4E79;
}

.hero-subtitle {
    color: #333;
    font-family: 'Titillium Web', sans-serif;
    margin-bottom: 1rem;
}

.hero-cta {
    margin-top: 1rem;
    font-weight: 600;
}

.hero-image-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.datagrid-selected-row {
    background-color: #fff3cd !important;
}

.datagrid-align-left {
    text-align: left;
}

.datagrid-align-center {
    text-align: center;
}

.datagrid-align-right {
    text-align: right;
}

.datagrid-col-codice {
    width: 100px;
}

.datagrid-col-nome {
    width: 150px;
}

.datagrid-col-data {
    width: 150px;
}

.datagrid-header-blue {
    background-color: #1F4E79 !important;
    color: white !important;
}

.mud-primary-text, .mud-primary, .mud-primary-hover {
    color: #1F4E79 !important;
}

.dashboard-hero-content {
    /* background: linear-gradient(135deg, #1F4E79 0%, #1565C0 50%, #1a237e 100%);
    background-size: cover;
    background-position: center center;*/
    background-image: url('images/kib-cec-hero-nologo.jpg');
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    height: 280px;
    display: flex;
    align-items: center;
    position: relative;
}

.dashboard-hero-text-container {
    position: relative;
    z-index: 10;
    padding-left: 20px;
    padding-top: 15px;
    padding-bottom: 15px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 4px;
    width: 50%;
}

.dashboard-hero-title {
    margin-left: 30px;
    font-family: 'Titillium Web', sans-serif;
    color: #ffffff;
    font-weight: 700;
    font-size: 2.25rem !important;
}

.dashboard-hero-subtitle-fix {
    margin-left: 30px;
    color: #ffffff;
    font-weight: 700;
    margin-top: 5px;
}

.dashboard-quicklinks-container {
    margin-top: -70px !important;
    position: relative;
    z-index: 10;
}

.dashboard-quicklink-card {
    text-align: center;
    border-radius: 8px !important;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    background: #f7f7f7;
    background: linear-gradient(to bottom, #ffffff 0%, #eeeeeecf 100%);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 3px 5px rgba(0, 0, 0, 0.1);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

    .dashboard-quicklink-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15) !important;
    }

.dashboard-quicklink-text {
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
}

.dashboard-section-title {
    color: #1F4E79;
    font-weight: 700;
    border-bottom: 3px solid #1F4E79;
    display: inline-block;
    padding-bottom: 5px;
}

.dashboard-news-card-detail {
    background-color: #1F4E79 !important;
    color: white !important;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.dashboard-news-title-detail {
    font-weight: 700;
    color: white !important;
}

.dashboard-read-more {
    color: white !important;
    text-decoration: underline !important;
}

.dashboard-small-news-card {
    flex-grow: 1;
    margin: 8px;
    padding: 12px;
    border-left: 4px solid #1F4E79;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dashboard-small-news-text {
    color: #1F4E79;
    font-weight: 500;
}

.dashboard-highlight-card {
    border-left: 5px solid #1F4E79;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.dashboard-highlight-header {
    color: #1F4E79;
    font-weight: 700;
}

.dashboard-list-item {
    border-bottom: 1px solid #f0f0f0;
    padding-left: 0 !important;
    font-weight: 500;
    cursor: pointer;
}

.dashboard-utility-box {
    color: white;
    min-height: 150px;
    border-radius: 8px;
    transition: transform 0.2s;
    cursor: pointer;
}

    .dashboard-utility-box:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
    }

.dashboard-feedback-box {
    background-color: #EA4335;
}

.dashboard-access-box {
    background-color: #1F4E79;
}

.dashboard-info-box {
    background-color: #1565C0;
}

.text-uppercase input {
    text-transform: uppercase;
}

.slot-card {
    transition: all 0.15s ease;
    cursor: pointer;
}

    .slot-card:hover {
        box-shadow: 0 2px 8px rgba(0,0,0,0.12) !important;
    }

.slot-libero {
    border-left: 3px solid var(--mud-palette-success) !important;
}

.slot-occupato {
    border-left: 3px solid var(--mud-palette-error) !important;
    background-color: rgba(var(--mud-palette-error-rgb), 0.04);
}

.slot-bloccato {
    border-left: 3px solid var(--mud-palette-warning) !important;
    opacity: 0.7;
}

.agenda-grid {
    max-height: calc(100vh - 300px);
    overflow-y: auto;
    padding-right: 4px;
}

.mud-table tfoot td {
    font-weight: 600;
    background-color: rgba(0,0,0,0.03);
}

.mud-nav-group .mud-nav-link {
    padding-left: 32px !important;
}

.mud-nav-link.active {
    background: rgba(var(--mud-palette-primary-rgb), 0.12) !important;
    border-right: 3px solid var(--mud-palette-primary);
}

.mud-main-content {
    background: #F5F7FA;
    min-height: calc(100vh - 64px);
}

.ksd-page-container {
    padding: 24px;
}

.ksd-page-container .mud-container {
    max-width: 100% !important;
}

.ksd-card {
    border-radius: 12px;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: box-shadow 0.2s;
}

    .ksd-card:hover {
        box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    }

.ksd-stat-card {
    border-radius: 12px;
    padding: 20px;
    color: white;
    position: relative;
    overflow: hidden;
}

    .ksd-stat-card .ksd-stat-icon {
        position: absolute;
        right: 16px;
        bottom: 16px;
        opacity: 0.2;
        font-size: 48px;
    }

    .ksd-stat-card .ksd-stat-value {
        font-size: 2rem;
        font-weight: 700;
    }

    .ksd-stat-card .ksd-stat-label {
        font-size: 0.9rem;
        opacity: 0.9;
        margin-top: 4px;
    }

.ksd-stat-primary {
    background: linear-gradient(135deg, #1F4E79, #1565C0);
}

.ksd-stat-success {
    background: linear-gradient(135deg, #2E7D32, #43A047);
}

.ksd-stat-warning {
    background: linear-gradient(135deg, #F9AB00, #FDD835);
    color: #333 !important;
}

.ksd-stat-error {
    background: linear-gradient(135deg, #EA4335, #E53935);
}

.ksd-page-header {
    margin-bottom: 24px;
}

    .ksd-page-header h1 {
        color: #1F4E79;
        font-weight: 700;
        font-size: 1.75rem;
        margin: 0;
    }

    .ksd-page-header .ksd-breadcrumb {
        color: #666;
        font-size: 0.85rem;
        margin-top: 4px;
    }

.ksd-filter-bar {
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}

.mud-button.ksd-btn-primary {
    background: #1F4E79 !important;
    color: white !important;
    border-radius: 8px !important;
    font-weight: 600;
    text-transform: none !important;
}

    .mud-button.ksd-btn-primary:hover {
        background: #1565C0 !important;
    }

.mud-button.ksd-btn-success {
    background: #2E7D32 !important;
    color: white !important;
    border-radius: 8px !important;
    font-weight: 600;
    text-transform: none !important;
}

    .mud-button.ksd-btn-success:hover {
        background: #1B5E20 !important;
    }

.ksd-module-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.ksd-badge-m1 { background: #E3F2FD; color: #1565C0; }
.ksd-badge-m2 { background: #E8F5E9; color: #2E7D32; }
.ksd-badge-m3 { background: #FFF3E0; color: #E65100; }
.ksd-badge-m4 { background: #F3E5F5; color: #7B1FA2; }
.ksd-badge-m5 { background: #FCE4EC; color: #C62828; }
.ksd-badge-m6 { background: #E0F7FA; color: #00838F; }
