@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg: #f4f7fb;
    --text: #0f172a;
    --muted: #64748b;
    --surface: #ffffff;
    --surface-border: #e2e8f0;
    --brand: #f7376b;
    --app-sidebar-width: 18rem;
    --lift-distance: -3px;
    --ease-out-smooth: cubic-bezier(0.22, 1, 0.36, 1);
    --shadow-soft-lift: 0 16px 34px rgba(15, 23, 42, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    margin: 0;
    font-family: 'Sarabun', sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.62;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    max-width: 100%;
    overflow-x: hidden;
}

table th,
table td {
    vertical-align: top;
}

input,
select,
textarea,
button {
    font: inherit;
}

@media (max-width: 767px) {
    input,
    select,
    textarea {
        font-size: 16px !important;
    }
}

a {
    text-decoration: none;
}

h1,
h2,
h3 {
    letter-spacing: -0.012em;
}

p {
    color: #334155;
}

.page-title-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #be123c;
    border: 1px solid #fecdd3;
    background:
        radial-gradient(circle at 25% 15%, #ffffff 0%, #fff6f9 56%, #ffe8ee 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 8px 18px rgba(190, 18, 60, 0.14);
}

.page-title-icon svg {
    width: 1.2rem;
    height: 1.2rem;
}

.surface-card,
.metric-card,
.my-booking-mobile-card,
section.rounded-2xl.border.bg-white,
article.rounded-2xl.border.bg-white {
    transition:
        transform 220ms var(--ease-out-smooth),
        box-shadow 220ms var(--ease-out-smooth),
        border-color 220ms ease;
}

.surface-card:hover,
.metric-card:hover,
.my-booking-mobile-card:hover,
section.rounded-2xl.border.bg-white:hover,
article.rounded-2xl.border.bg-white:hover {
    transform: translateY(var(--lift-distance));
    border-color: #d8e2f0;
    box-shadow: var(--shadow-soft-lift);
}

button,
a.inline-flex.rounded-xl,
a.inline-flex.rounded-lg,
a.inline-flex.rounded-full {
    transition:
        transform 180ms var(--ease-out-smooth),
        box-shadow 180ms var(--ease-out-smooth),
        filter 180ms ease,
        border-color 180ms ease,
        background-color 180ms ease;
}

button:hover,
a.inline-flex.rounded-xl:hover,
a.inline-flex.rounded-lg:hover,
a.inline-flex.rounded-full:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.14);
    filter: saturate(1.05);
}

button:active,
a.inline-flex.rounded-xl:active,
a.inline-flex.rounded-lg:active,
a.inline-flex.rounded-full:active {
    transform: translateY(0);
}

.table-responsive-shadow table tbody tr td {
    transition: background-color 180ms ease, box-shadow 180ms ease;
}

.table-responsive-shadow table tbody tr:hover td {
    background: rgba(248, 250, 252, 0.92);
}

.table-responsive-shadow table tbody tr:hover td:first-child {
    box-shadow: inset 3px 0 0 rgba(247, 55, 107, 0.72);
}

.dashboard-body {
    position: relative;
    width: 100%;
    max-width: 100%;
}

.app-header {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 120 !important;
}

.dashboard-body:not(.has-sidebar-shell) .app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
}

.dashboard-body:not(.has-sidebar-shell) .app-main-shell {
    margin-top: 4rem;
}

@media (max-width: 1023px) {
    html,
    body.dashboard-body {
        scroll-padding-top: calc(4.75rem + env(safe-area-inset-top));
    }

    .dashboard-body.has-sidebar-shell .app-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        transform: translateZ(0);
        backface-visibility: hidden;
    }

    .dashboard-body.has-sidebar-shell .app-main-shell {
        margin-top: 4rem;
    }

    .app-main-content input:not([type='checkbox']):not([type='radio']):not([type='range']),
    .app-main-content select,
    .app-main-content textarea {
        scroll-margin-top: calc(5rem + env(safe-area-inset-top));
    }
}

