/*
========================================================================
   PROPERTYHUB — DESIGN SYSTEM EXTENSIONS
   Built on top of the Spark Admin theme (assets/css/main.css).
   Uses the theme tokens only; main.css itself is never modified.
========================================================================

   1. Utilities
   2. Sidebar additions (scroll area, submenus, section spacing)
   3. Navbar additions (global search results, role chip)
   4. Status badges (all colour keys used by App\Enums\*::color())
   5. Stat cards with icons & KPI tiles
   6. Cards, detail lists & tabs
   7. Filter bar & table helpers
   8. Forms (errors, required marker, file input)
   9. Empty states, loaders & skeletons
  10. Toasts & modals
  11. Property cards & avatars
  12. Timeline
  13. Auth pages
  14. Placeholder (upcoming module) page
--------------------------------------------------------------------- */

/* 1. Utilities ------------------------------------------------------ */
.text-main { color: var(--text-main) !important; }
.text-muted-green { color: var(--text-muted-green) !important; }
.text-forest { color: var(--brand-forest-medium) !important; }
.bg-canvas { background-color: var(--bs-body-bg) !important; }
.bg-lime-soft { background-color: var(--brand-lime-translucent) !important; }
.bg-forest { background-color: var(--brand-forest-medium) !important; }
.fw-800 { font-weight: 800 !important; }
.fs-sm { font-size: 0.85rem !important; }
.rounded-xl { border-radius: var(--radius-xl) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.min-w-0 { min-width: 0 !important; }
.gap-xs { gap: 0.35rem !important; }
.cursor-pointer { cursor: pointer; }
.link-forest { color: var(--brand-forest-medium); font-weight: 600; }
.link-forest:hover { color: var(--brand-forest-dark); text-decoration: underline; }
.divider { height: 1px; background: var(--border-light); margin: 1.25rem 0; }

/* 2. Sidebar additions ---------------------------------------------- */
.sidebar-wrapper { padding-bottom: 1.25rem; }
.sidebar-brand { margin-bottom: 1.75rem; }
.sidebar-brand-sub {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-sidebar-muted);
    margin-top: 0.1rem;
}
.sidebar-nav {
    flex-grow: 1;
    overflow-y: auto;
    margin: 0 -1.5rem;
    padding: 0 1.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); }
.sidebar-menu-section { margin-bottom: 1.25rem; }
.sidebar-menu-link { padding: 0.65rem 0.85rem; font-size: 0.9rem; }
.sidebar-menu-link.is-open { color: #FFFFFF; }
.sidebar-submenu { padding-left: 2.35rem; margin: 0.15rem 0 0.35rem; }
.sidebar-submenu-link { padding: 0.4rem 0; font-size: 0.85rem; position: relative; }
.sidebar-submenu-link::before {
    content: '';
    position: absolute;
    left: -0.95rem;
    top: 50%;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--text-sidebar-muted);
    opacity: 0.35;
    transform: translateY(-50%);
}
.sidebar-submenu-link.active { color: var(--brand-lime); font-weight: 600; }
.sidebar-submenu-link.active::before { background: var(--brand-lime); opacity: 1; }
.sidebar-profile { margin-top: 1rem; text-decoration: none; }
.sidebar-profile:hover { background-color: rgba(255, 255, 255, 0.06); color: #FFFFFF; }
.sidebar-profile-role {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--brand-lime);
}
body.sidebar-minimized .sidebar-brand-sub { display: none; }
@media (min-width: 1201px) {
    body.sidebar-minimized .sidebar-nav { margin: 0 -0.75rem; padding: 0 0.75rem; }
}

