body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    color: #182333;
    background: #f4f6f8;
}

button,
input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
}

a {
    color: #0b6fb8;
    text-decoration: none;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.login-box,
.panel {
    background: #fff;
    border: 1px solid #dfe5eb;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(24, 35, 51, .08);
}

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

.area-page {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
    padding: 48px 0;
}

.area-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 30px;
}

.area-header h1 {
    margin: 5px 0 8px;
    font-size: 34px;
}

.area-header p {
    margin: 0;
    color: #52606d;
}

.area-kicker,
.area-code {
    color: #0b6fb8;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.area-user {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-top: 8px;
    white-space: nowrap;
}

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

.area-card {
    display: flex;
    flex-direction: column;
    min-height: 210px;
    padding: 24px;
    background: #fff;
    border: 1px solid #dfe5eb;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(24, 35, 51, .06);
}

.area-card h2 {
    margin: 10px 0 8px;
    color: #182333;
}

.area-card p {
    flex: 1;
    margin: 0 0 22px;
    color: #52606d;
    line-height: 1.5;
}

.area-card-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 6px;
}

.area-card-summary-item {
    display: flex;
    flex: 1 1 120px;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    box-sizing: border-box;
    min-height: 34px;
    padding: 7px 9px;
    border: 1px solid #cfe0ef;
    border-radius: 6px;
    color: #52606d;
    background: #f2f8ff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.area-card-summary-item strong {
    color: #0b6fb8;
    font-size: 16px;
}

.area-card-summary-unpaid {
    border-color: #f1d0cc;
    background: #fff5f3;
}

.area-card-summary-unpaid strong {
    color: #b42318;
}

.area-button {
    width: 100%;
}

.area-button.aspNetDisabled {
    color: #6b7785;
    background: #e7ebef;
    cursor: not-allowed;
}

.area-message {
    display: block;
    margin: 0 0 20px;
    padding: 12px 14px;
    color: #875600;
    background: #fff8e6;
    border: 1px solid #f0d791;
    border-radius: 7px;
    font-weight: 700;
}

.area-message:empty {
    display: none;
}

.shell {
    min-height: 100vh;
}

.topbar {
    background: #182333;
    color: #fff;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar a {
    color: #fff;
    margin-left: 16px;
}

.layout {
    display: grid;
    grid-template-columns: 230px 1fr;
    min-height: calc(100vh - 54px);
}

.sidebar {
    background: #fff;
    border-right: 1px solid #dfe5eb;
    padding: 18px;
}

.sidebar a {
    display: block;
    padding: 10px 12px;
    border-radius: 6px;
    color: #182333;
}

.sidebar a:hover {
    background: #f0f4f8;
}

.content {
    padding: 24px;
}

.panel {
    padding: 20px;
    margin-bottom: 20px;
}

.panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.panel-heading h2 {
    margin: 0;
}

.panel-subtitle {
    margin: 6px 0 0;
    color: #52606d;
    font-size: 14px;
}

.grid {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.grid th,
.grid td {
    padding: 10px 12px;
    border-bottom: 1px solid #e5ebf0;
    text-align: left;
    vertical-align: middle;
}

.grid th {
    background: #f6f8fa;
    color: #52606d;
    font-size: 13px;
    text-transform: uppercase;
}

.grid-middle th,
.grid-middle td {
    vertical-align: middle;
}

.contact-grid-wrap {
    width: 100%;
    overflow-x: auto;
}

.area-page.contact-page {
    width: calc(100% - 32px);
    max-width: none;
    margin-right: 16px;
    margin-left: 16px;
}

.contact-grid {
    width: 100%;
    min-width: 100%;
}

.contact-name-column {
    min-width: 260px;
}

.contact-email-column {
    min-width: 70px;
    text-align: center;
}

.contact-link {
    color: #0b6fb8;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.contact-link:hover {
    color: #084a78;
}

.contact-whatsapp-column {
    min-width: 110px;
    text-align: center;
}

.btn-whatsapp {
    color: #fff;
    background: #198754;
    white-space: nowrap;
}

.btn-whatsapp:hover,
.btn-whatsapp:focus {
    color: #fff;
    background: #146c43;
}

.contact-status-select {
    width: 100%;
    min-width: 170px;
    box-sizing: border-box;
    border: 1px solid #cfd8e3;
    border-radius: 6px;
    padding: 9px 10px;
    background: #fff;
}

.contact-note-editor {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 360px;
}

.contact-note-editor textarea {
    flex: 1 1 auto;
    width: auto;
    min-width: 240px;
    min-height: 76px;
    box-sizing: border-box;
    resize: vertical;
    border: 1px solid #cfd8e3;
    border-radius: 6px;
    padding: 9px 10px;
    font: inherit;
}

.contact-note-editor .btn {
    flex: 0 0 auto;
    align-self: center;
}

.contact-notes-column .data-note,
.contact-notes-column {
    max-width: none;
}

.contact-actions-column {
    min-width: 90px;
    text-align: center;
}

.contact-transfer-column {
    min-width: 260px;
}

.contact-area-transfer {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.contact-area-select {
    width: 100%;
    min-width: 230px;
    box-sizing: border-box;
    border: 1px solid #cfd8e3;
    border-radius: 6px;
    padding: 9px 10px;
    background: #fff;
}

.contact-transfer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.contact-transfer-actions .btn {
    flex: 1 1 90px;
    text-align: center;
}

.contact-grid tr:last-child table {
    width: auto;
    margin: 8px auto 0;
}

.contact-grid tr:last-child table td {
    border: 0;
    padding: 4px;
}

.contact-grid tr:last-child table a,
.contact-grid tr:last-child table span {
    display: inline-flex;
    min-width: 24px;
    min-height: 24px;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    padding: 3px 7px;
}

.contact-grid tr:last-child table a {
    background: #e9f4ff;
}

.contact-grid tr:last-child table span {
    color: #fff;
    background: #0b6fb8;
}

.contact-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-width: 150px;
}

.notification-grid .row-danger td {
    background: #fff1f0;
}

.notification-grid .row-warning td {
    background: #fff8e6;
}

.notification-grid .row-info td {
    background: #f2f8ff;
}

.soste-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 16px;
}

