/* ============================================================
   RealAssist — Design System
   Premium Indian fintech aesthetic (Zerodha Kite / Jupiter Money)
   ============================================================ */

:root {
    /* Palette */
    --color-base:     #0f172a;   /* deep navy — sidebar */
    --color-surface:  #f8fafc;   /* off-white — page bg */
    --color-card:     #ffffff;
    --color-accent:   #f59e0b;   /* warm amber — CTAs, highlights */
    --color-positive: #16a34a;   /* raise signal */
    --color-warning:  #d97706;   /* hold signal */
    --color-negative: #dc2626;   /* lower signal */
    --color-muted:    #64748b;   /* secondary text */
    --color-border:   #e2e8f0;

    /* Typography */
    --font-sans: 'Plus Jakarta Sans', -apple-system, sans-serif;
    --font-mono: 'DM Mono', 'Fira Mono', ui-monospace, monospace;

    --text-xs:   clamp(0.7rem,  1.5vw, 0.75rem);
    --text-sm:   clamp(0.8rem,  1.8vw, 0.875rem);
    --text-base: clamp(0.9rem,  2vw,   1rem);
    --text-lg:   clamp(1rem,    2.5vw, 1.125rem);
    --text-2xl:  clamp(1.4rem,  3.5vw, 1.75rem);
    --text-4xl:  clamp(2rem,    5vw,   2.75rem);

    /* Semantic aliases */
    --color-success: #16a34a;   /* alias of --color-positive */
    --color-red:     #dc2626;   /* alias of --color-negative */

    /* Border radius scale */
    --radius:    8px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Sidebar */
    --sidebar-width: 220px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    background: var(--color-surface);
    color: var(--color-base);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ============================================================
   App Shell
   ============================================================ */

.app-shell {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--color-base);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 10;
    padding: 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1.5rem 1.25rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.logo-mark {
    background: var(--color-accent);
    color: var(--color-base);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.4rem;
    border-radius: 4px;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.logo-text {
    color: #fff;
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem;
    border-radius: 6px;
    font-size: var(--text-sm);
    font-weight: 500;
    color: rgba(255,255,255,0.55);
    transition: color 0.15s, background 0.15s, opacity 0.15s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.nav-item svg { flex-shrink: 0; }

.nav-item:hover {
    color: rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.06);
    opacity: 1;
}

.nav-item--active {
    color: #fff;
    background: rgba(255,255,255,0.08);
    border-left: 2px solid var(--color-accent);
    padding-left: calc(0.75rem - 2px);
}

.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.07);
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem;
}

.user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--color-accent);
    color: var(--color-base);
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-info { min-width: 0; }

.user-email {
    font-size: var(--text-xs);
    color: rgba(255,255,255,0.45);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
}

.nav-item--logout { color: rgba(255,255,255,0.4); }

/* ---- Main content ---- */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 2rem 2.5rem;
    min-width: 0;
}

/* ---- Mobile top bar (hidden on desktop) ---- */
.mobile-topbar {
    display: none;
}

.hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-base);
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
}

.mobile-brand {
    font-weight: 700;
    font-size: var(--text-base);
    letter-spacing: -0.01em;
}

/* ---- Sidebar backdrop (mobile) ---- */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9;
}

.sidebar-backdrop.backdrop--visible {
    display: block;
}

/* ---- Mobile breakpoint ---- */
@media (max-width: 680px) {
    .mobile-topbar {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.75rem 0;
        margin-bottom: 1rem;
        border-bottom: 1px solid var(--color-border);
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

    .sidebar.sidebar--open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 1.25rem 1rem;
    }
}

/* ============================================================
   Page layout pieces
   ============================================================ */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    gap: 1rem;
}

.page-header-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    align-items: flex-start;
    padding-top: 0.2rem;
}

.back-link {
    font-size: var(--text-sm);
    color: var(--color-muted);
    display: inline-block;
    margin-bottom: 0.1rem;
    transition: color 0.15s;
}

.back-link:hover { color: var(--color-base); }

.page-title {
    font-size: var(--text-2xl);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
    color: var(--color-base);
}

.page-subtitle {
    font-size: var(--text-sm);
    color: var(--color-muted);
    margin-top: 0.25rem;
}

.section-header {
    margin-bottom: 0.5rem;
}

.section-label {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-muted);
}

.section-label-count {
    font-size: var(--text-xs);
    color: var(--color-muted);
    font-weight: 400;
}

.pagination-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
    justify-content: center;
}

.pagination-info {
    font-size: var(--text-sm);
    color: var(--color-muted);
    min-width: 3.5rem;
    text-align: center;
}

.pagination-disabled {
    opacity: 0.35;
    pointer-events: none;
    cursor: default;
}

.page-footer {
    margin-top: 3rem;
    font-size: var(--text-xs);
    color: #cbd5e1;
}

/* ============================================================
   Stats strip (dashboard)
   ============================================================ */

.stats-strip {
    display: flex;
    align-items: center;
    background: var(--color-card);
    border-top: 3px solid var(--color-accent);
    padding: 1.25rem 1.75rem;
    margin-bottom: 2rem;
    gap: 0;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0 1.5rem;
}

.stat-item:first-child { padding-left: 0; }

.stat-number {
    font-size: var(--text-2xl);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--color-base);
    line-height: 1;
}

.stat-unit {
    font-size: var(--text-sm);
    font-weight: 400;
    color: var(--color-muted);
}

.stat-label {
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.stat-divider {
    width: 1px;
    height: 36px;
    background: var(--color-border);
    flex-shrink: 0;
}

/* ============================================================
   Property list (dashboard)
   ============================================================ */

.property-list {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--color-card);
    margin-top: 0.5rem;
}

.property-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    transition: background 0.15s, opacity 0.15s, transform 0.15s;
    color: inherit;
}

.property-row:last-child { border-bottom: none; }

.property-row:hover {
    background: #f1f5f9;
    opacity: 0.95;
    transform: translateX(-1px);
}

.property-row-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.property-row-name {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--color-base);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.property-row-location {
    font-size: var(--text-sm);
    color: var(--color-muted);
}

.property-row-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15rem;
    flex-shrink: 0;
}

.property-row-beds {
    font-size: var(--text-sm);
    color: var(--color-muted);
}

.property-row-rent {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--color-base);
}

.rent-unit {
    font-size: var(--text-sm);
    font-weight: 400;
    color: var(--color-muted);
}

.property-row-arrow {
    color: #cbd5e1;
    flex-shrink: 0;
}

/* ============================================================
   Empty state
   ============================================================ */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--color-muted);
}

.empty-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
    color: #cbd5e1;
}

.empty-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--color-base);
    margin-bottom: 0.35rem;
}

.empty-sub {
    font-size: var(--text-sm);
    color: var(--color-muted);
}

/* ============================================================
   Analytics strip (property detail)
   ============================================================ */

.source-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: var(--text-xs);
    font-weight: 600;
}

