/* Esprit Estate Agent - Eva Tan Group — deep navy + teal accent (admin ERP, not Blazor purple) */
:root {
    --eea-navy: #122b46;
    --eea-navy-mid: #1a3d5c;
    --eea-navy-deep: #0c1e33;
    --eea-accent: #2a7a8c;
    --eea-accent-hover: #236877;
    --eea-accent-deep: #1b5563;
    --eea-ink: #1c2430;
    --eea-muted: #5c6b7a;
    --eea-page: #f4f6f8;
    --eea-surface: #ffffff;
    --eea-line: rgba(18, 43, 70, 0.12);
    --eea-table-head-bg: #2a7a8c;
    --eea-table-head-color: #ffffff;
    --eea-table-head-border: #1b5563;
    --eea-table-head-hover: #d4eef2;

    --bs-primary: #2a7a8c;
    --bs-primary-rgb: 42, 122, 140;
    --bs-primary-text-emphasis: #1b5563;
    --bs-primary-bg-subtle: #e8f3f5;
    --bs-primary-border-subtle: #9fc8d1;
    --bs-link-color: #2a7a8c;
    --bs-link-color-rgb: 42, 122, 140;
    --bs-link-hover-color: #1b5563;
    --bs-link-hover-color-rgb: 27, 85, 99;
    --bs-focus-ring-color: rgba(42, 122, 140, 0.35);
    --bs-body-color: #1c2430;
    --bs-body-bg: #f4f6f8;
    --bs-border-color: rgba(18, 43, 70, 0.14);
}

html, body {
    height: 100%;
    overflow: hidden;
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--eea-ink);
    background-color: var(--eea-page);
}

a, .btn-link {
    color: var(--eea-accent);
}

a:hover, .btn-link:hover {
    color: var(--eea-accent-deep);
}

.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--eea-accent);
    --bs-btn-border-color: var(--eea-accent);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--eea-accent-hover);
    --bs-btn-hover-border-color: var(--eea-accent-hover);
    --bs-btn-focus-shadow-rgb: 42, 122, 140;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--eea-accent-deep);
    --bs-btn-active-border-color: var(--eea-accent-deep);
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: var(--eea-accent);
    --bs-btn-disabled-border-color: var(--eea-accent);
}

.btn-outline-primary {
    --bs-btn-color: var(--eea-accent);
    --bs-btn-border-color: var(--eea-accent);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--eea-accent);
    --bs-btn-hover-border-color: var(--eea-accent);
    --bs-btn-focus-shadow-rgb: 42, 122, 140;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--eea-accent-deep);
    --bs-btn-active-border-color: var(--eea-accent-deep);
    --bs-btn-disabled-color: var(--eea-accent);
    --bs-btn-disabled-border-color: var(--eea-accent);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-select:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem #fff, 0 0 0 0.25rem rgba(42, 122, 140, 0.35);
}

.form-control:focus, .form-select:focus {
    border-color: var(--eea-accent);
}

.page-link {
    color: var(--eea-accent);
}

.page-link:hover {
    color: var(--eea-accent-deep);
    background-color: var(--bs-primary-bg-subtle);
    border-color: var(--eea-line);
}

.page-item.active .page-link {
    background-color: var(--eea-accent);
    border-color: var(--eea-accent);
}

.card {
    background-color: var(--eea-surface);
    border-color: var(--eea-line);
}

.table {
    --bs-table-bg: transparent;
}

.content {
    padding-top: 1.1rem;
}

.listing-page-scroll-room,
.page-scroll-room {
    /* Extra scroll room so content near the bottom can clear the sticky header. */
    padding-bottom: clamp(8rem, calc(50vh - 3.5rem), 24rem);
}

/* Shared ERP admin shell (Users + Master Data — matches Property Listings chrome) */
.admin-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.1rem;
}

.admin-page-header h1 {
    color: #172b3a;
    font-size: clamp(1.65rem, 2vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.025em;
}

.admin-page-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
}

