/* GARAMIKA INC. — Resident App styles. Tokens from Brand Guidelines v1.0 (Nov 2026). */
:root {
  --navy: #0A2A4E;        /* Harbour Navy — headlines, headers */
  --blue: #3D73B1;        /* Garamika Blue — icons, links, Tread */
  --morning: #C7D6F1;     /* Morning Blue — shapes only, never text on light */
  --deep: #2F5E96;        /* Deep Blue — buttons */
  --sand: #C8B38A;        /* Sand — badges, sparingly */
  --linen: #FAF7F2;       /* page background */
  --mist: #E8EEF8;        /* info cards, rows */
  --stone: #E7E2D9;       /* lines */
  --ink: #1D2633;         /* body text */
  --slate: #5B6675;       /* captions */
  --white: #FFFFFF;
  --sage: #5E7F6B;        /* functional: verified / paid */
  --alert: #9B3B2E;       /* functional addition for overdue & emergency — owner to approve */
  --alert-bg: #F6E9E6;
  --sage-bg: #E7EFEA;
  --sand-bg: #F3ECDD;
  --radius: 12px;
  --serif: 'Lora', Georgia, serif;
  --sans: 'Inter', Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--linen); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--deep); }
img { max-width: 100%; display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Layout */
.app { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--linen); position: relative; padding-bottom: calc(84px + var(--safe-b)); }
.app.admin { max-width: 1040px; padding-bottom: 40px; }
.app.nonav { padding-bottom: 32px; }
.page { padding: 8px 20px 24px; }
.stack > * + * { margin-top: 16px; }
.stack-sm > * + * { margin-top: 8px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 760px) { .admin .grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; } .admin .cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; } .admin .cols2 > * + * { margin-top: 0; } }

/* Type */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; color: var(--navy); margin: 0; }
h1 { font-size: 28px; line-height: 1.15; }
h2 { font-size: 21px; line-height: 1.2; }
h3 { font-size: 17px; line-height: 1.3; }
p { margin: 0; }
.label { font-family: var(--sans); font-weight: 600; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--slate); }
.label.navy { color: var(--navy); }
.caption { font-size: 13.5px; color: var(--slate); }
.muted { color: var(--slate); }
.big { font-family: var(--serif); font-size: 32px; font-weight: 600; color: var(--navy); line-height: 1.1; }
.strong { font-weight: 600; }

