/*
 * One stylesheet for the resident portal, the management panel and the printed
 * pages. Mobile first: residents open the portal on a phone, and a manager or
 * caretaker often records a payment from one too. No inline styles anywhere
 * (the Content-Security-Policy forbids them); the site's own colour comes from
 * index.php?r=tema as --brand.
 */
:root {
  --brand: #1f6f5c;
  --ink: #1d2326;
  --muted: #5b6770;
  --line: #dde3e1;
  --bg: #f5f7f6;
  --card: #ffffff;
  --soft: #eef3f1;
  --ok: #1d7a4c;
  --ok-bg: #e5f4ec;
  --warn: #8a5300;
  --warn-bg: #fff3d9;
  --bad: #b3261e;
  --bad-bg: #fdecea;
  --info: #22529a;
  --info-bg: #e8f0fb;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 2px 10px rgba(0, 0, 0, .04);
  --focus: 0 0 0 3px rgba(34, 82, 154, .35);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--ink); background: var(--bg); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--info); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: none; box-shadow: var(--focus); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6rem; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 .8rem; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.bad-text { color: var(--bad); }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: .5rem 1rem; z-index: 50; }
.skip:focus { left: .5rem; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 640px; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.row-between { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; }
.nowrap-row { flex-wrap: nowrap; }
.grid-2, .grid-3 { display: grid; gap: 1rem; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.demo-band { background: #23302c; color: #fff; font-size: .86rem; padding: .45rem 16px; text-align: center; }
.demo-band strong { color: #ffd88a; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: .55rem 1rem; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; background: var(--brand); color: #fff; }
.btn:hover { filter: brightness(1.06); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost { background: transparent; color: var(--info); border-color: transparent; padding-left: .4rem; padding-right: .4rem; }
.btn-danger { background: #fff; color: var(--bad); border-color: #efc4c0; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-big { min-height: 52px; font-size: 1.05rem; padding: .7rem 1.3rem; }
.btn-block { width: 100%; }
.btn-small { min-height: 36px; padding: .3rem .7rem; font-size: .9rem; }
form.inline { display: inline; }

/* Cards, notices, chips */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.notice { border-radius: 10px; padding: .75rem 1rem; border: 1px solid; margin: 0 0 1rem; }
.notice p:last-child { margin-bottom: 0; }
.notice-ok { background: var(--ok-bg); border-color: #b8e0cb; color: #11472d; }
.notice-warn { background: var(--warn-bg); border-color: #f1d49a; color: #5c3900; }
.notice-error { background: var(--bad-bg); border-color: #f2c1bc; color: #7a1a14; }
.notice-info { background: var(--info-bg); border-color: #c4d6f2; color: #173a70; }
.chip { display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; background: var(--soft); color: var(--ink); border: 1px solid transparent; }
.chip.ok, .bal-zero, .rq-done { background: var(--ok-bg); color: #11472d; }
.chip.warn, .rq-in_progress { background: var(--warn-bg); color: #5c3900; }
.chip.bad, .bal-due { background: var(--bad-bg); color: #7a1a14; border-color: #f2c1bc; }
.bal-credit, .rq-new { background: var(--info-bg); color: #173a70; }
.rq-rejected { background: #eceeee; color: #444; }
.count { display: inline-flex; min-width: 1.4rem; height: 1.4rem; padding: 0 .35rem; border-radius: 999px; background: var(--bad); color: #fff; font-size: .78rem; align-items: center; justify-content: center; }
.money-big { font-size: 1.3rem; }
.money-big .chip { font-size: 1.1rem; padding: .3rem .8rem; }

/* Forms */
.field { margin: 0 0 1rem; }
.field label, .label { display: block; font-weight: 600; margin: 0 0 .3rem; }
.field .hint { font-size: .86rem; color: var(--muted); margin: .25rem 0 0; }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=date], input[type=month], input[type=number], input[type=search], input[type=color], select, textarea { width: 100%; min-height: 44px; padding: .55rem .7rem; font: inherit; color: var(--ink); background: #fff; border: 1px solid #c8d0cd; border-radius: 10px; }
input[type=color] { padding: .2rem; width: 5rem; }
textarea { min-height: 96px; resize: vertical; }
[aria-invalid=true] { border-color: var(--bad); background: #fffafa; }
.field-error { color: var(--bad); font-size: .88rem; font-weight: 600; margin: .3rem 0 0; }
.check { display: flex; gap: .6rem; align-items: flex-start; margin: .4rem 0; }
.check input { width: 1.25rem; height: 1.25rem; margin-top: .15rem; flex: none; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin: 0 0 1.2rem; background: #fff; min-width: 0; }
legend { font-weight: 700; font-size: 1.05rem; padding: 0 .4rem; }
select { max-width: 100%; text-overflow: ellipsis; }
label > input, label > select { margin-top: .2rem; }
.code-box { font-size: 2rem; font-weight: 800; letter-spacing: .12em; background: #fff; border: 2px dashed var(--brand); border-radius: var(--radius); padding: .5rem 1rem; display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.code-box.small-code { font-size: 1.2rem; padding: .15rem .6rem; }
.code-line { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; background: var(--soft); border-radius: 8px; padding: .5rem .7rem; overflow-wrap: anywhere; }

/* Public pages and the resident portal */
.site-head, .panel-head { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 25; }
.site-head .wrap, .panel-head .wrap { display: flex; align-items: center; gap: .6rem; min-height: 56px; }
.panel-head .wrap { max-width: none; }
.brand { font-weight: 800; font-size: 1.1rem; color: var(--brand); text-decoration: none; margin-right: auto; }
.head-link { text-decoration: none; color: var(--ink); font-weight: 600; padding: .5rem .4rem; }
.who { font-size: .85rem; color: var(--muted); }
/* Demo only (1.1.5): management and resident sign-in as two equal links, and two big cards on the front page. */
.head-nav { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: flex-end; }
.head-login { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: .5rem .8rem; min-height: 44px; display: inline-flex; align-items: center; }
.head-login:hover { border-color: var(--brand); color: var(--brand); }
.entry-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.entry-card { margin-bottom: 0; text-align: center; border-top: 4px solid var(--brand); }
.entry-card p { margin-top: .3rem; }
main { padding: 1.2rem 0 2.5rem; }
.hero { background: linear-gradient(135deg, #fff 0%, var(--soft) 100%); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; margin-bottom: 1.2rem; }
.site-foot { border-top: 1px solid var(--line); background: #fff; padding: 1.2rem 0 2rem; font-size: .9rem; color: var(--muted); }
.site-foot a { color: var(--muted); }
.tabs { display: flex; gap: .3rem; overflow-x: auto; padding-top: .6rem; padding-bottom: .2rem; scrollbar-width: thin; }
.tabs a { flex: none; text-decoration: none; color: var(--ink); font-weight: 600; padding: .5rem .8rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); }
.tabs a[aria-current=page] { background: var(--brand); color: #fff; border-color: var(--brand); }
.pill-nav { display: flex; gap: .5rem; overflow-x: auto; padding: .2rem 0 .6rem; margin-bottom: .6rem; scrollbar-width: thin; }
.pill-nav a { flex: none; text-decoration: none; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .45rem .9rem; font-weight: 600; font-size: .92rem; }
.pill-nav a[aria-current=page] { background: var(--brand); color: #fff; border-color: var(--brand); }
.balance-card { border-top: 4px solid var(--brand); }
.login-box { max-width: 440px; margin: 1.5rem auto; }
.demo-accounts { display: grid; gap: .5rem; }

/* Panel */
.panel-shell { display: grid; grid-template-columns: 1fr; min-height: calc(100vh - 56px); }
@media (min-width: 960px) { .panel-shell { grid-template-columns: 230px 1fr; } }
.side-nav { display: none; background: #fff; border-right: 1px solid var(--line); padding: 1rem .6rem; }
@media (min-width: 960px) { .side-nav { display: block; } }
.side-nav a { display: flex; align-items: center; gap: .4rem; justify-content: space-between; padding: .5rem .8rem; border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 600; }
.side-nav a[aria-current=page] { background: var(--soft); color: var(--brand); }
.side-nav .sep { border-top: 1px solid var(--line); margin: .6rem 0; }
.side-nav .nav-label { padding: .1rem .8rem .3rem; font-size: .78rem; font-weight: 700; letter-spacing: .02em; color: var(--muted, #5b6b66); text-transform: uppercase; }
.side-nav .nav-more > summary { cursor: pointer; padding: .5rem .8rem; border-radius: 8px; font-weight: 600; color: var(--muted, #5b6b66); list-style: none; }
.side-nav .nav-more > summary::-webkit-details-marker { display: none; }
.side-nav .nav-more > summary::before { content: '▸ '; }
.side-nav .nav-more[open] > summary::before { content: '▾ '; }
.side-nav .nav-more > a { padding-left: 1.4rem; font-weight: 500; }
.panel-main { padding: 1rem 16px 6rem; min-width: 0; }
@media (min-width: 960px) { .panel-main { padding: 1.4rem 28px 3rem; } }
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding-bottom: env(safe-area-inset-bottom); }
@media (min-width: 960px) { .bottom-nav { display: none; } }
.bottom-nav a, .bottom-nav summary { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 56px; font-size: .8rem; font-weight: 700; color: var(--muted); text-decoration: none; list-style: none; cursor: pointer; }
.bottom-nav summary::-webkit-details-marker { display: none; }
.bottom-nav .ico { font-size: 1.2rem; line-height: 1; }
.bottom-nav a[aria-current=page] { color: var(--brand); }
.bottom-nav details { position: relative; }
.bottom-nav details[open] .more-menu { display: block; }
.more-menu { display: none; position: absolute; right: .4rem; bottom: 62px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); min-width: 230px; max-height: 70vh; overflow-y: auto; padding: .4rem; }
.more-menu a { flex-direction: row; justify-content: flex-start; gap: .4rem; font-size: .95rem; color: var(--ink); min-height: 44px; padding: 0 .8rem; }
@media (max-width: 700px) { .panel-head .who, .site-head .who { display: none; } .brand { font-size: 1rem; } }
@media (max-width: 520px) { .site-head .wrap-logins { flex-wrap: wrap; padding-top: .4rem; padding-bottom: .4rem; } .site-head .wrap-logins .brand { flex: 1 1 100%; } .head-nav { flex: 1 1 100%; justify-content: stretch; } .head-nav .head-login { flex: 1 1 0; justify-content: center; padding: .5rem .4rem; font-size: .95rem; } }
.page-title { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.page-title h1 { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin-bottom: 1rem; }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.stat .n { font-size: 1.3rem; font-weight: 800; overflow-wrap: anywhere; }
.stat .t { font-size: .82rem; color: var(--muted); }
.stat meter { width: 100%; height: 10px; }
.stat-due .n { color: var(--bad); }
.filters { display: grid; gap: .6rem; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 1rem; align-items: end; }
@media (min-width: 900px) { .filters { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.filters .field { margin: 0; }
.filters .q { grid-column: 1 / -1; }
@media (min-width: 900px) { .filters .q { grid-column: span 2; } }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: baseline; padding: .5rem 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list .num { margin-left: auto; font-weight: 700; }
.kv { display: grid; grid-template-columns: minmax(7rem, 36%) 1fr; gap: .3rem .8rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.events { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.events li { padding: .4rem 0; border-top: 1px solid var(--line); }
.onboard ol { margin: 0; padding-left: 1.3rem; }
.onboard li { margin-bottom: .3rem; }
.onboard li.done { color: var(--muted); }
details.box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem 1rem; margin-bottom: 1rem; }
details.box > summary { font-weight: 700; cursor: pointer; min-height: 36px; display: flex; align-items: center; }
.inline-details { display: inline-block; }
.inline-details > summary { cursor: pointer; color: var(--bad); font-size: .85rem; }
.action-box { border: 2px solid var(--brand); }
.archived { opacity: .6; }
.preview-dialog { border: 0; border-radius: 14px; max-width: min(520px, 92vw); padding: 1.2rem; box-shadow: 0 10px 40px rgba(0, 0, 0, .25); }
.preview-dialog::backdrop { background: rgba(0, 0, 0, .35); }
.preview-text { white-space: pre-wrap; background: #e7f7e3; border-radius: 10px; padding: .8rem; }

/* Tables: on a phone every row becomes a small card with labels */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin-bottom: 1rem; }
.table { width: 100%; border-collapse: collapse; background: #fff; }
.table th, .table td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .84rem; color: var(--muted); font-weight: 700; background: #f9fbfa; }
.table .num, .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table tfoot th { color: var(--ink); background: #f3f6f5; }
tr.voided td, li.voided { color: var(--muted); text-decoration: line-through; }
tr.is-paid td:nth-child(2) { text-decoration: line-through; color: var(--muted); }
tr.is-payment td { background: #f7fbf9; }
tr.row-error td { background: var(--bad-bg); }
tr.muted-row td { color: var(--muted); font-size: .85rem; }
tr.is-current td { font-weight: 700; }
@media (max-width: 700px) {
  .rtable thead { display: none; }
  .rtable, .rtable tbody, .rtable tr, .rtable td { display: block; width: 100%; }
  .rtable tfoot tr { display: flex; justify-content: space-between; }
  .rtable tr { border-bottom: 1px solid var(--line); padding: .4rem .2rem; }
  .rtable td { border: 0; padding: .15rem .5rem; text-align: left; }
  .rtable td.num { text-align: left; }
  .rtable td[data-label]::before { content: attr(data-label); display: block; font-size: .75rem; color: var(--muted); font-weight: 700; }
  .rtable td[data-label=""]::before { content: none; }
}

/* The paid / partly paid / unpaid grid of a month */
.unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(2.8rem, 1fr)); gap: 4px; margin-bottom: .8rem; }
.cell { display: inline-flex; align-items: center; justify-content: center; min-height: 2.2rem; padding: 0 .35rem; border-radius: 6px; font-weight: 700; font-size: .85rem; text-decoration: none; color: #fff; }
.cell.paid { background: #2e8b57; }
.cell.partial { background: #d9921b; }
.cell.open { background: #c0392b; }
.cell.void { background: #999; }
.legend .cell { min-height: 1.6rem; font-size: .78rem; }

/* Printed pages: receipts, statements, notices, invitations */
.print-sheet { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; margin-bottom: 1rem; }
.print-sheet header { border-bottom: 2px solid var(--ink); padding-bottom: .5rem; margin-bottom: 1rem; }
.print-table th, .print-table td { padding: .35rem .5rem; font-size: .92rem; }
.sign-cell { min-width: 7rem; }
.sign-line { margin-top: 2rem; }
.sign-row { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; margin-top: 1.2rem; font-size: .9rem; }
.letter { max-width: 760px; }
.receipt { background: #fff; border: 1px solid var(--ink); border-radius: 8px; padding: 1.2rem; max-width: 760px; margin: 1rem 0; }
.receipt header { border-bottom: 2px solid var(--ink); padding-bottom: .6rem; margin-bottom: 1rem; }
.receipt-no { text-align: right; }
.receipt footer { margin-top: 1.5rem; }
.receipt.is-void { position: relative; }
.void-stamp { color: var(--bad); font-weight: 800; border: 3px solid var(--bad); display: inline-block; padding: .3rem .8rem; transform: rotate(-3deg); }
.slips { display: grid; gap: 1rem; }
@media (min-width: 900px) { .slips { grid-template-columns: 1fr 1fr; } }
.slip { background: #fff; border: 1px dashed #999; border-radius: 8px; padding: 1rem; break-inside: avoid; }
.slip h2 { font-size: 1.05rem; }
.budget-lines input, .budget-lines select { min-width: 8rem; }

.print-only { display: none; }
@media print {
  body { background: #fff; font-size: 11pt; }
  .no-print, .panel-head, .site-head, .side-nav, .bottom-nav, .demo-band, .site-foot, .tabs { display: none !important; }
  .print-only { display: block; }
  .panel-shell { display: block; }
  .panel-main, main { padding: 0; }
  .card, .print-sheet, .receipt { box-shadow: none; border-color: #999; break-inside: avoid; }
  .page-break { page-break-after: always; }
  .slips { grid-template-columns: 1fr 1fr; }
  .cell { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: #000; text-decoration: none; }
}

/* Bank movements */
.bt-matched { background: var(--info-bg); color: #173a70; }
.bt-review { background: var(--warn-bg); color: #5c3900; }
.bt-unmatched { background: var(--bad-bg); color: #7a1a14; border-color: #f2c1bc; }
.bt-posted { background: var(--ok-bg); color: #11472d; }
.bt-ignored, .bt-debit { background: #eceeee; color: #444; }
.reasons { margin: 0; padding-left: 1.2rem; }
.reasons li { margin-bottom: .2rem; }
.pay-info dd strong { font-size: 1.05rem; overflow-wrap: anywhere; }
.pay-info .btn { margin-top: .3rem; }

/* Resident portal: the account at a glance */
body.resident main { padding-bottom: 6rem; }
@media (max-width: 959px) { body.resident .tabs { display: none; } body.resident .site-foot { padding-bottom: 5.5rem; } }
.resident-nav .more-menu form { margin: 0; }
.resident-nav .more-menu .btn { width: 100%; justify-content: flex-start; min-height: 44px; }
.ok-text { color: var(--ok); }
.unit-title { margin: 0; font-size: 1.25rem; }
.status-card { border-top: 5px solid var(--brand); }
.status-card.is-clear { border-top-color: var(--ok); }
.status-card.is-due { border-top-color: #d9921b; }
.status-card.is-late { border-top-color: var(--bad); }
.status-line { font-size: 1.15rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: 0; }
.tick-big { display: inline-flex; width: 2rem; height: 2rem; border-radius: 50%; background: var(--ok); color: #fff; align-items: center; justify-content: center; font-weight: 800; }
.big-amount { font-size: 1.9rem; font-weight: 800; }
.kind-table { width: 100%; border-collapse: collapse; }
.kind-table td, .kind-table th { padding: .45rem 0; border-top: 1px solid var(--line); text-align: left; }
.kind-table .num { text-align: right; }
.kind-table tfoot th { font-size: 1.05rem; }
.action-row { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.action-row .btn { min-height: 50px; font-size: 1.05rem; }
.year-box { background: var(--info-bg); border: 1px solid #c4d6f2; border-radius: 10px; padding: .6rem .8rem; }
.year-box p { margin: 0 0 .3rem; }
.year-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; text-align: center; }
.year-grid .t { display: block; font-size: .8rem; color: var(--muted); }
.year-grid .n { display: block; font-weight: 800; font-size: 1.02rem; overflow-wrap: anywhere; }
.month-chart { width: 100%; height: auto; max-height: 220px; }
.month-chart .bar-charged { fill: #9fc8e6; }
.month-chart .bar-paid { fill: #1f6fb5; }
.month-chart .tick-bg { fill: #2e9e5b; }
.month-chart .tick { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.month-chart .axis { stroke: var(--line); }
.month-chart text { font-size: 14px; fill: var(--muted); }
.legend .swatch { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; vertical-align: middle; margin-left: .4rem; }
.legend .swatch.charged { background: #9fc8e6; }
.legend .swatch.paid { background: #1f6fb5; }
.tick-mini { display: inline-flex; width: 1.2rem; height: 1.2rem; border-radius: 50%; background: #2e9e5b; color: #fff; font-size: .8rem; align-items: center; justify-content: center; margin-left: .4rem; }
.moves { list-style: none; margin: 0; padding: 0; }
.moves.card { padding: 0 .8rem; }
.moves li { display: grid; grid-template-columns: 4.6rem 1fr auto; gap: .5rem; align-items: start; padding: .6rem 0; border-top: 1px solid var(--line); }
.moves li:first-child { border-top: 0; }
.moves li.is-paid .move-text { text-decoration: line-through; color: var(--muted); }
.move-date { font-size: .82rem; color: var(--muted); }
.move-amount { text-align: right; font-weight: 700; white-space: nowrap; }
.request-card { display: flex; flex-direction: column; gap: .35rem; text-decoration: none; color: var(--ink); border-left: 5px solid var(--line); }
.rq-border-new { border-left-color: #4a7bd0; }
.rq-border-in_progress { border-left-color: #e0a100; }
.rq-border-done { border-left-color: var(--ok); }
.rq-border-rejected { border-left-color: #999; }

/* The monthly dues table: flats down the side, months across. Every cell says its state in words. */
.dues-legend { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; }
.dues-legend li { display: flex; align-items: center; gap: .35rem; }
.dt-chip { display: inline-block; padding: .1rem .5rem; border-radius: 6px; font-weight: 700; font-size: .8rem; }
.dues-table { font-size: .9rem; }
.dues-table th, .dues-table td { white-space: nowrap; vertical-align: middle; }
.dues-table .dues-month { text-align: center; }
.dues-table tbody th { background: #fff; color: var(--ink); font-size: .9rem; font-weight: 600; }
.dues-table td.dt { text-align: center; min-width: 6.5rem; border-left: 1px solid #fff; }
.dt-state { display: block; font-weight: 700; }
.dt-amount { display: block; font-size: .78rem; }
.dt-paid { background: var(--ok-bg); color: #11472d; }
.dt-partial { background: var(--warn-bg); color: #5c3900; }
.dt-unpaid { background: var(--bad-bg); color: #7a1a14; }
.dt-waiting { background: var(--info-bg); color: #173a70; }
.dt-none { color: var(--muted); }
.dues-table .dues-unit { position: sticky; left: 0; z-index: 1; min-width: 5.5rem; box-shadow: 1px 0 0 var(--line); }
.dues-table .dues-group th { background: var(--soft); color: var(--ink); font-size: .92rem; font-weight: 700; }
.dues-table .dues-group th span { position: sticky; left: .6rem; display: inline-block; }
@media (max-width: 700px) { .dues-table .dues-who { display: none; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Download buttons: Excel (.xlsx) and CSV */
.export-form { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .3rem; margin: 0; }
.export-label { font-weight: 600; margin-right: .2rem; }
.export-list .export-form { display: flex; }
@media (min-width: 700px) { .export-list .export-label { min-width: 12rem; } }

/* The demo's "try it in five minutes" list */
.try-list { margin: 0; padding-left: 1.3rem; }
.try-list li { margin-bottom: .45rem; }

@media print {
  .dues-wrap { overflow: visible; border: 0; }
  .dues-table { font-size: 7.5pt; }
  .dues-table th, .dues-table td, .dues-table tbody th { font-size: 1em; padding: .1rem .25rem; }
  .dues-table .dt-amount { font-size: .92em; }
  .dues-legend { margin-bottom: .3rem; font-size: 8pt; }
  .dues-legend .dt-chip { font-size: 1em; }
  .dues-table .dues-unit { position: static; box-shadow: none; }
  .dues-table td.dt { min-width: 0; }
  .dues-table tr { break-inside: avoid; }
  .dt-paid, .dt-partial, .dt-unpaid, .dt-waiting { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Yönlendirme (1.1.9): kurulum çubuğu, sihirbaz adımları, «Bu ekran ne işe yarar?» kutusu */
.guide-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; padding: .6rem .9rem; margin: 0 0 1rem; background: var(--card, #fff); border: 1px solid var(--line, #d8dedb); border-radius: 12px; }
.guide-bar-big { font-size: 1.05rem; }
.guide-meter { flex: 1 1 140px; min-width: 120px; height: 10px; background: #e3e8e5; border-radius: 99px; overflow: hidden; }
.guide-meter > span { display: block; height: 100%; background: var(--brand, #1f7a63); border-radius: 99px; }
.guide-steps { list-style: none; margin: 0 0 1rem; padding: 0; }
.guide-step h2 { font-size: 1.05rem; margin: 0; }
.guide-step.done { opacity: .75; }
.guide-step.next { border-color: var(--brand, #1f7a63); box-shadow: 0 0 0 2px rgba(31, 122, 99, .18); }
.guide-no { display: inline-block; min-width: 1.6em; text-align: center; font-weight: 700; }
.pill-next { background: var(--brand, #1f7a63); color: #fff; }
.guide-help { margin: 0 0 1rem; }
.guide-help summary { cursor: pointer; font-weight: 600; }
/* Genişlikler sınıfla verilir: satır içi style, sayfanın güvenlik ilkesince (CSP) çalışmaz. 6 adım = bu yüzdeler. */
.guide-w0 { width: 0%; }
.guide-w17 { width: 17%; }
.guide-w33 { width: 33%; }
.guide-w50 { width: 50%; }
.guide-w67 { width: 67%; }
.guide-w83 { width: 83%; }
.guide-w100 { width: 100%; }
.guide-w14 { width: 14%; }
.guide-w29 { width: 29%; }
.guide-w43 { width: 43%; }
.guide-w57 { width: 57%; }
.guide-w71 { width: 71%; }
.guide-w86 { width: 86%; }
.row-link { cursor: pointer; }
.row-link:hover td { background: #f4f6ff; }
.row-tap { cursor: pointer; }
li[data-href] { cursor: pointer; }
.row-tap:hover th, .row-tap:hover .dues-who { background: #f4f6ff; }
details.more-fields { margin: .5rem 0; }
details.more-fields > summary { cursor: pointer; font-weight: 600; min-height: 36px; display: flex; align-items: center; }


/* Phone box (1.1.19): "Telefonuma ekle" window, the trial note and the larger writing of a trial installation. */
.add-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-end; justify-content: center; padding: 12px; }
.add-overlay[hidden] { display: none; }
.add-card { background: var(--card); border-radius: var(--radius); padding: 1.1rem; width: 100%; max-width: 30rem; max-height: 90vh; overflow: auto; box-shadow: var(--shadow); }
.add-card h2 { margin-top: 0; }
.add-card ol { padding-left: 1.3rem; margin: .5rem 0; }
.add-card li { margin-bottom: .5rem; }
.phone-install { max-width: 30rem; margin: 0 auto; }
.trial-note p { margin: 0; }
body.big { font-size: 18px; }
body.big .btn { min-height: 52px; font-size: 1.1rem; }
body.big .btn-small { min-height: 44px; font-size: 1rem; }
body.big .side-nav a, body.big .tabs a, body.big .bottom-nav a, body.big .bottom-nav summary { font-size: 1.05rem; }
body.big input, body.big select, body.big textarea { font-size: 1.1rem; min-height: 48px; }
[hidden] { display: none !important; }

/* Plain home screen (simple mode, 1.1.19): a few big buttons, each with one short sentence. */
.lead { font-size: 1.1rem; }
.simple-tasks { display: grid; grid-template-columns: 1fr; gap: .8rem; margin: .8rem 0 1.2rem; }
@media (min-width: 640px) { .simple-tasks { grid-template-columns: 1fr 1fr; } }
.simple-task { display: grid; grid-template-columns: auto 1fr; column-gap: .9rem; align-items: center; text-decoration: none; color: var(--ink); background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 1rem; min-height: 5.2rem; box-shadow: var(--shadow); }
.simple-task:hover, .simple-task:focus-visible { border-color: var(--brand); }
.simple-task-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.simple-ico { grid-row: 1 / span 2; font-size: 1.9rem; width: 2.6rem; text-align: center; font-weight: 800; }
.simple-title { font-size: 1.25rem; font-weight: 800; }
.simple-text { font-size: .98rem; opacity: .85; }
.simple-next { border-color: var(--brand); border-width: 2px; }
.simple-alert { display: block; background: var(--info-bg); color: var(--info); border-radius: var(--radius); padding: .9rem 1rem; margin-bottom: .8rem; text-decoration: none; font-size: 1.05rem; }
.simple-stats { margin-bottom: 1.2rem; }
.row-more td { background: #f4f6ff; }
.row-more[hidden] { display: none; }


/* The bar that asks for notifications (assets/phone.js). */
.push-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.push-bar p { margin: 0; flex: 1 1 14rem; }

/* The bell in the header: how many new things are waiting (a sign on the screen even if a notification never arrived). */
.bell { display: inline-flex; align-items: center; gap: .25rem; text-decoration: none; font-size: 1.3rem; padding: .2rem .45rem; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); }
.bell .count { font-size: .85rem; }

/* 1.1.20 - plain setup: list of owners, message to the residents, poster */
.owner-grid { display: grid; gap: .6rem; }
.owner-row { display: grid; grid-template-columns: 6rem 1fr 1fr; gap: .5rem; align-items: center; }
.owner-row.has-error input { border-color: #b3261e; }
.owner-err { grid-column: 1 / -1; margin: 0; }
@media (max-width: 640px) { .owner-row { grid-template-columns: 1fr 1fr; } .owner-no { grid-column: 1 / -1; } }
.msg-box { background: #f6f6f2; border: 1px solid #d8d8d0; border-radius: .6rem; padding: .8rem 1rem; line-height: 1.5; overflow-wrap: anywhere; }
.qr-small { width: 9rem; height: 9rem; }
.poster { max-width: 40rem; margin: 0 auto; text-align: center; padding: 1.5rem 1rem; border: 2px solid #222; border-radius: 1rem; }
.poster h1 { font-size: 2.2rem; margin: .3rem 0 .6rem; }
.poster-site { font-size: 1.3rem; font-weight: 700; margin: 0; }
.poster-lead { font-size: 1.2rem; }
.poster-qr { width: 18rem; height: 18rem; margin: 1rem auto; }
.poster-steps { text-align: left; font-size: 1.2rem; line-height: 1.6; max-width: 30rem; margin: 1rem auto; }
.poster-link { font-size: .95rem; color: #555; overflow-wrap: anywhere; }

.guide-step.later { opacity: .55; padding-top: .6rem; padding-bottom: .6rem; }
.guide-step.later h2 { font-size: 1rem; }

.welcome-steps { margin: 0; padding-left: 1.3rem; line-height: 1.7; }
.stuck-hint a { font-weight: 700; }

.trial-note.trial-slim { padding: .25rem .8rem; background: transparent; border: 0; }
.trial-note.trial-slim p { margin: 0; font-size: .9rem; color: #345; }

.dues-wrap { contain: paint; }

.maker { margin-top: .4rem; font-size: .8rem; opacity: .75; }
.maker a { color: inherit; }

/* 1.1.31: bina kurallari, bina rehberi, duyuru ulasim satiri, Seffaf Kasa */
.rules-body h3 { margin: 1rem 0 .25rem; font-size: 1.05rem; }
.rules-body p { margin: .3rem 0; }
.rules-list { margin: .2rem 0 .7rem; padding-left: 1.3rem; }
.rules-list li { margin: .25rem 0; }
.reach p { margin: .25rem 0; }
.reach .list li { align-items: center; }
.card meter { width: 100%; height: 14px; }
