@font-face { font-family: "Jakarta"; src: url("fonts/plus-jakarta-sans-latin.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }

:root {
  --bg: #FCDFA6; --card: #fff; --ink: #11231f; --muted: #4a5955; --line: #eadfc8;
  --brand: #0f766e; --brand-dark: #0b5a54; --brand-soft: #dff3f0;
  --warn: #b45309; --warn-soft: #fef3c7; --bad: #b91c1c; --bad-soft: #fee2e2; --good: #15803d; --good-soft: #dcfce7;
  --blue: #1d4ed8; --blue-soft: #dbeafe;
  --radius: 16px; --shadow: 0 1px 2px rgba(17,35,31,.06), 0 4px 14px rgba(17,35,31,.05);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0d1513; --card: #15211e; --ink: #e8f0ee; --muted: #9db0ab; --line: #24332f;
    --brand: #2dd4bf; --brand-dark: #5eead4; --brand-soft: #123a35;
    --warn: #fbbf24; --warn-soft: #3a2c0b; --bad: #f87171; --bad-soft: #3b1414; --good: #4ade80; --good-soft: #10301b;
    --blue: #93c5fd; --blue-soft: #172a4a; --shadow: none; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 "Jakarta", system-ui, -apple-system, "Segoe UI", "Noto Sans Devanagari", sans-serif; padding-bottom: 84px; }
body.plain { padding-bottom: 0; }
a { color: var(--brand); }
h1 { font-size: 1.45rem; line-height: 1.25; margin: 6px 0 6px; letter-spacing: -.01em; }
h2 { font-size: 1.08rem; margin: 0 0 10px; }
.muted { color: var(--muted); margin-top: 0; }
.small { font-size: .88rem; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .08em; }
.wrap { max-width: 720px; margin: 0 auto; padding: 14px 16px 24px; }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand span { display: flex; flex-direction: column; min-width: 0; }
.brand b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1rem; }
.brand small { color: var(--muted); font-size: .75rem; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; text-transform: uppercase; }
.menu-card { position: absolute; right: 0; top: 46px; width: 230px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.15); padding: 8px; }
.menu-card .who { margin: 4px 8px 8px; display: flex; flex-direction: column; }
.menu-card .who small { color: var(--muted); }
.menu-item { display: block; width: 100%; text-align: left; padding: 10px; border: 0; background: none; color: var(--ink); font: inherit; border-radius: 10px; text-decoration: none; cursor: pointer; }
.menu-item:hover { background: var(--bg); }
.menu-item.danger { color: var(--bad); }

/* bottom tabs */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around; background: var(--card); border-top: 1px solid var(--line); padding: 6px 4px; padding-bottom: max(6px, env(safe-area-inset-bottom)); }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .72rem; font-weight: 600; color: var(--muted); text-decoration: none; padding: 4px 2px; max-width: 110px; }
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabs a.on { color: var(--brand); }
.tabs a.add svg { background: var(--brand); color: #fff; border-radius: 50%; width: 34px; height: 34px; padding: 6px; margin-top: -4px; }
.tabs a.add { color: var(--brand); }

/* cards and blocks */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin: 0 0 14px; }
.flash { padding: 12px 14px; border-radius: 12px; margin: 0 0 14px; font-weight: 600; background: var(--good-soft); color: var(--good); }
.flash.error { background: var(--bad-soft); color: var(--bad); }
.hello { margin: 6px 0 14px; }
.hello h1 { margin-bottom: 0; }
.section-title { margin: 22px 0 10px; font-size: 1.05rem; }
.empty { color: var(--muted); text-align: center; }
.back { display: inline-block; margin: 2px 0 10px; text-decoration: none; font-weight: 600; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.more { display: inline-block; margin-top: 4px; font-weight: 600; text-decoration: none; }

.big-action { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: var(--radius); background: var(--brand); color: #fff; text-decoration: none; box-shadow: 0 6px 18px rgba(15,118,110,.28); }
.big-action .plus { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 14px; background: rgba(255,255,255,.18); font-size: 2rem; line-height: 1; }
.big-action b { display: block; font-size: 1.12rem; }
.big-action small { opacity: .9; }
@media (prefers-color-scheme: dark) { .big-action { color: #04201c; } }

/* complaint cards */
.list { display: grid; gap: 10px; }
.ccard { display: block; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 14px; padding: 12px 14px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.ccard.urgent { border-left-color: var(--bad); }
.ccard-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ref { font-weight: 700; color: var(--muted); font-size: .85rem; margin-right: 2px; }
.ccard-title { margin: 6px 0 2px; }
.ccard-desc { margin: 0; color: var(--muted); font-size: .94rem; overflow-wrap: anywhere; }
.ccard-meta { margin: 6px 0 0; font-size: .8rem; color: var(--muted); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 700; background: var(--bg); color: var(--muted); }
.pill.s-open { background: var(--blue-soft); color: var(--blue); }
.pill.s-in_progress { background: var(--warn-soft); color: var(--warn); }
.pill.s-done { background: var(--good-soft); color: var(--good); }
.pill.s-closed, .pill.s-rejected { background: var(--bg); color: var(--muted); }
.pill.urgent, .pill.overdue { background: var(--bad-soft); color: var(--bad); }
.tag { display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: .7rem; font-weight: 700; background: var(--brand-soft); color: var(--brand-dark); }
.tag.note { background: var(--warn-soft); color: var(--warn); }

/* complaint page */
.detail.urgent { border-left: 4px solid var(--bad); }
.detail-title { margin-top: 10px; font-size: 1.25rem; }
.desc { white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0 12px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin: 0; }
.facts div { min-width: 0; }
.facts dt { font-size: .76rem; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; background: var(--bg); }
.gallery.small { grid-template-columns: repeat(4, 1fr); max-width: 360px; }
.progress { list-style: none; padding: 0; margin: 4px 0 16px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; counter-reset: s; }
.progress li { position: relative; text-align: center; font-size: .74rem; color: var(--muted); padding-top: 14px; }
.progress li::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 6px; border-radius: 6px; background: var(--line); }
.progress li.done::before { background: var(--brand); }
.progress li.now { color: var(--ink); font-weight: 700; }
.action h2 { margin-bottom: 12px; }
.action-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.act { flex: 1 1 100%; }
.act[open] > summary { margin-bottom: 10px; }
.act > summary { list-style: none; }
.act > summary::-webkit-details-marker { display: none; }
.timeline { list-style: none; padding: 0; margin: 0 0 14px; }
.ev { position: relative; padding: 0 0 14px 18px; border-left: 2px solid var(--line); margin-left: 6px; }
.ev::before { content: ""; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--card); border: 2px solid var(--brand); }
.ev.note::before { border-color: var(--warn); }
.ev-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .9rem; }
.ev-head time { color: var(--muted); font-size: .78rem; margin-left: auto; }
.ev p { margin: 4px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.ev-status { color: var(--muted); }
.reopen { margin-top: 12px; }
.reopen summary { cursor: pointer; color: var(--bad); font-weight: 600; }
.stars { display: flex; flex-direction: row-reverse; justify-content: center; gap: 4px; margin-bottom: 4px; }
.stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars label { font-size: 2.2rem; color: var(--line); cursor: pointer; line-height: 1; padding: 0 2px; margin: 0; }
.stars input:checked ~ label, .stars label:hover, .stars label:hover ~ label { color: #f59e0b; }
.stars input:focus-visible + label { outline: 2px solid var(--brand); border-radius: 6px; }

/* dashboard */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.stat b { display: block; font-size: 1.7rem; line-height: 1.1; }
.stat span { font-size: .8rem; color: var(--muted); font-weight: 600; }
.stat.warn b { color: var(--warn); } .stat.bad b { color: var(--bad); } .stat.good b { color: var(--good); }

/* forms */
.form label, fieldset legend { display: block; font-weight: 600; font-size: .92rem; margin: 10px 0 6px; }
fieldset { border: 1px solid var(--line); }
fieldset legend { float: left; width: 100%; margin: 0 0 10px; font-size: 1rem; }
fieldset legend + * { clear: both; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 13px; min-height: 48px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; accent-color: var(--brand); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 10px 18px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.primary { color: #04201c; } }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { background: transparent; }
.btn.danger-ghost { background: transparent; color: var(--bad); border-color: var(--bad-soft); }
.btn.small { min-height: 38px; padding: 6px 12px; font-size: .88rem; }
.btn.block { display: flex; width: 100%; margin-top: 14px; }
.btn.big { min-height: 56px; font-size: 1.06rem; }
.btn:disabled { opacity: .6; }
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.choices.two { grid-template-columns: 1fr 1fr; margin-bottom: 4px; }
.choice { margin: 0 !important; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 48px; padding: 8px; border: 1.5px solid var(--line); border-radius: 12px; font-weight: 600; cursor: pointer; }
.choice input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.choice input:focus-visible + span { outline: 2px solid var(--brand); }
.photo-pick { display: block; margin-top: 12px !important; cursor: pointer; }
.photo-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.photo-pick span { display: flex; align-items: center; justify-content: center; min-height: 48px; border: 1.5px dashed var(--line); border-radius: 12px; color: var(--muted); font-weight: 600; }
.photo-pick.inline { margin: 0 !important; }
.photo-pick.inline span { width: 48px; }
.previews { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.previews:empty { display: none; }
.previews img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.urgent-toggle { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.urgent-toggle input { margin-top: 5px; width: 20px; height: 20px; }
.urgent-toggle small { display: block; color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; font-weight: 600; margin: 0 !important; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 10px; }
.filters input[type="search"] { flex: 1 1 100%; }
.filters select { flex: 1 1 140px; width: auto; }
[data-show-when] { margin-top: 4px; }

/* flats */
.flat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 14px; }
.flat-chip { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-decoration: none; color: var(--ink); text-align: center; }
.flat-chip b { display: block; }
.flat-chip small { color: var(--muted); font-size: .76rem; }
.flat-chip.off { opacity: .5; }
.add-box > summary { cursor: pointer; color: var(--brand); padding: 4px 0; }
.person-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.person-row small { display: block; color: var(--muted); }
.person-actions { display: flex; gap: 6px; }
.pins { border: 2px solid var(--brand); }
.big-pin { font-size: 2.2rem; font-weight: 800; margin: 4px 0; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }

/* login */
.login { max-width: 420px; margin: 0 auto; padding-top: 6vh; text-align: center; }
.login .form { text-align: left; }
.login-logo { border-radius: 18px; }
.lang-switch { display: inline-flex; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.lang-switch button { border: 0; background: none; font: inherit; font-weight: 600; padding: 6px 14px; border-radius: 999px; color: var(--muted); cursor: pointer; }
.lang-switch button.on { background: var(--brand); color: #fff; }
.powered { color: var(--muted); font-size: .8rem; margin-top: 28px; }

@media (min-width: 720px) {
  .act { flex: 0 1 auto; }
  .act[open] { flex: 1 1 100%; }
  .filters input[type="search"] { flex: 1 1 200px; }
}

/* install + notifications card */
.app-card { padding: 12px 14px; }
.app-row { display: flex; align-items: center; gap: 12px; }
.app-row + .app-row { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.app-row > div { flex: 1; min-width: 0; }
.app-row small { display: block; color: var(--muted); font-size: .84rem; }
.app-ic { font-size: 1.5rem; }
.notice h2 { margin: 0; }
.notice-img { width: 100%; max-height: 420px; object-fit: contain; border-radius: 12px; background: var(--bg); margin-top: 6px; }
.right { text-align: right; margin-top: 8px; }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 0; }
.quick a { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 6px; text-align: center; text-decoration: none; color: var(--ink); font-weight: 600; font-size: .86rem; }
.quick a span { display: block; font-size: 1.3rem; }
.notice-mini { display: block; text-decoration: none; color: var(--ink); }
.notice-mini b { display: block; }
.notice-mini small { color: var(--muted); }
.table-wrap { overflow-x: auto; padding: 8px 12px; }
.table td, .table th { white-space: nowrap; }
.targets { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.target { display: grid !important; grid-template-columns: 1fr 64px auto; align-items: center; gap: 6px; margin: 0 !important; font-weight: 600; }
.target input { min-height: 40px; padding: 6px 8px; text-align: center; }
.target small { color: var(--muted); font-weight: 500; }
.admin-nav { display: flex; align-items: center; gap: 14px; font-weight: 600; }
.admin-nav a { text-decoration: none; }
.top + h1, .top + .row-between, .top + .back { margin-top: 16px; }
body.plain .top { margin: -14px -16px 0; }
.helping { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 16px; background: #7c2d12; color: #fff; font-size: .88rem; font-weight: 600; }
.helping .btn { min-height: 32px; padding: 4px 10px; background: #fff; color: #7c2d12; border: 0; }
