* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f6f8;
    color: #1f2937;
}

.layout {
    display: flex;
    min-height: 100vh;
}

aside {
    width: 240px;
    background: #111827;
    color: white;
    padding: 24px;
}

aside h2 {
    margin-top: 0;
}

aside a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

main {
    flex: 1;
    padding: 28px;
}

.card {
    background: white;
    border-radius: 14px;
    padding: 22px;
    margin-bottom: 22px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .06);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
}

.grid .card span {
    display: block;
    font-size: 32px;
    margin-top: 10px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

label {
    display: block;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    padding: 10px;
    margin-top: 6px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
}

textarea {
    min-height: 90px;
}

.full {
    grid-column: 1 / -1;
}

button {
    background: #2563eb;
    color: white;
    border: 0;
    border-radius: 8px;
    padding: 11px 16px;
    cursor: pointer;
}

button:hover {
    background: #1d4ed8;
}

button.danger {
    background: #b91c1c;
}

button.danger:hover {
    background: #991b1b;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 10px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}

.flash {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 14px;
}

.flash.success {
    background: #dcfce7;
    color: #166534;
}

.flash.error,
.error {
    background: #fee2e2;
    color: #991b1b;
}

.muted {
    color: #64748b;
}

.login-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
}

.login {
    max-width: 420px;
    width: 100%;
}

.public {
    max-width: 960px;
    margin: 0 auto;
    padding: 28px;
}

/* Booking pubblico */

.booking-title {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 28px;
}

.booking-title-en {
    font-size: 0.58em;
    font-weight: 500;
    color: #475569;
}

.flag {
    margin-right: 6px;
}

.booking-search-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 16px;
    row-gap: 32px;
    align-items: end;
}

.booking-field {
    display: flex;
    flex-direction: column;
}

.label-multilang {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 8px;
    min-height: 44px;
}

.label-translation {
    font-size: 0.9em;
    font-weight: 500;
    color: #64748b;
}

.booking-submit {
    min-height: 64px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-top: 0;
}

.booking-submit span {
    display: block;
    line-height: 1.2;
}

.booking-submit-it {
    font-size: 15px;
    font-weight: 700;
}

.booking-submit-en {
    font-size: 14px;
    font-weight: 500;
}

.booking-result-box {
    margin-bottom: 24px;
}

.booking-result-box p {
    margin: 8px 0;
}

.booking-result-availability {
    margin-bottom: 20px;
}

.booking-customer-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 16px;
    row-gap: 26px;
    align-items: end;
}

.booking-full {
    grid-column: 1 / -1;
}

.booking-pay-button {
    width: 100%;
    max-width: 320px;
    min-height: 64px;
}

