:root {
    --bacci-blue: #17375e;
    --bacci-blue-dark: #0b223c;
    --bacci-blue-soft: #eaf0f7;
    --bacci-black: #111827;
    --bacci-gray-900: #20242b;
    --bacci-gray-700: #4b5563;
    --bacci-gray-100: #f4f6f9;
    --bacci-border: #d9e0ea;
    --bacci-danger: #b42318;
    --bacci-success: #147a43;
    --bacci-warning: #b7791f;
    --bacci-radius: 14px;
    --bacci-shadow: 0 14px 34px rgba(15, 35, 62, 0.10);
    --app-bottom-bar-height: 36px;
}

.app-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    min-height: var(--app-bottom-bar-height);
    padding: 0.4rem 1rem calc(0.4rem + env(safe-area-inset-bottom, 0px)) 1rem;
    background: var(--bacci-blue);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.35;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.25rem 0.65rem;
    text-align: center;
    box-shadow: 0 -2px 8px rgba(15, 35, 62, 0.18);
    z-index: 1000;
}

.app-bottom-bar-item {
    white-space: nowrap;
}

.app-bottom-bar-sep {
    opacity: 0.45;
}

/* Su display molto stretti la dicitura "Tutti i diritti riservati" andrebbe a capo
   e mangerebbe spazio utile: la nascondiamo, lasciando versione + copyright. */
@media (max-width: 480.98px) {
    .app-bottom-bar-tagline-only {
        display: none !important;
    }
}

html, body {
    min-height: 100%;
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--bacci-black);
    background: var(--bacci-gray-100);
}

body {
    letter-spacing: 0.01em;
}

a, .btn-link {
    color: var(--bacci-blue);
    font-weight: 600;
}

    a:hover, .btn-link:hover {
        color: var(--bacci-blue-dark);
    }

h1, h2, h3, h4, h5, h6 {
    color: var(--bacci-black);
    font-weight: 700;
    letter-spacing: -0.02em;
    border: none;
    outline: none;
    box-shadow: none;
}

.content {
    padding-top: 1.75rem;
    padding-bottom: 2.5rem;
}

    .content h1 {
        color: var(--bacci-blue-dark);
        font-size: 2.25rem;
        font-weight: 800;
        letter-spacing: -0.04em;
        margin-bottom: 0.35rem;
        border: none;
        outline: none;
        box-shadow: none;
    }

    .content p {
        color: #333333;
        font-size: 1rem;
    }

.btn {
    border-radius: 10px;
    font-weight: 650;
    letter-spacing: 0.01em;
}

.btn-primary {
    color: #fff;
    background-color: var(--bacci-blue);
    border-color: var(--bacci-blue);
}

    .btn-primary:hover,
    .btn-primary:focus {
        color: #fff;
        background-color: var(--bacci-blue-dark);
        border-color: var(--bacci-blue-dark);
    }

.btn-outline-primary {
    color: var(--bacci-blue);
    border-color: var(--bacci-blue);
}

    .btn-outline-primary:hover,
    .btn-outline-primary:focus {
        color: #fff;
        background-color: var(--bacci-blue);
        border-color: var(--bacci-blue);
    }

.btn-secondary {
    background-color: #6b7280;
    border-color: #6b7280;
}

.btn-danger {
    background-color: var(--bacci-danger);
    border-color: var(--bacci-danger);
}

.btn-success {
    background-color: var(--bacci-success);
    border-color: var(--bacci-success);
}

.btn-warning {
    color: #1f2937;
    background-color: #f2c94c;
    border-color: #f2c94c;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: rgba(23, 55, 94, 0.55);
    box-shadow: 0 0 0 0.22rem rgba(23, 55, 94, 0.16);
}

.form-control,
.form-select {
    border-radius: 10px;
    border-color: var(--bacci-border);
}

.form-label {
    font-weight: 650;
    color: var(--bacci-gray-900);
}

.card {
    border: 1px solid var(--bacci-border) !important;
    border-radius: var(--bacci-radius);
    box-shadow: var(--bacci-shadow);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--bacci-border);
    font-weight: 700;
}