.app-main-shell,
.app-main-track,
.app-main-content {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.app-ambient {
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: -1;
}

.orb {
    position: absolute;
    border-radius: 999px;
    filter: blur(70px);
    opacity: 0.28;
}

.orb-one {
    width: 420px;
    height: 420px;
    top: -120px;
    right: -100px;
    background: #ff87a8;
}

.orb-two {
    width: 380px;
    height: 380px;
    left: -100px;
    top: 30%;
    background: #7fb6ff;
}

.orb-three {
    width: 300px;
    height: 300px;
    right: 26%;
    bottom: -120px;
    background: #ffd19c;
}

.surface-card {
    background: color-mix(in srgb, var(--surface) 93%, transparent);
}

.app-sidebar {
    transform: translateX(calc(-100% - 1rem));
    opacity: 0.96;
    visibility: hidden;
    z-index: 80 !important;
    will-change: transform, opacity;
    transition:
        transform 280ms var(--ease-out-smooth),
        opacity 220ms ease,
        visibility 0s linear 280ms;
}

.app-sidebar.is-open {
    display: block !important;
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}

.app-sidebar.is-closing {
    pointer-events: none;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70 !important;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 220ms ease, visibility 0s linear 220ms;
}

@media (max-width: 767px) {
    .app-sidebar {
        top: 4rem;
        bottom: 0;
        height: calc(100dvh - 4rem);
    }
}

.sidebar-backdrop.is-visible {
    display: block !important;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
}

.sidebar-backdrop.is-hiding {
    pointer-events: none;
}

#loginModal,
#calendarBookingModal,
#myBookingEditModal,
#attachmentPreviewModal {
    z-index: 140 !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 220ms ease, visibility 0s linear 220ms;
}

#loginModal>button,
#calendarBookingModal>button,
#myBookingEditModal>button,
#attachmentPreviewModal>button {
    opacity: 0;
    transition: opacity 220ms ease;
}

#loginModal>section,
#calendarBookingModal>section,
#myBookingEditModal>section,
#attachmentPreviewModal>section {
    transform: translateY(16px) scale(0.985);
    opacity: 0.98;
    will-change: transform, opacity;
    transition:
        transform 260ms var(--ease-out-smooth),
        opacity 220ms ease;
}

#loginModal.is-open,
#calendarBookingModal.is-open,
#myBookingEditModal.is-open,
#attachmentPreviewModal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
}

#loginModal.is-open>button,
#calendarBookingModal.is-open>button,
#myBookingEditModal.is-open>button,
#attachmentPreviewModal.is-open>button {
    opacity: 1;
}

#loginModal.is-open>section,
#calendarBookingModal.is-open>section,
#myBookingEditModal.is-open>section,
#attachmentPreviewModal.is-open>section {
    transform: translateY(0) scale(1);
    opacity: 1;
}

#loginModal.is-closing,
#calendarBookingModal.is-closing,
#myBookingEditModal.is-closing,
#attachmentPreviewModal.is-closing {
    pointer-events: none;
}

.flash-item {
    position: relative;
    overflow: hidden;
}

.flash-item::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: currentColor;
    opacity: 0.18;
}

[data-reveal] {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 220ms ease, transform 220ms ease;
}

[data-reveal].reveal-pending {
    opacity: 0;
    transform: translateY(8px);
}

[data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
}

.table-responsive-shadow {
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.18);
    border-radius: 0.9rem;
}

/* ── Universal table horizontal-scroll wrapper ── */
.table-scroll-wrap {
    position: relative;
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: scroll;
    overflow-y: hidden;
    min-width: 0;
    margin-bottom: 0.15rem;
    padding-bottom: 0.5rem;
    overscroll-behavior-x: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #e2e8f0;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
}

.table-scroll-wrap::-webkit-scrollbar {
    height: 12px;
}