.booking-subtitle {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.booking-subtitle-en {
    font-size: 0.72em;
    font-weight: 500;
    color: #475569;
}

.booking-back-link {
    margin-top: 22px;
}

/* Metodo pagamento */

.payment-method-box {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 8px;
}

.payment-method-option {
    display: grid;
    grid-template-columns: 22px 1fr;
    align-items: start;
    column-gap: 10px;
    padding: 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    cursor: pointer;
    font-weight: 400;
}

.payment-method-option input[type="radio"] {
    width: 16px !important;
    height: 16px;
    margin: 3px 0 0 0;
    padding: 0;
    border-radius: 50%;
    justify-self: start;
    align-self: start;
}

.payment-method-option > span {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.payment-method-option strong {
    font-size: 16px;
    color: #111827;
    line-height: 1.25;
}

.payment-method-option small {
    font-size: 14px;
    color: #475569;
    line-height: 1.25;
}

.payment-method-option:has(input[type="radio"]:checked) {
    border-color: #2563eb;
    background: #eff6ff;
}

.payment-method-option span {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.payment-method-option strong {
    font-size: 16px;
    color: #111827;
}

.payment-method-option small {
    font-size: 14px;
    color: #475569;
}

.payment-method-option:has(input[type="radio"]:checked) {
    border-color: #2563eb;
    background: #eff6ff;
}

.bank-transfer-box {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 18px;
    margin: 18px 0;
}

/* Calendario prenotazioni admin */

.booking-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.booking-calendar-header h2 {
    margin: 0;
    text-align: center;
}

.calendar-nav-button {
    display: inline-block;
    background: #2563eb;
    color: #ffffff;
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 8px;
    font-weight: 700;
}

.calendar-nav-button:hover {
    background: #1d4ed8;
}

.booking-calendar-scroll {
    width: 100%;
    overflow-x: auto;
    margin-top: 20px;
    padding-bottom: 8px;
}

.booking-calendar-grid {
    min-width: 900px;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #e5e7eb;
    gap: 1px;
}

.booking-calendar-day-name {
    background: #111827;
    color: #ffffff;
    padding: 10px;
    text-align: center;
    font-weight: 700;
}

.booking-calendar-cell {
    background: #ffffff;
    min-height: 125px;
    padding: 8px;
    position: relative;
}

.booking-calendar-empty {
    background: #f8fafc;
}

.booking-calendar-today {
    background: #eff6ff;
}

.booking-calendar-day-number {
    font-weight: 700;
    margin-bottom: 6px;
    color: #111827;
}

.booking-calendar-items {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.booking-calendar-item {
    border-left: 5px solid #64748b;
    border-radius: 7px;
    padding: 5px 6px;
    font-size: 12px;
    line-height: 1.25;
    color: #111827;
    overflow: hidden;
}

.booking-calendar-item-pending {
    opacity: 0.72;
    border-style: dashed;
}

.booking-calendar-item-blocked {
    background-image: repeating-linear-gradient(
        45deg,
        rgba(17, 24, 39, 0.08),
        rgba(17, 24, 39, 0.08) 6px,
        transparent 6px,
        transparent 12px
    );
}

.calendar-property-name {
    display: block;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-guests {
    display: inline-block;
    margin-top: 2px;
    font-size: 11px;
}

.calendar-status {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 5px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    background: #111827;
    color: #ffffff;
}

.calendar-status.pending {
    background: #f59e0b;
}

.calendar-status.confirmed {
    background: #16a34a;
}

.calendar-status.blocked {
    background: #64748b;
}

.booking-calendar-legend {
    margin-top: 24px;
    border-top: 1px solid #e5e7eb;
    padding-top: 18px;
}

.booking-calendar-legend h3 {
    margin-top: 0;
}

.booking-calendar-legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.booking-calendar-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.booking-calendar-legend-color {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    display: inline-block;
}

.calendar-status-note {
    margin-top: 14px;
}

/* Responsive */

@media (max-width: 800px) {
    .layout {
        flex-direction: column;
    }

    aside {
        width: 100%;
    }

    main {
        padding: 18px;
    }

    .public {
        padding: 18px;
    }

    .booking-search-grid,
    .booking-customer-grid {
        grid-template-columns: 1fr;
    }

    .label-multilang {
        min-height: auto;
    }

    .booking-submit {
        min-height: auto;
    }

    .booking-pay-button {
        max-width: 100%;
    }

    .payment-method-box {
        grid-template-columns: 1fr;
    }

    .booking-calendar-header {
        flex-direction: column;
        align-items: stretch;
    }

    .calendar-nav-button {
        text-align: center;
    }

    .booking-calendar-grid {
        min-width: 760px;
    }

    .booking-calendar-cell {
        min-height: 110px;
        padding: 6px;
    }

    .booking-calendar-item {
        font-size: 11px;
        padding: 4px 5px;
    }

    .calendar-guests {
        font-size: 10px;
    }
}
/* Calendario mobile esterno */

.mobile-calendar-body {
    background: #f4f6f8;
}

.mobile-calendar-page {
    max-width: 520px;
    margin: 0 auto;
    padding: 14px;
}

.mobile-calendar-top,
.mobile-block-form,
.mobile-month-card,
.mobile-calendar-legend {
    background: #ffffff;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .06);
}

.mobile-calendar-top h1 {
    margin-top: 0;
    font-size: 24px;
}

.mobile-year-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 14px 0;
}

.mobile-year-nav a {
    background: #2563eb;
    color: #ffffff;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
}

.mobile-block-form h2,
.mobile-month-card h2,
.mobile-calendar-legend h2 {
    margin-top: 0;
}

.mobile-block-form form {
    display: grid;
    gap: 12px;
}

.mobile-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.mobile-day-name {
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    padding-bottom: 4px;
}

.mobile-day-cell {
    min-height: 76px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 5px;
    text-decoration: none;
    color: #111827;
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow: hidden;
}

.mobile-day-cell:hover {
    border-color: #2563eb;
    background: #eff6ff;
}

.mobile-day-empty {
    background: transparent;
    border: 0;
    pointer-events: none;
}

.mobile-day-today {
    background: #eff6ff;
    border-color: #2563eb;
}

.mobile-day-number {
    font-weight: 700;
    font-size: 13px;
    line-height: 1;
}

.mobile-day-item {
    display: block;
    border-left: 4px solid #64748b;
    border-radius: 6px;
    padding: 3px 4px;
    font-size: 10px;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-day-item-block {
    background-image: repeating-linear-gradient(
        45deg,
        rgba(17, 24, 39, 0.08),
        rgba(17, 24, 39, 0.08) 5px,
        transparent 5px,
        transparent 10px
    );
}

.mobile-legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
}

.mobile-legend-color {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 5px;
}

@media (max-width: 420px) {
    .mobile-calendar-page {
        padding: 10px;
    }

    .mobile-calendar-top,
    .mobile-block-form,
    .mobile-month-card,
    .mobile-calendar-legend {
        padding: 12px;
    }

    .mobile-day-cell {
        min-height: 68px;
        padding: 4px;
    }

    .mobile-day-item {
        font-size: 9px;
    }

    .mobile-year-nav a {
        font-size: 13px;
        padding: 9px 10px;
    }
}
.mobile-add-block-link {
    display: inline-block;
    font-size: 10px;
    line-height: 1;
    color: #2563eb;
    text-decoration: none;
    font-weight: 700;
    margin-bottom: 2px;
}

.mobile-add-block-link:hover {
    text-decoration: underline;
}

.mobile-block-delete-form {
    margin: 0;
}

.mobile-block-delete-button {
    width: 100%;
    text-align: left;
    border-top: 0;
    border-right: 0;
    border-bottom: 0;
    cursor: pointer;
    color: #111827;
    font-family: inherit;
}

.mobile-block-delete-button:hover {
    filter: brightness(0.96);
}