/* ==========================================================================
   COURTYARD ATELIER — Phase 1 theme layer (Sheba Plaza client copy)
   Loads LAST (after system-consistency.css) from includes/layout.php and
   login.php. Presentation only: no layout.php behaviour depends on it.
   Palette sampled from the approved design reference (pg-02 / pg-15):
   warm cream surfaces, deep courtyard green, soft green tints, amber and
   clay accents, serif display type (Fraunces) + Inter for UI text.
   ========================================================================== */

:root {
    --cy-cream: #faf5ea;
    --cy-cream-deep: #f4edda;
    --cy-card: #fffdf8;
    --cy-ink: #263324;
    --cy-ink-soft: #55604f;
    --cy-muted: #7c8271;
    --cy-heading: #1e4633;
    --cy-green-900: #143d27;
    --cy-green-800: #1e5c39;
    --cy-green: #1d6a3e;
    --cy-green-hover: #175733;
    --cy-tint: #e8f1dc;
    --cy-tint-deep: #d9e8c8;
    --cy-amber: #e9a23b;
    --cy-amber-chip-bg: #fbeed3;
    --cy-amber-chip-text: #96650f;
    --cy-clay: #c2521b;
    --cy-rose-tint: #f9e9e1;
    --cy-blue-tint: #e3ebf7;
    --cy-blue-text: #33527e;
    --cy-line: #e8e0cb;
    --cy-line-soft: #efe8d3;
    --cy-radius: 16px;
    --cy-radius-sm: 10px;
    --cy-shadow: 0 1px 2px rgba(94, 74, 22, .05), 0 10px 30px rgba(94, 74, 22, .06);
    --cy-font-ui: "Inter", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --cy-font-display: "Fraunces", Georgia, "Times New Roman", serif;
    --cy-motion: cubic-bezier(.2, .8, .2, 1);
}

/* ---------- Base ---------- */
body {
    background: var(--cy-cream);
    color: var(--cy-ink);
    font-family: var(--cy-font-ui);
}
h1, h2, h3, .page-heading h1 {
    font-family: var(--cy-font-display);
    color: var(--cy-heading);
    letter-spacing: -.01em;
}
a { color: var(--cy-green); }
::selection { background: var(--cy-tint-deep); }

/* ---------- Shell frame (sidebar layout -> courtyard frame) ---------- */
.app-shell { display: block; min-height: 100vh; }
.main-area { margin-left: 0 !important; min-height: 100vh; display: flex; flex-direction: column; }
.content { max-width: 1180px; width: 100%; margin: 0 auto; padding: 26px 28px 40px; flex: 1; }
.app-footer { border-top: 1px solid var(--cy-line-soft); color: var(--cy-muted); background: transparent; }
.app-footer a { color: var(--cy-green); }

/* Desktop: the old sidebar is retired (it returns as the mobile sheet). */
@media (min-width: 981px) {
    .sidebar.cy-sheet { display: none !important; }
    .sidebar-overlay { display: none !important; }
}

/* Global loader, warmed up */
.global-loader-panel { background: var(--cy-card); border: 1px solid var(--cy-line); }
.loader-track i { background: var(--cy-green); }
.loader-brand .cy-brand-mark { color: #fff; }

/* ---------- Top navbar ---------- */
.cy-header {
    position: sticky; top: 0; z-index: 40;
    background: rgba(250, 245, 234, .92);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--cy-line);
}
.cy-header-in {
    max-width: 1240px; margin: 0 auto; padding: 10px 20px; min-height: 62px;
    display: flex; align-items: center; gap: 18px;
}
.cy-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex: 0 0 auto; }
.cy-brand-mark {
    width: 38px; height: 38px; display: grid; place-items: center;
    color: var(--cy-green-800);
}
.cy-brand-mark .ui-icon { width: 34px; height: 34px; stroke-width: 1.6; }
.cy-brand-name {
    font-family: var(--cy-font-display); font-weight: 700; font-size: 21px;
    color: var(--cy-heading); white-space: nowrap;
}

