.tcb-booking-app,
.tcb-booking-app * {
    box-sizing: border-box;
}

.tcb-booking-app {
    --tcb-green: #138a5b;
    --tcb-green-dark: #0f7049;
    --tcb-green-soft: #e9f7f0;
    --tcb-blue: #1676d2;
    --tcb-blue-dark: #0f5fae;
    --tcb-red: #dc3949;
    --tcb-yellow: #ffc523;
    --tcb-ink: #1d2730;
    --tcb-muted: #6b7680;
    --tcb-line: #dce2e6;
    --tcb-panel: #ffffff;
    --tcb-bg: #f4f7f6;
    position: relative;
    width: 100%;
    max-width: 1580px;
    margin: 0 auto;
    color: var(--tcb-ink);
    font-family: inherit;
}

.tcb-booking-app button,
.tcb-booking-app input,
.tcb-booking-app select {
    font: inherit;
}

.tcb-app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 22px 24px;
    border: 1px solid var(--tcb-line);
    border-radius: 12px 12px 0 0;
    background: var(--tcb-panel);
}

.tcb-app-header h2 {
    margin: 2px 0 4px;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.1;
}

.tcb-app-header p {
    margin: 0;
    color: var(--tcb-muted);
}

.tcb-app-kicker,
.tcb-schedule-caption {
    color: var(--tcb-green-dark);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.tcb-app-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tcb-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 5px;
    text-decoration: none !important;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.tcb-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(26, 38, 47, .12);
}

.tcb-button:disabled {
    opacity: .6;
    cursor: wait;
}