.soste-legend-card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 190px;
    border: 1px solid rgba(24, 35, 51, .18);
    border-radius: 6px;
    padding: 12px 16px;
    color: #182333;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
}

.legend-prenotata {
    background: #ffe58a;
}

.legend-uscita {
    background: #bfe4ff;
}

.legend-in-area {
    background: #c7efcf;
}

.grid .row-prenotata td {
    background: #ffe58a;
}

.grid .row-uscita td {
    background: #bfe4ff;
}

.grid .row-in-area td {
    background: #c7efcf;
}

.status-pill {
    display: inline-block;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.status-danger {
    color: #9f1d14;
    background: #ffd8d3;
}

.status-warning {
    color: #875600;
    background: #ffe8a3;
}

.status-info {
    color: #0b4f7c;
    background: #d9ecff;
}

.status-success {
    color: #0f5132;
    background: #d1e7dd;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.form-row-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
    font-size: 14px;
}

.field-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
    font-size: 14px;
}

.required-marker {
    color: #b42318;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cfd8e3;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
}

.inline-options {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

.invoice-admin-choice {
    margin-top: 16px;
    margin-bottom: 14px;
}

.invoice-admin-panel {
    margin-top: 12px;
    padding: 16px;
    border: 1px solid #dfe5eb;
    border-radius: 6px;
    background: #f8fafc;
}

.invoice-admin-panel h2 {
    margin: 0 0 14px;
    font-size: 18px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border: 0;
    border-radius: 6px;
    padding: 10px 16px;
    color: #fff;
    background: #0b6fb8;
    cursor: pointer;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
}

.btn-secondary {
    background: #52606d;
}

.btn-success {
    background: #198754;
}

.btn-danger {
    background: #b42318;
}

.btn-light {
    color: #0b4f7c;
    background: #e9f4ff;
}

.btn-small {
    padding: 7px 10px;
    font-size: 12px;
    margin: 2px 0;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.payment-result {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    max-width: 760px;
    margin: 0 auto 20px;
    padding: 26px;
    background: #fff;
    border: 1px solid #dfe5eb;
    border-left: 6px solid #0b6fb8;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(24, 35, 51, .08);
}

.payment-result-marker {
    width: 18px;
    height: 54px;
    border-radius: 4px;
    background: #0b6fb8;
    flex: 0 0 auto;
}

.payment-result-success {
    border-left-color: #198754;
}

.payment-result-success .payment-result-marker {
    background: #198754;
}

.payment-result-warning {
    border-left-color: #b76e00;
}

.payment-result-warning .payment-result-marker {
    background: #b76e00;
}

.payment-result-danger {
    border-left-color: #b42318;
}

.payment-result-danger .payment-result-marker {
    background: #b42318;
}

.payment-result-kicker {
    display: block;
    margin-bottom: 8px;
    color: #52606d;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.payment-result-title {
    display: block;
    margin-bottom: 10px;
    color: #182333;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.15;
}

.payment-result-text {
    display: block;
    color: #52606d;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.45;
}

.payment-result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.status-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 24px;
    border: 1px solid #cfd8e3;
    border-radius: 6px;
    padding: 3px 8px;
    background: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.status-outline-prenotata {
    color: #7a5a00;
    border-color: #e4c14a;
    background: #fff9de;
}

.status-outline-uscita {
    color: #52606d;
    border-color: #cfd8e3;
    background: #f6f8fa;
}

.status-outline-warning {
    color: #875600;
    border-color: #e4c14a;
    background: #fff9de;
}

.status-outline-success {
    color: #0f5132;
    border-color: #8bc7a5;
    background: #edf8f1;
}

.status-outline-danger {
    color: #9f1d14;
    border-color: #e4a19b;
    background: #fff1f0;
}

.booking-cell {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.booking-date {
    color: #52606d;
    font-size: 12px;
    white-space: nowrap;
}

.data-stack {
    display: flex;
    flex-direction: column;
    gap: 4px;
    line-height: 1.35;
}

.data-note {
    display: block;
    max-width: 260px;
    white-space: normal;
    line-height: 1.35;
}

.message {
    margin: 12px 0;
    color: #b42318;
    font-weight: 700;
}

.message-success {
    color: #0f6b3d;
}

.message-lightbox-host {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 24px;
    pointer-events: none;
}

.message-lightbox {
    width: min(560px, 100%);
    margin-top: 10px;
    pointer-events: auto;
    animation: message-lightbox-in 180ms ease-out;
}

.message-lightbox + .message-lightbox {
    margin-top: 12px;
}

.message-lightbox-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    background: #fff;
    border: 1px solid #d8e1ea;
    border-left: 5px solid #0b6fb8;
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.22);
    padding: 16px 16px 16px 18px;
}

.message-lightbox-text {
    color: #182333;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.45;
}

.message-lightbox-close {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: #eef3f7;
    color: #182333;
    cursor: pointer;
    flex: 0 0 auto;
    font-size: 22px;
    line-height: 28px;
    padding: 0;
}

.message-lightbox-close:hover,
.message-lightbox-close:focus {
    background: #dfe8f0;
    outline: none;
}

.message-lightbox-success .message-lightbox-card {
    border-left-color: #18864b;
}

.message-lightbox-danger .message-lightbox-card {
    border-left-color: #b42318;
}

.message-lightbox-warning .message-lightbox-card {
    border-left-color: #b76e00;
}

.message-lightbox-info .message-lightbox-card {
    border-left-color: #0b6fb8;
}

.message-lightbox.is-hiding {
    animation: message-lightbox-out 200ms ease-in forwards;
}

@keyframes message-lightbox-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes message-lightbox-out {
    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}

body.confirm-lightbox-open {
    overflow: hidden;
}

.confirm-lightbox-host {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.58);
    animation: message-lightbox-in 180ms ease-out;
}

