/* U-dee theme: primary #06356A (sidebar), secondary #BFD100 (accent) */
@font-face {
    font-family: 'Google Sans';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/google-sans/GoogleSans-Regular.ttf') format('truetype');
}

@font-face {
    font-family: 'Google Sans';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/google-sans/GoogleSans-Medium.ttf') format('truetype');
}

@font-face {
    font-family: 'Google Sans';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/google-sans/GoogleSans-Bold.ttf') format('truetype');
}

@font-face {
    font-family: 'IBM Plex Sans Thai';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/ibm-plex-sans-thai/IBMPlexSansThai-Medium.ttf') format('truetype');
}

@font-face {
    font-family: 'IBM Plex Sans Thai';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/ibm-plex-sans-thai/IBMPlexSansThai-SemiBold.ttf') format('truetype');
}

@font-face {
    font-family: 'IBM Plex Sans Thai';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/ibm-plex-sans-thai/IBMPlexSansThai-Bold.ttf') format('truetype');
}

:root {
    --font-family: 'Google Sans';
    --udee-primary: #06356A;
    --udee-secondary: #BFD100;
    --udee-font-body: 'Google Sans', ui-sans-serif, system-ui, sans-serif;
    --udee-font-heading: 'IBM Plex Sans Thai', 'Google Sans', ui-sans-serif, system-ui, sans-serif;
}

html,
body,
.fi-body,
button,
input,
select,
textarea {
    font-family: var(--udee-font-body);
}

h1, h2, h3, h4,
.fi-header-heading,
.fi-section-header-heading,
.fi-simple-header-heading,
.fi-modal-heading,
.fi-ta-header-heading,
.fi-sidebar-group-label,
.fi-wi-stats-overview-stat-value {
    font-family: var(--udee-font-heading);
}

/* Buttons use the loopless Thai font */
.fi-btn {
    font-family: var(--udee-font-heading);
}

/* Topbar height (Filament sets 4rem on .fi-body) */
.fi-body {
    --topbar-height: 4.5rem;
}

/* Light by default; dark when the user picks dark mode (ตั้งค่าระบบ) */
:root {
    color-scheme: light;
}

.dark {
    color-scheme: dark;
}

.fi-sidebar {
    background-color: var(--udee-primary);
    background-image:
        linear-gradient(to bottom, var(--udee-primary) 0%, var(--udee-primary) 35%, rgb(6 53 106 / 0) 100%),
        linear-gradient(rgb(0 0 0 / 0.3), rgb(0 0 0 / 0.3)),
        url('/images/sidebar-mascot-oct-2026.webp');
    background-repeat: no-repeat;
    background-position: center bottom;
    background-size: 100% 100%, 100% 100%, 100% auto;
    --color-gray-950: #fff;
    --color-gray-700: #fff;
    --color-gray-500: #fff;
    --color-gray-400: #fff;
}

html.udee-no-sidebar-image .fi-sidebar {
    background-image: none;
}

/* Package card below the sidebar navigation (filament/sidebar-package) */
/* Negative margin lines it up with the nav items, which the nav groups pull out by 0.5rem. */
.udee-sidebar-package {
    margin-inline: -0.5rem;
    padding: 0.75rem;
    border-radius: var(--radius-lg);
    background-color: rgb(255 255 255 / 0.08);
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.2);
    color: #fff;
    font-size: 0.875rem;
    line-height: 1.5;
}

a.udee-sidebar-package {
    display: block;
}

a.udee-sidebar-package:hover {
    background-color: rgb(255 255 255 / 0.14);
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.4);
}

.udee-sidebar-package-name {
    font-weight: 600;
}

.fi-sidebar-item:not(.fi-active) .fi-sidebar-item-label,
.fi-sidebar-item:not(.fi-active) .fi-sidebar-item-icon,
.fi-sidebar-group-label,
.fi-sidebar-group-collapse-button,
.fi-sidebar-group-btn .fi-icon {
    color: #fff;
}

.fi-sidebar-header,
.fi-sidebar-footer {
    background-color: transparent;
    box-shadow: none;
}

.fi-sidebar-item-btn:hover,
.fi-sidebar-group-btn:hover {
    background-color: rgb(255 255 255 / 0.1);
}