.tcb-button-primary {
    color: #fff !important;
    background: linear-gradient(180deg, #1a9868, var(--tcb-green-dark));
    border-color: var(--tcb-green-dark);
}

.tcb-button-secondary {
    color: #34414b !important;
    background: #fff;
    border-color: #aeb8bf;
}

.tcb-button-danger {
    color: #fff !important;
    background: linear-gradient(180deg, #eb5060, #c92d3c);
    border-color: #b92231;
}

.tcb-button-small {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 13px;
}

.tcb-date-control-panel {
    display: grid;
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
    gap: 18px;
    padding: 18px 24px;
    border: 1px solid var(--tcb-line);
    border-top: 0;
    background: var(--tcb-bg);
}

.tcb-date-settings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-content: start;
}

.tcb-date-settings label {
    display: grid;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
}

.tcb-date-settings label span {
    color: #394650;
}

.tcb-date-settings input,
.tcb-date-settings select,
.tcb-modal-field input,
.tcb-modal-field select,
.tcb-series-search-row input {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid #bcc6cc;
    border-radius: 5px;
    color: var(--tcb-ink);
    background: #fff;
}

.tcb-date-settings .tcb-button {
    grid-column: 1 / -1;
    justify-self: start;
}

.tcb-date-strip-shell {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 28px;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.tcb-date-strip {
    display: flex;
    gap: 5px;
    min-width: 0;
    padding: 2px 0 8px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.tcb-booking-app button.tcb-date-arrow {
    -webkit-appearance: none !important;
    appearance: none !important;
    box-sizing: border-box !important;
    width: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    justify-self: center;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    color: #fff;
    background: #52616b;
    box-shadow: none !important;
    font-size: 18px !important;
    font-weight: 700;
    line-height: 1 !important;
    text-align: center;
    cursor: pointer;
}

.tcb-booking-app button.tcb-date-arrow:disabled {
    opacity: .35;
    cursor: default;
}

.tcb-date-card {
    flex: 0 0 112px;
    min-height: 118px;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 4px;
    padding: 10px 7px;
    border: 1px solid #b8c5d3;
    border-radius: 4px;
    color: #17375b;
    background: linear-gradient(180deg, #e7eff9, #cddbef);
    cursor: pointer;
    box-shadow: inset 0 -1px 0 rgba(255,255,255,.65);
}

.tcb-date-card span {
    font-size: 14px;
}

.tcb-date-card strong {
    font-size: 30px;
    line-height: 1;
}

.tcb-date-card small {
    color: #475e76;
    text-transform: capitalize;
}

.tcb-date-card.is-selected {
    border-color: var(--tcb-green-dark);
    color: #fff;
    background: linear-gradient(180deg, #1a9665, #0d7048);
    box-shadow: 0 5px 14px rgba(15, 112, 73, .25);
}

.tcb-date-card.is-selected small {
    color: #e6fff3;
}

.tcb-date-card.is-today:not(.is-selected)::after {
    content: "Oggi";
    padding: 2px 7px;
    border-radius: 10px;
    color: #fff;
    background: var(--tcb-blue);
    font-size: 10px;
    font-weight: 800;
}

.tcb-date-card:disabled {
    opacity: .35;
    cursor: default;
}

.tcb-schedule-section {
    padding: 22px 4px 8px;
}

.tcb-schedule-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding: 0 20px 12px;
}

.tcb-schedule-heading h3 {
    margin: 3px 0 0;
    font-size: clamp(23px, 3vw, 32px);
    text-transform: capitalize;
}

.tcb-view-toggle {
    display: inline-flex;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(20, 30, 38, .15);
}

.tcb-view-toggle button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 38px;
    padding: 8px 13px;
    border: 0;
    color: #fff;
    background: #59656d;
    font-weight: 700;
    cursor: pointer;
}

.tcb-view-toggle button.is-active {
    background: var(--tcb-green-dark);
}

.tcb-courts-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(235px, 1fr));
    align-items: start;
    gap: 7px;
    padding: 0 4px 8px;
    overflow-x: auto;
}

.tcb-court-column {
    min-width: 235px;
    border: 1px solid #d6dde1;
    background: #fff;
}

.tcb-court-column__header {
    position: relative;
    min-height: 155px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 12px 44px;
    border-bottom: 1px solid #cfd7dc;
    text-align: center;
    background: linear-gradient(180deg, #fff, #f2f5f6);
}

.tcb-court-column__header::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    background: #2f7bb5;
}

.tcb-court-accent-1 .tcb-court-column__header::before { background: #2482d4; }
.tcb-court-accent-2 .tcb-court-column__header::before { background: #16845a; }
.tcb-court-accent-3 .tcb-court-column__header::before { background: #22292f; }
.tcb-court-accent-4 .tcb-court-column__header::before { background: #d3a100; }

.tcb-court-title-wrap h4 {
    margin: 0 0 2px;
    font-size: 17px;
    font-weight: 500;
}

.tcb-court-title-wrap > span {
    color: #6c747a;
    font-size: 14px;
}

.tcb-court-badge {
    display: table;
    margin: 8px auto 0;
    padding: 3px 8px;
    border-radius: 11px;
    color: #fff;
    font-size: 10px;
    text-transform: uppercase;
}

.tcb-court-badge.is-closed { background: #707a81; }
.tcb-court-badge.is-reserved { background: #7a55a3; }

.tcb-court-admin-actions {
    position: absolute;
    right: 9px;
    bottom: 9px;
    display: flex;
    gap: 5px;
}

.tcb-icon-button {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid #0b5ca5;
    border-radius: 4px;
    color: #fff;
    background: linear-gradient(180deg, #1b7bd2, #0c61b2);
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,.15);
}

.tcb-icon-button .dashicons {
    width: 22px;
    height: 22px;
    font-size: 22px;
}

.tcb-standard-view {
    display: grid;
    gap: 8px;
    padding: 17px 8px 12px;
}

.tcb-slot-button {
    position: relative;
    width: 100%;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 6px 8px;
    border: 1px solid transparent;
    border-radius: 3px;
    color: #fff;
    font-weight: 500;
    cursor: default;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}

.tcb-slot-button > span {
    font-size: 15px;
}

.tcb-slot-button > small {
    padding: 1px 5px;
    border-radius: 8px;
    color: currentColor;
    background: rgba(255,255,255,.18);
    font-size: 8px;
    font-weight: 800;
}

.tcb-slot-button.is-free {
    border-color: #14794f;
    background: linear-gradient(180deg, #259865, #13794f);
    cursor: pointer;
}

.tcb-slot-button.is-free:hover {
    filter: brightness(1.08);
}

.tcb-slot-button.is-mine {
    border-color: #e0aa00;
    color: #2f2b15;
    background: linear-gradient(180deg, #ffd84e, #ffbd16);
    cursor: pointer;
}

.tcb-slot-button.is-busy {
    border-color: #c92435;
    background: linear-gradient(180deg, #eb5060, #d92e40);
}

.tcb-slot-button.is-admin-booking {
    border-color: #1264b8;
    background: linear-gradient(180deg, #2f8be3, #156bc4);
}

.tcb-slot-button.is-admin-booking[title*="Prenotato da te"] {
    cursor: pointer;
}

.tcb-slot-button.is-closed,
.tcb-slot-button.is-outside {
    border-color: #aab2b7;
    color: #657078;
    background: #e7ebed;
}

.tcb-slot-button.is-outside {
    cursor: pointer;
}

.tcb-slot-button.is-outside:hover {
    filter: brightness(.96);
}

.tcb-loading-card,
.tcb-empty-state {
    padding: 22px 14px;
    border: 1px dashed #c6ced3;
    border-radius: 5px;
    color: var(--tcb-muted);
    background: #f8faf9;
    text-align: center;
}

.tcb-loading-card.is-error,
.tcb-empty-state.is-error {
    color: #a82432;
    border-color: #e4abb1;
    background: #fff0f2;
}

.tcb-detail-view {
    overflow-x: auto;
}

.tcb-detail-view table,
.tcb-series-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.tcb-detail-view th,
.tcb-detail-view td,
.tcb-series-table th,
.tcb-series-table td {
    padding: 9px 8px;
    border-bottom: 1px solid #dfe4e7;
    text-align: left;
    vertical-align: middle;
}

.tcb-detail-view th,
.tcb-series-table th {
    color: #34414a;
    background: #f1f4f5;
    font-weight: 800;
}

.tcb-detail-row:nth-child(even) {
    background: #fafbfb;
}

.tcb-detail-dot {
    display: inline-block;
    width: 11px;
    height: 11px;
    margin-right: 6px;
    border-radius: 50%;
    background: #9aa3a9;
}

.tcb-detail-row.is-free .tcb-detail-dot { background: var(--tcb-green); }
.tcb-detail-row.is-mine .tcb-detail-dot { background: var(--tcb-yellow); }
.tcb-detail-row.is-busy .tcb-detail-dot { background: var(--tcb-red); }
.tcb-detail-row.is-admin-booking .tcb-detail-dot { background: var(--tcb-blue); }

.tcb-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px 22px;
    padding: 14px;
    color: #56616a;
    font-size: 12px;
}

.tcb-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tcb-legend i {
    width: 13px;
    height: 13px;
    border-radius: 3px;
}

.tcb-legend .is-free { background: var(--tcb-green); }
.tcb-legend .is-mine { background: var(--tcb-yellow); }
.tcb-legend .is-busy { background: var(--tcb-red); }
.tcb-legend .is-admin { background: var(--tcb-blue); }
.tcb-legend .is-closed { background: #c7ced2; }

.tcb-app-message {
    position: fixed;
    z-index: 100000;
    right: 24px;
    bottom: 24px;
    max-width: min(420px, calc(100vw - 40px));
    padding: 12px 16px;
    border-radius: 6px;
    color: #fff;
    background: #23313a;
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}

.tcb-app-message.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.tcb-app-message.is-success { background: #0f7049; }
.tcb-app-message.is-error { background: #b52635; }

.tcb-modal[hidden] {
    display: none !important;
}

.tcb-modal {
    position: fixed;
    z-index: 99999;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
}

.tcb-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(14, 21, 26, .64);
    backdrop-filter: blur(1px);
}

.tcb-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(760px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    border: 1px solid #aeb8be;
    border-radius: 6px;
    color: var(--tcb-ink);
    background: #fff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .3);
}

.tcb-modal[data-tcb-modal="multiple"] .tcb-modal__dialog {
    width: min(1120px, 100%);
}

.tcb-modal__header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 18px;
    border-bottom: 1px solid #d9dfe2;
    background: #fff;
}

.tcb-modal__header h3 {
    margin: 0;
    font-size: 23px;
}

.tcb-modal__close {
    width: 36px;
    height: 36px;
    border: 0;
    color: #56616a;
    background: transparent;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.tcb-modal__body {
    padding: 22px;
}

.tcb-booking-summary {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 5px 18px;
    padding: 14px 16px;
    border: 1px solid #d9e0e4;
    border-radius: 5px;
    background: #f6f8f8;
}

.tcb-booking-summary strong {
    font-size: 17px;
}

.tcb-booking-summary span:nth-of-type(1) {
    grid-column: 1;
}

.tcb-booking-summary span:nth-of-type(2) {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    font-weight: 800;
}

.tcb-modal__body h4 {
    margin: 24px 0 10px;
    font-size: 25px;
    text-align: center;
}

.tcb-modal-field {
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
    font-weight: 700;
}

.tcb-price-box {
    display: grid;
    place-items: center;
    min-height: 155px;
    margin: 18px 0;
    padding: 18px;
    border: 1px solid #2d9a73;
    background: #fbfffd;
}

.tcb-price-box strong {
    color: #278f68;
    font-size: 34px;
    font-weight: 500;
}

.tcb-price-box span,
.tcb-price-box small {
    color: #5d676e;
}

.tcb-price-box.is-compact {
    min-height: 120px;
}

.tcb-modal-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.tcb-my-bookings-list {
    display: grid;
    gap: 10px;
}

.tcb-my-booking-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    border: 1px solid #cfe5da;
    border-radius: 5px;
    background: var(--tcb-green-soft);
}

.tcb-my-booking-card > div:first-child {
    display: grid;
    gap: 3px;
}

.tcb-my-booking-card span,
.tcb-my-booking-card small {
    color: #53635b;
}

.tcb-admin-booking-intro {
    padding: 4px 0 12px;
}

.tcb-admin-booking-intro h4 {
    margin: 0 0 8px;
    text-align: left;
}

.tcb-admin-booking-intro p {
    margin: 0;
    color: var(--tcb-muted);
}

.tcb-multiple-court-heading {
    margin: -6px 0 18px;
    padding: 10px 12px;
    border-left: 4px solid var(--tcb-blue);
    background: #eef6ff;
}

.tcb-multiple-menu {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.tcb-multiple-menu-card {
    min-height: 160px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    padding: 24px;
    border: 1px solid #cfd7dc;
    border-radius: 5px;
    color: #202a31;
    background: linear-gradient(180deg, #fff, #f5f7f8);
    cursor: pointer;
}

.tcb-multiple-menu-card:hover {
    border-color: var(--tcb-blue);
    box-shadow: 0 8px 24px rgba(20, 55, 90, .12);
}

.tcb-multiple-menu-card .dashicons {
    width: 46px;
    height: 46px;
    font-size: 46px;
}

.tcb-multiple-menu-card strong {
    font-size: 21px;
}

.tcb-multiple-menu-card small {
    color: var(--tcb-muted);
}

.tcb-multiple-panel[hidden] {
    display: none !important;
}

.tcb-modal-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 18px;
}

.tcb-field-wide {
    grid-column: 1 / -1;
}

.tcb-series-search-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto auto;
    gap: 10px;
    margin-bottom: 16px;
}

.tcb-series-results {
    max-height: 460px;
    overflow: auto;
    border: 1px solid #d7dee2;
}

.tcb-series-results > p,
.tcb-series-results > .tcb-empty-state {
    margin: 0;
    border: 0;
}

.tcb-icon-delete {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid #b82131;
    border-radius: 4px;
    color: #fff;
    background: var(--tcb-red);
    cursor: pointer;
}

html.tcb-has-open-modal,
html.tcb-has-open-modal body {
    overflow: hidden;
}

@media (max-width: 980px) {
    .tcb-date-control-panel {
        grid-template-columns: 1fr;
    }

    .tcb-courts-board {
        grid-template-columns: repeat(4, minmax(280px, 280px));
        scroll-snap-type: x proximity;
    }

    .tcb-court-column {
        min-width: 280px;
        scroll-snap-align: start;
    }
}

@media (max-width: 680px) {
    .tcb-app-header,
    .tcb-schedule-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .tcb-app-header {
        padding: 18px;
    }

    .tcb-app-header-actions .tcb-button {
        width: 100%;
    }

    .tcb-date-control-panel {
        padding: 14px;
    }

    .tcb-date-settings {
        grid-template-columns: 1fr;
    }

    .tcb-date-settings .tcb-button {
        width: 100%;
    }

    .tcb-date-card {
        flex-basis: 92px;
        min-height: 105px;
    }

    .tcb-schedule-heading {
        padding: 0 8px 12px;
    }

    .tcb-view-toggle {
        align-self: flex-start;
    }

    .tcb-courts-board {
        padding-inline: 0;
        grid-template-columns: repeat(4, minmax(calc(100vw - 54px), calc(100vw - 54px)));
    }

    .tcb-court-column {
        min-width: calc(100vw - 54px);
    }

    .tcb-modal {
        padding: 8px;
    }

    .tcb-modal__dialog {
        max-height: calc(100vh - 16px);
    }

    .tcb-modal__body {
        padding: 16px;
    }

    .tcb-booking-summary {
        grid-template-columns: 1fr;
    }

    .tcb-booking-summary span:nth-of-type(2) {
        grid-column: 1;
        grid-row: auto;
    }

    .tcb-multiple-menu,
    .tcb-modal-form-grid {
        grid-template-columns: 1fr;
    }

    .tcb-field-wide {
        grid-column: auto;
    }

    .tcb-series-search-row {
        grid-template-columns: 1fr;
    }

    .tcb-my-booking-card {
        align-items: stretch;
        flex-direction: column;
    }

    .tcb-modal-actions .tcb-button {
        flex: 1 1 140px;
    }
}