.pill--live     { background: #dcfce7; color: #15803d; }
.pill--ai       { background: #f1f5f9; color: var(--color-muted); }
.pill--high     { background: #dcfce7; color: #15803d; }
.pill--moderate { background: #fef3c7; color: #92400e; }
.pill--low      { background: #f1f5f9; color: var(--color-muted); }

.scrape-hint {
    font-size: var(--text-xs, 0.75rem);
    color: var(--color-muted);
    background: #eff6ff;
    border-left: 3px solid #3b82f6;
    padding: 0.45rem 0.75rem;
    margin: 0.5rem 0 0;
    border-radius: 4px;
}

.analytics-strip {
    display: flex;
    align-items: stretch;
    background: var(--color-card);
    border-top: 3px solid var(--color-accent);
    margin-bottom: 1rem;
}

.analytic {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1.25rem 1.5rem;
}

.analytic-sep {
    width: 1px;
    background: var(--color-border);
    flex-shrink: 0;
    margin: 1rem 0;
}

.analytic-label {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--color-muted);
}

.analytic-number {
    font-size: var(--text-2xl);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--color-base);
}

.analytic-number.accent    { color: var(--color-accent); }
.analytic-number.analytic-positive { color: var(--color-positive); }
.analytic-number.analytic-warning  { color: var(--color-warning); }
.analytic-number.analytic-negative { color: var(--color-negative); }

.analytic-unit {
    font-size: var(--text-sm);
    font-weight: 400;
    color: var(--color-muted);
}

.analytic-range {
    font-size: var(--text-xs);
    color: var(--color-muted);
}

/* ============================================================
   Trend card
   ============================================================ */

.trend-card {
    background: var(--color-card);
    border-left: 3px solid var(--color-border);
    padding: 1.1rem 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.trend-card--raise { border-left-color: var(--color-positive); }
.trend-card--hold  { border-left-color: #3b82f6; }
.trend-card--lower { border-left-color: var(--color-negative); }

.trend-signal {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.trend-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.trend-icon--positive { color: var(--color-positive); }
.trend-icon--hold     { color: #3b82f6; }
.trend-icon--negative { color: var(--color-negative); }

.trend-label {
    font-size: var(--text-base);
    font-weight: 700;
    white-space: nowrap;
    color: var(--color-base);
}

.trend-reason {
    font-size: var(--text-sm);
    color: var(--color-muted);
    line-height: 1.5;
}

/* ============================================================
   Data sections
   ============================================================ */

.data-section {
    background: var(--color-card);
    border-left: 3px solid var(--color-border);
    padding: 1.1rem 1.5rem;
    margin-bottom: 1rem;
}

.analysis-text {
    font-size: var(--text-sm);
    color: #475569;
    line-height: 1.65;
    margin-top: 0.6rem;
}

.sources-panel { list-style: none; }

.sources-toggle {
    cursor: pointer;
    display: inline-block;
    user-select: none;
}

.sources-toggle:hover { color: var(--color-base); }

.sources-list {
    list-style: none;
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sources-list a {
    font-size: var(--text-sm);
    color: #3b82f6;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.15s;
}

.sources-list a:hover { opacity: 0.75; }

/* ============================================================
   Forms
   ============================================================ */

.form-card {
    background: var(--color-card);
    border-top: 3px solid var(--color-accent);
    padding: 1.75rem;
    max-width: 560px;
}

.form-group {
    margin-bottom: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.35rem;
}

.label-hint {
    font-weight: 400;
    color: #9ca3af;
}

/* Required field indicator — adds a red asterisk after the label */
.form-group.required > label::after {
    content: " *";
    color: var(--color-red, #ef4444);
    font-weight: 600;
}

.required-star {
    color: var(--color-red, #ef4444);
    font-weight: 600;
}

input {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1.5px solid var(--color-border);
    border-radius: 6px;
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    color: var(--color-base);
    background: #fafbfc;
    transition: border-color 0.15s;
}

input:focus {
    outline: none;
    border-color: var(--color-accent);
    background: #fff;
}

input::placeholder { color: #b4bcc7; }

.form-error {
    background: #fef2f2;
    border-left: 3px solid var(--color-negative);
    color: #991b1b;
    font-size: var(--text-sm);
    padding: 0.65rem 1rem;
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-family: var(--font-sans);
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.15s, transform 0.15s;
}

.btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--color-accent);
    color: var(--color-base);
    padding: 0.6rem 1.25rem;
    font-size: var(--text-sm);
}

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-base);
    border: 1.5px solid var(--color-border);
    padding: 0.55rem 1.1rem;
    font-size: var(--text-sm);
}

.btn-danger {
    background: #fef2f2;
    color: var(--color-negative);
    border: 1.5px solid #fecaca;
    padding: 0.55rem 1.1rem;
    font-size: var(--text-sm);
}

.btn-sm {
    padding: 0.45rem 1rem;
    font-size: var(--text-sm);
}

.btn-full {
    display: flex;
    width: 100%;
}

/* ============================================================
   Alerts / flash
   ============================================================ */

.flash-messages { margin-bottom: 1.25rem; }

.flash {
    padding: 0.75rem 1rem;
    font-size: var(--text-sm);
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.flash--success { background: #dcfce7; color: #15803d; }
.flash--error   { background: #fef2f2; color: #991b1b; }
.flash--info    { background: #eff6ff; color: #1d4ed8; }

.alert {
    padding: 0.85rem 1.1rem;
    font-size: var(--text-sm);
    border-radius: 6px;
    margin-bottom: 1rem;
}

.alert--error { background: #fef2f2; color: #991b1b; border-left: 3px solid var(--color-negative); }

/* ============================================================
   Auth pages
   ============================================================ */

.auth-body {
    background: var(--color-base);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
}

.auth-shell {
    width: 100%;
    max-width: 400px;
}

.auth-card {
    background: var(--color-card);
    padding: 2.25rem;
    border-radius: 8px;
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.75rem;
}

.logo-text-dark {
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--color-base);
    letter-spacing: -0.01em;
}

.auth-heading {
    font-size: var(--text-2xl);
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--color-base);
    margin-bottom: 0.3rem;
}

.auth-subheading {
    font-size: var(--text-sm);
    color: var(--color-muted);
    margin-bottom: 1.5rem;
}

.auth-form { margin-bottom: 1.25rem; }

.auth-links {
    text-align: center;
    font-size: var(--text-sm);
    color: var(--color-muted);
}

.auth-links a {
    color: var(--color-base);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-links-sep { margin: 0 0.4rem; }

/* ============================================================
   Phase 3 — KPI cards (individual boxes on dashboard)
   ============================================================ */

.kpi-cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.875rem;
    margin-bottom: 1.5rem;
}

.kpi-card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-top: 3px solid var(--color-accent);
    border-radius: 12px;
    padding: 1.25rem 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    box-shadow: 0 1px 4px rgba(15,23,42,0.04);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.kpi-card:hover {
    box-shadow: 0 4px 14px rgba(15,23,42,0.1);
    transform: translateY(-1px);
}

/* Top-border colour variants */
.kpi-card--green { border-top-color: var(--color-positive); }
.kpi-card--amber { border-top-color: var(--color-warning); }
.kpi-card--red   { border-top-color: var(--color-negative); }

.kpi-value {
    font-size: clamp(1.4rem, 2.5vw, 1.8rem);
    font-weight: 800;
    color: var(--color-base);
    line-height: 1;
    letter-spacing: -0.03em;
}

.kpi-value--green  { color: var(--color-positive); }
.kpi-value--amber  { color: var(--color-warning); }
.kpi-value--red    { color: var(--color-negative); }
.kpi-value--muted  { color: var(--color-muted); }

.kpi-label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

.kpi-sub {
    font-size: var(--text-xs);
    color: var(--color-muted);
    margin-top: 0.05rem;
}

/* ============================================================
   Phase 3 — Lease-expiry alert strip
   ============================================================ */

.alert-strip {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    background: #fef9ee;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: var(--text-sm);
}

.alert-strip-icon {
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 0.05rem;
    color: #b45309;
}

.alert-strip-body {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    color: #78350f;
}

.alert-strip-item a { color: inherit; }
.alert-strip-item a:hover { text-decoration: underline; }

/* ============================================================
   Phase 3 — Chips inside alerts
   ============================================================ */

.chip {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.45rem;
    border-radius: 99px;
    font-size: var(--text-xs);
    font-weight: 700;
    margin-left: 0.25rem;
}

.chip--red   { background: #fee2e2; color: #991b1b; }
.chip--amber { background: #fef3c7; color: #92400e; }

/* ============================================================
   Phase 3 — Property card grid
   ============================================================ */

.prop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    justify-content: start;
}

.prop-card {
    display: flex;
    flex-direction: column;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1.1rem 1.2rem 1rem;
    transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
    color: var(--color-base);
    position: relative;
    overflow: hidden;
    max-width: 480px;
}

/* Ghost "Add property" card */
.prop-card--ghost {
    background: transparent;
    border: 2px dashed var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    text-decoration: none;
    overflow: visible;
    max-width: 480px;
}
.prop-card--ghost::before { display: none; }
.prop-card--ghost:hover {
    border-color: var(--color-accent);
    background: #fffbf0;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(15,23,42,0.06);
}
.prop-card-ghost-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-muted);
    pointer-events: none;
}
.prop-card-ghost-icon {
    font-size: 1.75rem;
    line-height: 1;
    color: var(--color-accent);
}
.prop-card-ghost-label {
    font-size: var(--text-sm);
    font-weight: 600;
}

.prop-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: transparent;
    transition: background 0.15s ease;
}

.prop-card:hover {
    box-shadow: 0 6px 20px rgba(15,23,42,0.09);
    transform: translateY(-2px);
    border-color: #d1d5db;
}

.prop-card:hover::before { background: var(--color-accent); }

.prop-card--urgent { border-color: #fca5a5; }
.prop-card--urgent::before { background: var(--color-negative); }

.prop-card-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.65rem;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.prop-card-name {
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--color-base);
    margin-bottom: 0.2rem;
    line-height: 1.3;
}

.prop-card-location {
    font-size: var(--text-xs);
    color: var(--color-muted);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.prop-card-divider {
    height: 1px;
    background: var(--color-border);
    margin-bottom: 0.75rem;
}

.prop-card-tenant {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.7rem;
    min-height: 1.4rem;
}

.prop-card-tenant-info {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-base);
    flex-wrap: wrap;
}

.prop-card-tenant-info--vacant {
    color: var(--color-muted);
    font-weight: 400;
}

.tenant-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-positive);
    flex-shrink: 0;
}

.lease-chip {
    display: inline-flex;
    padding: 0.1rem 0.45rem;
    border-radius: 99px;
    font-size: var(--text-xs);
    font-weight: 700;
}
.lease-chip--red   { background: #fee2e2; color: #991b1b; }
.lease-chip--amber { background: #fef3c7; color: #92400e; }

.prop-card-rent-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.prop-card-rent {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--color-base);
}

.prop-card-rent-unit {
    font-size: var(--text-xs);
    font-weight: 400;
    color: var(--color-muted);
}

.prop-card-arrow {
    color: var(--color-muted);
    transition: transform 0.15s ease;
}
.prop-card:hover .prop-card-arrow { transform: translateX(3px); color: var(--color-base); }

/* ============================================================
   Phase 3 — Market signal chip on cards
   ============================================================ */

.market-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 99px;
    font-size: var(--text-xs);
    font-weight: 600;
}
.market-chip--up   { background: #fef3c7; color: #92400e; }
.market-chip--down { background: #fee2e2; color: #991b1b; }
.market-chip--hold { background: #f1f5f9; color: var(--color-muted); }

/* ============================================================
   Phase 3 — Pay badges (shared dashboard + detail)
   ============================================================ */

.pay-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 99px;
    font-size: var(--text-xs);
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}
.pay-badge--paid { background: #dcfce7; color: #15803d; }
.pay-badge--due  { background: #fee2e2; color: #991b1b; }
.pay-badge--lg   { font-size: var(--text-sm); padding: 0.25rem 0.75rem; }

/* ============================================================
   Phase 3 — Payment panel on property detail
   ============================================================ */

.payment-panel {
    margin-top: 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 0.9rem 1rem;
}

.payment-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.payment-panel-title {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--color-base);
}

.payment-form {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.payment-amount-input {
    flex: 1;
    min-width: 200px;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: var(--text-sm);
    font-family: var(--font-sans);
    background: var(--color-card);
    color: var(--color-base);
}
.payment-amount-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(245,158,11,0.15);
}

.payment-history-link {
    display: inline-block;
    margin-top: 0.65rem;
    font-size: var(--text-xs);
    color: var(--color-muted);
    font-weight: 600;
    transition: color 0.15s;
}
.payment-history-link:hover { color: var(--color-base); }

/* ============================================================
   Phase 2 — Status badges
   ============================================================ */

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 99px;
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.02em;
    vertical-align: middle;
    line-height: 1.5;
}

.status-badge--occupied {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-badge--vacant {
    background: #f1f5f9;
    color: var(--color-muted);
}

/* ============================================================
   Phase 2 — Dashboard stat colours
   ============================================================ */

.stat-number--green  { color: var(--color-positive); }
.stat-number--muted  { color: var(--color-muted); }

/* ============================================================
   Phase 2 — Property name+badge row
   ============================================================ */

.property-row-name-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ============================================================
   Phase 2 — Section header with action button
   ============================================================ */

.section-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

/* ============================================================
   Phase 2 — Tenant card
   ============================================================ */

.tenant-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 1rem 1.1rem;
}

.tenant-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-accent);
    color: var(--color-base);
    font-weight: 800;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tenant-info {
    flex: 1;
    min-width: 0;
}

.tenant-name {
    font-weight: 700;
    font-size: var(--text-base);
    margin-bottom: 0.2rem;
}

.tenant-meta,
.tenant-lease,
.tenant-rent,
.tenant-notes {
    font-size: var(--text-sm);
    color: var(--color-muted);
    margin-top: 0.2rem;
}

.tenant-rent {
    color: var(--color-base);
    font-weight: 600;
}

.tenant-notes {
    font-style: italic;
    margin-top: 0.4rem;
}

.tenant-actions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex-shrink: 0;
}

.empty-inline {
    font-size: var(--text-sm);
    color: var(--color-muted);
    padding: 0.5rem 0;
}

/* ============================================================
   Phase 2 — Estimate history table
   ============================================================ */

.history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
    font-size: var(--text-sm);
}

.history-table th {
    text-align: left;
    padding: 0.4rem 0.6rem;
    color: var(--color-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--color-border);
}

.history-table td {
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

.history-table tbody tr:last-child td {
    border-bottom: none;
}

.history-date { color: var(--color-muted); }
.history-range { color: var(--color-muted); font-size: var(--text-xs); }

/* ============================================================
   Phase 2 — xs button variant
   ============================================================ */

.btn-xs {
    padding: 0.25rem 0.7rem !important;
    font-size: var(--text-xs) !important;
}

/* ============================================================
   Phase 2 — form actions row
   ============================================================ */

.form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 0.75rem;
}

/* ============================================================
   Dashboard two-column layout
   ============================================================ */

.dash-layout {
    display: grid;
    grid-template-columns: 1fr clamp(260px, 22%, 340px);
    gap: 1.5rem;
    align-items: start;
    margin-top: 1.75rem;
}

.dash-main { min-width: 0; }

.dash-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    position: sticky;
    top: 1.25rem;
}

.insight-card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 0.9rem 1rem;
}

.insight-card--amber  { border-left: 3px solid var(--color-warning); }
.insight-card--red    { border-left: 3px solid var(--color-negative); }
.insight-card--actions { background: var(--color-surface); }
.insight-card--ai     { border-top: 3px solid var(--color-accent); }

/* AI Rent Analysis card */
.ai-live-dot {
    display: inline-block;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #22c55e;
    animation: pulse-ai 1.8s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes pulse-ai {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(0.85); }
}
.ai-prop-name {
    font-size: var(--text-xs);
    color: var(--color-muted);
    margin-bottom: 0.35rem;
    margin-top: 0.1rem;
}
.ai-suggest {
    font-size: clamp(1.3rem, 2vw, 1.6rem);
    font-weight: 800;
    color: var(--color-base);
    letter-spacing: -0.03em;
    line-height: 1;
}
.ai-range {
    font-size: var(--text-xs);
    color: var(--color-muted);
    margin-top: 0.2rem;
    margin-bottom: 0.6rem;
}
.ai-signal {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    font-size: var(--text-xs);
    font-weight: 700;
    margin-bottom: 0.75rem;
}
.ai-signal--raise { background: #fef3c7; color: #92400e; }
.ai-signal--lower { background: #fee2e2; color: #991b1b; }
.ai-signal--hold  { background: #f1f5f9; color: var(--color-muted); }

.ai-bar-wrap { margin-bottom: 0.75rem; }
.ai-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--color-muted);
    margin-bottom: 0.25rem;
}
.ai-bar-bg {
    height: 6px;
    background: var(--color-surface);
    border-radius: 9999px;
    overflow: hidden;
}
.ai-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-accent), #fbbf24);
    border-radius: 9999px;
}
.ai-sources-title {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
}
.ai-source-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    color: var(--color-text);
    padding: 0.2rem 0;
    border-bottom: 1px solid var(--color-border);
}
.ai-source-row:last-of-type { border-bottom: none; }
.ai-source-name { color: var(--color-muted); }
.ai-source-price { font-weight: 700; color: var(--color-base); }
.ai-also-title {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.75rem;
    margin-bottom: 0.3rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border);
}
.ai-also-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    color: var(--color-text);
    text-decoration: none;
    padding: 0.2rem 0;
}
.ai-also-row:hover { color: var(--color-base); }
.ai-also-chip {
    font-size: 0.65rem;
    font-weight: 700;
    background: #fef3c7;
    color: #92400e;
    padding: 0.1rem 0.45rem;
    border-radius: 9999px;
}
.ai-link-row {
    display: flex;
    justify-content: space-between;
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--color-border);
}
.ai-view-link {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-accent);
    text-decoration: none;
}
.ai-view-link:hover { text-decoration: underline; }

