/* Koja online: portal styles. Same palette and type as kojapropertymanagement.ca:
   canal ink, verdigris, brass and limestone, with system fonts only. */
:root {
  --ink: #15332f; --ink-2: #1d443e; --verdigris: #2f6f64; --verdigris-dark: #235a50; --verdigris-light: #8dbfb2;
  --brass: #c9973f; --brass-light: #e6c27a; --brass-pale: #f6ecd6; --stone: #eceee8; --stone-2: #e1e6df;
  --paper: #fafbf8; --text: #1e2b28; --muted: #55635e; --line: #c9d1ca; --field: #a9b5ad; --brick: #a23e2c;
  --brick-pale: #f6e1dc; --ok: #2e6b3f; --ok-pale: #e2efe5; --info-pale: #e4eef3; --info: #2b5d75;
  --serif: "Palatino Linotype", "Book Antiqua", Palatino, "Iowan Old Style", "URW Palladio L", P052, Georgia, serif;
  --sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --radius: 8px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--stone); color: var(--text); font: 400 1rem/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--verdigris); text-underline-offset: 3px; }
a:hover { color: var(--verdigris-dark); }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.2; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(1.75rem, 3.5vw, 2.25rem); }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------------ header */
.top { background: var(--ink); color: #fff; border-bottom: 3px solid var(--brass); }
.top-inner { max-width: 1160px; margin: 0 auto; padding: 10px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; margin-right: 6px; }
.brand svg { width: 40px; height: 27px; flex: none; }
.brand b { font-family: var(--serif); font-weight: 400; font-size: 1.35rem; line-height: 1; }
.brand small { display: block; font-size: .72rem; color: var(--on-ink, #a7bcb5); letter-spacing: .02em; }
.brand:hover { color: #fff; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.nav a { color: #d3e2dc; text-decoration: none; padding: 6px 10px; border-radius: 6px; font-size: .95rem; }
.nav a:hover, .nav a[aria-current="page"] { color: #fff; background: rgba(255,255,255,.09); }
.top-tools { display: flex; align-items: center; gap: 10px; }
.lang { color: var(--brass-light); text-decoration: none; font-weight: 600; font-size: .9rem; border: 1px solid rgba(230,194,122,.5); padding: 3px 9px; border-radius: 999px; }
.lang:hover { color: #fff; border-color: #fff; }
.who { color: #c9d6d1; font-size: .9rem; text-decoration: none; }
.who:hover { color: #fff; }
.top form { margin: 0; }
.linklike { background: none; border: 0; padding: 0; color: #c9d6d1; font: inherit; font-size: .9rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.linklike:hover { color: #fff; }

/* -------------------------------------------------------------------- page */
main { max-width: 1160px; margin: 0 auto; padding: 22px 16px 48px; }
main.narrow { max-width: 560px; }
main.medium { max-width: 820px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.kicker { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 4px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.break { word-break: break-word; overflow-wrap: anywhere; }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--brass); border-radius: var(--radius); padding: 12px 14px; }
.stat b { display: block; font-family: var(--serif); font-size: 1.7rem; font-weight: 400; color: var(--ink); line-height: 1.1; }
.stat span { font-size: .85rem; color: var(--muted); }
.stat a { color: inherit; text-decoration: none; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.actions.end { justify-content: flex-end; }
.spaced > * + * { margin-top: 12px; }
hr.soft { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* ----------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; justify-content: center; font: 600 .95rem/1.2 var(--sans); padding: 10px 16px; border-radius: 6px; border: 1px solid var(--verdigris); background: var(--verdigris); color: #fff; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--verdigris-dark); border-color: var(--verdigris-dark); color: #fff; }
.btn.secondary { background: #fff; color: var(--ink); border-color: var(--field); }
.btn.secondary:hover { background: var(--stone); color: var(--ink); }
.btn.brass { background: var(--brass); border-color: var(--brass); color: var(--ink); }
.btn.brass:hover { background: var(--brass-light); border-color: var(--brass-light); }
.btn.danger { background: #fff; color: var(--brick); border-color: #d9a79c; }
.btn.danger:hover { background: var(--brick-pale); }
.btn.small { padding: 6px 10px; font-size: .85rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
form.inline { display: inline; margin: 0; }

/* ------------------------------------------------------------------- forms */
.field { margin-bottom: 14px; }
.field label, .label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 5px; color: var(--ink); }
.hint { display: block; font-size: .85rem; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: #fff; border: 1px solid var(--field); border-radius: 6px; padding: 9px 11px; }
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--verdigris); outline-offset: 0; border-color: var(--verdigris); }
input[readonly] { background: var(--stone); }
.check { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; }
.check input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.check span { font-size: .95rem; }
.radio-row { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.radio-row label { display: flex; gap: 6px; align-items: center; font-weight: 400; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: block; border: 1px solid var(--field); border-radius: 6px; padding: 10px 12px; background: #fff; cursor: pointer; font-size: .95rem; }
.choice input:checked + span { border-color: var(--verdigris); box-shadow: inset 0 0 0 2px var(--verdigris); background: #f2f8f6; }
.choice input:focus-visible + span { outline: 3px solid var(--brass); }
.choice small { display: block; color: var(--muted); font-size: .8rem; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; }
fieldset { border: 0; padding: 0; margin: 0 0 14px; }
legend { font-weight: 600; font-size: .92rem; margin-bottom: 6px; color: var(--ink); padding: 0; }

/* ------------------------------------------------------------------ notices */
.flash { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.flash li, .note { border-radius: 6px; padding: 11px 14px; border: 1px solid var(--line); background: #fff; }
.flash .success, .note.success { background: var(--ok-pale); border-color: #b7d3be; color: #1d4a29; }
.flash .error, .note.error { background: var(--brick-pale); border-color: #e2b4a8; color: #6e2416; }
.flash .info, .note.info { background: var(--info-pale); border-color: #b8cfdb; color: #1f4559; }
.note.warn { background: var(--brass-pale); border-color: #e1cc9c; color: #3a2a0c; }
.note > :last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--stone-2); vertical-align: top; }
th { background: var(--paper); font-weight: 600; color: var(--ink); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f7f9f6; }
td.check-col, th.check-col { width: 36px; }
td .sub { display: block; font-size: .82rem; color: var(--muted); }

/* ------------------------------------------------------------------- badges */
.badge { display: inline-block; font-size: .78rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--stone-2); color: var(--ink); white-space: nowrap; }
.badge.s-Open { background: var(--brass-pale); color: #6b4a10; }
.badge.s-In-Progress { background: #dcebe7; color: var(--verdigris-dark); }
.badge.s-Waiting { background: #ececec; color: #4a4a4a; }
.badge.s-Vendor { background: var(--info-pale); color: var(--info); }
.badge.s-Closed { background: var(--ok-pale); color: var(--ok); }
.badge.s-Removed { background: #ececec; color: #6b6b6b; }
.badge.p-Urgent { background: var(--brick); color: #fff; }
.badge.p-High { background: #f3d9c9; color: #7a3412; }
.badge.p-Medium { background: var(--stone-2); color: var(--ink); }
.badge.p-Low { background: #f1f3ef; color: var(--muted); }
.badge.ok { background: var(--ok-pale); color: var(--ok); }
.badge.warn { background: var(--brass-pale); color: #6b4a10; }
.badge.bad { background: var(--brick-pale); color: var(--brick); }
.badge.plain { background: #f1f3ef; color: var(--muted); }

/* ------------------------------------------------------------------- tickets */
.ticket-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ticket-list li { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.ticket-list a { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px 16px; color: inherit; text-decoration: none; }
.ticket-list a:hover { background: #f7f9f6; }
.ticket-list .title { font-weight: 600; color: var(--ink); }
.ticket-list .meta { font-size: .85rem; color: var(--muted); grid-column: 1 / 2; }
.ticket-list .badges { grid-row: 1 / 3; grid-column: 2; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.ticket-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px 16px; margin: 0 0 14px; }
.ticket-facts dt { font-size: .8rem; color: var(--muted); }
.ticket-facts dd { margin: 0; font-weight: 600; }
.answers { margin: 0; }
.answers > div { padding: 10px 0; border-top: 1px solid var(--stone-2); }
.answers > div:first-child { border-top: 0; padding-top: 0; }
.answers dt { font-size: .8rem; color: var(--muted); margin-bottom: 2px; }
.answers dd { margin: 0; white-space: pre-wrap; }
.btn .count { display: inline-block; min-width: 1.5em; padding: 0 6px; border-radius: 999px; background: var(--brass); color: var(--ink); font-size: .78rem; line-height: 1.5; text-align: center; }
.desc { white-space: pre-wrap; background: var(--paper); border: 1px solid var(--stone-2); border-radius: 6px; padding: 12px 14px; }
.thread { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.thread li { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: #fff; }
.thread li.mine { background: #f2f8f6; border-color: #bcd6cf; }
.thread li.staff { background: var(--brass-pale); border-color: #e1cc9c; }
.thread li.system { background: transparent; border-style: dashed; color: var(--muted); font-size: .92rem; }
.thread .head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
.thread .head b { color: var(--ink); font-size: .92rem; }
.thread .body { white-space: pre-wrap; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 10px; }
.photos a { display: block; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--paper); text-decoration: none; }
.photos img { width: 100%; height: 110px; object-fit: cover; display: block; }
.photos .file { display: flex; align-items: center; justify-content: center; height: 110px; padding: 8px; font-size: .82rem; color: var(--ink); text-align: center; word-break: break-word; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0 0 1em; display: grid; gap: 8px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; }
.steps li::before { content: counter(s); width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: .9rem; }
.emergency { border-left: 4px solid var(--brick); background: var(--brick-pale); padding: 12px 14px; border-radius: 0 6px 6px 0; margin-bottom: 16px; }
.emergency p:last-child { margin: 0; }

/* -------------------------------------------------------------------- auth */
.auth-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 28px; }
.auth-card h1 { font-size: 1.9rem; }
.auth-foot { margin-top: 16px; text-align: center; color: var(--muted); font-size: .95rem; }
.welcome-units { list-style: none; padding: 0; margin: 0 0 14px; }

/* -------------------------------------------------------------------- footer */
.foot { max-width: 1160px; margin: 0 auto; padding: 18px 16px 30px; color: var(--muted); font-size: .85rem; display: flex; flex-wrap: wrap; gap: 8px 18px; border-top: 1px solid var(--line); }
.foot a { color: var(--muted); }
.copybox { display: flex; gap: 8px; align-items: center; }
.copybox input { font-size: .85rem; }

@media (max-width: 640px) {
  .top-inner { gap: 8px 12px; }
  .nav { order: 3; flex-basis: 100%; }
  .card, .auth-card { padding: 16px; }
  th, td { padding: 8px; }
  .ticket-list a { grid-template-columns: 1fr; }
  .ticket-list .badges { grid-row: auto; grid-column: 1; flex-direction: row; align-items: center; }
}
@media print { .top, .foot, .no-print { display: none !important; } body { background: #fff; } }
.mt { margin-top: 16px; }
.mb0 { margin-bottom: 0; }
.mb { margin-bottom: 16px; }
.linklike-dark { background: none; border: 0; padding: 0; color: var(--brick); font: inherit; font-size: .9rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
a.building-card { display: block; color: inherit; text-decoration: none; margin: 0; }
a.building-card:hover { border-color: var(--verdigris); box-shadow: 0 2px 0 var(--verdigris-light); }
a.building-card h2 { margin-bottom: 6px; }
.filterbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filterbar input[type=search] { flex: 1 1 260px; width: auto; }
.filterbar select { width: auto; flex: 0 1 auto; }