.cy-nav { display: flex; align-items: center; gap: 2px; margin-inline: auto; }
.cy-nav .nav-link {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 13px; margin: 0; border: 0; border-radius: 999px;
    color: var(--cy-ink-soft); font-size: 14px; font-weight: 600;
    background: transparent; box-shadow: none; transform: none;
    transition: background-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.cy-nav .nav-link::before { display: none; }
/* Icon colour follows the link's own colour: the SVGs stroke with
   currentColor, and app.css otherwise pins .nav-icon to a slate tone —
   and to WHITE on .nav-link.active, which on the old light-tint active
   pill was 1.16:1 (the "blending icon" bug). Every state below colours
   icon + label together, so no state can split them apart again. */
.cy-nav .nav-link .nav-icon { display: inline-grid; place-items: center; color: inherit; transform: none; }
.cy-nav .nav-link .ui-icon { width: 17px; height: 17px; }
.cy-nav .nav-link:hover { color: var(--cy-heading); background: var(--cy-tint); transform: none; }
.cy-nav .nav-link:hover .nav-icon { transform: none; }
.cy-nav .nav-link.active {
    color: var(--cy-cream);
    background: linear-gradient(120deg, var(--cy-green-800), var(--cy-green-900));
    box-shadow: 0 6px 16px rgba(20, 61, 39, .22); border-color: transparent;
}
.cy-nav .nav-link.active .nav-count { background: rgba(250, 245, 234, .24); color: var(--cy-cream); }

.cy-head-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.cy-search {
    width: 230px; height: 38px; border-radius: 999px;
    background: var(--cy-card); border: 1px solid var(--cy-line);
    transition: border-color .18s ease, box-shadow .18s ease;
}
.cy-search:focus-within { border-color: var(--cy-green); box-shadow: 0 0 0 3px var(--cy-tint); }
.cy-search input { color: var(--cy-ink); font-size: 13px; }
.cy-search kbd { display: none; }
.cy-head-actions .icon-button {
    color: var(--cy-ink-soft); border-radius: 999px;
    transition: background-color .18s ease, color .18s ease;
}
.cy-head-actions .icon-button:hover { background: var(--cy-tint); color: var(--cy-heading); }
.cy-head-actions .icon-button:active { background: var(--cy-tint-deep); color: var(--cy-heading); }
.notification-popover { border-color: var(--cy-line); background: var(--cy-card); }
.notification-popover-head a { color: var(--cy-green); }

/* Language toggle (markup + mechanism unchanged; colours warmed) */
.lang-toggle { border-color: var(--cy-line); background: var(--cy-card); }
.lang-toggle a { color: var(--cy-ink-soft); }
.lang-toggle a.active { background: var(--cy-green); color: #fff; }

/* Owner menu (native <details>, no JS needed) */
.cy-owner { position: relative; }
.cy-owner-btn {
    list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 9px;
    padding: 5px 12px 5px 5px; border: 1px solid var(--cy-line); border-radius: 999px;
    background: var(--cy-card); color: var(--cy-ink); user-select: none;
    transition: background-color .18s ease, border-color .18s ease;
}
.cy-owner-btn:hover { background: var(--cy-cream-deep); border-color: var(--cy-tint-deep); }
.cy-owner[open ] .cy-owner-btn { background: var(--cy-tint); border-color: var(--cy-tint-deep); }
.cy-owner-btn::-webkit-details-marker { display: none; }
.cy-owner-avatar {
    width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
    background: var(--cy-tint); color: var(--cy-green-800); font-weight: 800; font-size: 13px;
}
.cy-owner-name { font-weight: 700; font-size: 13.5px; }
.cy-owner-role { display: none; }
.cy-owner-chev { width: 15px; height: 15px; color: var(--cy-muted); transform: rotate(90deg); transition: transform .18s ease; }
.cy-owner[open ] .cy-owner-chev { transform: rotate(-90deg); }
.cy-owner-menu {
    position: absolute; right: 0; top: calc(100% + 10px); width: 264px; z-index: 90;
    background: var(--cy-card); border: 1px solid var(--cy-line); border-radius: 14px;
    box-shadow: 0 24px 60px rgba(60, 45, 10, .16); padding: 10px;
    animation: cy-menu-enter .16s ease both;
}
.cy-owner-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--cy-line-soft); margin-bottom: 8px; display: grid; }
.cy-owner-head strong { font-size: 14.5px; color: var(--cy-heading); }
.cy-owner-head span { font-size: 12px; color: var(--cy-muted); }
.cy-owner-menu .nav-link {
    display: flex; align-items: center; gap: 10px; padding: 9px 10px; margin: 1px 0;
    border: 0; border-radius: 9px; color: var(--cy-ink); font-size: 13.5px; font-weight: 600;
    background: transparent; box-shadow: none; transform: none;
    transition: background-color .18s ease, color .18s ease;
}
.cy-owner-menu .nav-link::before { display: none; }
.cy-owner-menu .nav-link .nav-icon { color: inherit; transform: none; }
.cy-owner-menu .nav-link .ui-icon { width: 17px; height: 17px; }
.cy-owner-menu .nav-link:hover { background: var(--cy-tint); color: var(--cy-heading); transform: none; }
.cy-owner-menu .nav-link:hover .nav-icon { transform: none; }
.cy-owner-menu .nav-link.active {
    background: linear-gradient(120deg, var(--cy-green-800), var(--cy-green-900));
    color: var(--cy-cream); box-shadow: none;
}
.cy-owner-tools {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 10px; margin-top: 8px; border-top: 1px solid var(--cy-line-soft);
}
.cy-signout {
    display: flex; align-items: center; gap: 10px; padding: 9px 10px;
    border-top: 1px solid var(--cy-line-soft); margin-top: 2px;
    color: var(--cy-clay); font-size: 13.5px; font-weight: 600; text-decoration: none;
}
.cy-signout .ui-icon { width: 17px; height: 17px; }
.cy-signout:hover { color: #a34415; }

/* ---------- Mobile sheet (the retired sidebar, restyled warm) ---------- */
@media (max-width: 980px) {
    .sidebar.cy-sheet {
        background: var(--cy-cream); color: var(--cy-ink);
        box-shadow: 18px 0 50px rgba(60, 45, 10, .18);
        height: 100dvh; width: min(300px, 86vw);
    }
    .cy-sheet .navigation { overflow-y: auto; -webkit-overflow-scrolling: touch; }
    .cy-sheet .brand { border-bottom: 1px solid var(--cy-line-soft); }
    .cy-sheet .cy-sheet-search {
        display: flex; align-items: center; gap: 10px;
        width: auto; max-width: none; flex: none;
        margin: 12px 16px 2px; padding: 0 12px;
    }
    .cy-sheet .cy-sheet-search > span { width: 18px; height: 18px; display: grid; place-items: center; color: var(--cy-muted); flex: 0 0 18px; }
    .cy-sheet .cy-sheet-search .ui-icon { width: 16px; height: 16px; }
    .cy-sheet .cy-sheet-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; }
    .cy-sheet .brand-copy strong { color: var(--cy-heading); font-family: var(--cy-font-display); }
    .cy-sheet .brand-copy span { color: var(--cy-muted); }
    .cy-sheet .sidebar-collapse { display: none !important; }
    .cy-sheet .sidebar-close { color: var(--cy-ink-soft); }
    .cy-sheet .nav-label { color: var(--cy-muted); }
    .cy-sheet .nav-link {
        color: var(--cy-ink-soft); border-color: transparent; background: transparent; box-shadow: none;
        transition: background-color .18s ease, color .18s ease;
    }
    .cy-sheet .nav-link .nav-icon { color: inherit; }
    .cy-sheet .nav-link::before { background: var(--cy-green); }
    .cy-sheet .nav-link:hover { color: var(--cy-heading); background: var(--cy-tint); transform: none; }
    .cy-sheet .nav-link.active {
        color: var(--cy-cream); border-color: transparent;
        background: linear-gradient(120deg, var(--cy-green-800), var(--cy-green-900));
        box-shadow: 0 6px 16px rgba(20, 61, 39, .20);
    }
    .cy-sheet .nav-link.active::before { background: var(--cy-cream); }
    .cy-sheet .sidebar-user { border-top: 1px solid var(--cy-line-soft); }
    .cy-sheet .sidebar-user-copy strong { color: var(--cy-ink); }
    .cy-sheet .sidebar-user-copy span { color: var(--cy-muted); }
    .cy-sheet .sidebar-signout { color: var(--cy-clay); }
}