.insight-card-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.75rem;
}

.insight-count-badge {
    margin-left: auto;
    background: var(--color-warning);
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 9999px;
    line-height: 1.4;
}

.insight-progress-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.insight-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--color-border);
    border-radius: 99px;
    overflow: hidden;
}

.insight-progress-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.4s ease;
}
.fill--green { background: var(--color-positive); }
.fill--amber { background: var(--color-warning); }
.fill--red   { background: var(--color-negative); }

.insight-progress-pct {
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--color-base);
    min-width: 2.5rem;
    text-align: right;
}

.insight-collection-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.insight-collection-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: var(--text-xs);
}

.insight-collection-name {
    font-weight: 600;
    color: var(--color-base);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.insight-collection-prop {
    color: var(--color-muted);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.insight-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.insight-list-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.35rem 0.4rem;
    border-radius: 6px;
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--color-base);
    transition: background 0.12s;
}
.insight-list-link:hover { background: var(--color-surface); }
.insight-list-link span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.insight-list-meta {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-muted);
    white-space: nowrap;
    flex-shrink: 0;
}
.insight-list-meta--red   { color: var(--color-negative); }
.insight-list-meta--amber { color: var(--color-warning); }

.insight-actions { display: flex; flex-direction: column; gap: 0.4rem; }

