/* =========================================================
   Lodgr design system
   Tokens -> base -> app shell -> components -> pages
   ========================================================= */

:root {
    --lodgr: #3B5C76;
    --lodgr-dark: #2a4358;
    --lodgr-soft: #e8eff5;
    --lodgr-teal: #27A6A2;
    --lodgr-red: #E5271F;

    --bg: #f4f7fa;
    --surface: #ffffff;
    --border: #e3e9ef;
    --text: #1f2d3a;
    --muted: #6b7a86;

    --radius: 8px;
    --radius-sm: 6px;
    --shadow-sm: 0 1px 2px rgba(31, 45, 58, .04);
    --shadow: 0 2px 8px rgba(31, 45, 58, .08);
    --shadow-lg: 0 8px 24px rgba(31, 45, 58, .14);

    --sidebar-w: 264px;
    --rail-w: 86px;

    /* Re-point Bootstrap at the brand colour so every .btn-primary, link, focus ring etc. follows it. */
    --bs-primary: #3B5C76;
    --bs-primary-rgb: 59, 92, 118;
    --bs-link-color: #3B5C76;
    --bs-link-color-rgb: 59, 92, 118;
    --bs-link-hover-color: #2a4358;
    --bs-body-color: #1f2d3a;
    --bs-body-bg: #f4f7fa;
    --bs-border-color: #e3e9ef;
    --bs-border-radius: 6px;
    --bs-body-font-family: Inter, "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

html { font-size: 15px; }
@media (min-width: 992px) { html { font-size: 16px; } }

body {
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { font-weight: 600; letter-spacing: -.01em; }
.app-content h1, .app-content h2, .app-content h3, .app-content h4, .app-content h5, .app-content h6 { color: var(--text); }
a { text-decoration: none; }
a:hover { text-decoration: underline; }
.text-muted { color: var(--muted) !important; }

:focus-visible { outline: 3px solid rgba(59, 92, 118, .35); outline-offset: 2px; }

/* ---------- Buttons ---------- */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 500;
    padding: .5rem .95rem;
    transition: background-color .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: .3rem .65rem; font-size: .84rem; border-radius: 5px; }
.btn-lg { padding: .75rem 1.5rem; }

.btn-primary, .btn-lodgr, .btn-log-issue {
    --bs-btn-bg: var(--lodgr); --bs-btn-border-color: var(--lodgr);
    --bs-btn-hover-bg: var(--lodgr-dark); --bs-btn-hover-border-color: var(--lodgr-dark);
    --bs-btn-active-bg: var(--lodgr-dark); --bs-btn-active-border-color: var(--lodgr-dark);
    --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff;
    --bs-btn-disabled-bg: var(--lodgr); --bs-btn-disabled-border-color: var(--lodgr);
    background: var(--lodgr); border: 1px solid var(--lodgr); color: #fff;
}
.btn-lodgr:hover, .btn-log-issue:hover { background: var(--lodgr-dark); border-color: var(--lodgr-dark); color: #fff; }
.btn-success {
    --bs-btn-bg: var(--lodgr-teal); --bs-btn-border-color: var(--lodgr-teal);
    --bs-btn-hover-bg: #1f8a87; --bs-btn-hover-border-color: #1f8a87;
    --bs-btn-active-bg: #1f8a87; --bs-btn-active-border-color: #1f8a87;
}
.btn-outline-secondary { --bs-btn-color: var(--lodgr); --bs-btn-border-color: var(--border); --bs-btn-hover-bg: var(--lodgr-soft); --bs-btn-hover-color: var(--lodgr-dark); --bs-btn-hover-border-color: var(--border); --bs-btn-active-bg: var(--lodgr-soft); --bs-btn-active-color: var(--lodgr-dark); }
.btn-remove { background: #fff; color: #c0392b; border: 1px solid #f0c9c4; }
.btn-remove:hover { background: #fdecea; color: #a93226; }
.btn .icon { width: 1.1em; height: 1.1em; margin-right: .4rem; vertical-align: -.15em; }

/* ---------- Forms ---------- */
.form-label { font-weight: 600; font-size: .85rem; color: var(--text); margin-bottom: .35rem; }
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1px solid #d5dde5;
    padding: .5rem .75rem;
    background-color: #fff;
}
.form-control:focus, .form-select:focus { border-color: var(--lodgr); box-shadow: 0 0 0 .22rem rgba(59, 92, 118, .18); }
.form-control:disabled, .form-select:disabled, fieldset:disabled .form-control, fieldset:disabled .form-select { background: #f1f4f7; color: #54626f; }
.form-control::placeholder { color: #9aa7b2; }
.form-check-input:checked { background-color: var(--lodgr); border-color: var(--lodgr); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.search-box { position: relative; }
.search-box .icon { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); width: 1.1rem; height: 1.1rem; color: var(--muted); pointer-events: none; }
.search-box .form-control { padding-left: 2.5rem; }

/* ---------- Cards ---------- */
.card { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); background: var(--surface); }
.card-header { background: transparent; border-bottom: 1px solid var(--border); font-weight: 650; padding: 1rem 1.25rem; }
.card-header.bg-primary { background: var(--lodgr) !important; border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0 !important; }
.card-header.bg-primary h4, .card-header.bg-primary h5 { color: #fff; margin: 0; font-size: 1.05rem; }
.card-body { padding: 1.25rem; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.panel-header h2 { font-size: 1rem; margin: 0; }
.panel-body { padding: 1.25rem; }
.panel > .table-responsive > .table, .panel > .table { margin-bottom: 0; }

/* ---------- Tables ---------- */
.table { --bs-table-bg: transparent; --bs-table-striped-bg: #f8fafc; --bs-table-hover-bg: #f3f7fa; color: var(--text); vertical-align: middle; }
.table > thead > tr > th {
    background: #f8fafc; color: var(--muted); font-size: .72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--border); padding: .75rem 1rem; white-space: nowrap;
}
.table > tbody > tr > td { padding: .8rem 1rem; border-color: var(--border); }
.table-dark, .table > thead.table-dark > tr > th { --bs-table-bg: #f8fafc; background: #f8fafc; color: var(--muted); }
.table-bordered { border: 0; }
.table-bordered > :not(caption) > * > * { border-width: 0 0 1px; }
.table tbody tr:last-child td { border-bottom: 0; }
/* Whole-row click target: put .stretched-link on the row's main link. */
.row-link tbody tr:not(.empty-row) { position: relative; cursor: pointer; }
.row-link tbody tr:not(.empty-row):hover > td { background: var(--lodgr-soft, rgba(0,0,0,.04)); }
.row-link a, .row-link a:hover { text-decoration: none; }
.row-link .row-action { position: relative; z-index: 2; }
.empty-row td { text-align: center; color: var(--muted); padding: 2rem 1rem !important; }

/* ---------- Badges / pills ---------- */
.badge { font-weight: 600; border-radius: 4px; padding: .35em .6em; }
.pill { display: inline-flex; align-items: center; font-size: .74rem; font-weight: 600; padding: .18rem .55rem; border-radius: 4px; white-space: nowrap; letter-spacing: .01em; }
.pill-new { background: #e8eef4; color: #2f567a; }
.pill-tenant { background: #e4f0f4; color: #1d6176; }
.pill-repairs { background: #f6efdd; color: #7a5a10; }
.pill-closed, .pill-occupied, .pill-low { background: #e5f2ea; color: #1f6b46; }
.pill-vacant, .pill-urgent { background: #f8e8e6; color: #a3342c; }
.pill-medium { background: #f6efdd; color: #7a5a10; }
.pill-none { background: #eef1f4; color: var(--muted); }

/* ---------- Alerts ---------- */
.alert { border-radius: var(--radius-sm); border: 0; padding: .85rem 1.1rem; font-weight: 500; }
.alert-danger { background: #fde7e5; color: #8f1f19; }
.alert-info { background: #e3f0fa; color: #1c5a85; }
.alert-success { background: #e1f5ec; color: #17694a; }

/* ---------- Modals ---------- */
.modal-content { border: 0; border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-header { border-bottom: 1px solid var(--border); padding: 1rem 1.25rem; }
.modal-header.bg-primary { background: var(--lodgr) !important; }
.modal-footer { border-top: 1px solid var(--border); padding: .85rem 1.25rem; }
.modal-title { font-size: 1rem; font-weight: 600; }

/* ---------- Tabs ---------- */
.nav-tabs { border-bottom: 1px solid var(--border); gap: .25rem; flex-wrap: nowrap; overflow-x: auto; }
.nav-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; padding: .75rem 1rem; border-radius: 0; white-space: nowrap; }
.nav-tabs .nav-link:hover { color: var(--lodgr); border-bottom-color: var(--border); }
.nav-tabs .nav-link.active { color: var(--lodgr); background: transparent; border-bottom-color: var(--lodgr); }
.tab-content { padding: 1.25rem; }

/* =========================================================
   App shell (signed-in pages)
   ========================================================= */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    z-index: 1045;
}
@media (min-width: 992px) {
    .sidebar { position: sticky; top: 0; height: 100vh; flex: 0 0 var(--sidebar-w); }
}
/* Landlords: slim icon rail that expands over the page on hover/focus, giving content the full width. */
@media (min-width: 992px) {
    .app-shell.has-rail { padding-left: var(--rail-w); }
    .sidebar.sidebar-auto {
        position: fixed; left: 0; top: 0; height: 100vh;
        width: var(--rail-w); flex: none; overflow: hidden;
        background-color: var(--surface) !important; /* Bootstrap's .offcanvas-lg forces transparent on desktop */
        transition: width .18s ease, box-shadow .18s ease;
    }
    /* centre icons and avatar in the wider rail */
    .sidebar.sidebar-auto .sidebar-nav { padding-left: calc(.85rem + 6px); }
    .sidebar.sidebar-auto .sidebar-footer { padding-left: calc(.85rem + 2.5px); }
    .sidebar.sidebar-auto:hover,
    .sidebar.sidebar-auto:focus-within { width: var(--sidebar-w); box-shadow: var(--shadow-lg); }
    /* collapsed: highlight the current page as a rounded square round the icon only */
    .sidebar.sidebar-auto:not(:hover):not(:focus-within) .side-link.active { background: transparent; box-shadow: none; }
    .sidebar.sidebar-auto:not(:hover):not(:focus-within) .side-link.active .icon { box-shadow: 0 0 0 .5rem #eef2f6; border-radius: 4px; }
    /* keep inner layout at full width so text doesn't reflow while the rail animates */
    .sidebar.sidebar-auto > * { width: var(--sidebar-w); flex-shrink: 0; }
    .sidebar.sidebar-auto .sidebar-brand { padding-left: .75rem; transition: padding-left .18s ease; }
    /* expanded: centre the logo (62.4px wide at 46px high) */
    .sidebar.sidebar-auto:hover .sidebar-brand,
    .sidebar.sidebar-auto:focus-within .sidebar-brand { padding-left: calc((var(--sidebar-w) - 62.4px) / 2); }
    .sidebar.sidebar-auto .side-link span,
    .sidebar.sidebar-auto .nav-heading,
    .sidebar.sidebar-auto .user-chip .who { opacity: 0; transition: opacity .12s; }
    .sidebar.sidebar-auto:hover .side-link span,
    .sidebar.sidebar-auto:hover .nav-heading,
    .sidebar.sidebar-auto:hover .user-chip .who,
    .sidebar.sidebar-auto:focus-within .side-link span,
    .sidebar.sidebar-auto:focus-within .nav-heading,
    .sidebar.sidebar-auto:focus-within .user-chip .who { opacity: 1; transition-delay: .06s; }
}
.sidebar .offcanvas-header { display: none; }
@media (max-width: 991.98px) {
    .sidebar { --bs-offcanvas-width: 284px; box-shadow: var(--shadow-lg); }
    .sidebar .offcanvas-header { display: flex; }
}
.sidebar-brand { display: flex; align-items: center; padding: 1.25rem 1.5rem 1rem; }
.sidebar-brand img { height: 46px; width: auto; }
.sidebar-nav { padding: .5rem .85rem 1rem; overflow-y: auto; flex: 1; }
.nav-heading { font-size: .68rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: #93a1ad; padding: 1rem .75rem .4rem; }
.side-link {
    display: flex; align-items: center; gap: .8rem;
    padding: .65rem .8rem; margin-bottom: 2px;
    border-radius: var(--radius-sm);
    color: #44525f; font-weight: 550; text-decoration: none !important;
    transition: background-color .12s, color .12s;
}
.side-link .icon { width: 1.3rem; height: 1.3rem; flex: 0 0 1.3rem; color: #7b8996; transition: color .12s; }
.side-link:hover { background: #f1f5f8; color: var(--text); }
.side-link.active { background: #eef2f6; color: var(--lodgr-dark); font-weight: 600; box-shadow: inset 3px 0 0 var(--lodgr); }
.side-link.active .icon { color: var(--lodgr); }
.sidebar-footer { padding: .85rem; border-top: 1px solid var(--border); }

.avatar {
    width: 38px; height: 38px; border-radius: 50%; flex: 0 0 38px;
    background: var(--lodgr); color: #fff; font-weight: 700; font-size: .85rem;
    display: inline-flex; align-items: center; justify-content: center; text-transform: uppercase;
}
.user-chip { display: flex; align-items: center; gap: .75rem; padding: .35rem .5rem; border-radius: var(--radius-sm); color: var(--text); width: 100%; background: none; border: 0; text-align: left; }
.user-chip:hover { background: #f1f5f8; text-decoration: none; }
.user-chip .who { line-height: 1.15; min-width: 0; }
.user-chip .who strong { display: block; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .who small { color: var(--muted); font-size: .76rem; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 1020;
    display: flex; align-items: center; gap: .75rem;
    height: 60px; padding: 0 1.25rem;
    background: rgba(255, 255, 255, .88); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}
@media (min-width: 992px) { .topbar { display: none; } }
.topbar .brand img { height: 32px; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; display: inline-flex; align-items: center; justify-content: center; color: var(--text); }
.icon-btn:hover { background: #f1f5f8; }
.icon-btn .icon { width: 1.4rem; height: 1.4rem; }

.app-content { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 1.75rem 1.5rem 2rem; }
@media (min-width: 992px) { .app-content { padding: 2.25rem 2.5rem 2.5rem; } }
.app-footer { color: var(--muted); font-size: .8rem; text-align: center; padding: 1rem; }

.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.4rem; margin: 0; }
.page-header .subtitle { color: var(--muted); margin: .2rem 0 0; }
.page-header .actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.crumbs { font-size: .82rem; margin-bottom: .35rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--lodgr); }

/* ---------- Stat cards ---------- */
.stat-card { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.15rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); height: 100%; }
.stat-icon { width: 38px; height: 38px; border-radius: 6px; flex: 0 0 38px; display: inline-flex; align-items: center; justify-content: center; background: #eef2f6; color: var(--lodgr); }
.stat-icon .icon { width: 1.15rem; height: 1.15rem; }
.stat-icon.teal, .stat-icon.amber, .stat-icon.green { background: #eef2f6; color: var(--lodgr); }
.stat-icon.red { background: #f8e8e6; color: #a3342c; }
.stat-label { color: var(--muted); font-size: .78rem; font-weight: 500; }
.stat-value { font-size: 1.55rem; font-weight: 650; line-height: 1.1; letter-spacing: -.02em; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 3.5rem 1.5rem; background: var(--surface); border: 1px dashed #c9d4de; border-radius: var(--radius); }
.empty-state .empty-icon { width: 48px; height: 48px; border-radius: 8px; background: #eef2f6; color: var(--lodgr); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 1rem; }
.empty-state .empty-icon .icon { width: 1.4rem; height: 1.4rem; }
.empty-state h2 { font-size: 1.25rem; }
.empty-state p { color: var(--muted); max-width: 42ch; margin: .25rem auto 1.25rem; }

/* ---------- Toolbar (search + filters) ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-bottom: 1rem; }
.toolbar .grow { flex: 1 1 260px; }
.toolbar .form-select { width: auto; min-width: 11rem; }

/* ---------- Property cards ---------- */
.prop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.prop-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; transition: border-color .15s, box-shadow .15s; color: inherit; }
.prop-card:hover { border-color: #c5d1db; box-shadow: var(--shadow); text-decoration: none; }
.prop-card .thumb { aspect-ratio: 16 / 10; background: var(--lodgr-soft); overflow: hidden; position: relative; }
.prop-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prop-card .thumb .pill { position: absolute; top: .75rem; left: .75rem; background: #fff; box-shadow: var(--shadow-sm); }
.prop-card .info { padding: 1rem 1.15rem 1.15rem; flex: 1; display: flex; flex-direction: column; gap: .15rem; }
.prop-card .addr { font-weight: 650; font-size: 1.02rem; color: var(--text); }
.prop-card .sub { color: var(--muted); font-size: .88rem; }
.prop-card .rent { margin-top: auto; padding-top: .75rem; font-weight: 700; color: var(--lodgr-dark); }
.prop-card .rent small { color: var(--muted); font-weight: 500; }

/* ---------- Property detail ---------- */
.hero-image { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--lodgr-soft); aspect-ratio: 16 / 10; box-shadow: var(--shadow-sm); }
.hero-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-image .upload-btn { position: absolute; right: .85rem; bottom: .85rem; }
.detail-list { margin: 0; }
.detail-list > div { display: flex; justify-content: space-between; gap: 1rem; padding: .65rem 0; border-bottom: 1px solid var(--border); }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--muted); font-weight: 550; font-size: .88rem; }
.detail-list dd { margin: 0; font-weight: 600; text-align: right; }

/* ---------- Issue wizard (modal) ---------- */
.step-badge { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 600; margin: 0 auto; transition: background .2s; }
.form-section-title { font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.small-help-text { font-size: .8rem; color: var(--muted); }
.issue-step-wrapper { overflow: hidden; width: 100%; }
.issue-step-track { display: flex; width: 200%; transition: transform .35s ease; }
.issue-step-track.step-1 { transform: translateX(0); }
.issue-step-track.step-2 { transform: translateX(-50%); }
.issue-step-panel { width: 50%; padding: 0 .25rem; }

/* ---------- Auth pages ---------- */
.auth-wrap { min-height: calc(100vh - 220px); display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 2.25rem 2rem; }
.auth-card .auth-logo { display: block; height: 56px; margin: 0 auto 1rem; }
.auth-card h1 { font-size: 1.5rem; text-align: center; margin-bottom: .25rem; }
.auth-card .lead-sm { text-align: center; color: var(--muted); margin-bottom: 1.5rem; }

/* ---------- Public site ---------- */
.public-nav { background: rgba(255, 255, 255, .92) !important; backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); box-shadow: none !important; padding: .5rem 0; }
.public-nav .navbar-brand img { height: 48px; }
.public-nav .nav-link { color: var(--text) !important; font-weight: 550; margin: 0 .25rem; }
.public-nav .nav-link:hover, .public-nav .nav-link.active { color: var(--lodgr) !important; }
.public-nav .nav-link::after { display: none; }
.public-main { padding-top: 76px; }
.footer-simple { color: var(--muted); text-align: center; padding: 1.5rem 1rem; border-top: 1px solid var(--border); background: #fff; font-size: .85rem; }

/* ---------- Misc ---------- */
.icon { width: 1.25rem; height: 1.25rem; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.link-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--border); color: var(--text); }
.link-row:last-child { border-bottom: 0; }
.link-row:hover { background: #f8fafc; text-decoration: none; }
.link-row .icon-lead { color: var(--lodgr); }
.pagination-lite { display: flex; gap: .35rem; justify-content: center; margin-top: 1rem; }
.d-contents { display: contents; }

.narrow { max-width: 760px; }

.table td.fw-semibold { white-space: nowrap; }

/* ---------- Charts (server-rendered SVG) ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: inherit; font-size: 11px; fill: var(--muted); }
.chart .grid { stroke: #e9eef3; stroke-width: 1; }
.chart .axis { stroke: #cfd8e0; stroke-width: 1; }
.chart .bar-a { fill: var(--lodgr); }
.chart .bar-b { fill: #9db3c6; }
.legend { display: flex; gap: 1rem; font-size: .8rem; color: var(--muted); }
.legend i { display: inline-block; width: .65rem; height: .65rem; border-radius: 2px; margin-right: .35rem; vertical-align: -.05rem; }
.legend .a { background: var(--lodgr); }
.legend .b { background: #9db3c6; }
.donut-wrap { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.donut-wrap svg { width: 150px; height: 150px; flex: 0 0 150px; }
.donut-centre { font-size: 26px; font-weight: 650; fill: var(--text); }
.donut-sub { font-size: 11px; fill: var(--muted); }
.coming-soon { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 190px; color: var(--muted); background: repeating-linear-gradient(135deg, #fafbfc, #fafbfc 10px, #f5f7f9 10px, #f5f7f9 20px); border-radius: 6px; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0 0 0 1.25rem; position: relative; }
.timeline::before { content: ""; position: absolute; left: 5px; top: .4rem; bottom: .4rem; width: 2px; background: var(--border); }
.timeline li { position: relative; padding-bottom: 1.1rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -1.25rem; top: .3rem; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid #9db3c6; }
.timeline li.done::before { background: var(--lodgr); border-color: var(--lodgr); }
.timeline li.current::before { border-color: var(--lodgr); box-shadow: 0 0 0 3px rgba(59, 92, 118, .18); }

/* ---------- Tenant layout (no sidebar) ---------- */
.tenant-body { background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
.tenant-bar { position: sticky; top: 0; z-index: 1020; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.tenant-bar-inner { max-width: 1100px; margin: 0 auto; padding: .5rem 1.25rem; display: flex; align-items: center; gap: 1rem; }
.tenant-brand img { height: 40px; width: auto; display: block; }
.user-chip-compact { width: auto; }
.tenant-content { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 1.75rem 1.25rem 2rem; }
@media (min-width: 992px) { .tenant-content { padding-top: 2rem; } }

/* =========================================================
   Mobile: app-style tabs, swipe animation, stacked tables
   ========================================================= */

/* Safety net: nothing on a tenant page is allowed to make the page scroll sideways. */
.tenant-body { overflow-x: clip; max-width: 100vw; }
.tenant-content { min-width: 0; }

/* Tab icons: inline on desktop, stacked above the label on phones. */
.nav-tabs-app .nav-link { display: inline-flex; align-items: center; gap: .45rem; }
.nav-tabs-app .nav-link .icon { width: 1.05rem; height: 1.05rem; }

@media (max-width: 575.98px) {
    /* Four equal tabs that always fit: no scrolling tab bar. The active tab is filled and underlined. */
    .nav-tabs-app { display: flex; flex-wrap: nowrap; overflow: visible; padding: 0 !important; gap: 0; }
    .nav-tabs-app .nav-item { flex: 1 1 0; min-width: 0; }
    .nav-tabs-app .nav-link {
        position: relative; width: 100%;
        flex-direction: column; gap: .15rem;
        padding: .6rem .1rem .55rem; text-align: center;
        font-size: .72rem; font-weight: 600; line-height: 1.1;
        border-bottom-width: 3px;
    }
    .nav-tabs-app .nav-link .icon { width: 1.35rem; height: 1.35rem; }
    .nav-tabs-app .nav-link.active { background: #eef2f6; }
    .nav-tabs-app .nav-link .badge {
        position: absolute; top: .3rem; left: calc(50% + .45rem);
        font-size: .6rem; padding: .22em .45em; min-width: 1.1rem;
    }
    .nav-tabs-app + .tab-content, .tab-content.tab-swipe { padding: 1rem; }

    .page-header .actions { width: 100%; }
    .page-header .actions .btn { flex: 1 1 auto; }
    .detail-list > div { flex-wrap: wrap; gap: .1rem 1rem; }
}

/* Swipeable area: let the browser handle vertical scroll/zoom, leave horizontal swipes to us. */
.tab-swipe { touch-action: pan-y pinch-zoom; overflow-x: clip; } /* clip: the slide-in animation must never create a horizontal scrollbar */

@keyframes slide-in-right { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes slide-in-left { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
.slide-in-right { animation: slide-in-right .22s ease-out; }
.slide-in-left { animation: slide-in-left .22s ease-out; }
@media (prefers-reduced-motion: reduce) { .slide-in-right, .slide-in-left { animation: none; } }

/* Documents list: long names wrap instead of widening the table; the small icon buttons stay on one line. */
.table-docs td:first-child { overflow-wrap: anywhere; min-width: 0; }
.table-docs .btn .icon { width: 1rem; height: 1rem; }
.table-docs td.cell-action { white-space: nowrap; }

/* Tables that turn into one card per row on phones (use with data-label on each td; .cell-main is the card's heading). */
@media (max-width: 575.98px) {
    .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
    .table-stack thead { display: none; }
    .table-stack tr { border: 1px solid var(--border); border-radius: var(--radius); padding: .65rem .9rem; margin-bottom: .75rem; background: #fff; }
    .table-stack tr:last-child { margin-bottom: 0; }
    .table-stack td { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .3rem 0; border: 0; text-align: right; white-space: normal; }
    .table-stack td::before { content: attr(data-label); flex: 0 0 auto; color: var(--muted); font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; text-align: left; }
    .table-stack td.cell-main { display: block; text-align: left; font-size: 1rem; font-weight: 600; padding: 0 0 .35rem; margin-bottom: .2rem; border-bottom: 1px solid var(--border); }
    .table-stack td.cell-main::before { display: none; }
    .table-stack td.cell-action { justify-content: flex-end; padding-top: .5rem; }
    .table-stack td.cell-action::before { display: none; }
    .table-stack td, .table-stack td.fw-semibold { white-space: normal; overflow-wrap: anywhere; }
    .table-stack td:empty { display: none; }
    .table-stack .text-muted.small { word-break: break-word; }
}


/* =========================================================
   Report-an-issue wizard
   ========================================================= */
.wizard { max-width: 720px; margin: 0 auto; }
.wizard-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 1.5rem; }
@media (max-width: 575.98px) { .wizard-card { padding: 1.1rem; } }

/* Progress header (built by JS) */
.wizard-steps { list-style: none; display: flex; justify-content: space-between; gap: .25rem; margin: 0 0 .65rem; padding: 0; counter-reset: s; }
.wizard-steps li { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: .3rem; text-align: center; }
.step-dot { width: 32px; height: 32px; border-radius: 50%; border: 2px solid #cdd7e0; background: #fff; color: var(--muted); font-weight: 600; font-size: .85rem; display: inline-flex; align-items: center; justify-content: center; padding: 0; cursor: default; }
.wizard-steps li.done .step-dot { background: var(--lodgr); border-color: var(--lodgr); color: #fff; cursor: pointer; }
.wizard-steps li.active .step-dot { border-color: var(--lodgr); color: var(--lodgr); box-shadow: 0 0 0 4px rgba(59, 92, 118, .15); }
.step-name { font-size: .72rem; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.wizard-steps li.active .step-name { color: var(--lodgr-dark); }
.wizard-bar { height: 4px; background: #e3e9ef; border-radius: 2px; overflow: hidden; margin-bottom: 1.5rem; }
.wizard-bar > div { height: 100%; width: 0; background: var(--lodgr); transition: width .3s ease; }

/* Without JS every step is visible; with JS only the active one. */
.wizard.js .wizard-step { display: none; }
.wizard.js .wizard-step.active { display: block; animation: slide-in-right .22s ease-out; }
.wizard:not(.js) .wizard-steps, .wizard:not(.js) .wizard-bar, .wizard:not(.js) #wizBack, .wizard:not(.js) #wizNext { display: none; }
.wizard:not(.js) #wizSubmit { display: inline-flex !important; }
.wizard-step { margin-bottom: 1.5rem; }
.wizard-title { font-size: 1.3rem; margin-bottom: .25rem; }
.wizard-sub { color: var(--muted); margin-bottom: 1.25rem; }

/* Selectable tiles (radio cards) */
.tile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem; }
.tile-grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 575.98px) { .tile-grid { grid-template-columns: repeat(2, 1fr); } .tile-grid-3 { grid-template-columns: 1fr; } }
.tile { display: block; margin: 0; cursor: pointer; }
.tile input { position: absolute; opacity: 0; pointer-events: none; }
.tile-body { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; min-height: 92px; padding: .8rem .6rem; text-align: center; background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius); transition: border-color .12s, background-color .12s, box-shadow .12s; }
.tile-body .icon { width: 1.6rem; height: 1.6rem; color: var(--muted); }
.tile-label { font-weight: 600; font-size: .9rem; line-height: 1.2; }
.tile-hint { font-size: .78rem; color: var(--muted); line-height: 1.25; }
.tile:hover .tile-body { border-color: #aebdca; }
.tile input:focus-visible + .tile-body { outline: 3px solid rgba(59, 92, 118, .35); outline-offset: 2px; }
.tile input:checked + .tile-body { border-color: var(--lodgr); background: #eef2f6; box-shadow: 0 0 0 1px var(--lodgr) inset; }
.tile input:checked + .tile-body .icon { color: var(--lodgr); }
.tile-urgent input:checked + .tile-body { border-color: #c0443b; background: #fbeceb; box-shadow: 0 0 0 1px #c0443b inset; }
.tile-medium input:checked + .tile-body { border-color: #b88a1c; background: #fbf4e2; box-shadow: 0 0 0 1px #b88a1c inset; }
.tile-low input:checked + .tile-body { border-color: #2f7d57; background: #e8f4ed; box-shadow: 0 0 0 1px #2f7d57 inset; }

/* Room chips */
.chip-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: .25rem .75rem; font-size: .82rem; color: var(--text); }
.chip:hover { border-color: var(--lodgr); color: var(--lodgr); }

/* Dropzone + file chips */
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem; padding: 2rem 1rem; text-align: center; border: 2px dashed #b9c6d2; border-radius: var(--radius); background: #fafbfc; color: var(--muted); cursor: pointer; transition: border-color .12s, background-color .12s; }
.dropzone:hover, .dropzone.over { border-color: var(--lodgr); background: #eef2f6; }
.dropzone .icon { width: 2rem; height: 2rem; color: var(--lodgr); }
.dz-main { font-weight: 600; color: var(--text); }
.file-list { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .5rem; }
.file-chip { display: flex; align-items: center; gap: .75rem; padding: .5rem .65rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; min-width: 0; }
.file-chip img, .file-ext { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 6px; object-fit: cover; background: #eef2f6; }
.file-ext { display: inline-flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 700; color: var(--lodgr); }
.file-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.file-name { font-weight: 600; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { font-size: .75rem; color: var(--muted); }
.file-remove { border: 0; background: transparent; font-size: 1.4rem; line-height: 1; color: var(--muted); padding: 0 .4rem; }
.file-remove:hover { color: #a3342c; }

/* Review + nav */
.review-list { margin: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.review-list > div { display: flex; gap: 1rem; padding: .7rem 1rem; border-bottom: 1px solid var(--border); background: #fff; }
.review-list > div:last-child { border-bottom: 0; }
.review-list dt { flex: 0 0 7.5rem; color: var(--muted); font-weight: 600; font-size: .82rem; }
.review-list dd { margin: 0; flex: 1; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 575.98px) { .review-list > div { flex-direction: column; gap: .1rem; } .review-list dt { flex: none; } }
.wizard-nav { display: flex; align-items: center; gap: .6rem; padding-top: 1rem; border-top: 1px solid var(--border); }
@media (max-width: 575.98px) { .wizard-nav .btn-primary, .wizard-nav .btn-success { flex: 1; } }

/* Attachments on the issue pages */
.attach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.attach { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.attach-thumb { aspect-ratio: 4 / 3; background: #eef2f6; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.attach-thumb img { width: 100%; height: 100%; object-fit: cover; }
.attach-thumb .icon { width: 2rem; height: 2rem; color: var(--lodgr); }
.attach-body { padding: .5rem .65rem; font-size: .8rem; min-width: 0; }
.attach-body .file-name { display: block; }
.attach-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: 0 .65rem .6rem; }

.cost-total { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .5rem .25rem; background: #fafbfc; }


/* Add-property wizard */
.photo-preview { width: 100%; max-height: 220px; object-fit: cover; border-radius: var(--radius-sm); }
.dropzone:has(.photo-preview:not(.d-none)) { padding: .75rem; }
.tenant-block { margin-top: .5rem; }
.wizard.js .tenant-block { display: none; }
.wizard.js .tenant-block.active { display: block; animation: slide-in-right .2s ease-out; }
.doc-list { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .65rem; }
.doc-row { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; padding: .7rem .8rem; }
.doc-top { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.doc-fields { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: .6rem; margin-top: .65rem; }
.doc-fields label { font-size: .72rem; font-weight: 600; color: var(--muted); display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
@media (max-width: 575.98px) { .doc-fields { grid-template-columns: 1fr; } }

/* =========================================================
   Properties: list / map toggle, map view, price pins
   ========================================================= */
.view-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.view-toggle a { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .85rem; font-weight: 550; color: var(--muted); text-decoration: none; }
.view-toggle a .icon { width: 1rem; height: 1rem; }
.view-toggle a.active { background: var(--lodgr); color: #fff; }

.map-view { display: grid; grid-template-columns: 360px 1fr; gap: 1rem; height: calc(100vh - 250px); min-height: 520px; }
.map-list { overflow-y: auto; display: flex; flex-direction: column; gap: .6rem; padding-right: .25rem; }
.map-item { display: flex; gap: .75rem; padding: .6rem; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); color: inherit; text-decoration: none; transition: border-color .12s, box-shadow .12s; }
.map-item:hover, .map-item.hl { border-color: var(--lodgr); box-shadow: var(--shadow); text-decoration: none; }
.map-item img { width: 84px; height: 72px; object-fit: cover; border-radius: 6px; background: var(--lodgr-soft); flex: 0 0 84px; }
.map-item-body { display: flex; flex-direction: column; min-width: 0; gap: .1rem; }
.map-item .addr { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-item .sub { color: var(--muted); font-size: .85rem; }
.map-item .rent { font-weight: 650; color: var(--lodgr-dark); font-size: .9rem; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.map-item .rent small { color: var(--muted); font-weight: 500; }
.map-missing { font-size: .75rem; color: #a3342c; }
.map-wrap { position: relative; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; min-height: 360px; }
#propMap { position: absolute; inset: 0; }
.map-status { position: absolute; z-index: 500; left: 50%; bottom: 1rem; transform: translateX(-50%); background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: 999px; padding: .35rem .9rem; font-size: .85rem; max-width: 90%; text-align: center; }
.map-status:empty { display: none; }
.map-legend { position: absolute; z-index: 500; right: .75rem; top: .75rem; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .3rem .6rem; font-size: .78rem; display: flex; gap: .75rem; box-shadow: var(--shadow-sm); }
.map-legend i { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; margin-right: .3rem; vertical-align: -.05rem; }
.map-legend .occ { background: var(--lodgr); }
.map-legend .vac { background: #fff; border: 2px solid #a3342c; }

.map-pin { display: block; overflow: visible; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35)); transform-origin: 50% 100%; transition: transform .12s; }
.map-pin.occ .pin-body { fill: var(--lodgr); stroke: #fff; stroke-width: 2; }
.map-pin.occ .pin-dot { fill: #fff; }
.map-pin.vac .pin-body { fill: #fff; stroke: #a3342c; stroke-width: 2.5; }
.map-pin.vac .pin-dot { fill: #a3342c; }
.map-pin.hl { transform: scale(1.25); }
.map-pin.hl .pin-body { fill: #1f2d3a; stroke: #fff; }
.map-pin.hl .pin-dot { fill: #fff; }
.cluster-pin { width: 38px; height: 38px; border-radius: 50%; background: var(--lodgr); color: #fff; border: 3px solid #fff; box-shadow: 0 1px 5px rgba(0, 0, 0, .4); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; }
.map-popup { min-width: 200px; }
.map-popup img { width: 100%; height: 110px; object-fit: cover; border-radius: 6px; margin-bottom: .5rem; background: var(--lodgr-soft); }
.map-popup .addr { font-weight: 650; }
.map-popup .sub { color: var(--muted); font-size: .82rem; }
.map-popup .rent { font-weight: 650; margin-top: .25rem; }
@media (max-width: 991.98px) {
    .map-view { grid-template-columns: 1fr; height: auto; }
    .map-wrap { order: -1; height: 60vh; min-height: 320px; }
    .map-list { max-height: none; overflow: visible; }
}

/* My account: header card + tabs */
.account-page { max-width: 820px; }
.avatar-lg { width: 52px; height: 52px; flex-basis: 52px; font-size: 1.05rem; }
.account-page .tab-content { padding: 1.5rem; }
.account-page .nav-tabs .icon { width: 1rem; height: 1rem; margin-right: .25rem; vertical-align: -.15em; }

/* Sign-up */
.auth-card.auth-card-wide { max-width: 600px; }
.signup-plan { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fafbfc; padding: .75rem 1rem; }
.signup-h { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin-bottom: .75rem; }

/* Issue conversation */
.thread { display: flex; flex-direction: column; gap: .85rem; }
.thread-sys { text-align: center; font-size: .8rem; color: var(--muted); }
.thread-empty { text-align: center; padding: .25rem 0; }
.msg { max-width: 88%; align-self: flex-start; background: #f3f5f8; border: 1px solid var(--border); border-radius: 10px; padding: .65rem .85rem; }
.msg.mine { align-self: flex-end; background: #eef5ff; border-color: #cfe0f7; }
.msg.note { background: #fff8e6; border-color: #f0dca0; border-style: dashed; }
.msg-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .85rem; margin-bottom: .25rem; }
.msg-meta .pill { font-size: .68rem; }
.msg-meta .icon { width: .8rem; height: .8rem; margin-right: .2rem; }
.msg-time { color: var(--muted); font-size: .78rem; margin-left: auto; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-files { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.msg-thumb img { width: 96px; height: 72px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); display: block; }
.msg-file { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; padding: .25rem .55rem; background: #fff; border: 1px solid var(--border); border-radius: 6px; }
.reply-form { border-top: 1px solid var(--border); margin-top: 1.25rem; padding-top: 1rem; }
@media (max-width: 575.98px) { .msg { max-width: 100%; } }

/* Unread markers */
.unread-dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: #e52920; margin-right: .45rem; vertical-align: .08em; }
.nav-badge { margin-left: auto; min-width: 1.35rem; padding: .05rem .4rem; border-radius: 999px; background: #e52920; color: #fff; font-size: .72rem; font-weight: 700; text-align: center; line-height: 1.35; }
.msg.new { box-shadow: 0 0 0 2px rgba(229, 41, 32, .35); }

/* Settings (preferences) */
.prefs-section { margin-bottom: 1.5rem; }
.prefs-title { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin-bottom: .25rem; }
.pref-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid var(--border); }
.pref-row:last-child { border-bottom: 0; }
.pref-label { font-weight: 600; margin: 0; }
.pref-help { color: var(--muted); font-size: .85rem; }
.pref-control { flex: 0 0 auto; }
.pref-control .form-switch .form-check-input { width: 2.4rem; height: 1.3rem; }
.pref-control .form-select { min-width: 10.5rem; }

.resolve-box { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); background: #fafbfc; }