/* Tread — signature device, once per screen */
.tread { display: flex; height: 4px; width: 72px; border-radius: 2px; overflow: hidden; }
.tread i { flex: 1; } .tread i:nth-child(1) { background: var(--navy); } .tread i:nth-child(2) { background: var(--blue); } .tread i:nth-child(3) { background: var(--morning); }
.tread.full { width: 100%; height: 4px; border-radius: 0; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--linen); padding: calc(12px + var(--safe-t)) 20px 10px; display: flex; align-items: center; gap: 12px; min-height: 60px; }
.topbar .title { font-family: var(--serif); font-weight: 600; font-size: 19px; color: var(--navy); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .logo { height: 18px; width: auto; }
.iconbtn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--stone); background: var(--white); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; position: relative; color: var(--navy); flex: none; }
.iconbtn .dot { position: absolute; top: 6px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--deep); color: #fff; font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.iconbtn.plain { border: 0; background: transparent; }
svg.i { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.sm { width: 18px; height: 18px; }
svg.i.lg { width: 26px; height: 26px; }

/* Cards */
.card { background: var(--white); border: 1px solid var(--stone); border-radius: var(--radius); padding: 18px; }
.card.mist { background: var(--mist); border-color: transparent; }
.card.navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.card.navy h2, .card.navy h3, .card.navy .big { color: #fff; }
.card.navy .label { color: var(--morning); }
.card.navy .caption { color: var(--morning); }
.card.tight { padding: 14px; }
.card.flush { padding: 0; overflow: hidden; }
.divider { height: 1px; background: var(--stone); margin: 14px 0; border: 0; }
.card.navy .divider { background: rgba(199,214,241,.25); }
.offset-frame { position: relative; }
.offset-frame::before { content: ''; position: absolute; inset: 8px -8px -8px 8px; border: 1.5px solid var(--blue); border-radius: var(--radius); z-index: 0; }
.offset-frame img { position: relative; z-index: 1; border-radius: var(--radius); width: 100%; height: 170px; object-fit: cover; }

/* Key-value list */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 15px; }
.kv dt { color: var(--slate); }
.kv dd { margin: 0; text-align: right; font-weight: 500; color: var(--ink); }
.card.navy .kv dt { color: var(--morning); } .card.navy .kv dd { color: #fff; }

/* List rows */
.list { background: var(--white); border: 1px solid var(--stone); border-radius: var(--radius); overflow: hidden; }
.list > .item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 60px; border-top: 1px solid var(--stone); cursor: pointer; background: none; width: 100%; text-align: left; border-left: 0; border-right: 0; border-bottom: 0; }
.list > .item:first-child { border-top: 0; }
.list > .item:hover { background: #FCFBF8; }
.list > .item.static { cursor: default; }
.list > .item .chev { color: var(--slate); }
.item .t { font-weight: 600; color: var(--ink); font-size: 15px; }
.item .s { font-size: 13.5px; color: var(--slate); }
.ico-tile { width: 40px; height: 40px; border-radius: 10px; background: var(--mist); color: var(--blue); display: flex; align-items: center; justify-content: center; flex: none; }
.ico-tile.alert { background: var(--alert-bg); color: var(--alert); }
.ico-tile.ok { background: var(--sage-bg); color: var(--sage); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 10px; border: 1px solid var(--deep); background: var(--deep); color: #fff; font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--navy); border-color: var(--navy); }
.btn.block { width: 100%; }
.btn.secondary { background: var(--white); color: var(--navy); border-color: var(--stone); }
.btn.secondary:hover { border-color: var(--deep); background: var(--white); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--deep); padding: 0 8px; }
.btn.ghost:hover { background: var(--mist); }
.btn.onnavy { background: #fff; color: var(--navy); border-color: #fff; }
.btn.danger { background: var(--white); color: var(--alert); border-color: var(--alert); }
.btn.ok { background: var(--sage); border-color: var(--sage); }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--deep); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* Quick actions */
.qa { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.qa button { background: var(--white); border: 1px solid var(--stone); border-radius: var(--radius); padding: 14px 6px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; min-height: 92px; color: var(--navy); font-size: 13px; font-weight: 600; line-height: 1.25; text-align: center; }
.qa button:hover { border-color: var(--blue); }
.qa svg { color: var(--blue); }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; line-height: 1.4; }
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--sage-bg); color: var(--sage); }
.badge.info { background: var(--mist); color: var(--deep); }
.badge.warn { background: var(--sand-bg); color: #6B5526; }
.badge.alert { background: var(--alert-bg); color: var(--alert); }
.badge.neutral { background: var(--mist); color: var(--navy); }
.badge.nodot::before { display: none; }
.card.navy .badge { background: #fff; }
.demo { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--navy); background: var(--sand); border-radius: 4px; padding: 2px 6px; vertical-align: middle; }

/* Notices */
.notice { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius); background: var(--mist); color: var(--navy); font-size: 14.5px; }
.notice.alert { background: var(--alert-bg); color: var(--alert); }
.notice.alert strong { color: var(--alert); }
.notice.warn { background: var(--sand-bg); color: #4F3F1C; }
.notice.ok { background: var(--sage-bg); color: #2F4A3A; }
.notice svg { flex: none; margin-top: 2px; }

/* Forms */
.field { display: block; }
.field > span { display: block; font-weight: 600; font-size: 14.5px; color: var(--navy); margin-bottom: 6px; }
.field > small { display: block; color: var(--slate); font-size: 13px; margin-top: 4px; }
.input, select.input, textarea.input { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid #CFC8BB; border-radius: 10px; background: var(--white); font-size: 16px; }
textarea.input { min-height: 96px; resize: vertical; }
.input:focus, .btn:focus-visible, .item:focus-visible, .chip:focus-visible, .qa button:focus-visible, .iconbtn:focus-visible, .navbtn:focus-visible { outline: 3px solid var(--morning); outline-offset: 2px; border-color: var(--deep); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 0 14px; border: 1px solid var(--stone); border-radius: 999px; background: var(--white); cursor: pointer; font-size: 14px; font-weight: 500; color: var(--ink); }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.upload { display: flex; align-items: center; gap: 12px; padding: 16px; border: 1.5px dashed #BFC9D8; border-radius: var(--radius); background: var(--white); cursor: pointer; color: var(--deep); font-weight: 600; }
.upload input { display: none; }
.thumb { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; border: 1px solid var(--stone); }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--deep); margin: 2px 0 0; flex: none; }

/* Tabs */
.tabs { display: flex; gap: 6px; background: var(--white); border: 1px solid var(--stone); border-radius: 12px; padding: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 1 0 auto; min-height: 40px; border: 0; border-radius: 9px; background: transparent; font-weight: 600; font-size: 13.5px; color: var(--slate); cursor: pointer; padding: 0 9px; white-space: nowrap; }
.tabs button.on { background: var(--navy); color: #fff; }

/* Bottom nav */
.bottomnav { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 480px; background: var(--white); border-top: 1px solid var(--stone); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 6px 4px calc(6px + var(--safe-b)); z-index: 30; }
.navbtn { background: none; border: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; min-height: 56px; cursor: pointer; color: var(--slate); font-size: 11.5px; font-weight: 600; border-radius: 10px; }
.navbtn.on { color: var(--navy); }
.navbtn.on svg { color: var(--blue); }
.navbtn.on::after { content: ''; width: 18px; height: 3px; border-radius: 2px; background: var(--blue); margin-top: 1px; }

/* Login */
.login { min-height: 100vh; display: flex; flex-direction: column; padding: calc(28px + var(--safe-t)) 24px 28px; }
.login .logo { width: 200px; height: auto; }
.pinrow { display: flex; gap: 10px; justify-content: center; }
.pinbox { width: 44px; height: 54px; border-radius: 10px; border: 1px solid #CFC8BB; background: var(--white); display: flex; align-items: center; justify-content: center; font-size: 24px; color: var(--navy); }
.pinbox.f { border-color: var(--deep); }
.pinbox.f::after { content: ''; width: 12px; height: 12px; border-radius: 50%; background: var(--navy); }
.pinbox.opt { border-style: dashed; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.keypad button { min-height: 58px; border-radius: 12px; border: 1px solid var(--stone); background: var(--white); font-size: 22px; font-weight: 500; color: var(--navy); cursor: pointer; }
.keypad button:active { background: var(--mist); }
.keypad button.fn { font-size: 14px; font-weight: 600; color: var(--deep); background: transparent; border-color: transparent; }
.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* Avatar */
.avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-weight: 600; font-size: 19px; flex: none; overflow: hidden; }
.avatar.lg { width: 76px; height: 76px; font-size: 27px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 30px; }
.timeline li::before { content: ''; position: absolute; left: 7px; top: 22px; bottom: -2px; width: 2px; background: var(--stone); }
.timeline li:last-child::before { display: none; }
.timeline .dotc { position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--stone); background: var(--white); }
.timeline li.done .dotc { background: var(--blue); border-color: var(--blue); }
.timeline li.now .dotc { background: var(--white); border-color: var(--deep); box-shadow: 0 0 0 4px var(--mist); }
.steps { display: flex; gap: 4px; }
.steps i { flex: 1; height: 6px; border-radius: 3px; background: var(--stone); }
.steps i.on { background: var(--blue); }

/* Progress */
.progress { height: 8px; background: var(--mist); border-radius: 4px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--blue); border-radius: 4px; }

/* Sheet / modal */
.scrim { position: fixed; inset: 0; background: rgba(10,42,78,.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--linen); width: 100%; max-width: 480px; max-height: 88vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 22px 20px calc(24px + var(--safe-b)); }
@media (min-width: 600px) { .scrim { align-items: center; } .sheet { border-radius: 18px; } }
.sheet .grab { width: 40px; height: 4px; background: var(--stone); border-radius: 2px; margin: -8px auto 14px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 14.5px; z-index: 60; max-width: 92vw; box-shadow: 0 6px 20px rgba(10,42,78,.25); }

/* Tables (admin) */
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; background: var(--white); border: 1px solid var(--stone); border-radius: var(--radius); overflow: hidden; }
.table th { text-align: left; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--slate); font-weight: 600; padding: 10px 12px; background: var(--mist); }
.table td { padding: 12px; border-top: 1px solid var(--stone); vertical-align: top; }
.table tr.click { cursor: pointer; } .table tr.click:hover td { background: #FCFBF8; }
.tablewrap { overflow-x: auto; border-radius: var(--radius); }
.stat { background: var(--white); border: 1px solid var(--stone); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; text-align: left; width: 100%; }
.stat .n { font-family: var(--serif); font-size: 28px; font-weight: 600; color: var(--navy); line-height: 1.1; }
.stat .l { font-size: 13px; color: var(--slate); margin-top: 2px; }
.stat.alert .n { color: var(--alert); }
.adminbar { background: var(--navy); color: #fff; padding: calc(12px + var(--safe-t)) 20px 0; position: sticky; top: 0; z-index: 20; }
.adminbar .logo { height: 16px; width: auto; }
.adminnav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin: 12px -8px 0; }
.adminnav::-webkit-scrollbar { display: none; }
.adminnav button { background: none; border: 0; color: var(--morning); font-weight: 600; font-size: 14px; padding: 10px 12px 12px; white-space: nowrap; cursor: pointer; border-bottom: 3px solid transparent; }
.adminnav button.on { color: #fff; border-bottom-color: var(--morning); }

/* Splash */
.splash { position: fixed; inset: 0; background: var(--linen); display: flex; align-items: center; justify-content: center; z-index: 100; transition: opacity .3s; }
.splash img { width: 180px; }

/* Receipt */
.receipt { background: var(--white); border: 1px solid var(--stone); border-radius: var(--radius); padding: 22px; }
.receipt .logo { width: 150px; }

.center { text-align: center; }
.mt0 { margin-top: 0 !important; }
.hide { display: none !important; }

.cardlinks { display: flex; justify-content: space-between; gap: 4px; margin-top: 6px; }
.cardlinks button { background: none; border: 0; color: #fff; font-weight: 600; font-size: 13.5px; min-height: 40px; padding: 0 6px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(199,214,241,.6); white-space: nowrap; border-radius: 8px; }
.cardlinks button:focus-visible { outline: 3px solid var(--morning); }

@media (max-width: 520px) { .hide-sm { display: none !important; } }

/* v2 additions */
.idchip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; background: var(--mist); color: var(--navy); font-weight: 700; font-size: 12.5px; letter-spacing: .06em; white-space: nowrap; }
.card.navy .idchip { background: rgba(199,214,241,.18); color: #fff; }
.btn.wa { background: var(--deep); border-color: var(--deep); }
.card.navy .btn.wa { background: #fff; color: var(--navy); border-color: #fff; }
.card.navy .btn.wa:hover { background: var(--mist); }
.illus { height: 140px; border-radius: var(--radius); background: var(--mist); display: flex; align-items: center; justify-content: center; color: var(--blue); position: relative; overflow: hidden; }
.illus::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: linear-gradient(90deg, var(--navy) 0 33.3%, var(--blue) 33.3% 66.6%, var(--morning) 66.6%); }
svg.i.xl { width: 64px; height: 64px; stroke-width: 1.25; }
.sheet.wide { max-width: 620px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--mist); border-top-color: var(--deep); margin: 0 auto; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.item.click { cursor: pointer; }
summary::-webkit-details-marker { color: var(--slate); }
.login .tabs button { font-size: 14px; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; }

/* ---- Tenancy agreement generator ---- */
.ta-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px 16px; }
.ta-grid .field small { display: block; margin-top: 4px; color: var(--muted, #5b6472); font-size: 12.5px; }
.ta-req { font-style: normal; font-size: 11.5px; color: var(--alert); margin-left: 4px; }
.ta-opt { font-style: normal; font-size: 11.5px; color: var(--muted, #5b6472); margin-left: 4px; }
@media (min-width: 760px) { .ta-actions { position: sticky; bottom: 0; z-index: 5; box-shadow: 0 -6px 18px rgba(16,32,64,.08); } }
.ta-preview { display: flex; flex-direction: column; gap: 16px; align-items: center; }
.ta-page { width: 100%; max-width: 760px; box-shadow: 0 2px 14px rgba(16,32,64,.18); background: #fff; }
.ta-page svg { display: block; width: 100%; height: auto; }
@media print { .ta-page { box-shadow: none; } }
.unit-block.inactive { opacity: .6; }
hr.sep { border: 0; border-top: 1px solid var(--line, #e3e6ea); margin: 6px 0; }
.ta-wide { grid-column: 1 / -1; }
.ta-warn { color: var(--alert) !important; }
/* management sub-tabs (one row per section) */
.subnav { display: flex; gap: 6px; flex-wrap: wrap; padding: 4px; background: var(--white); border: 1px solid var(--stone); border-radius: 12px; align-self: flex-start; max-width: 100%; }
.subnav button { background: none; border: 0; padding: 8px 14px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--slate); cursor: pointer; }
.subnav button.on { background: var(--navy); color: #fff; }