.insight-action-btn {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.75rem;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 7px;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-base);
    transition: background 0.12s, border-color 0.12s;
}
.insight-action-btn:hover {
    background: var(--color-base);
    color: #fff;
    border-color: var(--color-base);
}

/* ============================================================
   Tab navigation (property detail)
   ============================================================ */

.tab-nav {
    display: flex;
    gap: 0.25rem;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: 1.5rem;
    padding-bottom: 0;
    overflow-x: auto;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1rem;
    font-size: var(--text-sm);
    font-weight: 600;
    font-family: var(--font-sans);
    color: var(--color-muted);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}

.tab-btn:hover {
    color: var(--color-base);
    background: var(--color-surface);
}

.tab-btn--active {
    color: var(--color-base);
    border-bottom-color: var(--color-accent);
}

.tab-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.05rem 0.4rem;
    border-radius: 99px;
    font-size: 0.65rem;
    font-weight: 700;
}
.tab-pill--green { background: #dcfce7; color: #15803d; }
.tab-pill--red   { background: #fee2e2; color: #991b1b; }

.tab-panel { display: none; }
.tab-panel--active { display: block; }

.tab-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
}

.tab-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--color-muted);
    gap: 0.25rem;
}
.tab-empty p:first-of-type { font-size: var(--text-base); font-weight: 600; color: var(--color-base); }
.tab-empty svg { opacity: 0.22; margin-bottom: 0.5rem; }

/* ============================================================
   Finance card (current month)
   ============================================================ */

.finance-card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1.1rem 1.2rem;
    margin-bottom: 0.5rem;
}

.finance-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.9rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.finance-card-title {
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--color-base);
}

/* ============================================================
   Lease expiry banner (on Tenant tab)
   ============================================================ */

.lease-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.85rem;
    padding: 0.6rem 0.9rem;
    border-radius: 8px;
    font-size: var(--text-sm);
    font-weight: 600;
}
.lease-banner--ok      { background: #f0fdf4; color: #15803d; }
.lease-banner--warn    { background: #fef9ee; color: #b45309; }
.lease-banner--expired { background: #fee2e2; color: #991b1b; }

/* ============================================================
   Phase 5 — P&L Strip + Expenses
   ============================================================ */

/* P&L summary strip at top of Finance tab */
.pl-strip {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 1.1rem 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    flex-wrap: wrap;
}

.pl-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 100px;
}

.pl-label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.pl-value {
    font-size: var(--text-2xl);
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--color-base);
}

.pl-value--green { color: var(--color-positive); }
.pl-value--red   { color: var(--color-negative); }
.pl-value--muted { color: var(--color-muted); font-size: var(--text-lg); }

.pl-sep {
    width: 1px;
    height: 40px;
    background: var(--color-border);
    margin: 0 1.5rem;
    flex-shrink: 0;
}

.pl-strip-label {
    position: absolute;
    top: 0.6rem;
    right: 1rem;
    font-size: var(--text-xs);
    color: var(--color-muted);
    font-weight: 500;
}

/* Finance tab — no tenant notice */
.finance-no-tenant {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: var(--text-sm);
    color: var(--color-muted);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
}

/* Expense category badge */
.expense-cat-badge {
    display: inline-flex;
    align-items: center;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 0.15rem 0.55rem;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-base);
    white-space: nowrap;
}