.table-scroll-wrap::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 999px;
}

.table-scroll-wrap::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #94a3b8, #64748b);
    border-radius: 999px;
}

.table-scroll-wrap::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, #64748b, #475569);
}

.table-scroll-wrap table {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
}

.table-scroll-wrap table th,
.table-scroll-wrap table td {
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
    line-height: 1.4;
}

.my-booking-table-wrap {
    position: relative;
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: scroll;
    overflow-y: hidden;
    min-width: 0;
    margin-bottom: 0.15rem;
    padding-bottom: 0.5rem;
    overscroll-behavior-x: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #e2e8f0;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
}

.my-booking-table-wrap::-webkit-scrollbar {
    height: 12px;
}

.my-booking-table-wrap::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 999px;
}

.my-booking-table-wrap::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #94a3b8, #64748b);
    border-radius: 999px;
}

.my-booking-table-wrap::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, #64748b, #475569);
}

.my-booking-table {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
}

.my-booking-table th,
.my-booking-table td {
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
    line-height: 1.4;
}

.my-booking-table button,
.my-booking-table a,
.my-booking-table .inline-flex,
.my-booking-table .rounded-full {
    white-space: nowrap;
}

.my-booking-mobile-card {
    box-shadow:
        0 8px 20px rgba(15, 23, 42, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.admin-dashboard-table-wrap {
    position: relative;
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: scroll;
    overflow-y: hidden;
    min-width: 0;
    padding-bottom: 0.5rem;
    margin-bottom: 0.15rem;
    overscroll-behavior-x: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #e2e8f0;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
}

@media (pointer: fine) {
    .admin-dashboard-table-wrap {
        cursor: grab;
    }
}

.admin-dashboard-table-wrap.is-dragging-scroll {
    cursor: grabbing;
    user-select: none;
}

.admin-dashboard-table-wrap::-webkit-scrollbar {
    height: 12px;
}

.admin-dashboard-table-wrap::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 999px;
}

.admin-dashboard-table-wrap::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #94a3b8, #64748b);
    border-radius: 999px;
}

.admin-dashboard-table-wrap::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, #64748b, #475569);
}

.admin-dashboard-table tbody tr {
    transition: background-color 180ms ease, transform 180ms ease;
}

.admin-dashboard-table tbody tr:hover {
    transform: translateY(-1px);
}

.admin-dashboard-table tbody tr:nth-child(odd) {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.32), rgba(248, 250, 252, 0.12));
}

.admin-dashboard-table {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
}

.admin-dashboard-table th,
.admin-dashboard-table td {
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
    line-height: 1.4;
}

.admin-dashboard-table button,
.admin-dashboard-table a,
.admin-dashboard-table .inline-flex,
.admin-dashboard-table .rounded-full {
    white-space: nowrap;
}

.admin-inline-scroll {
    display: inline-block;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    vertical-align: middle;
    scrollbar-width: thin;
}

.admin-inline-scroll::-webkit-scrollbar {
    height: 6px;
}

.admin-summary-cell {
    display: inline-block;
    max-width: none;
    white-space: nowrap;
    line-height: 1.35;
    padding-bottom: 0.06rem;
}

.admin-file-name {
    display: inline-block;
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
    vertical-align: top;
    padding-bottom: 0.06rem;
}

@media (min-width: 1024px) and (max-width: 1365px) {

    .my-booking-table,
    .admin-dashboard-table {
        font-size: 0.82rem;
    }

    .my-booking-table th,
    .my-booking-table td,
    .admin-dashboard-table th,
    .admin-dashboard-table td {
        padding: 0.62rem 0.58rem;
    }
}

.metric-card {
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    right: -40px;
    top: -48px;
    width: 120px;
    height: 120px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
}