/* 3. Navbar additions ----------------------------------------------- */
.navbar-search-wrapper { position: relative; }
.navbar-search-form { width: 100%; }
.dropdown-menu-profile { width: min(18rem, calc(100vw - 2rem)); }
.dropdown-signed-in-email {
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-weight: 700;
    color: var(--text-main);
    overflow-wrap: anywhere;
    word-break: break-word;
}
.navbar-role-chip {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--brand-forest-medium);
    background: var(--brand-lime-translucent);
    padding: 0.3rem 0.65rem;
    border-radius: 50rem;
    white-space: nowrap;
}
.navbar-action-badge.count {
    width: auto;
    height: auto;
    min-width: 18px;
    padding: 0 5px;
    font-size: 0.65rem;
    font-weight: 800;
    line-height: 18px;
    border-radius: 50rem;
    color: var(--brand-forest-dark);
    text-align: center;
    top: 2px;
    right: 0;
}
.notification-empty { padding: 2rem 1rem; text-align: center; color: var(--text-muted-green); font-size: 0.85rem; }

/* 4. Status badges -------------------------------------------------- */
.badge-table.info { background-color: rgba(14, 165, 233, 0.1); color: #0284C7; }
.badge-table.info::before { background-color: #0EA5E9; }
.badge-table.neutral { background-color: rgba(100, 116, 139, 0.1); color: #475569; }
.badge-table.neutral::before { background-color: #94A3B8; }
.badge-table.primary { background-color: rgba(7, 47, 31, 0.08); color: var(--brand-forest-medium); }
.badge-table.primary::before { background-color: var(--brand-forest-medium); }
.badge-table.lime { background-color: rgba(180, 241, 5, 0.22); color: #3F5A00; }
.badge-table.lime::before { background-color: #7FAE00; }
.badge-table.warning { background-color: rgba(249, 115, 22, 0.1); color: var(--sys-orange); }
.badge-table.warning::before { background-color: var(--sys-orange); }
.badge-table.danger { background-color: rgba(239, 68, 68, 0.1); color: var(--sys-red); }
.badge-table.danger::before { background-color: var(--sys-red); }
.badge-table.no-dot::before { display: none; }
.badge-table.lg { font-size: 0.8rem; padding: 0.35rem 0.85rem; }

/* 5. Stat cards & KPI tiles ----------------------------------------- */
.stat-card { height: 100%; display: flex; flex-direction: column; justify-content: space-between; margin-bottom: 0; }
.stat-card .stat-value { font-size: 1.65rem; margin-bottom: 0.5rem; }
.stat-card .stat-label { margin-bottom: 0.35rem; }
.stat-card-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    background: var(--brand-forest-dark);
    color: var(--brand-lime);
}
.stat-card-icon.soft { background: var(--brand-lime-translucent); color: var(--brand-forest-medium); }
.stat-card-icon.orange { background: var(--sys-orange-bg); color: var(--sys-orange); }
.stat-card-icon.red { background: var(--sys-red-bg); color: var(--sys-red); }
.stat-card-icon.green { background: var(--sys-green-bg); color: #15803D; }
.stat-card-icon.blue { background: #E0F2FE; color: #0284C7; }
.stat-meta { font-size: 0.78rem; color: var(--text-muted-green); font-weight: 500; }
.stat-meta strong { color: var(--text-main); }
.alert-green-card .stat-value-lg { font-size: 2.1rem; font-weight: 800; color: #FFFFFF; letter-spacing: -0.03em; line-height: 1.1; }
.alert-green-card .alert-green-kpis { display: flex; gap: 1.5rem; margin-top: 1rem; flex-wrap: wrap; }
.alert-green-card .alert-green-kpi-label { font-size: 0.72rem; color: var(--text-sidebar-muted); font-weight: 600; }
.alert-green-card .alert-green-kpi-value { font-size: 1rem; color: #FFFFFF; font-weight: 700; }
.kpi-tile {
    background: var(--bs-body-bg);
    border-radius: var(--radius-lg);
    padding: 1rem 1.1rem;
    height: 100%;
}
.kpi-tile-label { font-size: 0.75rem; color: var(--text-muted-green); font-weight: 600; margin-bottom: 0.25rem; }
.kpi-tile-value { font-size: 1.2rem; font-weight: 800; color: var(--text-main); letter-spacing: -0.02em; }
.progress.progress-thin { height: 6px; }
.progress-bar.bg-forest { background-color: var(--brand-forest-medium) !important; }

/* 6. Cards, detail lists & tabs ------------------------------------- */
.card.card-flush { padding: 0; }
.card.card-compact { padding: 1.25rem; }
.card .card-subtitle { font-size: 0.8rem; color: var(--text-muted-green); font-weight: 500; margin-top: 0.15rem; }
.card-link-more { font-size: 0.8rem; font-weight: 700; color: var(--brand-forest-medium); display: inline-flex; align-items: center; gap: 0.3rem; }
.card-link-more:hover { color: var(--brand-forest-dark); }
.card-link-more i { transition: transform 0.2s; }
.card-link-more:hover i { transform: translateX(3px); }
.detail-list { display: grid; grid-template-columns: minmax(130px, 38%) 1fr; gap: 0.75rem 1rem; margin: 0; font-size: 0.875rem; }
.detail-list dt { color: var(--text-muted-green); font-weight: 600; }
.detail-list dd { margin: 0; color: var(--text-main); font-weight: 600; word-break: break-word; }
.nav-tabs-custom { border-bottom: 1px solid var(--border-light); gap: 0.25rem; flex-wrap: nowrap; overflow-x: auto; margin-bottom: 1.5rem; }
.nav-tabs-custom .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted-green);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
    white-space: nowrap;
    background: none;
}
.nav-tabs-custom .nav-link:hover { color: var(--text-main); }
.nav-tabs-custom .nav-link.active { color: var(--brand-forest-medium); border-bottom-color: var(--brand-lime); background: none; }
.nav-tabs-custom .nav-link .count { font-size: 0.7rem; background: var(--bs-body-bg); border-radius: 50rem; padding: 0.1rem 0.45rem; margin-left: 0.35rem; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.85rem 0; border-bottom: 1px solid var(--border-light); }
.list-row:last-child { border-bottom: none; padding-bottom: 0; }
.list-row:first-child { padding-top: 0; }

/* 7. Filter bar & table helpers ------------------------------------- */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.filter-bar .form-select-custom,
.filter-bar .form-control-custom { width: auto; min-width: 160px; padding-top: 0.5rem; padding-bottom: 0.5rem; font-size: 0.85rem; }
.table-custom td { font-size: 0.875rem; }
.table-custom td.text-wrap { white-space: normal; }
.table-custom tfoot td { background: #F8FAF9; font-weight: 700; border-top: 1px solid rgba(11, 19, 15, 0.08); }
.table-custom a.table-link { color: var(--text-main); font-weight: 700; }
.table-custom a.table-link:hover { color: var(--brand-forest-medium); text-decoration: underline; }
.table-sort { color: inherit; display: inline-flex; align-items: center; gap: 0.25rem; }
.table-sort:hover { color: var(--text-main); }
.table-card-custom .card-header-inline { padding: 1.25rem; border-bottom: 1px solid rgba(11, 19, 15, 0.06); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.table-footer-control .pagination { margin-bottom: 0; gap: 0.25rem; }
.table-footer-control .pagination .page-link { border: none; min-width: 34px; text-align: center; font-size: 0.85rem; font-weight: 600; }

/* 8. Forms ---------------------------------------------------------- */
.form-label-custom .required { color: var(--sys-red); margin-left: 0.15rem; }
.form-hint { display: block; font-size: 0.75rem; color: var(--text-muted-green); margin-top: 0.35rem; }
.form-control-custom.is-invalid-custom,
.form-select-custom.is-invalid-custom { border-color: var(--sys-red); }
.form-control-custom.is-invalid-custom:focus,
.form-select-custom.is-invalid-custom:focus { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1); }
.form-feedback-custom { display: flex; align-items: center; gap: 0.35rem; font-size: 0.78rem; font-weight: 600; margin-top: 0.4rem; }
.form-feedback-custom.invalid-custom { color: var(--sys-red); }
input[type="file"].form-control-custom { padding: 0.45rem 0.75rem; }
input[type="file"].form-control-custom::file-selector-button {
    border: none;
    background: var(--brand-forest-medium);
    color: #FFFFFF;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-md);
    margin-right: 0.75rem;
    cursor: pointer;
}
.form-section-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.25rem; }
.form-section-desc { font-size: 0.8rem; color: var(--text-muted-green); margin-bottom: 1.25rem; }
.form-actions { display: flex; justify-content: flex-end; gap: 0.75rem; flex-wrap: wrap; padding-top: 1.25rem; border-top: 1px solid var(--border-light); margin-top: 0.5rem; }
.form-check-custom .form-check-label, .form-switch-custom .form-switch-label { font-size: 0.875rem; cursor: pointer; }
.choice-card {
    display: block;
    border: 1px solid rgba(11, 19, 15, 0.1);
    border-radius: var(--radius-lg);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    height: 100%;
}
.choice-card:hover { border-color: var(--brand-forest-medium); }
.choice-card input { display: none; }
.choice-card:has(input:checked) { border-color: var(--brand-forest-medium); background: rgba(180, 241, 5, 0.08); box-shadow: 0 0 0 3px rgba(7, 47, 31, 0.06); }
.choice-card-title { font-weight: 700; font-size: 0.9rem; }
.choice-card-desc { font-size: 0.78rem; color: var(--text-muted-green); margin-top: 0.2rem; }

/* 9. Empty states, loaders & skeletons ------------------------------ */
.empty-state { text-align: center; padding: 3rem 1.5rem; }
.empty-state-icon-wrap {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--bs-body-bg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: var(--text-muted-green);
    margin-bottom: 1rem;
}
.empty-state-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.35rem; }
.empty-state-text { font-size: 0.85rem; color: var(--text-muted-green); max-width: 420px; margin: 0 auto 1.25rem; }
.btn-custom.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn-custom.is-loading::after {
    content: '';
    position: absolute;
    width: 1rem;
    height: 1rem;
    border: 2px solid currentColor;
    border-color: #FFFFFF #FFFFFF transparent transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.btn-custom-light.is-loading::after, .btn-custom-secondary.is-loading::after { border-color: var(--brand-forest-dark) var(--brand-forest-dark) transparent transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, #EEF2F0 25%, #F6F8F7 50%, #EEF2F0 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius-md); }
@keyframes shimmer { to { background-position: -200% 0; } }
.page-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--brand-lime); z-index: 2000; transition: width 0.4s ease; }
.page-progress.active { width: 70%; }

/* 10. Toasts & modals ----------------------------------------------- */
.toast-stack { position: fixed; top: 1.25rem; right: 1.25rem; z-index: 1090; display: flex; flex-direction: column; gap: 0.75rem; max-width: 380px; width: calc(100% - 2.5rem); }
.toast-custom {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: #FFFFFF;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 0.95rem 1rem;
    border-left: 4px solid var(--brand-forest-medium);
    animation: toastIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.875rem;
}
.toast-custom.success { border-left-color: var(--sys-green); }
.toast-custom.error { border-left-color: var(--sys-red); }
.toast-custom.warning { border-left-color: var(--sys-orange); }
.toast-custom.hiding { opacity: 0; transform: translateX(20px); transition: all 0.25s; }
.toast-custom-icon { font-size: 1.15rem; line-height: 1.3; }
.toast-custom.success .toast-custom-icon { color: var(--sys-green); }
.toast-custom.error .toast-custom-icon { color: var(--sys-red); }
.toast-custom.warning .toast-custom-icon { color: var(--sys-orange); }
.toast-custom-body { flex-grow: 1; }
.toast-custom-title { font-weight: 700; margin-bottom: 0.1rem; }
.toast-custom-close { background: none; border: none; color: var(--text-muted-green); padding: 0; line-height: 1; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
.modal-content { border: none; border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); }
.modal-header { border-bottom: 1px solid var(--border-light); padding: 1.25rem 1.5rem; }
.modal-title { font-weight: 700; font-size: 1.05rem; }
.modal-body { padding: 1.5rem; }
.modal-footer { border-top: 1px solid var(--border-light); padding: 1rem 1.5rem; gap: 0.5rem; }
.modal-footer > * { margin: 0; }
.modal-backdrop.show { opacity: 0.45; background-color: var(--brand-forest-dark); }
.confirm-icon { width: 56px; height: 56px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; background: var(--sys-red-bg); color: var(--sys-red); margin-bottom: 1rem; }
.confirm-icon.primary { background: var(--brand-lime-translucent); color: var(--brand-forest-medium); }

/* 11. Property cards & avatars -------------------------------------- */
.avatar-initials {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
    background: var(--brand-forest-dark);
    color: var(--brand-lime);
    flex-shrink: 0;
    letter-spacing: 0.02em;
}
.avatar-initials.sm { width: 30px; height: 30px; font-size: 0.7rem; border-radius: var(--radius-md); }
.avatar-initials.lg { width: 64px; height: 64px; font-size: 1.25rem; border-radius: var(--radius-xl); }
.avatar-initials.soft { background: var(--brand-lime-translucent); color: var(--brand-forest-medium); }
.property-thumb {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
    background: var(--brand-forest-dark);
    color: var(--brand-lime);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    overflow: hidden;
}
.property-thumb img { width: 100%; height: 100%; object-fit: cover; }
.property-card { padding: 0; height: 100%; display: flex; flex-direction: column; margin-bottom: 0; transition: transform 0.2s, box-shadow 0.2s; }
.property-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.property-card-cover {
    height: 130px;
    background: linear-gradient(135deg, var(--brand-forest-dark), var(--brand-forest-light));
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(180, 241, 5, 0.85);
    font-size: 2.5rem;
    overflow: hidden;
}
.property-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.property-card-cover .badge-table { position: absolute; top: 0.85rem; left: 0.85rem; background: rgba(255, 255, 255, 0.92); }
.property-card-body { padding: 1.25rem 1.35rem; flex-grow: 1; display: flex; flex-direction: column; }
.property-card-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.2rem; color: var(--text-main); }
.property-card-address { font-size: 0.78rem; color: var(--text-muted-green); margin-bottom: 1rem; }
.property-card-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-top: auto; }
.property-card-stat { background: var(--bs-body-bg); border-radius: var(--radius-md); padding: 0.5rem; text-align: center; }
.property-card-stat-value { font-weight: 800; font-size: 0.95rem; }
.property-card-stat-label { font-size: 0.68rem; color: var(--text-muted-green); font-weight: 600; }

/* 12. Timeline ------------------------------------------------------ */
.timeline { position: relative; padding-left: 1.75rem; margin: 0; list-style: none; }
.timeline::before { content: ''; position: absolute; left: 0.45rem; top: 0.35rem; bottom: 0.35rem; width: 2px; background: var(--border-light); }
.timeline-item { position: relative; padding-bottom: 1.25rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot { position: absolute; left: -1.75rem; top: 0.2rem; width: 0.95rem; height: 0.95rem; border-radius: 50%; background: #FFFFFF; border: 3px solid var(--brand-forest-medium); }
.timeline-dot.lime { border-color: #7FAE00; }
.timeline-dot.orange { border-color: var(--sys-orange); }
.timeline-dot.red { border-color: var(--sys-red); }
.timeline-dot.green { border-color: var(--sys-green); }
.timeline-title { font-weight: 700; font-size: 0.875rem; }
.timeline-meta { font-size: 0.75rem; color: var(--text-muted-green); }
.timeline-body { font-size: 0.85rem; margin-top: 0.35rem; color: var(--text-main); }

/* 13. Auth pages ---------------------------------------------------- */
.login-card.login-card-wide { max-width: 560px; }
.login-card .alert-custom { font-size: 0.82rem; }
.login-input.is-invalid-custom { border-color: var(--sys-red); }
.login-feedback { color: var(--sys-red); font-size: 0.78rem; font-weight: 600; margin-top: 0.35rem; display: block; }
.login-demo { margin-top: 1.5rem; padding: 1rem; background: var(--bs-body-bg); border-radius: var(--radius-lg); font-size: 0.78rem; }
.login-demo-title { font-weight: 700; margin-bottom: 0.5rem; color: var(--text-main); }
.login-demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem 0.75rem; }
.login-demo button { background: none; border: none; padding: 0; color: var(--brand-forest-medium); font-weight: 600; text-align: left; font-size: 0.78rem; }
.login-demo button:hover { text-decoration: underline; }

/* 14. Placeholder page ---------------------------------------------- */
.upcoming-card { text-align: center; padding: 4rem 2rem; }
.upcoming-card .bi-asterisk { font-size: 3rem; color: var(--brand-lime); display: inline-block; animation: asteriskSpin 20s infinite linear; }

/* Responsive tweaks ------------------------------------------------- */
@media (max-width: 1200px) {
    .navbar-role-chip { display: none; }
}
@media (max-width: 576px) {
    .card { padding: 1.25rem; border-radius: var(--radius-xl); }
    .page-title { font-size: 1.4rem; }
    .detail-list { grid-template-columns: 1fr; gap: 0.15rem; }
    .detail-list dd { margin-bottom: 0.6rem; }
    .filter-bar .form-select-custom, .filter-bar .form-control-custom { width: 100%; }
}
@media print {
    .sidebar-wrapper, .navbar-custom, .footer-custom, .page-header .btn-custom, .no-print { display: none !important; }
    .main-wrapper { margin: 0 !important; padding: 0 !important; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}

/* Auth footer line breathing room below the primary button */
.login-card form + .login-footer-text { margin-top: 1.25rem; }

/* Compact inline filters inside the theme table toolbar */
.table-filter-group .form-select-custom,
.table-filter-group .form-control-custom {
    width: auto;
    min-width: 140px;
    max-width: 220px;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
    font-size: 0.82rem;
    border-radius: var(--radius-lg);
}
.table-filter-group .form-select-custom { padding-right: 2.25rem; }
.table-header-control .table-search-box { min-width: 220px; }
@media (max-width: 576px) {
    .table-filter-group { width: 100%; }
    .table-filter-group .form-select-custom,
    .table-filter-group .form-control-custom { flex: 1 1 calc(50% - 0.75rem); max-width: none; min-width: 0; }
}

/* Dense listings: tighter cells so every column fits beside the sidebar */
.table-custom.table-compact th,
.table-custom.table-compact td { padding: 0.8rem 0.85rem; }
.table-custom.table-compact th:first-child,
.table-custom.table-compact td:first-child { padding-left: 1.25rem; }

/* Switch / checkbox hints sit on their own line under the label, not squeezed beside it */
.form-switch-custom, .form-check-custom { flex-wrap: wrap; }
.form-switch-custom > .form-hint, .form-check-custom > .form-hint { flex-basis: 100%; margin-left: 0 !important; margin-top: 0.25rem; }
.form-switch-custom > .form-switch-label, .form-check-custom > .form-check-label { flex: 1 1 0; min-width: 0; }

/* ---------------------------------------------------------------
   Maintenance: progress stepper, photo gallery, timeline chat
   --------------------------------------------------------------- */
.stepper { display: flex; gap: 0.25rem; list-style: none; margin: 0; padding: 0; overflow-x: auto; }
.stepper-step { flex: 1 1 0; min-width: 88px; text-align: center; position: relative; padding-top: 1.9rem; font-size: 0.75rem; color: var(--text-muted-green); }
.stepper-step::before { content: ''; position: absolute; top: 0.6rem; left: -50%; right: 50%; height: 3px; background: var(--border-light); }
.stepper-step:first-child::before { display: none; }
.stepper-dot { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 1.5rem; height: 1.5rem; border-radius: 50%; background: #FFFFFF; border: 3px solid var(--border-light); display: grid; place-items: center; font-size: 0.7rem; z-index: 1; }
.stepper-step.done::before, .stepper-step.current::before { background: #7FAE00; }
.stepper-step.done .stepper-dot { background: var(--brand-lime); border-color: var(--brand-lime); color: var(--brand-forest-medium); }
.stepper-step.current .stepper-dot { border-color: var(--brand-forest-medium); background: var(--brand-forest-medium); color: var(--brand-lime); }
.stepper-step.done, .stepper-step.current { color: var(--text-main); font-weight: 600; }
.stepper-step.stopped .stepper-dot { border-color: var(--sys-red); background: var(--sys-red); color: #FFFFFF; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 0.75rem; }
.photo-tile { position: relative; display: block; aspect-ratio: 1; border-radius: var(--radius-md); overflow: hidden; background: var(--bs-body-bg); border: 1px solid var(--border-light); }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s ease; }
.photo-tile:hover img { transform: scale(1.04); }
.photo-tag { position: absolute; left: 0.4rem; top: 0.4rem; padding: 0.1rem 0.45rem; border-radius: 50rem; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: rgba(7, 47, 31, .85); color: var(--brand-lime); }
.photo-tag.after { background: var(--brand-lime); color: var(--brand-forest-medium); }
.file-tile { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.75rem; border: 1px solid var(--border-light); border-radius: var(--radius-md); color: inherit; text-decoration: none; }
.file-tile:hover { border-color: var(--brand-lime); }
@media (prefers-reduced-motion: reduce) { .photo-tile img { transition: none; } }

.timeline-item.internal .timeline-body { background: #FFF8E6; border-radius: var(--radius-sm); padding: 0.5rem 0.65rem; }
.timeline-item .timeline-photos { display: flex; gap: 0.4rem; margin-top: 0.4rem; flex-wrap: wrap; }
.upload-hint { font-size: 0.75rem; color: var(--text-muted-green); }
.material-row + .material-row { margin-top: 0.5rem; }

/* Selectable tiles (radio inputs styled as cards), e.g. the tenant's issue category picker */
.choice-tile { display: flex; align-items: center; gap: 0.5rem; width: 100%; padding: 0.6rem 0.75rem; border: 1px solid var(--border-light); border-radius: var(--radius-md); background: #FFFFFF; color: var(--text-main); font-size: 0.85rem; cursor: pointer; transition: border-color .15s ease, background-color .15s ease; }
.choice-tile:hover { border-color: var(--brand-lime-hover); }
.btn-check:checked + .choice-tile { border-color: #7FAE00; background: var(--brand-lime-translucent); font-weight: 600; }
.btn-check:focus-visible + .choice-tile { box-shadow: 0 0 0 3px var(--brand-lime-translucent); }
@media (prefers-reduced-motion: reduce) { .choice-tile { transition: none; } }

/* Inspection checklist: condition pills per area */
.cond-group { display: flex; flex-wrap: nowrap; gap: 0.2rem; }
.cond-pill { padding: 0.2rem 0.5rem; white-space: nowrap; border: 1px solid var(--border-light); border-radius: 50rem; font-size: 0.75rem; font-weight: 600; color: var(--text-muted-green); background: #FFFFFF; cursor: pointer; user-select: none; }
.cond-pill:hover { border-color: var(--brand-lime-hover); }
.btn-check:checked + .cond-pill { background: var(--brand-lime-translucent); border-color: #7FAE00; color: var(--text-main); }
.btn-check:checked + .cond-pill.poor { background: #FEF3C7; border-color: #F59E0B; }
.btn-check:checked + .cond-pill.damaged { background: var(--sys-red-bg); border-color: var(--sys-red); color: #B42318; }
.btn-check:focus-visible + .cond-pill { box-shadow: 0 0 0 3px var(--brand-lime-translucent); }
.checklist-row { display: grid; grid-template-columns: minmax(110px, 1fr) max-content minmax(110px, 1.3fr) max-content; gap: 0.75rem; align-items: center; padding: 0.75rem 0; border-bottom: 1px solid var(--border-light); }
.checklist-row:last-child { border-bottom: 0; }
.checklist-row.flagged { background: linear-gradient(90deg, rgba(239, 68, 68, .06), transparent); }
@media (max-width: 1200px) { .checklist-row { grid-template-columns: 1fr max-content; } .checklist-row > :nth-child(2) { grid-column: 1 / -1; order: 3; } .checklist-row > :nth-child(3) { grid-column: 1 / -1; order: 4; } }
@media (max-width: 576px) { .cond-group { flex-wrap: wrap; } }

/* Conversation threads (complaints & inquiries) */
.thread { display: flex; flex-direction: column; gap: 1rem; }
.thread-msg { display: flex; gap: 0.75rem; max-width: 88%; }
.thread-msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.thread-avatar { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; background: var(--brand-lime-translucent); color: var(--brand-forest-medium); }
.thread-msg.staff .thread-avatar { background: var(--brand-forest-medium); color: var(--brand-lime); }
.thread-bubble { min-width: 0; padding: 0.75rem 0.9rem; border-radius: var(--radius-lg); background: var(--bs-body-bg); border: 1px solid var(--border-light); }
.thread-msg.mine .thread-bubble { background: rgba(180, 241, 5, 0.12); border-color: rgba(127, 174, 0, 0.35); }
.thread-msg.internal .thread-bubble { background: #FFF8E6; border-color: #F5D98B; border-style: dashed; }
.thread-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; font-size: 0.75rem; color: var(--text-muted-green); margin-bottom: 0.3rem; }
.thread-meta strong { color: var(--text-main); font-size: 0.8rem; }
.thread-body { font-size: 0.875rem; color: var(--text-main); white-space: pre-line; word-break: break-word; }
.thread-event { align-self: center; font-size: 0.75rem; color: var(--text-muted-green); background: var(--bs-body-bg); border-radius: 50rem; padding: 0.2rem 0.75rem; }
@media (max-width: 576px) { .thread-msg { max-width: 100%; } }

/* Document rows and sharing chips */
.doc-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0; border-bottom: 1px solid var(--border-light); }
.doc-row:last-child { border-bottom: 0; padding-bottom: 0; }
.doc-row:first-child { padding-top: 0; }
.doc-icon { flex: 0 0 38px; width: 38px; height: 38px; border-radius: var(--radius-md); display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; background: var(--brand-lime-translucent); color: var(--brand-forest-medium); }
.share-chip { display: inline-flex; align-items: center; gap: 0.2rem; font-size: 0.7rem; font-weight: 600; padding: 0.05rem 0.45rem; border-radius: 50rem; background: rgba(14, 165, 233, 0.1); color: #0284C7; }
.share-chip.internal { background: rgba(100, 116, 139, 0.1); color: #475569; }

/* Notice board */
.notice-card { border-left: 4px solid var(--border-light); }
.notice-card.pinned { border-left-color: var(--sys-orange); }
.notice-body { font-size: 0.9rem; white-space: pre-line; color: var(--text-main); }

/* Reports hub */
.report-card { transition: border-color .15s ease, transform .15s ease; border: 1px solid transparent; }
.report-card:hover { border-color: var(--brand-lime); transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .report-card { transition: none; } .report-card:hover { transform: none; } }

/* Sidebar counts on grouped items and sub-items */
.sidebar-submenu-link { display: flex; align-items: center; gap: 0.5rem; }
.sidebar-submenu-link .sidebar-menu-badge { font-size: 0.68rem; padding: 0.05rem 0.45rem; margin-right: 0.5rem; }
.sidebar-menu-link .sidebar-menu-badge + .dropdown-caret { margin-left: 0.35rem; }

/* Dashboard "Needs attention" chips */
.attention-chip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.75rem; border-radius: 50rem; font-size: 0.8rem; font-weight: 600; text-decoration: none; border: 1px solid var(--border-light); color: var(--text-main); background: #FFFFFF; }
.attention-chip strong { background: var(--bs-body-bg); border-radius: 50rem; padding: 0 0.45rem; }
.attention-chip.warning { border-color: rgba(249, 115, 22, 0.35); } .attention-chip.warning i { color: var(--sys-orange); }
.attention-chip.danger { border-color: rgba(239, 68, 68, 0.35); } .attention-chip.danger i { color: var(--sys-red); }
.attention-chip.info i { color: #0284C7; }
.attention-chip:hover { border-color: var(--brand-lime); color: var(--text-main); }