.table {
    --bs-table-border-color: var(--bacci-border);
    vertical-align: middle;
}

    .table thead th,
    .table > thead > tr > th {
        color: var(--bacci-gray-900);
        background: var(--bacci-blue-soft);
        border-bottom-color: var(--bacci-border);
        font-size: 0.82rem;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

.table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-bg-type: rgba(23, 55, 94, 0.025);
}

/* Griglia del report analitico: le colonne lettera restano leggibili anche con molte righe. */
.meal-order-actions {
    position: sticky;
    top: 0;
    z-index: 20;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #fff;
    border: 1px solid var(--bacci-border);
    border-radius: var(--bacci-radius);
    box-shadow: 0 8px 20px rgba(15, 35, 62, 0.08);
}

.meal-order-actions-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.meal-order-actions .btn {
    min-height: 2.75rem;
}

.order-save-toast {
    position: fixed;
    z-index: 1200;
    left: 0.75rem;
    right: 0.75rem;
    bottom: calc(var(--app-bottom-bar-height, 36px) + 0.75rem + env(safe-area-inset-bottom, 0px));
    margin: 0 auto;
    max-width: 36rem;
    box-shadow: var(--bacci-shadow);
}

@media (min-width: 576px) {
    .meal-order-actions-buttons {
        grid-template-columns: max-content max-content;
    }
}

@media (min-width: 641px) and (min-height: 501px) {
    .meal-order-actions {
        top: 4rem;
    }

    .order-save-toast {
        left: auto;
        right: 1.5rem;
        width: min(24rem, calc(100vw - 20rem));
        max-width: none;
    }
}

.report-analytic-grid {
    --bs-table-border-color: #8fa0b5;
}

    .report-analytic-grid > :not(caption) > * > * {
        border-color: #8fa0b5;
        border-width: 1px;
    }

.badge {
    border-radius: 999px;
    padding: 0.42em 0.7em;
    font-weight: 700;
}

.bg-primary {
    background-color: var(--bacci-blue) !important;
}

.text-primary {
    color: var(--bacci-blue) !important;
}

.alert {
    border: 0;
    border-radius: 12px;
    font-weight: 600;
}

.alert-success {
    color: #0f5132;
    background: #e8f5ee;
}

.alert-danger {
    color: #842029;
    background: #f8e8e8;
}

.alert-warning {
    color: #664d03;
    background: #fff4d4;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--bacci-success);
}

.invalid {
    outline: 1px solid var(--bacci-danger);
}

.validation-message {
    color: var(--bacci-danger);
    font-size: 0.9rem;
    font-weight: 600;
}

.password-toggle-button {
    width: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-color: var(--bacci-border);
}

.password-toggle-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.bacci-logo {
    display: block;
    width: 150px;
    max-width: 100%;
    height: auto;
}

.bacci-logo-auth {
    width: 190px;
    margin: 0 auto 1.3rem auto;
}

.bacci-auth-body {
    min-height: 100vh;
    background: radial-gradient(circle at 20% 10%, rgba(23, 55, 94, 0.10), transparent 28rem), linear-gradient(135deg, #ffffff 0%, #f4f6f9 52%, #e9eef5 100%);
}

.bacci-auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem calc(var(--app-bottom-bar-height) + env(safe-area-inset-bottom, 0px) + 1.5rem) 1rem;
}