.admin-toolbar {
    margin-bottom: 0.8rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--eea-line, #d7dee4);
    border-radius: 0.55rem;
    background: #fff;
}

.admin-toolbar-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1rem;
}

.admin-toolbar-field {
    flex: 1 1 10rem;
    min-width: 9rem;
}

.admin-toolbar-field--narrow {
    flex: 0 1 8.5rem;
    min-width: 7.5rem;
}

.admin-toolbar-field--search {
    flex: 0 0 auto;
    min-width: 0;
}

.admin-toolbar-field--search .btn {
    min-width: 6.5rem;
}

.admin-toolbar-field .form-label {
    margin-bottom: 0.35rem;
    font-size: 0.8125rem;
}

.root-hard-delete-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.admin-col-select {
    width: 2.5rem;
    min-width: 2.5rem;
    text-align: center;
}

.admin-table-wrap {
    overflow: visible;
    max-width: 100%;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background-color: #fff;
}

.admin-table {
    --bs-table-striped-bg: rgba(0, 0, 0, 0.02);
    margin-bottom: 0;
    table-layout: fixed;
    width: 100%;
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.admin-table-head th {
    position: sticky;
    top: 0;
    z-index: 4;
    background-color: var(--eea-table-head-bg);
    border-bottom: 2px solid var(--eea-table-head-border);
    padding: 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.4;
    vertical-align: middle;
    white-space: nowrap;
    color: var(--eea-table-head-color);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.admin-sort-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 600;
    line-height: inherit;
    text-align: inherit;
    white-space: nowrap;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.admin-sort-btn:hover,
.admin-sort-btn.is-active,
.admin-sort-btn.is-default {
    color: var(--eea-table-head-hover);
}

.admin-sort-btn:focus-visible {
    outline: 2px solid var(--eea-accent, #2a7a8c);
    outline-offset: 2px;
    border-radius: 0.25rem;
}

.admin-sort-icon {
    flex-shrink: 0;
    width: 0.75rem;
    height: 0.875rem;
    position: relative;
    opacity: 0.45;
}

.admin-sort-btn.is-active .admin-sort-icon,
.admin-sort-btn.is-default .admin-sort-icon {
    opacity: 1;
}

.admin-sort-icon-muted::before,
.admin-sort-icon-muted::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
}

.admin-sort-icon-muted::before {
    top: 1px;
    border-bottom: 4px solid currentColor;
}

.admin-sort-icon-muted::after {
    bottom: 1px;
    border-top: 4px solid currentColor;
}

.admin-sort-icon-asc::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 5px solid currentColor;
}

.admin-sort-icon-desc::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
}