.confirm-lightbox-card {
    width: min(520px, 100%);
    box-sizing: border-box;
    background: #fff;
    border: 1px solid #d8e1ea;
    border-left: 5px solid #b42318;
    border-radius: 10px;
    box-shadow: 0 24px 56px rgba(15, 23, 42, 0.35);
    padding: 22px;
}

.confirm-lightbox-title {
    margin: 0 0 12px;
    color: #182333;
    font-size: 21px;
}

.confirm-lightbox-text {
    margin: 0;
    color: #344054;
    font-size: 15px;
    line-height: 1.55;
}

.confirm-lightbox-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}

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

.kpi {
    background: #fff;
    border: 1px solid #dfe5eb;
    border-radius: 8px;
    padding: 18px;
}

.kpi-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 32px;
}

.kpi-head span {
    font-weight: 700;
}

.kpi strong {
    display: block;
    font-size: 30px;
    color: #0b6fb8;
    margin-top: 8px;
}

.kpi-danger strong {
    color: #b42318;
}

.kpi-warning strong {
    color: #b76e00;
}

.dashboard-note {
    display: block;
    margin: 0 0 14px;
    color: #182333;
    font-weight: 700;
}

.stripe-details-panel {
    border-left: 5px solid #0b6fb8;
}

.stripe-details-note {
    margin-bottom: 14px;
    color: #52606d;
    font-weight: 700;
}

.stripe-details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
}

.stripe-detail-row {
    min-width: 0;
    padding: 12px;
    background: #f7fafc;
    border: 1px solid #dfe5eb;
    border-radius: 8px;
}

.stripe-detail-row span {
    display: block;
    margin-bottom: 6px;
    color: #52606d;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.stripe-detail-row code {
    display: block;
    color: #182333;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.4;
    overflow-wrap: anywhere;
    white-space: normal;
}

@media (max-width: 800px) {
    .layout,
    .form-row,
    .kpi-row {
        grid-template-columns: 1fr;
    }

    .panel-heading {
        display: block;
    }

    .panel-heading .btn {
        margin-top: 12px;
    }

    .payment-result {
        display: block;
        padding: 22px;
    }

    .payment-result-marker {
        width: 100%;
        height: 6px;
        margin-bottom: 16px;
    }

    .payment-result-title {
        font-size: 23px;
    }

    .stripe-details-grid {
        grid-template-columns: 1fr;
    }

    .area-page {
        width: min(100% - 30px, 1180px);
        padding: 28px 0;
    }

    .area-header {
        display: block;
    }

    .area-header h1 {
        font-size: 28px;
    }

    .area-user {
        margin-top: 18px;
        white-space: normal;
    }
}
