:root {
    --bg: #f3f5f8;
    --panel: #ffffff;
    --panel2: #f8fafc;
    --line: #dfe4ea;
    --text: #172033;
    --muted: #6c7788;
    --nav: #071126;
}

html { color-scheme: light; }
body { background: var(--bg); color: var(--text); }

.topbar {
    color: #f7f9ff;
    background: linear-gradient(90deg, #020817 0%, #07142d 55%, #030a1b 100%);
    border-bottom: 1px solid #263653;
    box-shadow: 0 4px 18px #07112645;
}
.brand { color: #ffdf4f; text-shadow: 0 1px 10px #ffbd1838; }
.brand-mark { color: #ffc329; filter: drop-shadow(0 0 8px #ffbd1870); }
.brand-logo {
    display: block;
    width: auto;
    height: 43px;
    max-width: min(300px, 38vw);
    object-fit: contain;
    object-position: left center;
}
.login-brand-logo {
    display: block;
    width: min(330px, 100%);
    height: auto;
    margin: 0 auto;
    object-fit: contain;
}
.login-favicon {
    width: 112px;
    height: 112px;
    border-radius: 22px;
    object-fit: contain;
}
.login-logo { margin-bottom: 16px; }
.nav-links > a,
.account-menu > summary { color: #f4f7ff; font-weight: 600; text-shadow: 0 1px 4px #0008; }
.nav-links > a:hover,
.account-menu > summary:hover { color: #ffdc55; background: #ffffff0c; }
.nav-links > a.active { color: #091127; text-shadow: none; }
.account-popover {
    background: #ffffff;
    color: var(--text);
    border-color: #dce2ea;
    box-shadow: 0 14px 35px #17203324;
}
.account-popover { width: 240px; padding: 10px; }
.account-summary { display: grid; gap: 5px; padding: 8px 9px 11px; border-bottom: 1px solid #e0e5eb; }
.account-popover > a { padding: 10px; border-radius: 6px; color: #253044; font-weight: 600; }
.account-popover > a:hover { background: #edf3fb; color: #1267d7; }
.account-popover form { border-top: 1px solid #e0e5eb; padding-top: 8px; }
.account-popover .logout-button { background: #fff1f2; color: #c9253a; }
.account-menu[open] > summary {
    height: 48px;
    margin-top: 5px;
    border: 2px solid #245fc4;
    border-radius: 12px;
    background: #0c1830;
}
.account-popover button { background: #edf2f8; color: var(--text); }
.role-chip, .action-chip { background: #eef4ff; border-color: #c7d8f5; color: #285796; }

.dashboard-toolbar {
    background: #ffffff;
    border-bottom-color: #dfe4ea;
    box-shadow: 0 2px 10px #1720330d;
}
.property-card {
    background: #ffffff;
    border-color: #dfe4ea;
    box-shadow: 0 2px 8px #1720330a;
}
.property-image span { background: #f0f2f5; color: #687384; }
.cell { border-color: #e2e6ec; }
.phone { color: #5e6979; }
.muted { color: var(--muted); }
.btn.ghost { color: #445064; border-color: #9ca6b3; background: #ffffff; }
.btn.outline-green { background: #ffffff; }

.panel {
    background: #ffffff;
    border-color: #dfe4ea;
    box-shadow: 0 3px 14px #1720330c;
}
.data-list dt, .data-list dd,
.customer-box,
.data-table td { border-color: #e4e8ed; }
.timeline article { background: #f8fafc; border-color: #e0e5eb; }
.edit-form hr { border-color: #dfe4ea; }
.boxed { background: #ffffff; border-color: #d9dfe7; }
.data-table th { background: #edf1f5; color: #536071; }
.count { background: #edf2f7; color: #5b6676; }

.pagination > a,
.pagination > span,
.pagination nav a,
.pagination nav span {
    background: #ffffff;
    border-color: #d9dee5;
    color: #1469dc;
}

.media-item {
    background: #f0f3f6;
    border-color: #dce2e8;
    color: var(--text);
    box-shadow: 0 2px 8px #17203312;
}
.media-image-button {
    width: 100%;
    padding: 0;
    font: inherit;
    cursor: zoom-in;
}
.media-item:hover { border-color: #7aaaf0; box-shadow: 0 5px 16px #1f6fd228; }
.media-item:focus-visible { outline: 3px solid #78aef8; outline-offset: 2px; }
.file-icon { color: #d99100; }

.note-row { grid-template-columns: 42px minmax(0, 1fr) auto; }
.note-actions { display: flex; gap: 6px; }
.note-action {
    min-width: 42px;
    padding: 3px 7px;
    border-radius: 6px;
    background: #ffffff;
    cursor: pointer;
    font-size: 12px;
}
.note-action.view { color: #1068dc; border: 1px solid #2977df; }
.note-action.add { color: #07834e; border: 1px solid #14915c; }
.note-action:hover { background: #edf5ff; }

.app-modal {
    position: fixed;
    inset: 0;
    z-index: 180;
    display: grid;
    place-items: center;
    padding: 24px;
    background: #10182799;
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s ease, visibility .18s ease;
}
.app-modal.open { opacity: 1; visibility: visible; }
.app-modal-dialog {
    width: min(800px, 96vw);
    max-height: 88vh;
    overflow: hidden;
    border: 1px solid #d7dde5;
    border-radius: 10px;
    background: #ffffff;
    color: var(--text);
    box-shadow: 0 24px 70px #10182755;
}
.app-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid #dde2e8;
}
.app-modal-head h2 { margin: 0 0 3px; font-size: 19px; }
.app-modal-head small { color: var(--muted); }
.app-modal-close { border: 0; background: transparent; color: #667080; font-size: 30px; cursor: pointer; }
.notes-modal-body { max-height: 65vh; overflow: auto; padding: 14px 16px 18px; }
.notes-modal-card { border: 1px solid #dce2e9; border-radius: 8px; margin-bottom: 10px; overflow: hidden; }
.notes-modal-meta { display: flex; gap: 12px; padding: 9px 12px; background: #f2f5f8; color: #4e5968; }
.notes-modal-card p { margin: 0; padding: 16px 12px; white-space: pre-wrap; line-height: 1.5; }
.notes-modal-empty { padding: 28px; text-align: center; }
.note-add-body { display: grid; gap: 18px; padding: 18px 16px 16px; }
.quick-note-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px 24px;
    margin: 0;
    padding: 14px;
    border: 1px solid #dce2e9;
    border-radius: 8px;
}
.quick-note-options legend { padding: 0 7px; font-weight: 700; }
.quick-note-options label { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.note-content-label { display: grid; gap: 7px; font-weight: 700; }
.note-content-label textarea {
    width: 100%;
    resize: vertical;
    padding: 11px;
    border: 1px solid #cfd7e2;
    border-radius: 7px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
}
.app-modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 16px; border-top: 1px solid #dde2e8; }

.profile-page { max-width: 1320px; }
.profile-panel { padding: 20px; }
.profile-panel > h1 { margin: 0 0 18px; font-size: 23px; }
.profile-form { display: grid; gap: 20px; }
.profile-identity { display: flex; align-items: center; gap: 18px; }
.profile-identity > div:last-child { display: grid; gap: 8px; font-size: 17px; }
.profile-avatar {
    width: 132px;
    height: 132px;
    display: grid;
    place-items: center;
    border: 5px solid #ffffff;
    border-radius: 50%;
    background: #07101d;
    box-shadow: 0 0 0 1px #d7dee7, 0 7px 22px #17203322;
    overflow: hidden;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar span { color: #ffffff; font-size: 72px; }
.profile-upload { display: grid; gap: 7px; }
.profile-upload small, .password-panel > small { color: var(--muted); }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.profile-grid label { display: grid; gap: 7px; font-weight: 600; }
.profile-grid input,
.profile-grid select,
.profile-grid textarea,
.profile-upload input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cfd7e2;
    border-radius: 6px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
}
.profile-wide { grid-column: 1 / -1; }
.password-panel { margin: 0; padding: 18px 0 0; border: 0; border-top: 1px solid #dce2e9; }
.password-panel legend { padding-right: 12px; font-weight: 700; }
.password-grid { grid-template-columns: repeat(3, 1fr); margin-bottom: 8px; }
.profile-actions { display: flex; justify-content: flex-end; }

.notes-history-page { max-width: 1320px; }
.notes-history-panel { padding: 0; overflow: hidden; }
.notes-history-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 22px; padding: 20px; }
.notes-search { display: flex; gap: 8px; flex: 1; }
.notes-search input { width: min(440px, 100%); padding: 10px 12px; border: 1px solid #cfd7e2; border-radius: 6px; }
.notes-history-title { text-align: right; }
.notes-history-title h1 { margin: 0 0 6px; font-size: 22px; }
.notes-history-title span { color: var(--muted); }
.notes-history-table th { white-space: nowrap; }
.notes-history-table td { vertical-align: top; line-height: 1.5; }
.notes-history-table th:first-child { width: 54px; }
.notes-history-table th:nth-child(2) { width: 130px; }
.notes-history-table th:nth-child(4) { width: 80px; }
.notes-history-table th:nth-child(5) { width: 160px; }
.notes-history-table th:nth-child(6) { width: 180px; }
.history-note-content { min-width: 280px; white-space: pre-wrap; }
.property-code-link { display: inline-flex; justify-content: center; min-width: 104px; padding: 6px 8px; border-radius: 7px; background: #14925d; color: #ffffff; font-size: 12px; font-weight: 700; line-height: 1.1; text-align: center; }
.property-code-link:hover { background: #087548; }
.note-group-chip { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.note-group-chip.sale { background: #e9f7ef; color: #087847; }
.note-group-chip.rent { background: #eaf2ff; color: #1e62bd; }
.notes-empty { padding: 50px !important; text-align: center; color: var(--muted); }

.gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 28px;
    background: #07101de8;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}
.gallery-modal.open { opacity: 1; visibility: visible; }
.gallery-dialog {
    position: relative;
    width: min(1180px, 96vw);
    height: min(820px, 92vh);
    display: grid;
    place-items: center;
}
.gallery-stage {
    width: 100%;
    height: 100%;
    margin: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    place-items: center;
    gap: 12px;
}
.gallery-stage img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 14px 55px #0009;
}
.gallery-stage figcaption {
    min-width: 76px;
    padding: 7px 13px;
    border-radius: 999px;
    color: #ffffff;
    background: #0009;
    text-align: center;
}
.gallery-close,
.gallery-nav {
    position: absolute;
    z-index: 2;
    display: grid;
    place-items: center;
    border: 1px solid #ffffff55;
    color: #ffffff;
    background: #06101cb8;
    cursor: pointer;
    transition: background .15s ease, transform .15s ease;
}
.gallery-close:hover,
.gallery-nav:hover { background: #176fe0; transform: scale(1.05); }
.gallery-close { top: 0; right: 0; width: 44px; height: 44px; border-radius: 50%; font-size: 30px; }
.gallery-nav { top: 50%; width: 50px; height: 66px; margin-top: -33px; border-radius: 10px; font-size: 42px; }
.gallery-prev { left: 0; }
.gallery-next { right: 0; }

.login-page { background: radial-gradient(circle at 50% 15%, #ffffff, #e8edf5 70%); }
.login-card {
    background: #ffffff;
    color: var(--text);
    border-color: #d9e0e9;
    box-shadow: 0 24px 70px #29415d24;
}
.login-card > p { color: #6f7b8c; }
.login-card input { background: #ffffff; color: var(--text); border-color: #cfd7e2; }

@media (max-width: 700px) {
    .gallery-modal { padding: 12px; }
    .gallery-dialog { width: 100%; height: 86vh; }
    .gallery-nav { width: 42px; height: 56px; font-size: 34px; }
    .gallery-close { width: 40px; height: 40px; }
    .app-modal { padding: 10px; }
    .quick-note-options { grid-template-columns: 1fr; }
    .profile-grid, .password-grid { grid-template-columns: 1fr; }
    .profile-wide { grid-column: auto; }
    .notes-history-toolbar { align-items: stretch; flex-direction: column; }
    .notes-history-title { text-align: left; }
    .notes-search { flex-wrap: wrap; }
    .notes-search input { width: 100%; }
}

.mobile-nav-toggle { display: none; }

/* Responsive layout shared by dashboard, details, forms and administration pages. */
@media (max-width: 820px) {
    body { min-width: 0; overflow-x: hidden; }
    .topbar { height: 58px; padding: 0 12px; }
    .brand { min-width: 0; gap: 8px; font-size: 17px; }
    .brand span:last-child { display: inline; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
    .brand-mark { font-size: 25px; }
    .brand-logo { height: 36px; max-width: min(245px, calc(100vw - 78px)); }
    .mobile-nav-toggle {
        display: grid;
        place-items: center;
        flex: 0 0 40px;
        width: 40px;
        height: 40px;
        border: 1px solid #31415e;
        border-radius: 8px;
        background: #0c172d;
        color: #ffffff;
        font-size: 24px;
        line-height: 1;
        cursor: pointer;
    }
    .nav-links {
        position: fixed;
        z-index: 55;
        top: 58px;
        right: 10px;
        left: 10px;
        height: auto;
        max-height: calc(100vh - 70px);
        display: none;
        align-items: stretch;
        padding: 8px;
        overflow-y: auto;
        border: 1px solid #263a5c;
        border-radius: 0 0 12px 12px;
        background: #071126;
        box-shadow: 0 16px 35px #07112666;
    }
    .nav-links.open { display: grid; }
    .nav-links > a,
    .account-menu > summary { height: 44px; padding: 0 12px; border-radius: 7px; font-size: 15px; }
    .nav-links > a.active { height: 44px; border-radius: 7px; }
    .account-menu { height: auto; }
    .account-menu > summary { font-size: 15px; }
    .account-popover { position: static; width: 100%; margin-top: 5px; box-shadow: none; }

    .dashboard-toolbar { top: 58px; padding: 9px 10px; gap: 10px; font-size: 12px; }
    .dashboard-toolbar > div:first-child { min-width: 0; }
    .toolbar-actions { flex: 0 0 auto; }
    .toolbar-actions .btn { padding: 8px 10px; white-space: nowrap; }
    .property-list { gap: 10px; padding: 10px; }
    .property-card {
        grid-template-columns: minmax(112px, .7fr) minmax(0, 1.3fr);
        min-height: 0;
        border-radius: 9px;
        font-size: 13px;
    }
    .property-image { padding: 10px; }
    .property-image img,
    .property-image span { height: 112px; }
    .property-card .cell { min-height: 0; padding: 10px; border-bottom: 1px solid var(--line); }
    .property-card .info { border-left: 1px solid var(--line); }
    .property-card .type,
    .property-card .status,
    .property-card .prices,
    .property-card .other { grid-column: span 1; }
    .property-card .notes,
    .property-card .customers { grid-column: 1 / -1; }
    .property-card .notes { gap: 8px; }
    .note-row { grid-template-columns: 42px minmax(0, 1fr) auto; }
    .note-row span { white-space: normal; }
    .note-actions { flex-wrap: wrap; justify-content: flex-end; }
    .other .btn { width: 100%; }

    .page-wrap,
    .page-wrap.narrow,
    .profile-page,
    .notes-history-page { width: 100%; padding: 12px; }
    .page-head { align-items: flex-start; gap: 12px; margin-bottom: 12px; }
    .page-head h1 { font-size: 22px; overflow-wrap: anywhere; }
    .page-head > .btn { flex: 0 0 auto; }
    .panel { padding: 14px; }
    .detail-grid,
    .form-grid.two,
    .profile-grid,
    .password-grid { grid-template-columns: minmax(0, 1fr); }
    .profile-wide { grid-column: auto; }
    .data-list { grid-template-columns: minmax(105px, .8fr) minmax(0, 1.2fr); }
    .data-list dt,
    .data-list dd { overflow-wrap: anywhere; }
    .form-actions,
    .profile-actions { flex-wrap: wrap; }
    .form-actions > *,
    .profile-actions > * { flex: 1 1 150px; }
    .profile-panel { padding: 15px; }
    .profile-identity { flex-direction: column; text-align: center; }
    .profile-avatar { width: 112px; height: 112px; }
    .profile-avatar span { font-size: 60px; }
    .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .note-form { grid-template-columns: 1fr; }
    .note-form .btn { width: 100%; }

    .table-wrap { margin: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .data-table { min-width: 720px; }
    .notes-history-panel { padding: 0; }
    .notes-history-toolbar { padding: 14px; }
    .notes-search .btn { flex: 1; }
    .notes-history-table { min-width: 780px; }
    .pagination { max-width: 100%; padding: 14px 4px; overflow-x: auto; justify-content: flex-start; }

    .app-modal { align-items: end; padding: 0; }
    .app-modal-dialog { width: 100%; max-height: 92dvh; border-radius: 14px 14px 0 0; }
    .notes-modal-body { max-height: 65dvh; }
    .filter-drawer { width: 100%; }
    .filter-form { padding-right: 12px; padding-left: 12px; }
    .gallery-dialog { height: 82dvh; }
    .flash { top: 66px; width: calc(100% - 24px); text-align: center; }
    .empty-state { padding: 45px 16px; }
}

@media (max-width: 430px) {
    .brand { font-size: 15px; }
    .dashboard-toolbar .muted { display: block; margin-top: 2px; }
    .brand-logo { height: 32px; max-width: calc(100vw - 76px); }
    .property-card { grid-template-columns: 108px minmax(0, 1fr); }
    .property-card .type,
    .property-card .status,
    .property-card .prices,
    .property-card .other { grid-column: 1 / -1; }
    .property-card .type,
    .property-card .status,
    .property-card .prices { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
    .property-card .type small,
    .property-card .status small,
    .property-card .prices small { grid-column: 1 / -1; }
    .property-card .status .status-pill { align-self: center; }
    .page-head { flex-direction: column; }
    .page-head > .btn { width: 100%; }
    .panel { border-radius: 7px; }
    .media-grid { grid-template-columns: 1fr 1fr; gap: 7px; }
    .media-item { height: 105px; }
    .quick-note-options { padding: 10px; }
    .app-modal-head { padding: 12px; }
    .app-modal-actions .btn { flex: 1; }
}

.dashboard-image-button { position: relative; width: 100%; padding: 0; overflow: hidden; border: 0; border-radius: 6px; background: transparent; cursor: zoom-in; }
.dashboard-image-button img { display: block; transition: transform .2s ease; }
.dashboard-image-button:hover img { transform: scale(1.04); }
.image-zoom-hint { position: absolute; right: 5px; bottom: 5px; width: auto !important; height: auto !important; padding: 3px 6px; border-radius: 5px; background: #071126d9 !important; color: #fff !important; font-size: 10px; opacity: 0; transition: opacity .2s ease; }
.dashboard-image-button:hover .image-zoom-hint,
.dashboard-image-button:focus-visible .image-zoom-hint { opacity: 1; }
.dashboard-gallery-modal { padding: 28px; }
.dashboard-gallery-shell { width: min(1140px, 96vw); max-height: 94vh; overflow: hidden; border-radius: 10px; background: #fff; box-shadow: 0 25px 80px #0008; }
.dashboard-gallery-head { height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 10px 16px; border-bottom: 1px solid #dce2e8; color: var(--text); }
.dashboard-gallery-head > div:first-child { display: grid; gap: 3px; }
.dashboard-gallery-head small { color: var(--muted); }
.dashboard-gallery-tools { display: flex; align-items: center; gap: 8px; }
.gallery-download { padding: 7px 12px; }
.gallery-head-close { width: 38px; height: 38px; border: 0; background: transparent; color: #6b7280; font-size: 30px; cursor: pointer; }
.dashboard-gallery-shell .gallery-dialog { width: 100%; height: min(760px, calc(94vh - 58px)); padding: 0 15px; background: #20252b; }
.dashboard-gallery-shell .gallery-stage { padding: 0 55px; }
.dashboard-gallery-shell .gallery-stage img { max-height: calc(94vh - 100px); }
.dashboard-gallery-shell .gallery-prev { left: 18px; }
.dashboard-gallery-shell .gallery-next { right: 18px; }

@media (max-width: 820px) {
    .image-zoom-hint { opacity: 1; }
    .dashboard-gallery-modal { align-items: center; padding: 8px; }
    .dashboard-gallery-shell { width: 100%; max-height: 96dvh; }
    .dashboard-gallery-head { height: 54px; padding: 8px 10px; }
    .dashboard-gallery-shell .gallery-dialog { height: calc(96dvh - 54px); padding: 0; }
    .dashboard-gallery-shell .gallery-stage { padding: 0 38px; }
    .dashboard-gallery-shell .gallery-stage img { max-height: calc(96dvh - 92px); }
    .dashboard-gallery-shell .gallery-nav { width: 36px; height: 52px; font-size: 32px; }
    .dashboard-gallery-shell .gallery-prev { left: 4px; }
    .dashboard-gallery-shell .gallery-next { right: 4px; }
    .gallery-download { padding: 7px 9px; font-size: 12px; }
}

.customer-cell-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.customer-cell-head small { margin: 0; }
.customer-add-button { padding: 3px 8px; border: 1px solid #14915c; border-radius: 6px; background: #fff; color: #07834e; font-size: 12px; cursor: pointer; }
.customer-add-button:hover { background: #eaf8f1; }
.dashboard-customer { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding-bottom: 4px; border-bottom: 1px dashed #e0e5eb; }
.dashboard-customer > div { min-width: 0; display: grid; gap: 4px; }
.dashboard-customer b { overflow-wrap: anywhere; }
.customer-delete-button { width: 24px; height: 24px; padding: 0; border: 1px solid #ef5264; border-radius: 5px; background: #fff; color: #d72d42; font-size: 17px; line-height: 1; cursor: pointer; }
.customer-delete-button:hover { background: #fff0f2; }
.customer-more { color: var(--muted); }
.customer-modal-dialog { width: min(520px, 96vw); }
.customer-modal-body { display: grid; gap: 15px; padding: 18px 16px; }
.customer-modal-body label { display: grid; gap: 7px; font-weight: 700; }
.customer-modal-body input { width: 100%; padding: 11px 12px; border: 1px solid #cfd7e2; border-radius: 7px; background: #fff; color: var(--text); }
.required { color: #d72d42; }

@media (max-width: 820px) {
    .customer-add-button { min-height: 32px; padding: 5px 10px; }
    .customer-modal-dialog { width: 100%; }
}

.image-upload-form { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 0 0 16px; padding: 14px; border: 1px dashed #aebfd3; border-radius: 8px; background: #f7faff; }
.image-upload-picker { min-width: 0; flex: 1; display: grid; gap: 7px; font-weight: 700; }
.image-upload-picker input { width: 100%; padding: 8px; border: 1px solid #cfd7e2; border-radius: 6px; background: #fff; font-weight: 400; }
.image-upload-picker small { color: var(--muted); font-weight: 400; }
.image-upload-actions { flex: 0 0 auto; display: grid; justify-items: end; gap: 7px; }
.image-upload-panel { margin-top: 16px; }

@media (max-width: 700px) {
    .image-upload-form { align-items: stretch; flex-direction: column; }
    .image-upload-actions { justify-items: stretch; }
    .image-upload-actions .btn { width: 100%; }
}

.activity-filter { display: flex; align-items: end; gap: 10px; padding: 14px; }
.activity-filter label { align-self: center; font-weight: 700; }
.activity-filter input { min-width: 280px; flex: 1; padding: 10px 12px; border: 1px solid #cfd7e2; border-radius: 6px; background: #fff; color: var(--text); }
.activity-filter .btn { white-space: nowrap; }

@media (max-width: 700px) {
    .activity-filter { align-items: stretch; flex-wrap: wrap; }
    .activity-filter label { width: 100%; }
    .activity-filter input { min-width: 0; width: 100%; flex-basis: 100%; }
    .activity-filter .btn { flex: 1; }
}

/* Laptop dashboard: keep all eight columns visible without horizontal clipping. */
@media (max-width: 1600px) and (min-width: 1151px) {
    .property-card { grid-template-columns: 90px 145px 145px 140px 135px minmax(235px, 1.7fr) minmax(180px, 1.2fr) 145px; font-size: 12px; }
    .property-image { padding: 6px; }
    .property-image img, .property-image span { height: 86px; }
    .cell { padding: 8px 7px; }
    .note-action { min-width: 38px; padding: 3px 5px; }
    .btn.outline-green { padding-right: 7px; padding-left: 7px; }
}
@media (max-width: 1150px) and (min-width: 821px) {
    .property-list { padding: 8px; }
    .property-card { grid-template-columns: 105px repeat(3, minmax(0, 1fr)); font-size: 12px; }
    .property-card .cell { border-bottom: 1px solid var(--line); }
    .property-card .notes { grid-column: span 2; }
    .property-card .customers, .property-card .other { grid-column: span 1; }
    .property-image img, .property-image span { height: 100px; }
}

.media-entry { position: relative; min-width: 0; }
.media-entry .media-item { width: 100%; }
.media-delete-button { position: absolute; z-index: 3; top: 5px; right: 5px; width: 28px; height: 28px; border: 1px solid #ff6978; border-radius: 50%; background: #fff; color: #d92339; font-size: 19px; line-height: 1; cursor: pointer; box-shadow: 0 2px 8px #0003; }
.media-delete-button:hover { background: #ffecef; }
.media-modal-delete, .btn.danger { border-color: #d9364b; background: #d9364b; color: #fff; }
.media-modal-delete:hover, .btn.danger:hover { background: #b91f34; }
.dashboard-gallery-tools form[hidden] { display: none; }
.user-search-form { display: flex; gap: 9px; padding: 14px; }
.user-search-form input { min-width: 280px; flex: 1; padding: 10px 12px; border: 1px solid #cfd7e2; border-radius: 6px; background: #fff; color: var(--text); }
.user-row-actions { display: flex; align-items: center; gap: 7px; }
.user-row-actions form { margin: 0; }
.user-row-actions .btn { padding: 5px 10px; white-space: nowrap; }

@media (max-width: 700px) {
    .user-search-form { flex-wrap: wrap; }
    .user-search-form input { min-width: 0; width: 100%; flex-basis: 100%; }
    .user-search-form .btn { flex: 1; }
}