.fi-sidebar-group-btn {
    border-radius: var(--radius-lg);
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
    background-color: var(--udee-secondary);
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn * {
    color: var(--udee-primary);
    font-weight: 600;
}

.fi-btn.fi-color-primary {
    background-color: var(--udee-primary);
}

.fi-btn.fi-color-primary:not(.fi-outlined),
.fi-btn.fi-color-primary:not(.fi-outlined) * {
    color: #fff;
}

.fi-btn.fi-color-warning:not(.fi-outlined),
.fi-fo-file-upload-editor .fi-btn.fi-color-success:not(.fi-outlined) {
    background: linear-gradient(to bottom, #0b4a8f, #06356A);
    border: 1px solid #052b57;
    box-shadow: 0 2px 4px rgb(0 0 0 / 0.2), inset 0 1px 0 rgb(255 255 255 / 0.35);
}

.fi-btn.fi-color-warning:not(.fi-outlined):hover,
.fi-fo-file-upload-editor .fi-btn.fi-color-success:not(.fi-outlined):hover {
    background: linear-gradient(to bottom, #083f7a, #042a55);
}

.fi-btn.fi-color-warning:not(.fi-outlined),
.fi-btn.fi-color-warning:not(.fi-outlined) *,
.fi-fo-file-upload-editor .fi-btn.fi-color-success:not(.fi-outlined) {
    color: #fff;
    font-weight: 700;
}

/* White (gray) buttons: icon as dark as the label */
.fi-btn:not(.fi-outlined):not(.fi-color) > .fi-icon {
    color: var(--gray-950);
}

.fi-btn.udee-btn-danger:not(.fi-outlined) {
    background: linear-gradient(to bottom, #e04848, #c62828);
    border: 1px solid #a81f1f;
    box-shadow: 0 2px 4px rgb(0 0 0 / 0.2), inset 0 1px 0 rgb(255 255 255 / 0.35);
}

.fi-btn.udee-btn-danger:not(.fi-outlined):hover {
    background: linear-gradient(to bottom, #d33c3c, #b52222);
}

.fi-btn.udee-btn-danger:not(.fi-outlined),
.fi-btn.udee-btn-danger:not(.fi-outlined) * {
    color: #fff;
    font-weight: 700;
}

.fi-btn.udee-btn-add:not(.fi-outlined) {
    background: linear-gradient(to bottom, #0b4a8f, #06356A);
    border: 1px solid #052b57;
    box-shadow: 0 2px 4px rgb(0 0 0 / 0.2), inset 0 1px 0 rgb(255 255 255 / 0.35);
}

.fi-btn.udee-btn-add:not(.fi-outlined):hover {
    background: linear-gradient(to bottom, #083f7a, #042a55);
}

.fi-btn.udee-btn-add:not(.fi-outlined),
.fi-btn.udee-btn-add:not(.fi-outlined) * {
    color: #fff;
    font-weight: 700;
}

/* BuyPackage "อัพเกรดแพคเกจ" and meter "จดค่าไฟ": raised orange, the same in dark mode */
.fi-btn.udee-btn-upgrade:not(.fi-outlined) {
    background: linear-gradient(to bottom, #fb923c, #ea580c);
    border: 1px solid #c2410c;
    box-shadow: 0 2px 4px rgb(0 0 0 / 0.2), inset 0 1px 0 rgb(255 255 255 / 0.35);
}

.fi-btn.udee-btn-upgrade:not(.fi-outlined):hover {
    background: linear-gradient(to bottom, #f97316, #c2410c);
}

.fi-btn.udee-btn-upgrade:not(.fi-outlined),
.fi-btn.udee-btn-upgrade:not(.fi-outlined) * {
    color: #fff;
    font-weight: 700;
}

.fi-btn.udee-btn-receive:not(.fi-outlined) {
    background: linear-gradient(to bottom, #b3c20b, #9fae08);
    border: 1px solid #8a9707;
    box-shadow: 0 2px 4px rgb(0 0 0 / 0.2), inset 0 1px 0 rgb(255 255 255 / 0.35);
}

.fi-btn.udee-btn-receive:not(.fi-outlined):hover {
    background: linear-gradient(to bottom, #a6b50a, #929f07);
}

.fi-btn.udee-btn-receive:not(.fi-outlined),
.fi-btn.udee-btn-receive:not(.fi-outlined) * {
    color: #fff;
    font-weight: 700;
}

.fi-simple-layout {
    background: url('/images/ud-login-background-2.webp') right bottom / cover no-repeat fixed;
}

/* Mobile: login fills the screen instead of a floating box */
@media (max-width: 639px) {
    .fi-simple-layout .fi-simple-main {
        margin: 0;
        min-height: 100dvh;
        max-width: none;
        display: flex;
        flex-direction: column;
        justify-content: center;
        border-radius: 0;
        box-shadow: none;
        --tw-ring-shadow: 0 0 #0000;
    }
}

.fi-simple-layout .fi-simple-main {
    background-color: rgb(255 255 255 / 0.85);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.fi-simple-layout .fi-simple-header-subheading {
    color: var(--gray-800);
}

.fi-simple-layout .fi-btn.fi-color-primary:not(.fi-outlined) {
    background: linear-gradient(to bottom, #0b4585, #06356A);
    border: 1px solid #042a54;
    box-shadow: 0 2px 4px rgb(0 0 0 / 0.2), inset 0 1px 0 rgb(255 255 255 / 0.35);
    font-weight: 700;
}

.fi-simple-layout .fi-btn.fi-color-primary:not(.fi-outlined):hover {
    background: linear-gradient(to bottom, #093c76, #052e5a);
}

.fi-simple-layout .fi-logo {
    content: url('/images/logo/U-dee-logo-blue.svg');
    height: 5rem !important;
}

/* Layout: sidebar full height with centred logo; topbar starts after the sidebar */
.fi-topbar .fi-logo {
    background-color: var(--udee-primary);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

.fi-topbar-end {
    flex: 1;
    justify-content: flex-end;
}

/* Property name in topbar: left-aligned, larger */
.fi-topbar .fi-tenant-menu {
    margin-inline-end: auto;
}

/* Collapsible sidebar hides the tenant name and chevron (x-show) when the sidebar is collapsed; keep them in the topbar */
.fi-topbar .fi-tenant-menu-trigger-text {
    display: grid !important;
}

.fi-topbar .fi-tenant-menu-trigger > .fi-icon {
    display: block !important;
}

.fi-topbar .fi-tenant-menu-trigger-tenant-name {
    font-family: var(--udee-font-heading);
    font-size: 1.25rem;
    font-weight: 600;
}

@media (max-width: 63.999rem) {
    /* Mobile: hide user name/role beside the avatar; property name stays on the left of the topbar */
    .fi-topbar .udee-topbar-user {
        display: none;
    }

    .fi-topbar .fi-tenant-menu {
        display: block;
        min-width: 0;
    }

    .fi-topbar .fi-tenant-menu .fi-tenant-avatar {
        display: none;
    }

    /* Long property names shrink to "ชื่อหอพัก…" on narrow screens */
    .fi-topbar .fi-topbar-end,
    .fi-topbar .fi-tenant-menu .fi-dropdown-trigger,
    .fi-topbar .fi-tenant-menu-trigger,
    .fi-topbar .fi-tenant-menu-trigger-text {
        min-width: 0;
    }

    .fi-topbar .fi-tenant-menu-trigger-tenant-name {
        font-size: 1rem;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Mobile sidebar: logo centred in the menu */
    .fi-body-has-topbar .fi-sidebar-header {
        height: auto;
        padding-block: 1rem;
        flex-direction: column;
        align-items: stretch;
    }

    .fi-sidebar-header-logo-ctn {
        display: flex;
        justify-content: center;
    }

    .fi-body-has-topbar .fi-sidebar-nav {
        padding-top: 0;
    }

    .fi-sidebar-header .fi-logo {
        width: 8rem;
        height: auto !important;
        margin-inline-start: 0;
    }

    .fi-topbar-end {
        justify-content: flex-end;
    }
}

@media (min-width: 64rem) {
    .fi-body.fi-body-has-topbar .fi-layout {
        margin-top: calc(-1 * var(--topbar-height));
    }

    .fi-body.fi-body-has-topbar .fi-main-ctn {
        padding-top: var(--topbar-height);
    }

    .fi-body.fi-body-has-topbar .fi-sidebar {
        top: 0;
        height: 100dvh;
    }

    .fi-body-has-topbar .fi-sidebar-header {
        display: flex;
        justify-content: center;
        height: var(--topbar-height);
        border-bottom: 1px solid rgb(255 255 255 / 0.2);
    }

    .fi-body-has-topbar .fi-sidebar-header-logo-ctn {
        display: flex;
        justify-content: center;
    }

    .fi-body-has-topbar .fi-sidebar-header .fi-logo {
        margin-inline-start: 0;
        height: 3.5rem !important;
    }

    .fi-topbar-start {
        display: none;
    }

    .fi-body.fi-body-has-topbar .fi-topbar-ctn {
        width: calc(100% - var(--sidebar-width, 20rem));
        margin-inline-start: var(--sidebar-width, 20rem);
    }

    /* Collapsible sidebar (app panel): keep only the collapse/expand button from the topbar start */
    .fi-body-has-sidebar-collapsible-on-desktop .fi-topbar-start {
        display: flex;
        flex: none;
        margin-inline-end: 0.5rem;
    }

    .fi-body-has-sidebar-collapsible-on-desktop .fi-topbar-start > :not(.fi-topbar-collapse-sidebar-btn-ctn) {
        display: none;
    }

    .fi-body.fi-body-has-topbar:has(.fi-sidebar:not(.fi-sidebar-open)) .fi-topbar-ctn {
        width: calc(100% - var(--collapsed-sidebar-width));
        margin-inline-start: var(--collapsed-sidebar-width);
    }

    .fi-sidebar:not(.fi-sidebar-open) .udee-sidebar-package {
        display: none;
    }

    .udee-sidebar-icon img {
        height: 2.5rem;
    }
}

/* Divider above the accounting and settings groups (collapsed and full sidebar) */
.fi-sidebar .fi-sidebar-group[data-group-label="บัญชี"],
.fi-sidebar .fi-sidebar-group[data-group-label="ตั้งค่า"] {
    border-top: 1px solid rgb(255 255 255 / 0.2);
    padding-top: 1rem;
}

.fi-sidebar svg {
    stroke-width: 1.25;
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn svg,
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn svg * {
    stroke-width: 1.25;
}

.fi-sidebar .fi-user-menu-trigger,
.fi-sidebar .fi-user-menu-trigger .fi-user-menu-trigger-text,
.fi-sidebar .fi-user-menu-trigger .fi-icon {
    color: #fff;
}

/* User name shown before the avatar in the topbar */
.udee-topbar-user-name {
    font-family: var(--udee-font-heading);
    font-weight: 500;
}

.udee-topbar-user {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.25;
}

.udee-topbar-user-role {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Tenant (apartment) avatar/logo in topbar: circular */
.fi-tenant-avatar {
    border-radius: 9999px;
    object-fit: cover;
}

/* Other properties in the tenant dropdown: circular too */
.fi-tenant-menu-item .fi-dropdown-list-item-image {
    border-radius: 9999px;
}

/* Active tab (e.g. settings/apartment): navy background, white text */
.fi-tabs-item.fi-active {
    background-color: #06356a;
}

.fi-tabs-item.fi-active .fi-tabs-item-label,
.fi-tabs-item.fi-active > .fi-icon {
    color: #fff;
}

/* Toggle switch: on-state background */
.fi-toggle.fi-toggle-on:not(.fi-hidden) {
    background-color: #06356a;
}

/* Active bank account toggle is disabled but should keep full color */
.udee-toggle-solid .fi-toggle[disabled] {
    opacity: 1;
}

/* Toggle buttons: neutral until selected, then navy background */
.fi-fo-toggle-buttons .fi-btn {
    background-color: #fff !important;
    color: #374151 !important;
    --tw-ring-color: #d1d5db !important;
}

.fi-fo-toggle-buttons .fi-btn:not([aria-pressed="true"]),
.fi-fo-toggle-buttons .fi-btn:not([aria-pressed="true"]) * {
    color: #374151 !important;
}

.fi-fo-toggle-buttons .fi-btn[aria-pressed="true"] {
    background-color: #06356a !important;
    color: #fff !important;
    --tw-ring-color: #06356a !important;
}

.fi-fo-toggle-buttons .fi-btn[aria-pressed="true"] > .fi-icon {
    color: #fff !important;
}

/* Transaction type: income green, expense red when selected */
.udee-transaction-type .fi-btn.fi-color-success[aria-pressed="true"] {
    background-color: #16a34a !important;
    --tw-ring-color: #16a34a !important;
}

.udee-transaction-type .fi-btn.fi-color-danger[aria-pressed="true"] {
    background-color: #dc2626 !important;
    --tw-ring-color: #dc2626 !important;
}

/* Logo upload: show only the image (no dark side bars, no file name) */
.udee-image-upload .filepond--item-panel,
.udee-image-upload .filepond--image-preview-overlay,
.udee-image-upload .filepond--image-preview,
.udee-image-upload .filepond--image-preview-wrapper {
    background: transparent !important;
    margin-inline: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
}

.udee-image-upload .filepond--file-info,
.udee-image-upload .filepond--file-status {
    display: none;
}

/* ...but a rejected file (too large, wrong type) still says why, in red on the white panel */
.udee-image-upload .filepond--item[data-filepond-item-state*='invalid'] .filepond--file-status,
.udee-image-upload .filepond--item[data-filepond-item-state*='error'] .filepond--file-status {
    display: flex;
    margin-left: 0;
    transform: none !important; /* FilePond slides it to the right, under the remove button */
    color: #dc2626;
}

/* Logo upload: remove top gradient overlay and borders */
.udee-image-upload .filepond--image-preview-overlay,
.udee-image-upload .filepond--image-preview-overlay svg {
    display: none !important;
}

.udee-image-upload .filepond--panel-root,
.udee-image-upload .filepond--drop-label,
.udee-image-upload .filepond--root,
.udee-image-upload .fi-fo-file-upload,
.udee-image-upload .filepond--item-panel {
    border: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
}

.udee-image-upload .filepond--panel-root {
    background: transparent !important;
    margin-inline: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
}

/* Logo upload: remove button on the right */
.udee-image-upload .filepond--action-remove-item {
    left: auto !important;
    right: 0.5rem !important;
}

/* Before FilePond loads (async, e.g. after a room popup tab switch), hold the empty drop area's height so the card doesn't grow a moment later */
.udee-image-upload .fi-fo-file-upload-input-ctn:not(:has(.filepond--root)) {
    min-height: 4.75em;
}

.udee-equal-box .fi-fo-file-upload-input-ctn:not(:has(.filepond--root)) {
    min-height: 7rem;
}

/* Image editor (crop) save button: same green + disk icon as other save buttons */
.fi-fo-file-upload-editor .fi-btn.fi-color-success:not(.fi-outlined)::before {
    content: "";
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    margin-inline-end: 0.375rem;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z'/%3E%3Cpath d='M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7'/%3E%3Cpath d='M7 3v4a1 1 0 0 0 1 1h7'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z'/%3E%3Cpath d='M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7'/%3E%3Cpath d='M7 3v4a1 1 0 0 0 1 1h7'/%3E%3C/svg%3E") center / contain no-repeat;
}

.fi-fo-file-upload-editor .fi-fo-file-upload-editor-control-panel-footer {
    justify-content: flex-end;
}

/* Tenant form: ID-card and house-registration uploads share the same height */
textarea.udee-equal-box,
.udee-equal-box .filepond--root {
    height: 7rem !important;
    min-height: 7rem;
}

/* Modal footer buttons: always right-aligned (submit rightmost) */
.fi-modal-footer .fi-modal-footer-actions {
    display: flex;
    flex-direction: row-reverse;
    flex-wrap: wrap;
    align-items: center;
}
.fi-modal-footer.fi-align-center {
    padding-inline: 1.5rem;
}

/* Dashboard stat cards: icon in a circle on the left, soft tinted background, border in the icon-circle tint */
.udee-stat-card {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    --stat-color: #06356A;
    background: var(--stat-bg, color-mix(in srgb, var(--stat-color) 8%, white));
    box-shadow: 0 0 0 1px var(--stat-border, var(--stat-icon-bg, color-mix(in srgb, var(--stat-color) 16%, white))), 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

.udee-stat-card .fi-wi-stats-overview-stat-content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: auto auto 1fr;
    grid-template-areas:
        'icon label value'
        'icon desc desc';
    align-items: center;
    column-gap: 0.75rem;
    row-gap: 0.125rem;
}

.udee-stat-card .fi-wi-stats-overview-stat-label-ctn {
    display: contents;
}

.udee-stat-card .fi-wi-stats-overview-stat-label-ctn > svg {
    grid-area: icon;
    box-sizing: content-box;
    width: 2rem;
    height: 2rem;
    padding: 0.875rem;
    border-radius: 9999px;
    /* Chromium clips the bottom of icons that touch the viewBox edge (triangle-alert) when the svg has padding */
    overflow: visible;
    stroke-width: 1.5;
    color: var(--stat-color);
    background: var(--stat-icon-bg, color-mix(in srgb, var(--stat-color) 16%, white));
}

.udee-stat-card .fi-wi-stats-overview-stat-label {
    grid-area: label;
}

.udee-stat-card .fi-wi-stats-overview-stat-value {
    grid-area: value;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--stat-color);
}

.udee-stat-card .fi-wi-stats-overview-stat-description {
    grid-area: desc;
    color: color-mix(in srgb, var(--stat-color) 60%, #64748b) !important;
}

.udee-stat-card .fi-wi-stats-overview-stat-label {
    font-size: 1.25rem;
    color: var(--stat-color);
    font-family: var(--udee-font-heading);
}

/* iPad portrait (iPad 13 is 1032px wide): stat cards 2 per row (6 cards -> 3 rows) instead of 3 */
@media (min-width: 640px) and (max-width: 1279px) and (orientation: portrait) {
    .fi-wi-stats-overview .fi-grid:not(.fi-grid-direction-col).\@xl\:fi-grid-cols {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Table filters: apply button right-aligned, raised like the save buttons (keeps its colour) */
.fi-ta-filters-actions-ctn {
    justify-content: flex-end;
}

.fi-btn[data-table-filter-action="apply"] {
    background: linear-gradient(to bottom, #0f4a8c, var(--udee-primary));
    border: 1px solid #052a54;
    box-shadow: 0 2px 4px rgb(0 0 0 / 0.2), inset 0 1px 0 rgb(255 255 255 / 0.35);
    font-weight: 700;
}

.fi-btn[data-table-filter-action="apply"]:hover {
    background: linear-gradient(to bottom, #0c3f78, #052a54);
}

/* Rooms table: title on the same row as the search/toolbar */
.fi-resource-rooms .fi-ta-header-ctn {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    border-bottom: 1px solid var(--gray-200);
}

.fi-resource-rooms .fi-ta-header-ctn > .fi-ta-header,
.fi-resource-rooms .fi-ta-header-ctn > .fi-ta-header-toolbar {
    border-bottom: 0;
}

.fi-resource-rooms .fi-ta-header-ctn > .fi-ta-header-toolbar {
    flex: 1 1 24rem;
}

/* Room types table: create button after (to the right of) the search field */
.fi-ta-header-toolbar:has(.udee-room-types-create) {
    flex-direction: row-reverse;
}

/* Dashboard widget titles (floor map, revenue chart) and the rooms table title */
.fi-wi-widget .fi-section-header-heading,
.fi-resource-rooms .fi-ta-header-heading {
    font-size: 1.25rem;
    line-height: 1.3;
}

.udee-stat-unit {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Wider global search in topbar */
.fi-topbar .fi-global-search-field {
    width: 285px;
    max-width: 100%;
}

/* Mobile: global search shows only the icon; expands over the topbar when focused */
@media (max-width: 639px) {
    .fi-topbar {
        position: relative;
    }

    .fi-topbar .fi-global-search {
        position: static;
    }

    .fi-topbar .fi-global-search-field {
        width: 2.5rem;
    }

    .fi-topbar .fi-global-search-field .fi-input-wrp {
        position: relative;
        background-color: transparent;
        box-shadow: none;
    }

    .fi-topbar .fi-global-search-field .fi-input {
        position: absolute;
        inset: 0;
        opacity: 0;
        cursor: pointer;
    }

    /* Search icon: same size and colour as the notifications bell */
    .fi-topbar .fi-global-search-field .fi-input-wrp {
        justify-content: center;
        height: 2.5rem;
        align-items: center;
    }

    .fi-topbar .fi-global-search-field .fi-input-wrp-prefix {
        padding-inline: 0;
    }

    /* Tighter gap between the search icon and the bell */
    .fi-topbar .fi-global-search-ctn {
        margin-inline-end: -0.75rem;
    }

    .fi-topbar .fi-global-search-field .fi-input-wrp-prefix > .fi-icon,
    .fi-topbar .fi-topbar-database-notifications-btn .fi-icon {
        width: 1.5rem;
        height: 1.5rem;
        margin-top: 0;
    }

    .fi-topbar .fi-global-search-field .fi-input-wrp-prefix > .fi-icon,
    .fi-topbar .fi-topbar-database-notifications-btn {
        color: var(--gray-500);
    }

    .fi-topbar .fi-global-search-field:focus-within .fi-input-wrp-prefix,
    .fi-topbar .fi-global-search-field:has(.fi-input:not(:placeholder-shown)) .fi-input-wrp-prefix {
        padding-inline: 0.75rem 0.5rem;
    }

    .fi-topbar .fi-global-search-field:focus-within,
    .fi-topbar .fi-global-search-field:has(.fi-input:not(:placeholder-shown)) {
        position: absolute;
        inset-inline: 1rem;
        top: 50%;
        transform: translateY(-50%);
        width: auto;
        z-index: 20;
    }

    .fi-topbar .fi-global-search-field:focus-within .fi-input-wrp,
    .fi-topbar .fi-global-search-field:has(.fi-input:not(:placeholder-shown)) .fi-input-wrp {
        background-color: var(--color-white);
        box-shadow: 0 0 0 1px color-mix(in oklab, var(--gray-950) 10%, transparent), 0 1px 3px 0 #0000001a;
    }

    .fi-topbar .fi-global-search-field:focus-within .fi-input,
    .fi-topbar .fi-global-search-field:has(.fi-input:not(:placeholder-shown)) .fi-input {
        position: static;
        opacity: 1;
        cursor: text;
    }

    .fi-topbar .fi-global-search-results-ctn {
        top: 100%;
        inset-inline: 1rem;
        width: auto;
        max-width: none;
    }
}

/* Image upload (multiple): space between images */
.udee-image-upload .filepond--root[data-style-panel-layout='grid'] .filepond--item {
    margin: 0.5rem !important;
    width: calc(50% - 1rem) !important;
}

@media (min-width: 1024px) {
    .udee-image-upload .filepond--root[data-style-panel-layout='grid'] .filepond--item {
        width: calc(33.33% - 1rem) !important;
    }
}

/* Breadcrumb: current page */
.fi-breadcrumbs-item-label[aria-current='page'] {
    color: #333 !important;
    font-weight: 700 !important;
}

/* Room popup tabs: same background as the page */
.fi-modal-content:has(.udee-room-tab) {
    background-color: var(--gray-50);
}

/* Tenant modal: light gray behind the tenant / vehicle tabs, header and footer included */
.fi-modal .fi-modal-window-ctn > .fi-modal-window:has(.udee-tenant-tabs),
.fi-modal .fi-modal-window-ctn > .fi-modal-window:has(.udee-tenant-tabs) > .fi-modal-header,
.fi-modal .fi-modal-window-ctn > .fi-modal-window:has(.udee-tenant-tabs) > .fi-modal-footer {
    background-color: var(--gray-100);
}

/* Keep its rounded corners: the long form scrolls inside the window and the square scrollbar/gray edges cover them */
.fi-modal .fi-modal-window-ctn > .fi-modal-window:has(.udee-tenant-tabs) {
    border-radius: var(--radius-xl);
    clip-path: inset(0 round var(--radius-xl));
}

/* Modal header tabs: no border or shadow */
.fi-modal-header .fi-tabs {
    box-shadow: none !important;
    --tw-ring-shadow: 0 0 #0000 !important;
    --tw-shadow: 0 0 #0000 !important;
    border: 0 !important;
    outline: 0 !important;
}

/* Contracts: tabs inside the table toolbar, no border/shadow */
.udee-toolbar-tabs {
    box-shadow: none !important;
    --tw-ring-shadow: 0 0 #0000 !important;
    --tw-shadow: 0 0 #0000 !important;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    margin-inline: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
}

.udee-toolbar-tabs .fi-tabs-item {
    border-radius: 0.5rem;
}

/* Mobile: scroll the toolbar tabs sideways (like settings/apartment) instead of overflowing the screen */
@media (max-width: 639px) {
    .udee-toolbar-tabs {
        max-width: calc(100% + 4px);
        overflow-x: auto !important;
        /* Room so the scroll edge doesn't clip the first/last tab's rounded corners; negative margin keeps the position */
        padding: 2px !important;
        margin: -2px !important;
        scroll-padding-inline: 2px;
    }
}

/* Sliding tabs (transitions.dev "Tabs sliding", e.g. parcels): the pill carries the active background and slides between tabs */
:root {
    --tabs-dur: 250ms;
    --tabs-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --tabs-pill-bg: #06356a;
}

.dark {
    --tabs-pill-bg: #bfd100;
}

.t-tabs {
    position: relative !important;
}

:is(nav.t-tabs, .t-tabs > .fi-tabs) .fi-tabs-item {
    position: relative;
    z-index: 1;
}

:is(nav.t-tabs, .t-tabs > .fi-tabs) .fi-tabs-item.fi-active {
    background-color: transparent !important;
}

:is(nav.t-tabs, .t-tabs > .fi-tabs) .fi-tabs-item .fi-tabs-item-label,
:is(nav.t-tabs, .t-tabs > .fi-tabs) .fi-tabs-item > .fi-icon {
    transition: color var(--tabs-dur) var(--tabs-ease);
}

.t-tabs-pill {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    background: var(--tabs-pill-bg);
    border-radius: 0.5rem;
    transform: translate(0, 0);
    transition:
        transform var(--tabs-dur) var(--tabs-ease),
        width var(--tabs-dur) var(--tabs-ease),
        height var(--tabs-dur) var(--tabs-ease);
    will-change: transform, width;
    z-index: 0;
    pointer-events: none;
}

/* Filament schema tabs (e.g. settings/apartment): the pill is the nav's ::before, positioned by public/js/udee-sliding-tabs.js */
.fi-sc-tabs.t-tabs > .fi-tabs {
    position: relative;
    isolation: isolate;
}

.fi-sc-tabs.t-tabs > .fi-tabs::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: var(--t-pill-w, 0);
    height: var(--t-pill-h, 0);
    background: var(--tabs-pill-bg);
    border-radius: 0.5rem;
    transform: translate(var(--t-pill-x, 0), var(--t-pill-y, 0));
    transition:
        transform var(--tabs-dur) var(--tabs-ease),
        width var(--tabs-dur) var(--tabs-ease),
        height var(--tabs-dur) var(--tabs-ease);
    z-index: 0;
    pointer-events: none;
}

.fi-sc-tabs.t-tabs-snap > .fi-tabs::before {
    transition: none;
}

@media (prefers-reduced-motion: reduce) {
    .fi-sc-tabs.t-tabs > .fi-tabs::before,
    .t-tabs-pill,
    :is(nav.t-tabs, .t-tabs > .fi-tabs) .fi-tabs-item .fi-tabs-item-label,
    :is(nav.t-tabs, .t-tabs > .fi-tabs) .fi-tabs-item > .fi-icon {
        transition: none !important;
    }
}

/* Card resize (transitions.dev "Card resize", e.g. reports, accounting): the card tweens to its new height; public/js/udee-card-resize.js sets the inline height */
:root {
    --resize-dur: 300ms;
    --resize-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

.t-resize {
    transition:
        width var(--resize-dur) var(--resize-ease),
        height var(--resize-dur) var(--resize-ease);
    will-change: width, height;
}

.t-resize.t-resizing {
    overflow: hidden;
}

/* Flex cards (schema tabs): keep the content at its own height while the card is shorter, or it squeezes and slides */
.t-resize.t-resizing > * {
    flex-shrink: 0;
}

@media (prefers-reduced-motion: reduce) {
    .t-resize {
        transition: none !important;
    }
}

/* Empty toolbar actions next to the tabs: don't take up a row */
.udee-toolbar-tabs ~ .fi-ta-actions:not(:has(*)) {
    display: none;
}

/* Gray row-action icons: same darkness as the label text */
.fi-link.udee-icon-text > .fi-icon {
    color: inherit !important;
}

.fi-dropdown-list-item.udee-icon-text > .fi-icon {
    color: var(--gray-700) !important;
}

.dark .fi-dropdown-list-item.udee-icon-text > .fi-icon {
    color: var(--gray-200) !important;
}

/* Row action as dark as the table text (e.g. customer name) */
.fi-link.udee-link-dark {
    color: var(--gray-950);
}

.dark .fi-link.udee-link-dark {
    color: var(--color-white);
}

/* Striped tables: no divider lines between rows */
.fi-ta-table:has(.fi-ta-row.fi-striped) > tbody > * {
    border-top-width: 0 !important;
    border-bottom-width: 0 !important;
}

.fi-ta-row.fi-striped {
    background-color: var(--gray-100);
}

.dark .fi-ta-row.fi-striped {
    background-color: color-mix(in oklab, var(--color-white) 8%, transparent);
}

/* Compact table rows: cell padding-block 16px -> 10px */
.fi-ta-row :is(.fi-ta-text, .fi-ta-icon, .fi-ta-image, .fi-ta-color, .fi-ta-select, .fi-ta-text-input, .fi-ta-checkbox, .fi-ta-toggle):not(.fi-inline),
.fi-ta-row > .fi-ta-cell:has(.fi-ta-actions),
.fi-ta-row > .fi-ta-cell:has(.fi-ta-record-checkbox) {
    padding-block: calc(var(--spacing) * 2.5) !important;
}

/* Dashboard floor map: room cells lift on hover */
.udee-room-cell {
    transition: transform 0.15s ease, filter 0.15s ease;
}

.udee-room-cell:hover {
    transform: translateY(-3px);
    filter: brightness(0.97) drop-shadow(0 4px 6px rgb(0 0 0 / 0.12));
    z-index: 10; /* keep the tooltip above neighbouring cells */
}

/* Floor map: room details shown above the cell on hover */
.udee-room-tip {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: 240px;
    padding: 8px 10px;
    border-radius: 8px;
    background: white;
    color: var(--gray-800);
    box-shadow: 0 4px 12px rgb(0 0 0 / 0.15), 0 0 0 1px var(--gray-200);
    font-size: 0.8rem;
    line-height: 1.5;
    text-align: left;
    pointer-events: none;
}

.udee-room-cell:hover .udee-room-tip {
    display: block;
}

/* Saved image in a .udee-image-zoom upload: click opens the full image (script in AppPanelProvider).
   Copies open through their data-udee-lightbox URL (access-logged), so FilePond's own open icon stays hidden. */
.udee-image-zoom .filepond--open-icon {
    display: none !important;
}

.udee-image-zoom .filepond--item:has(.filepond--open-icon) {
    pointer-events: auto; /* FilePond disables pointer events on the whole root in view (disabled) mode */
    cursor: zoom-in;
}

/* Full-size image popup opened from a .udee-image-zoom upload; above Filament modals (z-index 40-50) */
.udee-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgb(0 0 0 / 0.8);
    cursor: zoom-out;
}

.udee-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 0.5rem;
}

.udee-lightbox iframe {
    width: 90vw;
    height: 90vh;
    border: 0;
    border-radius: 0.5rem;
    background: #fff;
}

/* Topbar notifications bell: same size as the search icon (mobile is handled above) */
@media (min-width: 640px) {
    .fi-topbar .fi-topbar-database-notifications-btn .fi-icon {
        width: 1.25rem;
        height: 1.25rem;
    }

    .fi-topbar .fi-global-search-field .fi-input-wrp-prefix > .fi-icon,
    .fi-topbar .fi-topbar-database-notifications-btn .fi-icon {
        color: var(--gray-500);
    }
}

/* Utility rates sections (ค่าน้ำ / ค่าไฟ): icon same color as the title, closer to it */
.udee-utility-section > .fi-section > .fi-section-header {
    column-gap: 0.5rem;
}

.udee-utility-section > .fi-section > .fi-section-header > .fi-icon {
    color: var(--gray-950);
}

/* Dark mode (ตั้งค่าระบบ > โหมดมืด): override the light-only colours above */
/* Same colour as the dashboard "ห้องว่าง" stat card in dark mode */
.dark .fi-sidebar {
    --udee-sidebar-dark: color-mix(in srgb, #06356A 14%, var(--gray-900));
    background-color: var(--udee-sidebar-dark);
    box-shadow: inset -1px 0 0 color-mix(in oklab, var(--color-white) 10%, transparent);
    background-image:
        linear-gradient(to bottom, var(--udee-sidebar-dark) 0%, var(--udee-sidebar-dark) 35%, transparent 100%),
        linear-gradient(rgb(0 0 0 / 0.3), rgb(0 0 0 / 0.3)),
        url('/images/sidebar-mascot-oct-2026.webp');
}

.dark .udee-sidebar-package {
    background-color: rgb(255 255 255 / 0.04);
    box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--color-white) 10%, transparent);
}

.dark a.udee-sidebar-package:hover {
    background-color: rgb(255 255 255 / 0.08);
    box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--color-white) 20%, transparent);
}

.dark .fi-body-has-topbar .fi-sidebar-header {
    border-bottom-color: color-mix(in oklab, var(--color-white) 10%, transparent);
}

/* Topbar: same tone as the sidebar, slightly darker */
.dark .fi-topbar {
    background-color: color-mix(in srgb, color-mix(in srgb, #06356A 14%, var(--gray-900)) 85%, #000);
    box-shadow: inset 0 -1px 0 color-mix(in oklab, var(--color-white) 10%, transparent);
}

.dark .udee-topbar-user-role {
    color: var(--gray-400);
}

.dark .fi-btn:not(.fi-outlined):not(.fi-color) > .fi-icon,
.dark .udee-utility-section > .fi-section > .fi-section-header > .fi-icon {
    color: var(--color-white);
}

.dark .fi-fo-toggle-buttons .fi-btn {
    background-color: var(--gray-800) !important;
    --tw-ring-color: var(--gray-700) !important;
}

.dark .fi-fo-toggle-buttons .fi-btn:not([aria-pressed="true"]),
.dark .fi-fo-toggle-buttons .fi-btn:not([aria-pressed="true"]) * {
    color: var(--gray-200) !important;
}

.dark .fi-fo-toggle-buttons .fi-btn[aria-pressed="true"] {
    background-color: #bfd100 !important;
    --tw-ring-color: #bfd100 !important;
}

.dark .fi-fo-toggle-buttons .fi-btn[aria-pressed="true"],
.dark .fi-fo-toggle-buttons .fi-btn[aria-pressed="true"] * {
    color: #06356a !important;
}

.dark .fi-btn.fi-color-warning:not(.fi-outlined),
.dark .fi-fo-file-upload-editor .fi-btn.fi-color-success:not(.fi-outlined),
.dark .fi-btn.udee-btn-add:not(.fi-outlined),
.dark .fi-btn[data-table-filter-action="apply"] {
    background: linear-gradient(to bottom, #dcec4a, #bfd100 55%, #a6b600);
    border: 1px solid #8d9a00;
    box-shadow: 0 3px 6px rgb(0 0 0 / 0.55), inset 0 1px 0 rgb(255 255 255 / 0.55), inset 0 -2px 0 rgb(0 0 0 / 0.12);
}

.dark .fi-btn.fi-color-warning:not(.fi-outlined):hover,
.dark .fi-fo-file-upload-editor .fi-btn.fi-color-success:not(.fi-outlined):hover,
.dark .fi-btn.udee-btn-add:not(.fi-outlined):hover,
.dark .fi-btn[data-table-filter-action="apply"]:hover {
    background: linear-gradient(to bottom, #d0e130, #b2c300 55%, #99a800);
}

.dark .fi-btn.fi-color-warning:not(.fi-outlined),
.dark .fi-btn.fi-color-warning:not(.fi-outlined) *,
.dark .fi-fo-file-upload-editor .fi-btn.fi-color-success:not(.fi-outlined),
.dark .fi-fo-file-upload-editor .fi-btn.fi-color-success:not(.fi-outlined) *,
.dark .fi-btn.udee-btn-add:not(.fi-outlined),
.dark .fi-btn.udee-btn-add:not(.fi-outlined) *,
.dark .fi-btn[data-table-filter-action="apply"],
.dark .fi-btn[data-table-filter-action="apply"] * {
    color: #06356a;
}

.dark .fi-ta-text-item.fi-color {
    color: var(--color-400);
}

.dark .fi-ta-text-item.fi-color-danger {
    color: #ffa3a3;
}

.dark .fi-toggle.fi-toggle-on:not(.fi-hidden) {
    background-color: #0b4a8f;
}

.dark .fi-tabs-item.fi-active {
    background-color: #bfd100;
}

.dark .fi-tabs-item.fi-active .fi-tabs-item-label,
.dark .fi-tabs-item.fi-active > .fi-icon {
    color: #06356a;
}

.dark .fi-tabs-item.fi-active .fi-badge {
    background-color: #06356a;
    --tw-ring-color: #06356a;
}

.dark .fi-tabs-item.fi-active .fi-badge,
.dark .fi-tabs-item.fi-active .fi-badge * {
    color: #fff;
}

.dark .fi-breadcrumbs-item-label[aria-current='page'] {
    color: var(--gray-200) !important;
}

.dark .fi-modal-content:has(.udee-room-tab),
.dark .fi-modal .fi-modal-window-ctn > .fi-modal-window:has(.udee-tenant-tabs),
.dark .fi-modal .fi-modal-window-ctn > .fi-modal-window:has(.udee-tenant-tabs) > .fi-modal-header,
.dark .fi-modal .fi-modal-window-ctn > .fi-modal-window:has(.udee-tenant-tabs) > .fi-modal-footer {
    background-color: var(--gray-950);
}

.dark .fi-resource-rooms .fi-ta-header-ctn {
    border-bottom-color: color-mix(in oklab, var(--color-white) 10%, transparent);
}

@media (max-width: 639px) {
    .dark .fi-topbar .fi-global-search-field:focus-within .fi-input-wrp,
    .dark .fi-topbar .fi-global-search-field:has(.fi-input:not(:placeholder-shown)) .fi-input-wrp {
        background-color: var(--gray-900);
    }
}

/* Dashboard stat cards: tint mixed into the dark card instead of white, lighter text so navy stays readable */
.dark .udee-stat-card {
    background: color-mix(in srgb, var(--stat-color) 14%, var(--gray-900));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--stat-color) 35%, var(--gray-900));
}

.dark .udee-stat-card.udee-stat-vacant {
    box-shadow: 0 0 0 1px color-mix(in oklab, var(--color-white) 18%, transparent);
}

.dark .udee-stat-card .fi-wi-stats-overview-stat-label-ctn > svg {
    color: color-mix(in srgb, var(--stat-color) 55%, white);
    background: color-mix(in srgb, var(--stat-color) 30%, var(--gray-900));
}

.dark .udee-stat-card .fi-wi-stats-overview-stat-label,
.dark .udee-stat-card .fi-wi-stats-overview-stat-value {
    color: color-mix(in srgb, var(--stat-color) 55%, white);
}

.dark .udee-stat-card .fi-wi-stats-overview-stat-description {
    color: var(--gray-400) !important;
}

/* Dashboard floor map: cells get their colour from --cell (inline styles are light-only, hence !important) */
.dark .udee-room-cell {
    background: color-mix(in srgb, var(--cell) 15%, var(--gray-900)) !important;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--cell) 40%, var(--gray-900)) !important;
    color: color-mix(in srgb, var(--cell) 55%, white) !important;
}

.dark .udee-room-tip {
    background: var(--gray-700);
    color: white;
    box-shadow: 0 4px 12px rgb(0 0 0 / 0.4);
}

.dark .udee-floor-row,
.dark .udee-floor-legend {
    border-top-color: color-mix(in oklab, var(--color-white) 10%, transparent) !important;
}

.dark .udee-floor-legend {
    color: var(--gray-400) !important;
}

.dark .udee-repair-card {
    background: color-mix(in srgb, #ca8a04 15%, var(--gray-900)) !important;
}

/* Reports page: tabs with the year picker beside them, plain number tables */
.udee-report-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.udee-report-year {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.udee-report-scroll {
    overflow-x: auto;
}

.udee-report-table {
    width: 100%;
    font-size: 0.875rem;
    border-collapse: collapse;
    white-space: nowrap;
}

.udee-report-table th,
.udee-report-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
}

.udee-report-table th {
    font-weight: 600;
    border-bottom: 1px solid var(--gray-200);
}

.udee-report-table tbody tr:nth-child(even) {
    background-color: var(--gray-50);
}

.udee-report-table tfoot td {
    font-weight: 600;
    border-top: 1px solid var(--gray-200);
}

.udee-report-table .udee-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.udee-report-table .udee-negative {
    color: var(--danger-600);
}

.udee-report-empty {
    text-align: center !important;
    color: var(--gray-500);
}

.dark .udee-report-table th {
    border-bottom-color: color-mix(in oklab, var(--color-white) 10%, transparent);
}

.dark .udee-report-table tfoot td {
    border-top-color: color-mix(in oklab, var(--color-white) 10%, transparent);
}

.dark .udee-report-table tbody tr:nth-child(even) {
    background-color: color-mix(in oklab, var(--color-white) 5%, transparent);
}

.dark .udee-report-table .udee-negative {
    color: var(--danger-400);
}

/* Property expiry notice at the top of every page (resources/views/filament/expiry-banner.blade.php) */
.udee-expiry-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    margin-bottom: -0.5rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-lg);
    background-color: var(--warning-50);
    color: var(--warning-900);
    border: 1px solid var(--warning-300);
}

.udee-expiry-banner-icon {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
}

.udee-expiry-banner-link {
    font-weight: 600;
    text-decoration: underline;
}

.udee-expiry-banner-danger {
    background-color: var(--danger-50);
    color: var(--danger-700);
    border-color: var(--danger-300);
}

.dark .udee-expiry-banner {
    background-color: color-mix(in oklab, var(--warning-400) 10%, transparent);
    color: var(--warning-300);
    border-color: color-mix(in oklab, var(--warning-400) 30%, transparent);
}

.dark .udee-expiry-banner-danger {
    background-color: color-mix(in oklab, var(--danger-400) 10%, transparent);
    color: var(--danger-300);
    border-color: color-mix(in oklab, var(--danger-400) 30%, transparent);
}

/* Package expiry popup shown once after login (resources/views/filament/expiry-popup.blade.php) */
.udee-expiry-popup-text {
    text-align: center;
}

.udee-expiry-popup-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

/* One-time code (2FA) field: center the label and the 6 digit boxes */
.fi-fo-field:has(.fi-one-time-code-input-ctn) .fi-fo-field-label-ctn {
    justify-content: center;
}

.fi-one-time-code-input-ctn {
    margin-inline: auto;
}

/* Tenant modal: the foreigner toggle sits at the right end of the tab bar (3.5rem tall, see .fi-tabs.fi-contained).
   Direct-child selectors only: a looser :has() also matches the page column that holds the modal and pushes it under the topbar. */
.fi-sc:has(> .fi-grid-col > .fi-sc-component > .udee-tenant-tabs-toggle) {
    position: relative;
}

.fi-sc > .fi-grid-col:has(> .fi-sc-component > .udee-tenant-tabs-toggle) {
    position: absolute;
    top: 0;
    right: 1rem;
    z-index: 1;
    height: 3.5rem;
    display: flex;
    align-items: center;
}

.fi-sc > .fi-grid-col > .fi-sc-component:has(> .udee-tenant-tabs-toggle) {
    height: auto;
}

.udee-tenant-tabs-toggle .fi-fo-field-label {
    align-items: center;
}

.udee-tenant-tabs-toggle .fi-toggle {
    margin-block: 0;
}

.udee-tenant-tabs > .fi-tabs {
    padding-inline-end: 9rem;
}

/* Phones: no room beside the tabs, so the toggle gets its own line above them, still on the right */
@media (max-width: 639px) {
    .fi-sc > .fi-grid-col:has(> .fi-sc-component > .udee-tenant-tabs-toggle) {
        position: static;
        height: auto;
        justify-content: flex-end;
    }

    .udee-tenant-tabs > .fi-tabs {
        padding-inline-end: calc(var(--spacing) * 3);
    }
}

/* Tenant modal: centered in the space below the topbar (4.5rem); a long form scrolls inside instead of running over the topbar */
.fi-modal-window-ctn:has(> .fi-modal-window .udee-tenant-tabs) {
    grid-template-rows: 1fr auto 1fr;
    padding-top: 5.5rem;
}

.fi-modal-window-ctn > .fi-modal-window:has(.udee-tenant-tabs) {
    max-height: calc(100dvh - 6.5rem);
}

.fi-modal-window:has(.udee-tenant-tabs) > .fi-modal-content {
    min-height: 0;
    overflow-y: auto;
}

/* Meter reading cards (จดค่าน้ำ / จดค่าไฟ): one card per room, made for a phone */
.udee-meter-cards .fi-fo-repeater-items {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
}

.udee-meter-cards .fi-fo-repeater-item-header {
    padding-block: 0.5rem;
}

.udee-meter-cards .fi-fo-repeater-item-header-label {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.udee-meter-room {
    font-size: 1.125rem;
    font-weight: 700;
}

.udee-meter-status,
.udee-meter-billed {
    border-radius: 9999px;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--gray-100);
    color: var(--gray-600);
}

.udee-meter-billed {
    background: var(--success-50);
    color: var(--success-700);
}

.udee-meter-cards input.udee-meter-current {
    font-size: 1.25rem;
    font-weight: 600;
}

.udee-meter-units {
    align-self: center;
    text-align: end;
    font-weight: 600;
}

/* Save button stays in reach at the bottom of the screen while scrolling through rooms */
.udee-meter-form > .fi-sc:last-child {
    position: sticky;
    bottom: 0;
    z-index: 10;
    padding-block: 0.75rem;
    background: var(--gray-50);
}

.dark .udee-meter-form > .fi-sc:last-child {
    background: var(--gray-950);
}

@media (max-width: 639px) {
    .udee-meter-form > .fi-sc:last-child .fi-btn {
        width: 100%;
    }
}

/* Topbar notifications bell: a red dot instead of the unread count */
.fi-topbar .fi-topbar-database-notifications-btn .fi-icon-btn-badge-ctn {
    inset-inline-start: auto;
    inset-inline-end: 0.2rem;
    top: 0.45rem;
    transform: none;
    background: transparent;
}

.fi-topbar .fi-topbar-database-notifications-btn .fi-icon-btn-badge-ctn .fi-badge {
    width: 0.6rem;
    height: 0.6rem;
    min-width: 0;
    padding: 0;
    border-radius: 9999px;
    background: #ef4444;
    box-shadow: 0 0 0 2px var(--color-white, #fff);
    font-size: 0;
    color: transparent;
}

.dark .fi-topbar .fi-topbar-database-notifications-btn .fi-icon-btn-badge-ctn .fi-badge {
    box-shadow: 0 0 0 2px var(--gray-900);
}

/* Thai address autocomplete (jquery.Thailand.js, public/js/udee-thai-address.js) */
.fi-input-wrp:has(.twitter-typeahead) {
    overflow: visible;
}

.fi-input-wrp .twitter-typeahead {
    display: block !important;
    flex: 1;
    width: 100%;
}

.fi-input-wrp .tt-hint {
    opacity: 0.35;
}

.tt-menu {
    width: 100%;
    margin-top: 0.25rem;
    max-height: 16rem;
    overflow-y: auto;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    background: var(--color-white, #fff);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

.tt-suggestion {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    cursor: pointer;
}

.tt-suggestion:hover,
.tt-suggestion.tt-cursor {
    background: var(--gray-100);
}

.dark .tt-menu {
    border-color: var(--gray-700);
    background: var(--gray-900);
}

.dark .tt-suggestion:hover,
.dark .tt-suggestion.tt-cursor {
    background: var(--gray-800);
}

/* Dashboard 4-column variant (lg..xl, iPad 13 portrait): the left stack is flattened so the right stack's row
   sits between the floor map and the 12-month chart; recent activity (2/4, two rows tall) on the left, LINE quota above income/expense on the right */
@media (min-width: 1024px) and (max-width: 1279px) {
    .fi-grid-col:has(> .fi-sc-component > .udee-dashboard-main),
    .fi-grid-col:has(> .fi-sc-component > .udee-dashboard-main) > .fi-sc-component,
    .udee-dashboard-main,
    .udee-dashboard-main > .fi-grid {
        display: contents;
    }

    .udee-dashboard-main [wire\:name$="MonthlyRevenueChart"] {
        order: 1;
    }

    .udee-dashboard-side .udee-recent-activity {
        order: -1;
        grid-row: span 2 / span 2;
    }

    /* Also on the transactions page (3 columns, span 1), so widened here rather than in the widget */
    .udee-dashboard-side [wire\:name$="IncomeExpenseChart"] {
        grid-column: span 2 / span 2;
    }

    /* Recent activity as tall as the LINE quota + income/expense cards beside it; its list fills the card
       (contain: size keeps the list from setting the rows' height — the two cards on the right do) */
    .udee-dashboard-side .udee-recent-activity .fi-section,
    .udee-dashboard-side .udee-recent-activity .fi-section-content-ctn,
    .udee-dashboard-side .udee-recent-activity .fi-section-content {
        display: flex;
        flex-direction: column;
    }

    .udee-dashboard-side .udee-recent-activity .fi-section {
        height: 100%;
    }

    .udee-dashboard-side .udee-recent-activity .fi-section-content-ctn,
    .udee-dashboard-side .udee-recent-activity .fi-section-content {
        flex: 1;
        min-height: 0;
    }

    .udee-dashboard-side .udee-activity-list {
        flex: 1;
        max-height: none !important;
        contain: size;
    }
}

/* Dashboard "ความเคลื่อนไหวล่าสุด" rows (recent-activity.blade.php) */
.udee-activity-row + .udee-activity-row {
    border-top: 1px solid var(--gray-200);
}

.udee-activity-row {
    border-radius: 8px;
}

.udee-activity-row:hover {
    background: var(--gray-50);
}

.udee-activity-icon {
    color: var(--udee-activity-color);
    background: color-mix(in srgb, var(--udee-activity-color) 12%, white);
}

.dark .udee-activity-row + .udee-activity-row {
    border-top-color: color-mix(in oklab, var(--color-white) 10%, transparent);
}

.dark .udee-activity-row:hover {
    background: color-mix(in oklab, var(--color-white) 5%, transparent);
}

.dark .udee-activity-icon {
    color: color-mix(in srgb, var(--udee-activity-color) 55%, white);
    background: color-mix(in srgb, var(--udee-activity-color) 25%, transparent);
}

/* Dashboard "โควตาส่งข้อความทาง LINE" card (line-quota.blade.php) */
.udee-line-quota-plan {
    color: #06356A;
}

.udee-line-quota-track {
    background: var(--gray-200);
}

.dark .udee-line-quota-plan {
    color: color-mix(in srgb, #06356A 55%, white);
}

.dark .udee-line-quota-track {
    background: color-mix(in oklab, var(--color-white) 10%, transparent);
}

/* Wizard (e.g. Onboarding): active step = filled #2B7FE2 circle with white icon, #06356A label */
.fi-sc-wizard-header-step.fi-active .fi-sc-wizard-header-step-icon-ctn {
    background-color: #2B7FE2;
    border-color: #2B7FE2 !important;
}

.fi-sc-wizard-header-step.fi-active .fi-sc-wizard-header-step-icon-ctn .fi-icon,
.fi-sc-wizard-header-step.fi-active .fi-sc-wizard-header-step-number {
    color: #fff !important;
}

.fi-sc-wizard-header-step.fi-active .fi-sc-wizard-header-step-label {
    color: #06356A !important;
}

.dark .fi-sc-wizard-header-step.fi-active .fi-sc-wizard-header-step-label {
    color: color-mix(in srgb, #06356A 55%, white) !important;
}

.fi-sc-wizard-header-step.fi-completed .fi-sc-wizard-header-step-icon-ctn {
    background-color: #06356A;
}

/* Same stroke as the Dashboard stat-card icons */
.fi-sc-wizard-header-step-icon-ctn .fi-icon {
    stroke-width: 1.5;
}

/* Numbered step in a section heading (BuyPackage: 1 bank accounts, 2 transfer notice) */
.udee-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    margin-right: 0.375rem;
    border-radius: 9999px;
    background: #06356A;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
}

/* BuyPackage: package table (resources/views/filament/package-table.blade.php) */
.udee-pkg-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: end;
}

@media (max-width: 640px) {
    .udee-pkg-cards {
        grid-template-columns: 1fr;
    }
}

.udee-pkg-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    overflow: hidden;
}

.udee-pkg-body {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 20px;
}

.udee-pkg-name {
    font-size: 2rem;
    font-weight: 700;
    text-transform: uppercase;
}

.udee-pkg-muted {
    color: var(--gray-500);
    font-size: 0.875rem;
}

.udee-pkg-price {
    margin-top: 12px;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

.udee-pkg-price small {
    font-size: 0.875rem;
}

.udee-pkg-features {
    flex: 1;
    margin: 16px 0;
    padding-top: 12px;
    border-top: 1px solid var(--gray-200);
    font-size: 0.875rem;
}

.udee-pkg-features li {
    display: flex;
    gap: 8px;
    padding: 3px 0;
}

.udee-pkg-features li {
    align-items: center;
}

/* White check in a filled circle. */
.udee-pkg-features li::before {
    content: '✓';
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 9999px;
    background: #16a34a;
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
}

.udee-pkg-card {
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(6, 53, 106, 0.12);
}

/* The selection rings replace box-shadow, so they repeat the lift shadow. */
.udee-pkg-card.is-selected {
    border-color: #06356A;
    box-shadow: 0 0 0 2px #06356A, 0 6px 16px rgba(6, 53, 106, 0.12);
}

/* Standard: white to a light cyan. */
.udee-pkg-card:not(.is-pro) {
    background: linear-gradient(to bottom right, #fff, #F0FBFC);
}

.udee-pkg-card:not(.is-pro, .is-selected) {
    border-color: #C8F0F5;
}

.udee-pkg-card:not(.is-pro) .udee-pkg-features li::before {
    background: #C8F0F5;
    color: #0EA5B7;
}

/* Pro: blue gradient, white text. */
.udee-pkg-card.is-pro {
    background: linear-gradient(160deg, #0B5CB0, #06326A) border-box;
    border-color: transparent;
    color: #fff;
}

.udee-pkg-card.is-pro {
    position: relative;
}

/* "ยอดนิยม" in the top right corner: same tint as the Pro check circles. */
.udee-pkg-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 4px 12px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    color: #fff;
    font-family: var(--udee-font-heading);
    font-size: 0.875rem;
    font-weight: 600;
}

/* The dark blue ring would vanish on the gradient: thin white gap first. */
.udee-pkg-card.is-pro.is-selected {
    box-shadow: 0 0 0 3px #fff, 0 0 0 6px #06356A, 0 6px 16px rgba(6, 53, 106, 0.12);
}

.udee-pkg-card.is-pro .udee-pkg-muted {
    color: rgba(255, 255, 255, 0.8);
}

.udee-pkg-card.is-pro .udee-pkg-features {
    border-color: rgba(255, 255, 255, 0.25);
}

/* "ทุกอย่างของแพคเกจ Standard" */
.udee-pkg-card.is-pro .udee-pkg-features li b {
    font-size: 1.1rem;
}

.udee-pkg-card.is-pro .udee-pkg-features li::before {
    background: rgba(255, 255, 255, 0.25);
}

/* Selected card: the mascot peeks up from the bottom right corner, about 3/4 showing, behind the text. */
.udee-pkg-card {
    position: relative;
}

.udee-pkg-mascot {
    position: absolute;
    right: 8px;
    bottom: -2px;
    width: 200px;
    pointer-events: none;
    animation: udee-pkg-mascot-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (max-width: 640px) {
    .udee-pkg-mascot {
        width: 100px;
    }
}

@keyframes udee-pkg-mascot-in {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
}

.udee-pkg-error {
    margin-top: 8px;
    color: #dc2626;
    font-size: 0.875rem;
}

.udee-order-summary {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 16px;
}

.udee-order-summary dt {
    color: var(--gray-500);
}

.udee-order-summary dd {
    text-align: right;
}

.dark .udee-pkg-features {
    border-color: var(--gray-700);
}

/* Dark mode package cards: the light gradients mixed into the dark section background */
.dark .udee-pkg-card {
    box-shadow: 0 6px 16px rgb(0 0 0 / 0.3);
}

.dark .udee-pkg-card.is-selected {
    border-color: #60a5fa;
    box-shadow: 0 0 0 2px #60a5fa, 0 6px 16px rgb(0 0 0 / 0.3);
}

.dark .udee-pkg-card:not(.is-pro) {
    background: linear-gradient(to bottom right, var(--gray-900), color-mix(in srgb, #0EA5B7 12%, var(--gray-900)));
}

.dark .udee-pkg-card:not(.is-pro, .is-selected) {
    border-color: color-mix(in srgb, #0EA5B7 30%, var(--gray-900));
}

.dark .udee-pkg-card:not(.is-pro) .udee-pkg-features li::before {
    background: color-mix(in srgb, #0EA5B7 25%, var(--gray-900));
    color: #67e8f9;
}

.dark .udee-pkg-card.is-pro {
    background: linear-gradient(160deg, color-mix(in srgb, #0B5CB0 55%, var(--gray-900)), color-mix(in srgb, #06326A 45%, var(--gray-900))) border-box;
}

.dark .udee-pkg-card.is-pro.is-selected {
    box-shadow: 0 0 0 3px var(--gray-900), 0 0 0 5px #60a5fa, 0 6px 16px rgb(0 0 0 / 0.3);
}

/* BuyPackage "อัพเกรดแพคเกจ" modal: one block per paid order, then the total */
.udee-upgrade {
    display: grid;
    gap: 16px;
}

.udee-upgrade-order {
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
}

.dark .udee-upgrade-order {
    border-color: var(--gray-700);
}

.udee-upgrade-title {
    margin-bottom: 8px;
    font-weight: 600;
}

.udee-upgrade-note {
    color: var(--gray-500);
}

/* Table thumbnail (maintenance photos): hovering shows a larger copy (script in AppPanelProvider).
   The copy is fixed to the viewport because the table's scroll container would clip anything grown inside it. */
.udee-thumb-zoom {
    border-radius: 4px;
    object-fit: cover;
    cursor: zoom-in;
}

.udee-thumb-preview {
    position: fixed;
    z-index: 50;
    max-width: 320px;
    max-height: 240px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgb(0 0 0 / 0.25);
    pointer-events: none;
}

/* Invoices page: status cards that filter the table; the picked one gets a ring in its colour */
.udee-invoice-cards {
    display: grid;
    gap: 1rem;
}

@media (min-width: 768px) {
    .udee-invoice-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.udee-invoice-card {
    width: 100%;
    text-align: start;
    cursor: pointer;
}

.udee-stat-card.udee-invoice-card-active,
.dark .udee-stat-card.udee-invoice-card-active {
    box-shadow: 0 0 0 2px var(--stat-color), 0 1px 3px 0 rgb(0 0 0 / 0.1);
}