.app-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 180 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background:
        radial-gradient(120% 120% at 10% 10%, rgba(255, 255, 255, 0.44) 0%, rgba(255, 255, 255, 0) 50%),
        rgba(15, 23, 42, 0.44);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 120ms ease, visibility 120ms ease;
}

.app-loading-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.app-loading-panel {
    min-width: min(92vw, 340px);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 1rem;
    padding: 1rem 1.1rem;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.97));
    box-shadow: 0 24px 46px rgba(15, 23, 42, 0.2);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.app-loading-spinner {
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 999px;
    border: 2.5px solid #fecdd3;
    border-top-color: #f7376b;
    animation: app-loading-spin 0.7s linear infinite;
    flex-shrink: 0;
}

.app-loading-text {
    margin: 0;
    color: #334155;
    font-size: 0.89rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

@keyframes app-loading-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.file-dropzone {
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border-width: 1.5px;
    background:
        radial-gradient(160% 120% at 0% 0%, #ffffff 0%, #f9fbff 44%, #f4f8ff 100%);
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, background-color 180ms ease;
}

.file-dropzone::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(120deg, rgba(247, 55, 107, 0.06), rgba(59, 130, 246, 0.08));
    opacity: 0.75;
    pointer-events: none;
}

.file-dropzone:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.file-dropzone-content [data-file-trigger] {
    cursor: pointer;
}

.file-dropzone-content {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 0.2rem;
}

.file-dropzone.is-dragover {
    border-color: var(--brand) !important;
    background: #fff4f8 !important;
    box-shadow: 0 0 0 4px rgba(247, 55, 107, 0.15), 0 8px 20px rgba(247, 55, 107, 0.13);
}

.file-dropzone.has-file {
    border-style: solid;
    border-color: color-mix(in srgb, var(--brand) 60%, #ffffff 40%) !important;
    background: linear-gradient(135deg, #fff7fb 0%, #fffdfd 100%) !important;
    box-shadow: 0 10px 20px rgba(247, 55, 107, 0.11);
}

.file-dropzone.is-processing {
    pointer-events: none;
    opacity: 0.9;
}

.file-dropzone.is-processing .file-dropzone-content::after {
    content: 'กำลังปรับขนาดรูป...';
    justify-self: center;
    margin-top: 0.25rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: #be123c;
}

.file-dropzone-preview {
    margin-top: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    border-radius: 0.9rem;
    border: 1px solid #f1d3dd;
    background: #ffffff;
    padding: 0.6rem 0.75rem;
}

.file-dropzone-preview-image,
.file-dropzone-preview-kind {
    width: 52px;
    height: 52px;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
}

.file-dropzone-preview-image {
    object-fit: cover;
}

.file-dropzone-preview-kind {
    display: grid;
    place-items: center;
    font-size: 0.74rem;
    font-weight: 700;
    color: #475569;
    letter-spacing: 0.04em;
}

.file-dropzone-clear {
    border: 1px solid #fecdd3;
    background: #fff1f2;
    color: #be123c;
    border-radius: 0.7rem;
    padding: 0.35rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    transition: background-color 140ms ease, border-color 140ms ease;
}

.file-dropzone-clear:hover {
    border-color: #fda4af;
    background: #ffe4e6;
}

.room-multiselect {
    position: relative;
}

.room-multiselect-native.is-enhanced {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    border: 0;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.room-multiselect-ui {
    position: relative;
}

.room-multiselect-toggle {
    width: 100%;
    min-height: 2.85rem;
    border-radius: 0.9rem;
    border: 1px solid #cbd5e1;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    padding: 0.45rem 0.65rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    text-align: left;
    transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.room-multiselect-toggle:hover {
    border-color: #94a3b8;
}

.room-multiselect-toggle:focus-visible {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(247, 55, 107, 0.18);
}

.room-multiselect.is-open .room-multiselect-toggle {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(247, 55, 107, 0.15);
    background: #fff7fb;
}

.room-multiselect.is-invalid .room-multiselect-toggle {
    border-color: #f43f5e;
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.16);
}

.room-multiselect-value {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    color: #0f172a;
}

.room-multiselect-placeholder {
    color: #64748b;
    font-size: 0.88rem;
    font-weight: 600;
}

.room-multiselect-chip {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    border-radius: 999px;
    border: 1px solid #fbcfe8;
    background: #fdf2f8;
    color: #be185d;
    padding: 0.2rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.room-multiselect-chip-muted {
    border-color: #cbd5e1;
    background: #f1f5f9;
    color: #475569;
}

.room-multiselect-caret {
    color: #64748b;
    flex-shrink: 0;
    transition: transform 140ms ease;
}

.room-multiselect.is-open .room-multiselect-caret {
    transform: rotate(180deg);
}

.room-multiselect-panel {
    position: absolute;
    z-index: 30;
    left: 0;
    right: 0;
    margin-top: 0.45rem;
    border-radius: 0.95rem;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    box-shadow:
        0 18px 30px rgba(15, 23, 42, 0.16),
        0 1px 0 rgba(255, 255, 255, 0.7) inset;
    overflow: hidden;
}

.room-multiselect-search-wrap {
    padding: 0.6rem 0.65rem 0.4rem;
    border-bottom: 1px solid #f1f5f9;
}

.room-multiselect-search {
    width: 100%;
    border-radius: 0.75rem;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    padding: 0.45rem 0.65rem;
    font-size: 0.86rem;
    color: #0f172a;
    outline: none;
}

.room-multiselect-search:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(247, 55, 107, 0.15);
    background: #ffffff;
}

.room-multiselect-list {
    max-height: 15rem;
    overflow-y: auto;
    padding: 0.35rem;
}

.room-multiselect-option {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    border-radius: 0.7rem;
    border: 1px solid transparent;
    background: transparent;
    padding: 0.45rem 0.55rem;
    text-align: left;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}

/* Tailwind `.hidden` loses to `display:flex` above (app.css loads after tailwind.css). */
.room-multiselect-option.hidden {
    display: none !important;
}

.room-multiselect-option:hover {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.room-multiselect-option:focus-visible {
    outline: none;
    background: #fff7fb;
    border-color: #f9a8d4;
}

.room-multiselect-option.is-selected {
    background: #fff1f7;
    border-color: #fbcfe8;
}

.room-multiselect-option-text {
    min-width: 0;
    display: grid;
    gap: 0.1rem;
}

.room-multiselect-option-name {
    color: #0f172a;
    font-size: 0.84rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.room-multiselect-option-meta {
    color: #64748b;
    font-size: 0.74rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.room-multiselect-option-check {
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    display: grid;
    place-items: center;
    color: transparent;
    background: #ffffff;
    transition: all 120ms ease;
    flex-shrink: 0;
}

.room-multiselect-option.is-selected .room-multiselect-option-check {
    border-color: #ec4899;
    background: #ec4899;
    color: #ffffff;
}

.room-multiselect-empty {
    padding: 0.65rem 0.75rem 0.8rem;
    color: #64748b;
    font-size: 0.8rem;
    text-align: center;
}

.room-multiselect-helper.is-error {
    color: #e11d48;
    font-weight: 700;
}

.calendar-wrap {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #e2e8f0;
    -webkit-overflow-scrolling: touch;
    --calendar-head-height: clamp(2rem, 4vw, 2.9rem);
    --calendar-head-font: clamp(0.56rem, 1.35vw, 0.79rem);
    --calendar-cell-height: clamp(4.4rem, 10vw, 7rem);
    --calendar-cell-padding: clamp(0.25rem, 0.65vw, 0.42rem);
    --calendar-chip-size: clamp(1.1rem, 2.5vw, 1.6rem);
    --calendar-chip-font: clamp(0.56rem, 1.35vw, 0.79rem);
    --calendar-entry-font: clamp(0.53rem, 1.2vw, 0.72rem);
}

.calendar-wrap::-webkit-scrollbar {
    height: 10px;
}

.calendar-wrap::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 999px;
}

.calendar-wrap::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #94a3b8, #64748b);
    border-radius: 999px;
}

.calendar-wrap::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, #64748b, #475569);
}

.calendar-table {
    width: max-content;
    min-width: max(100%, 700px);
    table-layout: auto;
}

.calendar-table th {
    height: var(--calendar-head-height);
    padding: 0.3rem 0.2rem;
    font-size: var(--calendar-head-font);
    line-height: 1;
}

.calendar-cell,
.calendar-cell-empty {
    height: var(--calendar-cell-height);
    min-width: 0;
    padding: var(--calendar-cell-padding);
}

.calendar-cell-booked:focus-visible {
    outline: 2px solid #f7376b;
    outline-offset: -2px;
}

.calendar-day-chip {
    width: var(--calendar-chip-size);
    height: var(--calendar-chip-size);
    font-size: var(--calendar-chip-font);
    line-height: 1;
}

.calendar-entry {
    padding: 0.14rem 0.24rem;
    font-size: var(--calendar-entry-font);
    line-height: 1.2;
}

.calendar-entry-button {
    display: block;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: filter 140ms ease, transform 140ms ease;
}

.calendar-entry-button:hover {
    filter: brightness(0.98);
    transform: translateY(-1px);
}

.calendar-entry-button:focus-visible {
    outline: 2px solid #f7376b;
    outline-offset: 1px;
}

.calendar-empty,
.calendar-more {
    font-size: var(--calendar-entry-font);
    line-height: 1.2;
}

@media (max-width: 767px) {
    .calendar-wrap {
        overflow-x: hidden;
        --calendar-head-height: 1.7rem;
        --calendar-head-font: 0.52rem;
        --calendar-cell-height: 3.5rem;
        --calendar-cell-padding: 0.16rem;
        --calendar-chip-size: 0.98rem;
        --calendar-chip-font: 0.5rem;
        --calendar-entry-font: 0.48rem;
    }

    .calendar-wrap::-webkit-scrollbar {
        height: 0;
    }

    .calendar-table {
        width: 100%;
        min-width: 0;
        table-layout: fixed;
    }

    .calendar-table th {
        min-width: 0 !important;
        padding: 0.2rem 0.05rem;
    }

    .calendar-entry {
        padding: 0.1rem 0.14rem;
    }
}

@media (min-width: 1024px) {
    .dashboard-body.has-sidebar-shell {
        display: grid;
        grid-template-rows: auto minmax(0, 1fr) auto;
        height: 100vh;
        overflow-x: hidden;
        overflow-y: hidden;
        max-width: 100%;
    }

    .dashboard-body.has-sidebar-shell .app-header>.mx-auto,
    .dashboard-body.has-sidebar-shell .app-footer>.mx-auto {
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .dashboard-body.has-sidebar-shell .app-main-shell {
        margin: 0;
        width: 100%;
        max-width: 100%;
        min-height: 0;
        padding: 0;
    }

    .dashboard-body.has-sidebar-shell .app-main-track {
        height: 100%;
        min-height: 0;
        min-width: 0;
        max-width: 100%;
        gap: 0;
    }

    .dashboard-body.has-sidebar-shell #appSidebar {
        position: relative !important;
        inset: auto !important;
        top: auto !important;
        left: auto !important;
        z-index: 20;
        display: block !important;
        transform: none !important;
        width: min(var(--app-sidebar-width), 30vw);
        min-width: 0;
        max-width: var(--app-sidebar-width);
        flex-shrink: 0;
        height: 100%;
        max-height: none;
        border-radius: 0;
        border-top: 0;
        border-bottom: 0;
        border-left: 0;
        box-shadow: none;
        overflow-y: auto;
    }

    .dashboard-body.has-sidebar-shell .app-main-content {
        height: 100%;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        padding: 1rem 1rem 1.25rem;
    }
}

.soft-scroll::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.soft-scroll::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #cbd5e1;
}

.soft-scroll::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

@media (min-width: 768px) {
    .app-sidebar {
        transform: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        transition: none !important;
    }

    .sidebar-backdrop {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
}

@media (max-width: 767px) {
    .app-sidebar {
        height: 100vh;
        max-height: 100vh;
        overflow-y: auto;
    }

    .app-loading-panel {
        min-width: min(94vw, 320px);
        border-radius: 0.9rem;
        padding: 0.85rem 0.95rem;
    }

    .app-loading-text {
        font-size: 0.79rem;
    }
}

.app-swal-popup {
    border-radius: 22px !important;
    border: 1px solid #dbe7ff !important;
    background: linear-gradient(145deg, #ffffff 0%, #f8fbff 100%) !important;
    box-shadow:
        0 26px 70px rgba(15, 23, 42, 0.33),
        0 6px 18px rgba(15, 23, 42, 0.16) !important;
}

.app-swal-title {
    margin-top: 0.35rem !important;
    color: #0f172a !important;
    font-size: 1.24rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.01em !important;
}

.app-swal-body {
    color: #334155 !important;
    padding-top: 0.3rem !important;
}

.app-swal-actions {
    gap: 0.58rem !important;
    margin-top: 1rem !important;
}

.app-swal-btn {
    min-width: 108px;
    border-radius: 12px !important;
    border: 1px solid transparent !important;
    padding: 0.62rem 1rem !important;
    font-weight: 800 !important;
    font-size: 0.89rem !important;
    letter-spacing: 0.01em !important;
    transition: transform 150ms ease, filter 150ms ease, box-shadow 180ms ease !important;
}

.app-swal-btn:hover {
    transform: translateY(-1px);
    filter: saturate(1.04);
}

.app-swal-btn:active {
    transform: translateY(0);
}

.app-swal-btn-primary {
    color: #fff !important;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.32) !important;
}

.app-swal-btn-secondary {
    color: #334155 !important;
    border-color: #cbd5e1 !important;
    background: #fff !important;
    box-shadow: 0 5px 12px rgba(15, 23, 42, 0.09) !important;
}

.app-swal-btn-danger {
    color: #fff !important;
    background: linear-gradient(135deg, #dc2626 0%, #be123c 100%) !important;
    box-shadow: 0 10px 20px rgba(220, 38, 38, 0.3) !important;
}

.app-swal-btn-success {
    color: #fff !important;
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%) !important;
    box-shadow: 0 10px 20px rgba(22, 163, 74, 0.32) !important;
}

.app-swal-btn-warning {
    color: #111827 !important;
    background: linear-gradient(135deg, #fde047 0%, #facc15 100%) !important;
    box-shadow: 0 10px 20px rgba(250, 204, 21, 0.28) !important;
}

.app-swal-btn-info {
    color: #fff !important;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
    box-shadow: 0 10px 20px rgba(2, 132, 199, 0.3) !important;
}

.app-swal-close {
    color: #64748b !important;
}

.app-swal-icon {
    margin-top: 0.28rem !important;
}

.app-swal-message {
    display: grid;
    gap: 0.72rem;
    text-align: left;
}

.app-swal-message-head {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    padding: 0.78rem 0.82rem;
    background: #f8fafc;
}

.app-swal-message-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 900;
    line-height: 1;
    color: #fff;
    background: #334155;
}

.app-swal-message-content {
    min-width: 0;
}

.app-swal-message-summary {
    margin: 0;
    color: #0f172a;
    font-size: 0.93rem;
    font-weight: 700;
    line-height: 1.52;
}

.app-swal-message--success .app-swal-message-head {
    border-color: #bbf7d0;
    background: #ecfdf5;
}

.app-swal-message--success .app-swal-message-badge {
    background: #16a34a;
}

.app-swal-message--warning .app-swal-message-head {
    border-color: #fde68a;
    background: #fffbeb;
}

.app-swal-message--warning .app-swal-message-badge {
    background: #d97706;
}

.app-swal-message--info .app-swal-message-head {
    border-color: #bae6fd;
    background: #f0f9ff;
}

.app-swal-message--info .app-swal-message-badge {
    background: #0284c7;
}

.app-swal-message--danger .app-swal-message-head {
    border-color: #fecdd3;
    background: #fff1f2;
}

.app-swal-message--danger .app-swal-message-badge {
    background: #dc2626;
}

.app-swal-detail-stack {
    display: grid;
    gap: 0.54rem;
}

.app-swal-detail-card {
    display: flex;
    align-items: flex-start;
    gap: 0.62rem;
    border: 1px solid #dbe3f0;
    border-radius: 12px;
    background: #fff;
    padding: 0.65rem 0.72rem;
}

.app-swal-detail-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.2rem;
    height: 1.2rem;
    border-radius: 999px;
    background: #e2e8f0;
    color: #0f172a;
    font-size: 0.69rem;
    font-weight: 800;
}

.app-swal-detail-text {
    margin: 0;
    color: #0f172a;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.5;
}

.app-swal-detail-grid {
    text-align: left;
    display: grid;
    gap: 0.5rem;
    line-height: 1.45;
}

.app-swal-detail-row {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    padding: 0.5rem 0.64rem;
}

.app-swal-detail-row strong {
    color: #334155;
    margin-right: 0.2rem;
}

.app-swal-attachment-link {
    display: inline-flex;
    align-items: center;
    border: 1px solid #bae6fd;
    border-radius: 10px;
    background: #f0f9ff;
    color: #075985;
    font-size: 0.77rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    padding: 0.35rem 0.58rem;
}

.app-swal-muted {
    color: #64748b;
}

.app-swal-day-list {
    max-height: 56vh;
    overflow: auto;
    text-align: left;
    padding: 0.08rem 0;
    display: grid;
    gap: 0.55rem;
}

.app-swal-day-item {
    display: block;
    width: 100%;
    text-align: left;
    border: 1px solid #d6e0f1;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    padding: 0.65rem 0.72rem;
    transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.app-swal-day-item:hover {
    border-color: #93c5fd;
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.12);
    transform: translateY(-1px);
}

.app-swal-day-item-time {
    color: #475569;
    font-size: 0.74rem;
    font-weight: 700;
}

.app-swal-day-item-title {
    margin-top: 0.16rem;
    color: #0f172a;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1.35;
}

.app-swal-day-item-meta {
    margin-top: 0.2rem;
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 600;
}

.app-swal-toast {
    border-radius: 14px !important;
    padding-right: 0.65rem !important;
    min-width: min(92vw, 440px) !important;
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.22) !important;
}

body.swal2-toast-shown .swal2-container,
body.swal2-toast-shown .swal2-container.swal2-backdrop-show {
    background: transparent !important;
    backdrop-filter: none !important;
}

.app-swal-toast-title {
    font-size: 0.89rem !important;
    font-weight: 800 !important;
}

.app-swal-toast-icon {
    transform: scale(0.88);
}

@keyframes appSwalEnter {
    0% {
        opacity: 0;
        transform: translateY(12px) scale(0.985);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes appSwalLeave {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateY(8px) scale(0.985);
    }
}

.app-swal-show {
    animation: appSwalEnter 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.app-swal-hide {
    animation: appSwalLeave 170ms ease-out;
}

@media (max-width: 767px) {
    .app-swal-popup {
        width: min(94vw, 540px) !important;
        border-radius: 18px !important;
    }

    .app-swal-actions {
        flex-wrap: wrap;
        justify-content: center;
    }

    .app-swal-btn {
        min-width: 44%;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