/* ---------- Mobile bottom tab bar ---------- */
.cy-tabbar { display: none; }
@media (max-width: 980px) {
    body { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
    .cy-tabbar {
        display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
        background: rgba(255, 253, 248, .96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
        border-top: 1px solid var(--cy-line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    }
    .cy-tabbar .nav-link, .cy-tab-menu {
        flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 3px;
        padding: 6px 2px; margin: 0; min-height: 0; border: 0; border-radius: 14px;
        background: transparent; box-shadow: none; transform: none;
        color: var(--cy-ink-soft); font-size: 11px; font-weight: 600; font-family: var(--cy-font-ui);
        cursor: pointer; text-decoration: none;
        transition: background-color .18s ease, color .18s ease, box-shadow .18s ease;
    }
    .cy-tabbar .nav-link::before { display: none; }
    .cy-tabbar .nav-link .nav-icon { display: grid; place-items: center; color: inherit; transform: none; }
    .cy-tabbar .nav-link .ui-icon, .cy-tab-menu .ui-icon { width: 19px; height: 19px; }
    .cy-tabbar .nav-link:hover { color: var(--cy-heading); background: transparent; transform: none; }
    .cy-tabbar .nav-link:hover .nav-icon { transform: none; }
    .cy-tabbar .nav-link.active {
        color: var(--cy-cream);
        background: linear-gradient(120deg, var(--cy-green-800), var(--cy-green-900));
        box-shadow: 0 6px 16px rgba(20, 61, 39, .22);
    }
    .cy-tab-menu:hover { color: var(--cy-heading); }
    .cy-tab-menu:active { background: var(--cy-tint); color: var(--cy-heading); }
    .cy-tab-menu .ui-icon { margin-top: 2px; }
}

/* Header responsiveness — explicit bands:
   >= 1200px  full nav, full-size search, generous gaps.
   981–1199px compact desktop: full nav stays, gaps/padding/search shrink.
   <= 980px   top bar = brand + search (until 860) + bell + owner, plus the
              bottom tab bar; the search narrows on mid widths and is hidden
              only on small phones, where the mobile sheet carries its own. */
@media (max-width: 1199px) and (min-width: 861px) {
    .cy-search { width: 168px; max-width: 168px; flex: 0 1 168px; }
}
@media (max-width: 1199px) and (min-width: 981px) {
    .cy-header-in { gap: 12px; padding: 10px 16px; }
    .cy-nav { gap: 0; }
    .cy-nav .nav-link { padding: 8px 10px; font-size: 13.5px; }
    .cy-brand-name { font-size: 20px; }
}
@media (max-width: 860px) {
    .cy-head-actions .cy-search { display: none; }
}
@media (max-width: 980px) {
    .cy-nav { display: none; }
    .cy-header-in { padding: 8px 14px; gap: 10px; min-height: 56px; }
    .cy-brand { min-width: 0; }
    .cy-brand-name { font-size: 19px; overflow: hidden; text-overflow: ellipsis; }
    .cy-owner-name { display: none; }
    .cy-owner-btn { padding: 4px; border: 0; background: transparent; }
    .cy-owner-chev { display: none; }
    .content { padding: 18px 14px 30px; }
}
/* Short landscape phones (e.g. 844x390): slim the chrome so content leads. */
@media (max-width: 980px) and (max-height: 480px) and (orientation: landscape) {
    .cy-header-in { min-height: 50px; padding-top: 6px; padding-bottom: 6px; }
    .cy-tabbar { padding-top: 4px; }
    body { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
}

/* ---------- Generic components ---------- */
.btn {
    border-radius: var(--cy-radius-sm); font-weight: 600;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease,
        box-shadow .18s ease, transform .18s ease;
}
.btn-primary {
    background: var(--cy-green); border-color: var(--cy-green); color: #fff;
    box-shadow: 0 6px 16px rgba(29, 106, 62, .22);
}
.btn-primary:hover { background: var(--cy-green-hover); border-color: var(--cy-green-hover); }
.btn-primary:active { transform: translateY(1px); box-shadow: 0 3px 10px rgba(29, 106, 62, .20); }
.btn-secondary:active { transform: translateY(1px); }
.btn-secondary {
    background: var(--cy-card); border: 1px solid var(--cy-line); color: var(--cy-green-800);
}
.btn-secondary:hover { background: var(--cy-cream-deep); border-color: var(--cy-line); color: var(--cy-heading); }
.card {
    background: var(--cy-card); border: 1px solid var(--cy-line-soft);
    border-radius: var(--cy-radius); box-shadow: var(--cy-shadow);
}
.card-header h2 { font-family: var(--cy-font-display); color: var(--cy-heading); }
.section-eyebrow { color: var(--cy-green); }
.page-heading-premium {
    background: var(--cy-card); border: 1px solid var(--cy-line-soft);
    border-radius: var(--cy-radius); box-shadow: var(--cy-shadow);
}
.page-heading-icon { background: var(--cy-tint); color: var(--cy-green-800); }
body.module-dashboard .page-heading { display: none; } /* Home has its own Courtyard headline */
.alert { border-radius: var(--cy-radius-sm); }
.badge { border-radius: 999px; }
input.input, select.select, textarea.input, .input, .select {
    border-color: var(--cy-line); border-radius: var(--cy-radius-sm); background: var(--cy-card);
}
.table th, table.table thead th { background: var(--cy-cream-deep); color: var(--cy-heading); }

/* ---------- Home: headline row ---------- */
.cy-home-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 18px; flex-wrap: wrap; margin: 4px 0 20px;
}
.cy-display {
    font-size: clamp(28px, 3.4vw, 40px); line-height: 1.12; font-weight: 600; margin: 0;
}
.cy-home-sub {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin: 8px 0 0; color: var(--cy-muted); font-size: 13.5px;
}
.cy-home-loc { display: inline-flex; align-items: center; gap: 5px; }
.cy-home-loc .ui-icon { width: 15px; height: 15px; color: var(--cy-green); }
.cy-dot-sep { color: var(--cy-line); }
.cy-home-actions { display: flex; align-items: center; gap: 10px; }
.cy-month-chip {
    display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px;
    background: var(--cy-card); border: 1px solid var(--cy-line); border-radius: var(--cy-radius-sm);
    font-weight: 600; font-size: 14px; color: var(--cy-ink);
}
.cy-month-chip .ui-icon { width: 16px; height: 16px; color: var(--cy-muted); }
.cy-collect-btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; font-size: 14.5px; }
.cy-collect-btn .ui-icon { width: 17px; height: 17px; }

/* ---------- Home: hero + stat stack ---------- */
.cy-hero-grid {
    display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
    gap: 16px; margin-bottom: 16px;
}
.cy-hero {
    position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
    padding: 26px 28px; border-radius: var(--cy-radius);
    background: linear-gradient(120deg, var(--cy-green-800), var(--cy-green-900));
    color: #f2f7ec; box-shadow: 0 14px 34px rgba(20, 61, 39, .25);
}
.cy-hero::before {
    content: ""; position: absolute; left: -30px; bottom: -46px; width: 210px; height: 210px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-opacity='0.10' stroke-width='1.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 21V11l8-7 8 7v10'/%3E%3Cpath d='M9.5 21v-5a2.5 2.5 0 0 1 5 0v5'/%3E%3Cpath d='M2.5 21h19'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-size: contain; pointer-events: none;
}
.cy-hero-main { position: relative; display: grid; gap: 6px; }
.cy-hero-label {
    font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #cfe3c8;
}
.cy-hero-amount {
    font-family: var(--cy-font-display); font-weight: 600;
    font-size: clamp(30px, 3.6vw, 44px); line-height: 1.05; color: #fff;
}
.cy-hero-side { position: relative; min-width: 180px; display: grid; gap: 7px; }
.cy-hero-side-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: #dcebdd; }
.cy-hero-side-head strong { font-size: 15px; color: #fff; }
.cy-progress { height: 7px; border-radius: 999px; background: rgba(255, 255, 255, .22); overflow: hidden; }
.cy-progress span { display: block; height: 100%; border-radius: 999px; background: #eaf5dc; }
.cy-hero-side small { color: #cfe3c8; font-size: 12.5px; }

.cy-stat-stack { display: grid; gap: 16px; }
.cy-stat {
    display: flex; align-items: center; gap: 14px; padding: 18px 20px;
    background: var(--cy-card); border: 1px solid var(--cy-line-soft); border-radius: var(--cy-radius);
    box-shadow: var(--cy-shadow); text-decoration: none;
    transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
a.cy-stat:hover { transform: translateY(-2px); border-color: var(--cy-line); box-shadow: 0 4px 8px rgba(94, 74, 22, .05), 0 16px 38px rgba(94, 74, 22, .09); }
.cy-stat-icon, .cy-occ-icon, .cy-next-icon {
    width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 12px;
}
.cy-stat-icon .ui-icon, .cy-occ-icon .ui-icon, .cy-next-icon .ui-icon { width: 20px; height: 20px; }
.tint-clay { background: var(--cy-rose-tint); color: var(--cy-clay); }
.tint-amber { background: var(--cy-amber-chip-bg); color: var(--cy-amber-chip-text); }
.tint-rose { background: var(--cy-rose-tint); color: var(--cy-clay); }
.tint-blue { background: var(--cy-blue-tint); color: var(--cy-blue-text); }
.cy-stat-copy { display: grid; gap: 2px; margin-right: auto; }
.cy-stat-copy > span { font-size: 13px; color: var(--cy-muted); font-weight: 600; }
.cy-stat-copy strong { font-family: var(--cy-font-display); font-size: 23px; font-weight: 600; color: var(--cy-heading); }
.cy-amount-clay { color: var(--cy-clay) !important; }
.cy-stat-chev { color: var(--cy-muted); display: grid; place-items: center; }
.cy-stat-chev .ui-icon { width: 16px; height: 16px; }

/* ---------- Home: occupancy strip ---------- */
.cy-occupancy {
    display: flex; align-items: center; gap: 14px; padding: 14px 20px; margin-bottom: 16px;
    background: var(--cy-card); border: 1px solid var(--cy-line-soft); border-radius: var(--cy-radius);
    box-shadow: var(--cy-shadow);
}
.cy-occ-icon { background: var(--cy-tint); color: var(--cy-green-800); }
.cy-occ-copy { display: grid; gap: 1px; }
.cy-occ-copy > span { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--cy-muted); }
.cy-occ-copy strong { font-size: 16.5px; color: var(--cy-heading); }
.cy-chip-vacant {
    padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
    background: var(--cy-amber-chip-bg); color: var(--cy-amber-chip-text);
}
.cy-add-expense { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; }
.cy-add-expense .ui-icon { width: 15px; height: 15px; }

/* ---------- Home: floors + next-to-look ---------- */
.cy-home-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.cy-card {
    background: var(--cy-card); border: 1px solid var(--cy-line-soft); border-radius: var(--cy-radius);
    box-shadow: var(--cy-shadow); padding: 20px 22px;
}
.cy-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.cy-card-head h2 { margin: 0; font-size: 20px; font-weight: 600; }
.cy-card-head p { margin: 3px 0 0; color: var(--cy-muted); font-size: 13px; }
.cy-viewall { font-size: 13px; font-weight: 700; color: var(--cy-green); text-decoration: none; white-space: nowrap; }
.cy-viewall:hover { color: var(--cy-green-hover); }
.cy-table-wrap { overflow-x: auto; }
.cy-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cy-table th {
    text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
    color: var(--cy-ink-soft); background: var(--cy-cream-deep); padding: 9px 12px; white-space: nowrap;
}
.cy-table th:first-child { border-radius: 8px 0 0 8px; }
.cy-table th:last-child { border-radius: 0 8px 8px 0; }
.cy-table td { padding: 12px; border-bottom: 1px solid var(--cy-line-soft); vertical-align: middle; }
.cy-table tbody tr:last-child td { border-bottom: 0; }
.cy-floor-link { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--cy-ink); }
.cy-floor-icon {
    width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px;
    background: var(--cy-cream-deep); color: var(--cy-green-800);
}
.cy-floor-icon .ui-icon { width: 17px; height: 17px; }
.cy-occ-ok { color: var(--cy-green-800); font-weight: 600; }
.cy-occ-vac { color: var(--cy-amber-chip-text); font-weight: 600; }
.cy-cell-chev { text-align: right; }
.cy-cell-chev a { color: var(--cy-muted); display: inline-grid; place-items: center; }
.cy-cell-chev .ui-icon { width: 16px; height: 16px; }
.cy-empty { color: var(--cy-muted); text-align: center; padding: 20px 12px !important; }
.cy-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.cy-next-list { display: grid; }
.cy-next-row {
    display: flex; align-items: center; gap: 13px; padding: 13px 6px;
    border-bottom: 1px solid var(--cy-line-soft); text-decoration: none; border-radius: 8px;
    transition: background-color .15s ease;
}
.cy-next-row:last-child { border-bottom: 0; }
.cy-next-row:hover { background: var(--cy-cream); }
.cy-next-icon { width: 40px; height: 40px; flex-basis: 40px; border-radius: 11px; }
.cy-next-copy { display: grid; gap: 1px; margin-right: auto; }
.cy-next-copy strong { font-size: 14.5px; color: var(--cy-ink); }
.cy-next-copy small { font-size: 12.5px; color: var(--cy-muted); }
.cy-next-chev { width: 16px; height: 16px; color: var(--cy-muted); }

/* ---------- Home: recent payments ---------- */
.cy-recent { margin-bottom: 16px; }
.cy-pay-tenant { display: inline-flex; align-items: center; gap: 10px; }
.cy-pay-check {
    width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
    background: var(--cy-green); color: #fff; flex: 0 0 22px;
}
.cy-pay-check .ui-icon { width: 12px; height: 12px; stroke-width: 2.4; }
.cy-amount-green { color: var(--cy-green-800); font-weight: 700; font-family: var(--cy-font-display); font-size: 15.5px; }
.cy-chip { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.cy-chip-cash { background: var(--cy-tint); color: var(--cy-green-800); }
.cy-chip-bank { background: var(--cy-blue-tint); color: var(--cy-blue-text); }
.cy-chip-other { background: var(--cy-cream-deep); color: var(--cy-ink-soft); }
.cy-date { color: var(--cy-muted); white-space: nowrap; }

/* Legacy dashboard blocks below the reference area: warm them up lightly */
.dashboard-quick-actions { margin-bottom: 16px; }
.dashboard-quick-action { border-radius: var(--cy-radius); border-color: var(--cy-line-soft); background: var(--cy-card); }
.dashboard-quick-action.primary { background: var(--cy-tint); border-color: var(--cy-tint-deep); }
.dashboard-main-grid, .dashboard-bottom-grid { margin-bottom: 16px; }
.attention-icon { border-radius: 11px; }

/* Home responsiveness */
@media (max-width: 900px) {
    .cy-hero-grid, .cy-home-grid { grid-template-columns: 1fr; }
    .cy-hero { flex-direction: column; align-items: flex-start; }
    .cy-hero-side { width: 100%; min-width: 0; }
    .cy-stat-stack { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
    .cy-stat-stack { grid-template-columns: 1fr; }
    .cy-home-actions { width: 100%; }
    .cy-collect-btn { flex: 1; justify-content: center; }
    .cy-occupancy { flex-wrap: wrap; }
    .cy-add-expense { margin-left: 0; }
    .cy-card { padding: 16px; }
}

/* ---------- Login (pg-15 concept) ---------- */
body.login-page {
    background: var(--cy-cream); font-family: var(--cy-font-ui); color: var(--cy-ink);
    min-height: 100vh; display: grid; place-items: center; padding: 28px 16px;
}
.cy-login-shell { width: 100%; max-width: 920px; }
.cy-login-card {
    display: grid; grid-template-columns: 1fr 1.05fr; overflow: hidden;
    background: var(--cy-card); border: 1px solid var(--cy-line); border-radius: 22px;
    box-shadow: 0 30px 80px rgba(60, 45, 10, .14);
}
.cy-login-left {
    padding: 36px 34px; display: flex; flex-direction: column; gap: 26px;
    background: linear-gradient(160deg, #fdfaf1, var(--cy-cream-deep));
    border-right: 1px solid var(--cy-line-soft);
}
.cy-login-brand { display: flex; align-items: center; gap: 11px; }
.cy-login-mark { width: 40px; height: 40px; color: var(--cy-green-800); display: grid; place-items: center; }
.cy-login-mark svg { width: 38px; height: 38px; }
.cy-login-brand strong { display: block; font-family: var(--cy-font-display); font-size: 19px; color: var(--cy-heading); }
.cy-login-brand span { font-size: 12px; color: var(--cy-muted); }
.cy-login-welcome { margin-top: 10px; }
.cy-login-welcome h1 {
    font-family: var(--cy-font-display); font-weight: 600; color: var(--cy-heading);
    font-size: clamp(26px, 3vw, 33px); line-height: 1.18; margin: 0 0 10px;
}
.cy-login-welcome p { margin: 0; color: var(--cy-ink-soft); font-size: 14.5px; line-height: 1.55; }
.cy-login-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cy-login-stats article {
    background: rgba(255, 253, 248, .75); border: 1px solid var(--cy-line-soft);
    border-radius: 12px; padding: 12px 13px; display: grid; gap: 2px;
}
.cy-login-stats strong { font-family: var(--cy-font-display); font-size: 20px; color: var(--cy-green-800); }
.cy-login-stats span { font-size: 11.5px; color: var(--cy-muted); font-weight: 600; }
.cy-login-secure { margin-top: auto; display: flex; gap: 12px; align-items: flex-start; }
.cy-login-secure svg {
    width: 26px; height: 26px; flex: 0 0 26px; fill: none; stroke: var(--cy-green);
    stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.cy-login-secure strong { display: block; font-size: 14px; color: var(--cy-heading); }
.cy-login-secure small { color: var(--cy-muted); font-size: 12.5px; line-height: 1.45; }
.cy-login-right { padding: 36px 38px 26px; display: flex; flex-direction: column; }
.cy-login-form-head { margin-bottom: 20px; }
.cy-login-greeting {
    font-size: 11.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--cy-green);
}
.cy-login-form-head h2 {
    font-family: var(--cy-font-display); font-weight: 600; font-size: 27px; color: var(--cy-heading); margin: 6px 0 5px;
}
.cy-login-form-head p { margin: 0; color: var(--cy-muted); font-size: 13.5px; }
.cy-login-right .login-control { border-color: var(--cy-line); border-radius: var(--cy-radius-sm); background: var(--cy-card); }
.cy-login-right .login-control:focus-within { border-color: var(--cy-green); box-shadow: 0 0 0 3px var(--cy-tint); }
.cy-login-right .login-submit {
    background: var(--cy-green); border-radius: var(--cy-radius-sm);
    box-shadow: 0 8px 20px rgba(29, 106, 62, .22);
}
.cy-login-right .login-submit:hover { background: var(--cy-green-hover); }
.cy-login-right .login-security { margin-top: 18px; }
.cy-login-foot {
    margin-top: auto; padding-top: 20px; display: flex; justify-content: space-between; gap: 10px;
    color: var(--cy-muted); font-size: 12px;
}
@media (max-width: 760px) {
    .cy-login-card { grid-template-columns: 1fr; }
    .cy-login-left { border-right: 0; border-bottom: 1px solid var(--cy-line-soft); padding: 26px 24px; gap: 18px; }
    .cy-login-secure { margin-top: 0; }
    .cy-login-right { padding: 26px 24px 20px; }
}

/* ---------- Round 2: focus, motion utilities, reduced motion ---------- */
/* Keyboard focus: one visible ring across the whole shell (2px + offset). */
.cy-header a:focus-visible, .cy-header button:focus-visible, .cy-header summary:focus-visible,
.cy-tabbar a:focus-visible, .cy-tabbar button:focus-visible,
.cy-sheet a:focus-visible, .cy-sheet button:focus-visible, .cy-sheet input:focus-visible,
.cy-owner-menu a:focus-visible, .cy-owner-menu button:focus-visible {
    outline: 2px solid var(--cy-green-800); outline-offset: 2px;
}

/* Menus settle in gently (opacity + a 3px settle — no bounce, no slide show). */
@keyframes cy-menu-enter { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }

/* Page-load entrance: app.css already runs its content-enter keyframes on
   .content > * for every page, so the shell adds no second entrance there.
   .cy-enter is the same pattern as a utility for elements a page adds
   itself (Lane B: hero blocks, cards). */
.cy-enter { animation: content-enter .48s both var(--cy-motion); }

/* Hero progress fill: the bar's width is an inline style set by the page,
   so the load animation scales a full-width span in from the left instead.
   Lane B adds .cy-progress-fill to the .cy-progress element on Home. */
@keyframes cy-progress-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.cy-progress-fill > span {
    transform-origin: left center;
    animation: cy-progress-fill .9s var(--cy-motion) .15s both;
}

/* Reduced motion: every Courtyard animation/transition becomes instant,
   including the app.css entrance the content relies on. */
@media (prefers-reduced-motion: reduce) {
    .cy-header *, .cy-tabbar *, .cy-sheet *, .content *, .cy-login-card * {
        animation-duration: .01ms !important; animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    .content > * { animation: none !important; }
    .cy-progress-fill > span { animation: none !important; transform: none !important; }
    a.cy-stat:hover { transform: none; }
    .btn-primary:active, .btn-secondary:active { transform: none; }
}

/* ---------- Print: app chrome stays off paper ---------- */
@media print {
    .cy-header, .cy-tabbar, .sidebar.cy-sheet { display: none !important; }
    body { padding-bottom: 0; background: #fff; }
}