/* Expense action buttons cell */
.expense-actions-cell {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    justify-content: flex-end;
}

/* KPI sub colour variants */
.kpi-sub--green { color: var(--color-positive); font-weight: 600; }
.kpi-sub--red   { color: var(--color-negative); font-weight: 600; }

/* ============================================================
   Analysis page
   ============================================================ */

.analysis-summary {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
.analysis-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.85rem;
    border-radius: 9999px;
    font-size: var(--text-xs);
    font-weight: 700;
}
.analysis-chip--raise { background: #fef3c7; color: #92400e; }
.analysis-chip--hold  { background: #f1f5f9; color: var(--color-muted); }
.analysis-chip--lower { background: #fee2e2; color: #991b1b; }

.analysis-table-wrap {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.25rem;
}
.analysis-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}
.analysis-table thead th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}
.analysis-row td {
    padding: 1rem;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}
.analysis-row:last-child td { border-bottom: none; }
.analysis-row--raise { background: #fffbeb; }
.analysis-row--lower { background: #fff5f5; }

.analysis-prop-name { font-weight: 600; color: var(--color-base); }
.analysis-prop-meta { font-size: 0.72rem; color: var(--color-muted); margin-top: 2px; }
.analysis-range     { font-size: 0.75rem; color: var(--color-muted); }
.analysis-val--raise { color: var(--color-positive); font-weight: 700; }
.analysis-val--lower { color: var(--color-negative); font-weight: 700; }

.analysis-gap { font-weight: 700; font-size: var(--text-sm); }
.analysis-gap--up   { color: var(--color-positive); }
.analysis-gap--down { color: var(--color-negative); }
.analysis-gap-pct   { font-size: 0.7rem; color: var(--color-muted); margin-left: 0.2rem; }

.analysis-footer-note {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 0.9rem 1.1rem;
    font-size: var(--text-sm);
    color: var(--color-base);
}
.text-positive { color: var(--color-positive); }
.text-muted    { color: var(--color-muted); }

.btn-xs {
    padding: 0.25rem 0.65rem;
    font-size: 0.72rem;
}

/* Expense empty state */
.expense-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--color-muted);
    gap: 0.35rem;
}

.expense-empty svg { margin-bottom: 0.35rem; opacity: 0.4; }
.expense-empty p:first-of-type { font-weight: 600; color: var(--color-base); }
.expense-empty p { font-size: var(--text-sm); }

/* ============================================================
   Phase 6 — Maintenance Request Tracker
   ============================================================ */

/* Header row above the list */
.maint-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

/* Summary chip strip */
.maint-summary {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.maint-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: var(--text-xs);
    font-weight: 600;
    padding: 0.2rem 0.65rem;
    border-radius: 9999px;
}
.maint-chip--open     { background: #fee2e2; color: #991b1b; }
.maint-chip--inprog   { background: #fef3c7; color: #92400e; }
.maint-chip--resolved { background: #d1fae5; color: #065f46; }

/* Card list */
.maint-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.maint-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1rem 1.125rem;
    border-left: 4px solid var(--color-border);
    transition: box-shadow 0.15s;
}
.maint-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.maint-card--open        { border-left-color: #ef4444; }
.maint-card--in_progress { border-left-color: #f59e0b; }
.maint-card--resolved    { border-left-color: #10b981; opacity: 0.85; }

.maint-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.maint-card-left {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 0;
}

.maint-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    line-height: 1.4;
}

.maint-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.4;
}

.maint-meta {
    font-size: var(--text-xs);
    color: var(--color-muted);
    margin-top: 0.2rem;
}

.maint-card-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Priority badge */
.maint-priority {
    font-size: var(--text-xs);
    font-weight: 600;
    padding: 0.15rem 0.55rem;
    border-radius: 9999px;
}
.maint-priority--high   { background: #fee2e2; color: #991b1b; }
.maint-priority--medium { background: #fef3c7; color: #92400e; }
.maint-priority--low    { background: #f3f4f6; color: #6b7280; }

/* Status button (clickable, cycles through states) */
.maint-status-btn {
    font-size: var(--text-xs);
    font-weight: 600;
    padding: 0.2rem 0.65rem;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    transition: opacity 0.15s;
}
.maint-status-btn:hover { opacity: 0.8; }
.maint-status-btn--open        { background: #fee2e2; color: #991b1b; }
.maint-status-btn--in_progress { background: #fef3c7; color: #92400e; }
.maint-status-btn--resolved    { background: #d1fae5; color: #065f46; }

/* Description */
.maint-desc {
    font-size: var(--text-sm);
    color: var(--color-muted);
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--color-border);
    line-height: 1.5;
}

/* Empty state */
.maint-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--color-muted);
}
.maint-empty svg {
    margin-bottom: 1rem;
    opacity: 0.4;
}
.maint-empty p {
    margin: 0.25rem 0;
    font-size: var(--text-sm);
}


/* ============================================================
   Phase 7 — Lease Document Storage
   ============================================================ */

/* Upload box */
.doc-upload-box {
    background: var(--color-card);
    border: 1.5px dashed var(--color-border);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

.doc-upload-form {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.doc-upload-fields {
    display: flex;
    gap: 0.75rem;
    flex: 1;
    flex-wrap: wrap;
    min-width: 0;
}

.doc-file-input {
    font-size: var(--text-sm);
    padding: 0.3rem 0.5rem;
}

.form-input--sm {
    padding: 0.4rem 0.65rem;
    font-size: var(--text-sm);
}

/* Document table */
.doc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.doc-table thead th {
    text-align: left;
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0 0.75rem 0.6rem;
    border-bottom: 1px solid var(--color-border);
}

.doc-row {
    border-bottom: 1px solid var(--color-border);
    transition: background 0.1s;
}
.doc-row:last-child { border-bottom: none; }
.doc-row:hover { background: var(--color-surface); }

.doc-row td {
    padding: 0.7rem 0.75rem;
    vertical-align: middle;
}

.doc-name-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.doc-icon { font-size: 1.1rem; flex-shrink: 0; }

.doc-filename {
    font-weight: 500;
    color: var(--color-text);
    word-break: break-word;
}

.doc-type-badge {
    display: inline-block;
    font-size: var(--text-xs);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-muted);
    padding: 0.15rem 0.55rem;
    border-radius: 9999px;
    white-space: nowrap;
}

.doc-size  { color: var(--color-muted); font-size: var(--text-xs); }
.doc-date  { color: var(--color-muted); font-size: var(--text-xs); white-space: nowrap; }

.doc-actions {
    display: flex;
    gap: 0.4rem;
    justify-content: flex-end;
    white-space: nowrap;
}


/* ============================================================
   Annual P&L Report (Phase 10)
   ============================================================ */

.rpt-header { align-items: flex-start; }
.rpt-header-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}
.rpt-fy-form { display: flex; align-items: center; }

/* KPI strip */
.rpt-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.875rem;
    margin-bottom: 1.75rem;
}
.rpt-kpi {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-top: 3px solid var(--color-border);
    border-radius: 12px;
    padding: 1.1rem 1.2rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.rpt-kpi--green { border-top-color: var(--color-positive); }
.rpt-kpi--red   { border-top-color: var(--color-negative); }
.rpt-kpi-label  { font-size: var(--text-xs); font-weight: 600; color: var(--color-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.rpt-kpi-value  { font-size: 1.5rem; font-weight: 700; color: var(--color-base); margin: 0.2rem 0; }
.rpt-kpi-sub    { font-size: var(--text-xs); color: var(--color-muted); }

/* Section */
.rpt-section { margin-bottom: 2rem; }
.rpt-section-title {
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--color-base);
    margin-bottom: 0.85rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

/* Tables */
.rpt-table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--color-border); }
.rpt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
    background: var(--color-card);
}
.rpt-table thead th {
    background: var(--color-surface);
    color: var(--color-muted);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.65rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}
.rpt-table td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.rpt-table tbody tr:last-child td { border-bottom: none; }
.rpt-table tbody tr:hover td { background: var(--color-surface); }
.rpt-num { text-align: right; }
.rpt-pos { color: var(--color-positive); }
.rpt-neg { color: var(--color-negative); }

.rpt-prop-name { font-weight: 600; color: var(--color-base); }
.rpt-prop-loc  { font-size: var(--text-xs); color: var(--color-muted); margin-top: 0.1rem; }
.rpt-month-label { font-weight: 500; }

.rpt-pct {
    display: inline-block;
    font-size: var(--text-xs);
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
}
.rpt-pct--green { background: #dcfce7; color: #15803d; }
.rpt-pct--amber { background: #fef3c7; color: #92400e; }
.rpt-pct--red   { background: #fee2e2; color: #b91c1c; }

.rpt-months { font-weight: 600; }

.rpt-total-row td {
    background: var(--color-surface);
    border-top: 2px solid var(--color-border);
    border-bottom: none;
    font-size: var(--text-sm);
}

/* Mini bar chart in monthly table */
.rpt-bar-wrap { display: flex; flex-direction: column; gap: 2px; }
.rpt-bar { height: 5px; border-radius: 3px; min-width: 2px; }
.rpt-bar--income  { background: var(--color-positive); opacity: 0.75; }
.rpt-bar--expense { background: var(--color-negative); opacity: 0.65; }

/* Expense breakdown */
.rpt-exp-grid { display: flex; flex-direction: column; gap: 0.65rem; }
.rpt-exp-row {
    display: grid;
    grid-template-columns: 180px 1fr auto auto;
    align-items: center;
    gap: 1rem;
    font-size: var(--text-sm);
}
.rpt-exp-label { color: var(--color-base); font-weight: 500; }
.rpt-exp-bar-wrap { height: 8px; background: var(--color-border); border-radius: 4px; overflow: hidden; }
.rpt-exp-bar { height: 100%; background: var(--color-accent); border-radius: 4px; }
.rpt-exp-amt { font-weight: 600; color: var(--color-negative); text-align: right; }
.rpt-exp-pct { color: var(--color-muted); font-size: var(--text-xs); width: 3rem; text-align: right; }

/* Tax note */
.rpt-tax-note {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    background: #fffbf0;
    border: 1px solid #fde68a;
    border-left: 3px solid var(--color-accent);
    border-radius: 8px;
    padding: 0.9rem 1rem;
    font-size: var(--text-sm);
    color: var(--color-base);
    margin-bottom: 2rem;
    line-height: 1.55;
}
.rpt-tax-note svg { flex-shrink: 0; margin-top: 0.1rem; color: var(--color-accent); }

.rpt-empty { color: var(--color-muted); padding: 2rem 0; font-size: var(--text-sm); }

/* ── Print styles ──────────────────────────────────────── */
@media print {
    .sidebar,
    .rpt-print-btn,
    .rpt-fy-form,
    .back-link,
    .flash-messages {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    .app-shell {
        display: block !important;
    }
    .rpt-kpi,
    .rpt-table-wrap,
    .rpt-section {
        break-inside: avoid;
    }
    .rpt-kpis {
        grid-template-columns: repeat(4, 1fr);
    }
    body {
        font-size: 11pt;
        color: #000;
    }
    .rpt-kpi { box-shadow: none; border: 1px solid #ccc; }
    .rpt-table-wrap { border: 1px solid #ccc; }
    .rpt-table thead th { background: #f0f0f0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .rpt-pct--green { background: #dcfce7 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .rpt-pct--amber { background: #fef3c7 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .rpt-pct--red   { background: #fee2e2 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    @page { margin: 1.5cm; size: A4 landscape; }
}

/* ============================================================
   Utility
   ============================================================ */

.mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

/* ============================================================
   Phase 11 — Security Deposit Tracker
   ============================================================ */

/* Tab pill — blue (Held status) */
.tab-pill--blue {
    background: #dbeafe;
    color: #1d4ed8;
}

/* ── Deposit summary cards ──────────────────────────────── */

.dep-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.dep-stat {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    border-top: 3px solid var(--color-border);
}
.dep-stat--green { border-top-color: var(--color-positive); }
.dep-stat--red   { border-top-color: var(--color-negative); }
.dep-stat--muted { opacity: 0.6; }

.dep-stat-label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
}

.dep-stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.15;
}

.dep-stat-sub {
    font-size: var(--text-xs);
    color: var(--color-muted);
    margin-top: 0.25rem;
}

/* Status badge inside the stat card */
.dep-status-badge {
    display: inline-block;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.2rem 0.65rem;
    border-radius: 9999px;
}
.dep-status-badge--held    { background: #dbeafe; color: #1d4ed8; }
.dep-status-badge--partial { background: #fef3c7; color: #92400e; }
.dep-status-badge--refunded{ background: #d1fae5; color: #065f46; }

/* ── Two-column body layout ─────────────────────────────── */

.dep-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

.dep-col {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
}

.dep-section-head {
    margin-bottom: 0.85rem;
}

.dep-section-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
}

/* ── Deduction list ─────────────────────────────────────── */

.dep-deduction-list {
    margin-bottom: 1rem;
}

.dep-deduction-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--color-border);
    font-size: var(--text-sm);
}

.dep-deduction-row:last-child { border-bottom: none; }

.dep-deduction-reason {
    flex: 1;
    color: var(--color-text);
}

.dep-deduction-amt {
    color: var(--color-negative);
    font-weight: 600;
    white-space: nowrap;
}

.dep-del-btn {
    background: none;
    border: none;
    color: var(--color-muted);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.2rem;
    border-radius: var(--radius);
    transition: color 0.15s;
}
.dep-del-btn:hover { color: var(--color-negative); }

.dep-empty-hint {
    font-size: var(--text-sm);
    color: var(--color-muted);
    margin: 0 0 1rem;
}

/* ── Add deduction form ─────────────────────────────────── */

.dep-add-form {
    border-top: 1px solid var(--color-border);
    padding-top: 1rem;
    margin-top: 0.25rem;
}

/* ── Refund form ────────────────────────────────────────── */

.dep-refund-form {
    margin-top: 0.25rem;
}

.dep-refunded-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #d1fae5;
    color: #065f46;
    font-size: var(--text-sm);
    font-weight: 600;
    padding: 0.65rem 1rem;
    border-radius: var(--radius);
    margin-top: 0.25rem;
}

.dep-notes {
    font-size: var(--text-sm);
    color: var(--color-muted);
    background: var(--color-bg);
    border-radius: var(--radius);
    padding: 0.6rem 0.85rem;
    margin-top: 1rem;
}

.dep-footer-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

/* ── Property card deposit badge ───────────────────────── */

.dep-card-badge {
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    white-space: nowrap;
    letter-spacing: 0.02em;
    margin-right: auto;
}
.dep-card-badge--held     { background: #dbeafe; color: #1d4ed8; }
.dep-card-badge--partial  { background: #fef3c7; color: #92400e; }
.dep-card-badge--refunded { background: #d1fae5; color: #065f46; }

/* ============================================================
   Phase 9 — Rent Revision
   ============================================================ */

/* ── Tenancy history (collapsible previous tenants) ── */
.tenancy-history {
    margin-top: 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}
.tenancy-history-toggle {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.65rem 0.9rem;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-muted);
    cursor: pointer;
    list-style: none;
    user-select: none;
    background: var(--color-surface-alt, #f8fafc);
}
.tenancy-history-toggle::-webkit-details-marker { display: none; }
details.tenancy-history[open] .tenancy-history-toggle svg { transform: rotate(180deg); }
.tenancy-history-toggle svg { transition: transform 0.15s ease; flex-shrink: 0; }
.tenancy-history-toggle:hover { color: var(--color-text); }
.tenancy-history-list { list-style: none; padding: 0; margin: 0; }
.tenancy-history-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.9rem;
    border-top: 1px solid var(--color-border);
}
.tenancy-history-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--color-surface-alt, #f1f5f9);
    color: var(--color-muted);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.tenancy-history-info { flex: 1; min-width: 0; }
.tenancy-history-name { font-size: var(--text-sm); font-weight: 600; color: var(--color-text); }
.tenancy-history-meta { font-size: var(--text-xs); color: var(--color-muted); margin-top: 0.1rem; }
.tenancy-history-actions { display: flex; gap: 0.3rem; flex-shrink: 0; }

/* Green badge variant for revision alerts */
.insight-count-badge--green {
    background: var(--color-positive);
}

.insight-list-meta--green {
    color: var(--color-positive);
    font-weight: 600;
}

/* "Draft Revision Notice" button on tenant card */
.btn-revision {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
    font-weight: 600;
    font-size: var(--text-xs);
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.btn-revision:hover {
    background: #dcfce7;
    border-color: #86efac;
    color: #15803d;
}

/* form-hint below inputs */
.form-hint {
    font-size: var(--text-xs);
    color: var(--color-muted);
    margin: 0.3rem 0 0;
}

/* ── Revision notice layout ──────────────────────────── */

.rev-kpis {
    grid-template-columns: repeat(4, 1fr);
}

.rev-notice-wrap {
    margin-bottom: 2rem;
}

.rev-notice {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2.5rem 3rem;
    max-width: 720px;
    font-size: 0.9375rem;
    line-height: 1.75;
    color: #1a1a2e;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.rev-notice-date {
    text-align: right;
    color: var(--color-muted);
    font-size: var(--text-sm);
    margin-bottom: 2rem;
}

.rev-notice-to {
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.rev-notice-addr {
    color: var(--color-muted);
    font-size: var(--text-sm);
}

.rev-notice-subject {
    background: #f8f9fb;
    border-left: 3px solid var(--color-positive);
    padding: 0.6rem 1rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.rev-notice p {
    margin: 0 0 1rem;
}

/* Rent comparison table inside notice */
.rev-rent-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0;
    font-size: 0.875rem;
}

.rev-rent-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

.rev-rent-table tr:last-child td {
    border-bottom: none;
}

.rev-rent-amt {
    text-align: right;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

.rev-rent-total {
    background: #f0fdf4;
}

.rev-rent-total td {
    color: #15803d;
    border-top: 2px solid #86efac;
    border-bottom: none;
}

.rev-notice-sig {
    margin-top: 2.5rem;
}

.rev-sig-line {
    width: 160px;
    height: 1px;
    background: #ccc;
    margin: 1.5rem 0 0.5rem;
}

/* ── Print styles for revision notice ────────────────── */

@media print {
    .sidebar,
    .rpt-header-controls,
    .back-link,
    .rev-kpis,
    .rpt-tax-note,
    .page-footer,
    .flash-messages,
    .nav-item {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }

    .page-header {
        padding: 0 !important;
        margin-bottom: 1rem !important;
    }

    .page-title {
        font-size: 1.25rem !important;
    }

    .page-subtitle {
        font-size: 0.8rem !important;
    }

    .rev-notice-wrap {
        margin: 0;
    }

    .rev-notice {
        border: none;
        box-shadow: none;
        padding: 0;
        max-width: 100%;
    }

    @page {
        size: A4 portrait;
        margin: 2cm;
    }
}

/* ============================================================
   Phase 8 — Automated Reminders
   ============================================================ */

/* Sidebar — amber insight card */
.insight-card--amber {
    border-left: 3px solid var(--color-amber, #f59e0b);
}
.insight-count-badge--red {
    background: var(--color-red-soft, #fee2e2);
    color: var(--color-red, #ef4444);
}
.insight-count-badge--amber {
    background: #fef3c7;
    color: #b45309;
}
.insight-list-meta--amber {
    color: #b45309;
    background: #fef3c7;
}

/* Settings page */
.settings-section {
    margin-bottom: 1.25rem;
}
.settings-section-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.settings-section-icon {
    font-size: 1.25rem;
    line-height: 1;
    margin-top: 0.1rem;
    flex-shrink: 0;
}
.settings-section-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.2rem;
}
.settings-section-sub {
    font-size: var(--text-xs);
    color: var(--color-muted);
    line-height: 1.5;
}
.settings-section-header > .settings-badge {
    margin-left: auto;
    flex-shrink: 0;
}
.settings-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 99px;
    letter-spacing: 0.01em;
}
.settings-badge--on {
    background: #dcfce7;
    color: #166534;
}
.settings-badge--off {
    background: var(--color-surface-alt, #f1f5f9);
    color: var(--color-muted);
}
.settings-link {
    color: var(--color-primary);
    text-decoration: none;
}
.label-optional {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--color-muted);
    font-style: italic;
}
.settings-link:hover { text-decoration: underline; }

/* ── Phase 8b — Lease contract styles ─────────────────────── */

/* Checkbox option in tenant form */
.lease-send-option {
    margin: 1rem 0 0.5rem;
    padding: 0.85rem 1rem;
    background: var(--color-surface-alt, #f8fafc);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md, 8px);
}
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
    margin-top: 0.2rem;
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    accent-color: var(--color-primary);
    cursor: pointer;
}
.checkbox-label-main {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text);
    display: block;
    margin-bottom: 0.2rem;
}

/* Radio button groups */
.radio-group-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.75rem;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.radio-option {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    cursor: pointer;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md, 8px);
    background: var(--color-card);
    transition: all 0.15s;
}

.radio-option:hover {
    background: var(--color-surface);
    border-color: var(--color-primary, #3b82f6);
}

.radio-option input[type="radio"] {
    margin-top: 0.2rem;
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.radio-option input[type="radio"]:checked + .radio-label-text {
    color: var(--color-primary);
}

.radio-label-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
}

.radio-label-main {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text);
    display: block;
}

.radio-label-hint {
    font-size: var(--text-xs);
    color: var(--color-muted);
    display: block;
    line-height: 1.4;
}

/* Lease contract sub-section inside reminder section */
.reminder-subsection {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
    border-top: 1px dashed var(--color-border);
}

/* Multi-tenant divider */
.tenant-divider {
    border: none;
    border-top: 1px dashed var(--color-border);
    margin: 1.25rem 0 1rem;
}

/* Tenant count pill next to section label */
.tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface-alt, #f1f5f9);
    color: var(--color-muted);
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 99px;
    padding: 0 5px;
    margin-left: 5px;
    vertical-align: middle;
}

/* Reminder actions in Tenant tab */
.reminder-section {
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--color-border);
}
.reminder-label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.6rem;
}
.reminder-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.reminder-btn {
    font-size: 11px !important;
    padding: 0.3rem 0.65rem !important;
}
.reminder-last-sent {
    margin-top: 0.65rem;
    font-size: var(--text-xs);
    color: var(--color-muted);
}

/* ── Lease Send Modal — doc preview card ────────────── */
.ls-doc-card {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.65rem 0.9rem;
    margin: 0.6rem 0 0.4rem;
}
.ls-doc-icon { font-size: 1.1rem; flex-shrink: 0; }
.ls-doc-name {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-base);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ls-to-line {
    font-size: var(--text-sm);
    color: var(--color-muted);
    margin-top: 0.1rem;
}

/* ── Reminder Preview Modal ─────────────────────────── */
.rp-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.rp-backdrop.rp-open {
    display: flex;
}
.rp-modal {
    background: var(--color-card);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    width: min(540px, 100%);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.rp-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.rp-modal-title {
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--color-base);
}
.rp-close-btn {
    background: none;
    border: none;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    color: var(--color-muted);
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
    transition: background 0.15s;
}
.rp-close-btn:hover { background: var(--color-surface); color: var(--color-base); }
.rp-modal-hint {
    font-size: var(--text-xs);
    color: var(--color-muted);
    margin-top: -0.4rem;
}
.rp-field-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.rp-field-row label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.rp-field-row input[type="text"] {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: var(--text-sm);
    font-family: var(--font-sans);
    background: var(--color-surface);
    transition: border-color 0.15s;
}
.rp-field-row input[type="text"]:focus { outline: none; border-color: var(--color-accent); }
.rp-field-row textarea {
    width: 100%;
    min-height: 160px;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: var(--text-sm);
    font-family: var(--font-sans);
    resize: vertical;
    line-height: 1.65;
    background: var(--color-surface);
    transition: border-color 0.15s;
}
.rp-field-row textarea:focus { outline: none; border-color: var(--color-accent); }
.rp-modal-footer {
    display: flex;
    gap: 0.6rem;
    justify-content: flex-end;
    padding-top: 0.25rem;
}

/* Channel tab pills inside reminder modal */
.rp-channel-tabs {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1rem;
}
.rp-channel-tab {
    padding: 0.32rem 1rem;
    border: 1.5px solid var(--color-border);
    border-radius: 9999px;
    background: transparent;
    color: var(--color-muted);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.rp-channel-tab:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}
.rp-channel-tab--active {
    border-color: var(--color-accent);
    background: var(--color-accent);
    color: #fff;
    font-weight: 600;
}

/* ============================================================
   Feedback page
   ============================================================ */

.feedback-type-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.feedback-type-option {
    cursor: pointer;
}

.feedback-type-option input[type="radio"] {
    display: none;
}

.feedback-type-pill {
    display: inline-block;
    padding: 0.4rem 1rem;
    border: 1.5px solid var(--color-border);
    border-radius: 9999px;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-muted);
    background: var(--color-card);
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.feedback-type-option:hover .feedback-type-pill {
    border-color: var(--color-primary, #3b82f6);
    color: var(--color-primary, #3b82f6);
}

.feedback-type-option input[type="radio"]:checked + .feedback-type-pill {
    border-color: var(--color-primary, #3b82f6);
    background: color-mix(in srgb, var(--color-primary, #3b82f6) 10%, transparent);
    color: var(--color-primary, #3b82f6);
    font-weight: 600;
}


/* ============================================================
   Responsive
   ============================================================ */

/* ── Tablet (681px – 900px) ───────────────────────────────── */
@media (max-width: 900px) {
    /* KPI strip: 5→3 columns */
    .kpi-cards { grid-template-columns: repeat(3, 1fr); }
    /* Report KPIs: 4→2 columns */
    .rpt-kpis  { grid-template-columns: repeat(2, 1fr); }
    /* Deposit summary: 4→2 columns */
    .dep-summary { grid-template-columns: repeat(2, 1fr); }
    /* Stats strip: allow wrapping */
    .stats-strip { flex-wrap: wrap; gap: 0.75rem; }
    .stat-divider { display: none; }
    .stat-item { padding: 0 0.75rem; }
    .stat-item:first-child { padding-left: 0; }
}

/* ── Mobile (≤ 680px) ─────────────────────────────────────── */
@media (max-width: 680px) {
    /* --- layout --- */
    .analytics-strip { flex-wrap: wrap; }
    .analytic { min-width: 45%; }
    .analytic-sep { display: none; }
    .form-row { grid-template-columns: 1fr; }
    /* KPI cards: 3→2 columns */
    .kpi-cards { grid-template-columns: repeat(2, 1fr); gap: 0.625rem; }
    /* Card grid */
    .prop-grid { grid-template-columns: 1fr; }
    /* Tenant card */
    .tenant-card { flex-direction: column; }
    .tenant-actions { flex-direction: row; }
    /* Payment form */
    .payment-amount-input { min-width: 100%; }
    .form-actions { flex-direction: column; }
    /* Dashboard sidebar collapses below main content on mobile */
    .dash-layout { grid-template-columns: 1fr; }
    .dash-sidebar { position: static; }
    /* P&L strip */
    .pl-strip { flex-direction: column; gap: 0.75rem; }
    .pl-sep { display: none; }
    .pl-strip-label { position: static; margin-top: 0.25rem; }
    /* Page header wraps on small screens */
    .page-header { flex-wrap: wrap; }
    /* Stats strip */
    .stats-strip { flex-wrap: wrap; gap: 0.5rem; padding: 1rem; }
    .stat-divider { display: none; }
    .stat-item { padding: 0.25rem 0.5rem; flex: 1 1 40%; }
    .stat-item:first-child { padding-left: 0.5rem; }
    /* Report KPIs: 2→2 columns (already from 900px rule) */
    .rpt-kpis { grid-template-columns: repeat(2, 1fr); }
    /* Deposit summary */
    .dep-summary { grid-template-columns: repeat(2, 1fr); }
    /* Deposit body: stack columns */
    .dep-body { grid-template-columns: 1fr; }
    /* Expense breakdown: drop fixed 180px label column */
    .rpt-exp-row { grid-template-columns: 1fr auto; }
    .rpt-exp-bar-wrap { display: none; }
    /* Trend card wraps on very small screens */
    .trend-card { flex-wrap: wrap; gap: 0.75rem; }
    /* Maintenance card right actions wrap */
    .maint-card-top { flex-wrap: wrap; gap: 0.5rem; }
    .maint-card-right { flex-wrap: wrap; }
    /* Revision notice: reduce padding */
    .rev-notice { padding: 1.5rem 1.25rem; }
    /* Tables: enable horizontal scroll */
    .analysis-table-wrap { overflow-x: auto; }
    .history-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; width: 100%; }
    .doc-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; width: 100%; }
}

/* ── Skeleton shimmer loader ────────────────────────────── */
@keyframes shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}
.skeleton {
    background: linear-gradient(90deg, var(--color-surface,#f8fafc) 25%, #e5e7eb 50%, var(--color-surface,#f8fafc) 75%);
    background-size: 800px 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 6px;
}
.skeleton-text   { height: 1rem;  margin-bottom: 0.5rem; }
.skeleton-number { height: 2rem;  width: 60%; margin-bottom: 0.25rem; }
.skeleton-block  { height: 4rem;  margin-bottom: 0.75rem; }

.btn--loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}
.btn--loading::after {
    content: "";
    display: inline-block;
    width: 14px; height: 14px;
    margin-left: 6px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