.admin-table tbody td {
    padding: 0.75rem;
    font-size: 0.9375rem;
    line-height: 1.45;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-table-th-actions,
.admin-table tbody td.admin-table-actions {
    position: sticky;
    right: 0;
    z-index: 2;
    width: 6rem;
    min-width: 6rem;
    max-width: 6rem;
    padding-left: 0.35rem;
    padding-right: 0.5rem;
    overflow: visible;
    text-align: right;
    white-space: nowrap;
    background: #fff;
    box-shadow: -4px 0 8px -6px rgba(12, 30, 51, 0.18);
}

.admin-table-th-actions {
    z-index: 5;
    background: var(--eea-table-head-bg);
    color: var(--eea-table-head-color);
}

.admin-table-head .form-check-input,
.listings-table-head .form-check-input,
.users-table-head .form-check-input {
    border-color: rgba(255, 255, 255, 0.7);
    background-color: #fff;
}

.admin-table tbody tr:nth-of-type(odd) > .admin-table-actions {
    background-color: #fafafa;
}

.admin-table tbody tr:hover > .admin-table-actions {
    background-color: var(--bs-table-hover-bg, #f5f5f5);
}

.admin-table tbody tr:has(.admin-row-menu[open]) {
    position: relative;
    z-index: 8;
}

.admin-table tbody tr:has(.admin-row-menu[open]) > .admin-table-actions {
    z-index: 40;
    overflow: visible;
}

.admin-row-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.2rem;
}

.admin-row-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2rem;
    padding: 0 0.6rem;
    border: 1px solid rgba(42, 122, 140, 0.35);
    border-radius: 0.35rem;
    background: #fff;
    color: var(--eea-accent-deep, #1b5360);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}

.admin-row-edit:hover {
    border-color: var(--eea-accent, #2a7a8c);
    background: rgba(42, 122, 140, 0.08);
    color: var(--eea-accent-deep, #1b5360);
}

.admin-row-menu {
    position: relative;
    display: inline-block;
    overflow: visible;
}

.admin-row-menu > summary {
    list-style: none;
}

.admin-row-menu > summary::-webkit-details-marker {
    display: none;
}

.admin-row-menu-trigger {
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border: 1px solid rgba(18, 43, 70, 0.14);
    border-radius: 0.35rem;
    background: #fff;
    color: #425466;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
}

.admin-row-menu-trigger:hover,
.admin-row-menu[open] .admin-row-menu-trigger {
    border-color: var(--eea-accent, #2a7a8c);
    color: var(--eea-accent-deep, #1b5360);
}

.admin-row-menu-popover {
    position: absolute;
    top: calc(100% + 0.25rem);
    right: 0;
    z-index: 8;
    display: none;
    min-width: 9.5rem;
    flex-direction: column;
    padding: 0.35rem;
    border: 1px solid var(--eea-line, #d7dee4);
    border-radius: 0.45rem;
    background: #fff;
    box-shadow: 0 0.75rem 2rem rgba(12, 30, 51, 0.18);
}

.admin-row-menu[open] > .admin-row-menu-popover {
    display: flex;
}

.admin-row-menu-item {
    width: 100%;
    padding: 0.55rem 0.65rem;
    border: 0;
    border-radius: 0.3rem;
    background: transparent;
    color: var(--eea-ink, #172b3a);
    font-size: 0.82rem;
    text-align: left;
    cursor: pointer;
}

.admin-row-menu-item:hover {
    background: #f1f4f6;
}

.admin-row-menu-item--danger {
    color: #b42318;
}

.admin-form {
    padding-bottom: 5.5rem;
}

.admin-form-sections {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.admin-form-section {
    padding: 1.125rem 1.25rem;
    border: 1px solid #adb5bd;
    border-radius: 0.5rem;
    background-color: #fff;
}

.admin-form-section-title {
    margin: 0 0 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #6c757d;
}

.admin-form-section .form-label {
    margin-bottom: 0.375rem;
    font-size: 0.9375rem;
}

.admin-form-actions {
    position: sticky;
    bottom: 0;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    margin-top: 1.25rem;
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    background-color: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(4px);
}

.admin-form-actions .btn {
    min-width: 6.5rem;
}

@media (max-width: 767.98px) {
    .admin-page-header {
        align-items: stretch;
        flex-direction: column;
        gap: 0.85rem;
    }

    .admin-page-actions .btn {
        width: 100%;
    }

    .admin-toolbar-field--search .btn {
        width: 100%;
    }

    .admin-table-wrap {
        max-height: none;
    }

    .admin-form {
        padding-bottom: 6rem;
    }

    .admin-form-section {
        padding: 1rem;
    }

    .admin-form-actions {
        margin-left: -0.25rem;
        margin-right: -0.25rem;
        border-radius: 0.375rem;
    }
}

/* Phone and tablet: wide list tables pan sideways instead of being clipped. */
@media (max-width: 991.98px) {
    .admin-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        max-width: 100%;
    }

    .admin-table {
        min-width: 42rem;
    }
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

html.listing-photo-lightbox-open,
body.listing-photo-lightbox-open {
    overflow: hidden;
}

.form-validation-summary {
    margin-bottom: 0;
}

.form-validation-summary ul {
    margin-bottom: 0;
    padding-left: 1.25rem;
}

.form-validation-summary li + li {
    margin-top: 0.25rem;
}

.row .form-control.is-invalid,
.row .form-select.is-invalid {
    border-color: var(--bs-form-invalid-border-color);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-danger-rgb), 0.15);
}

.row .form-select.is-invalid:disabled {
    border-color: var(--bs-form-invalid-border-color);
}

.form-field-has-error .form-label {
    color: var(--bs-form-invalid-color);
}

.list-page-results {
    margin-bottom: 0;
    width: 100%;
    max-width: 100%;
}

.list-results-summary {
    padding-top: 0.25rem;
}

.list-results-footer {
    width: 100%;
    max-width: 100%;
    min-height: 3.5rem;
    padding-top: 0.75rem;
    padding-bottom: 0.5rem;
}

.list-pagination {
    width: 100%;
    max-width: 100%;
}

.list-pagination .pagination {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.375rem;
    margin-bottom: 0;
}

.list-pagination .page-link {
    border-radius: 0.375rem;
    padding: 0.5rem 0.875rem;
}

/* Compact multi-select (Building Type, etc.) */
.lookup-multi-trigger {
    display: flex;
    align-items: center;
}

.lookup-multi-trigger-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lookup-multi-trigger-open {
    border-color: var(--eea-accent);
    box-shadow: 0 0 0 0.25rem rgba(42, 122, 140, 0.25);
}

.lookup-multi-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
}

.lookup-multi-panel {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 0;
    right: 0;
    z-index: 1050;
    max-height: 16rem;
    display: flex;
    flex-direction: column;
}

.lookup-multi-options {
    overflow-y: auto;
    max-height: 11rem;
}

.lookup-multi-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.lookup-multi-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.15rem 0.5rem;
    line-height: 1.3;
}

.lookup-multi-chip-x {
    font-size: 1.1em;
    line-height: 1;
    opacity: 0.7;
}

.listing-remarks-input {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9rem;
    line-height: 1.45;
    white-space: pre-wrap;
}

.listing-brochure-value {
    white-space: pre-line;
}

/* Grow height with content; width stays full column. Cap height for very long notes. */
textarea.auto-grow-textarea {
    width: 100%;
    max-width: 100%;
    min-height: calc(1.5em + 0.75rem + calc(var(--bs-border-width, 1px) * 2));
    max-height: min(40vh, 16rem);
    overflow-x: hidden;
    overflow-y: auto;
    overflow-wrap: break-word;
    resize: none;
}

.listing-notes-block {
    max-width: 42rem;
}

.listing-notes-oneline {
    line-height: 1.5;
    margin-bottom: 0.35rem;
}

.listing-notes-list {
    margin: 0;
    padding-left: 1.25rem;
    line-height: 1.55;
}

.listing-notes-list li + li {
    margin-top: 0.25rem;
}

/* Listing details view — same card language as Meta / Workflow */
.listing-view-sections {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.listing-view-dl > dt {
    font-weight: 600;
    color: var(--bs-body-color);
}

.listing-view-dl > dd {
    margin-bottom: 0.65rem;
    color: var(--bs-body-color);
}

.listing-view-dl > dt:last-of-type,
.listing-view-dl > dd:last-of-type {
    margin-bottom: 0;
}

.listing-export-dropdown {
    position: relative;
}

.listing-export-menu {
    position: absolute;
    right: 0;
    left: auto;
    z-index: 20;
}

.listing-view-notes {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.listing-view-note-title {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--bs-body-color);
}

.listing-view-checks .form-check-input:disabled {
    opacity: 1;
}

.listing-view-checks .form-check-input:disabled ~ .form-check-label {
    opacity: 1;
    color: var(--bs-body-color);
}