.bacci-privacy-consent {
    padding: 1rem 1.15rem;
    color: var(--bacci-gray-900, #1f2a3b);
    background: #f8f9fb;
    border: 1px solid var(--bacci-border);
    border-radius: 0.6rem;
    font-size: 0.86rem;
    line-height: 1.5;
}

.bacci-privacy-consent .bacci-privacy-consent-heading {
    margin-top: 0;
    margin-bottom: 0.85rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--bacci-blue, #17375e);
}

.bacci-privacy-consent p {
    margin-bottom: 0.85rem;
}

.bacci-privacy-consent .form-check {
    padding-top: 0.5rem;
    border-top: 1px dashed var(--bacci-border);
}

.bacci-privacy-consent .form-check-label {
    font-weight: 600;
}

.bacci-auth-card {
    width: 100%;
    max-width: 500px;
}

    .bacci-auth-card .card-body {
        padding: 2rem !important;
    }

.bacci-language-switch {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    display: inline-flex;
    gap: 0.35rem;
    align-items: center;
    padding: 0.35rem 0.55rem;
    border: 1px solid var(--bacci-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 24px rgba(15, 35, 62, 0.08);
}

    .bacci-language-switch a {
        padding: 0.15rem 0.35rem;
        text-decoration: none;
        color: var(--bacci-blue);
    }

    .bacci-language-switch span {
        color: #9ca3af;
    }

.material-symbols-outlined {
    font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
    font-size: 28px;
    line-height: 1;
}

.bulletin-hero {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

    .bulletin-hero h1 {
        font-size: 2rem;
        font-weight: 800;
        color: var(--bacci-blue-dark);
        letter-spacing: -0.03em;
    }

.bulletin-hero-logo {
    width: 220px;
    max-width: 88%;
    height: auto;
}

.bulletin-card {
    border-radius: var(--bacci-radius);
}

.bulletin-severity-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bulletin-severity-icon-sm {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    vertical-align: middle;
}

.bulletin-sev-info {
    background: #2563eb;
    color: #fff;
}

.bulletin-sev-warn {
    background: #f5c518;
    color: #1c1917;
}

.bulletin-sev-important {
    background: #dc2626;
    color: #fff;
}

.bulletin-body-text {
    white-space: pre-wrap;
    word-break: break-word;
    color: #2d3748;
    line-height: 1.55;
}

.admin-announcement-preview {
    max-width: 420px;
    max-height: 5rem;
    overflow: hidden;
}

.home-hero {
    max-width: 760px;
    padding: 2.5rem 0;
}

    .home-hero h1 {
        color: var(--bacci-blue-dark);
        font-size: 2.5rem;
        font-weight: 800;
        letter-spacing: -0.04em;
        margin-bottom: 0.5rem;
        border: none;
        outline: none;
        box-shadow: none;
    }

    .home-hero p {
        color: #3f4a57;
        font-size: 1.1rem;
    }

.nav-section-title {
    font-size: 0.72rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.55);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.nav-separator {
    margin: 0.75rem 1rem;
    border-color: rgba(255, 255, 255, 0.18);
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.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;
}

.min-width-zero {
    min-width: 0;
}

/* Barra date unificata (frecce + campo + calendario) */
.bcc-date-nav {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    width: 100%;
    max-width: 22rem;
    border-radius: 12px;
    border: 1px solid var(--bacci-border);
    background: #fff;
    box-shadow: 0 4px 18px rgba(15, 35, 62, 0.08);
    overflow: hidden;
}

.bcc-date-nav-btn {
    flex: 0 0 2.625rem;
    width: 2.625rem;
    border: none;
    border-radius: 0;
    margin: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1;
    color: var(--bacci-blue);
    background: linear-gradient(180deg, #fafbfd 0%, #eef3fa 100%);
    transition: background 0.15s ease, color 0.15s ease;
}

.bcc-date-nav-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #f4f7fc 0%, #e3ebf8 100%);
    color: var(--bacci-blue-dark);
}

.bcc-date-nav-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Settimana ISO: campo read-only stile data giornaliero; calendario lunedì-prima-colonna */
.bcc-week-picker-field:not(:disabled) {
    cursor: pointer;
}

/* Wrapper componente dentro la barra */
.bcc-ddmm-datepicker {
    position: relative;
}

.bcc-ddmm-segment {
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-left: 1px solid var(--bacci-border);
    border-right: 1px solid var(--bacci-border);
}

.bcc-ddmm-middle {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    flex: 1 1 auto;
    min-height: calc(2.25rem + 2px);
    background: #fff;
    transition: box-shadow 0.15s ease;
}

.bcc-ddmm-middle:focus-within {
    box-shadow: inset 0 0 0 2px rgba(23, 55, 94, 0.18);
}

.bcc-ddmm-input {
    flex: 1 1 auto;
    min-width: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.bcc-ddmm-input:focus {
    border: none;
    box-shadow: none;
    outline: 0;
}

.bcc-ddmm-cal-btn {
    flex: 0 0 2.625rem;
    width: 2.625rem;
    border: none;
    border-radius: 0;
    border-left: 1px solid var(--bacci-border);
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #fafbfd 0%, #eef3fa 100%);
    color: var(--bacci-blue);
    transition: background 0.15s ease, color 0.15s ease;
}

.bcc-ddmm-cal-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #f4f7fc 0%, #e3ebf8 100%);
    color: var(--bacci-blue-dark);
}

.bcc-ddmm-cal-icon {
    display: block;
    vertical-align: middle;
}

.bcc-date-field-shell {
    border-radius: 12px;
    border: 1px solid var(--bacci-border);
    background: #fff;
    box-shadow: 0 4px 18px rgba(15, 35, 62, 0.08);
    overflow: hidden;
}

.bcc-date-field-shell .bcc-ddmm-middle:focus-within {
    box-shadow: inset 0 0 0 2px rgba(23, 55, 94, 0.12);
}

.bcc-date-field-shell .bcc-ddmm-middle {
    border-radius: inherit;
}

/* Calendario modale gg/mm/cultura (DdMmCalendarModal) */
.bcc-cal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1060;
    background: rgba(15, 35, 62, 0.4);
    backdrop-filter: blur(2px);
}

.bcc-cal-dialog {
    position: fixed;
    z-index: 1070;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 1rem 1.125rem 1rem;
    min-width: 18.5rem;
    max-width: min(94vw, 22rem);
    border-radius: 14px;
    box-shadow: var(--bacci-shadow);
    border: 1px solid var(--bacci-border);
}

.bcc-cal-month-nav {
    min-width: 2rem;
    font-weight: 700;
}

.bcc-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

.bcc-cal-weekday {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: capitalize;
    color: var(--bacci-gray-700);
    padding: 4px 0;
}

.bcc-cal-day {
    --bs-btn-padding-y: 0.35rem;
    --bs-btn-padding-x: 0.2rem;
    font-weight: 600;
    line-height: 1.25;
    border-radius: 10px !important;
    border: 1px solid transparent !important;
}

.bcc-cal-day-in {
    color: var(--bacci-black);
    background: var(--bacci-blue-soft);
}

.bcc-cal-day-in:hover:not(.bcc-cal-day-active) {
    background: #dfe8f7;
}

.bcc-cal-day-muted {
    color: #9aa7b9;
    background: transparent;
    opacity: 0.82;
}

.bcc-cal-day-active {
    border-color: var(--bacci-blue-dark) !important;
    background: var(--bacci-blue) !important;
    color: #fff !important;
}

.bcc-cal-day-disabled {
    opacity: 0.38;
    pointer-events: none;
    cursor: not-allowed;
}

/* Modale form (es. modifica utente admin) */
.bcc-admin-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1045;
    background: rgba(15, 35, 62, 0.42);
    backdrop-filter: blur(2px);
}

.bcc-admin-modal-panel {
    position: fixed;
    z-index: 1055;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(96vw, 38rem);
    max-height: 92vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 14px;
    padding: 1.25rem 1.35rem;
    box-shadow: var(--bacci-shadow);
    border: 1px solid var(--bacci-border);
}

.users-table > :not(caption) > * > * {
    padding: 0.16rem 0.4rem;
    font-size: 0.8rem;
    vertical-align: middle;
}

.users-table .badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.18em 0.42em;
}

.users-table .users-actions {
    width: 1%;
    white-space: nowrap;
}

.users-icon-btn,
.smtp-icon-btn {
    width: 1.65rem;
    height: 1.65rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.smtp-icon-btn {
    width: 2rem;
    height: 2rem;
}
