@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
  --brick: #B03A2E;
  --brick-dark: #8B2E24;
  --brick-deep: #6E241C;
  --plum: #F0C75E;
  --plum-soft: #F8E4A8;
  --plum-deep: #D4A63A;
  --cream: #FFF8EC;
  --cream-2: #FFF1D6;
  --paper: #FFFCFA;
  --ink: #1F1512;
  --muted: #6B5348;
  --line: #E4D4BC;
  --ok: #2F6B45;
  --ok-soft: #D8F0E0;
  --shadow: 0 1px 4px rgba(110, 36, 28, .08);
  --font: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
body {
  font-family: var(--font);
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.45;
  font-size: 15px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body > header {
  background: var(--brick);
  color: #fff;
  padding: .7rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  border-bottom: 3px solid var(--plum);
}
body > header nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .55rem;
  max-width: 100%;
}
body > header a { color: var(--plum-soft); text-decoration: none; margin-left: 0; font-weight: 600; font-size: .9rem; white-space: nowrap; }
body > header a:hover { color: #fff; }
body > header nav span { opacity: .85; margin-right: .35rem; font-size: .85rem; }

.brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  color: #fff !important;
  text-decoration: none;
  margin-left: 0 !important;
}
.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: var(--cream);
  box-shadow: 0 0 0 2px var(--plum);
  flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong {
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.brand-text small {
  opacity: .8;
  font-size: .72rem;
  font-weight: 500;
  font-family: var(--mono);
}

.lang-switch a { margin-left: .25rem !important; font-size: .82rem; }

.nav-sep {
  display: inline-block;
  width: 1px;
  height: 1em;
  background: rgba(255, 255, 255, .35);
  margin: 0 .2rem;
  vertical-align: middle;
  flex-shrink: 0;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  margin-left: .35rem;
  padding: 0 .3rem;
  border-radius: 999px;
  background: var(--plum);
  color: var(--brick-deep);
  font-size: .68rem;
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
  box-shadow: 0 0 0 2px var(--brick);
}

.page-kicker {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--brick-deep);
  margin: 0 0 .85rem;
}

.muted-text { color: var(--muted); font-size: .9rem; }

main { max-width: 1100px; margin: 1.25rem auto; padding: 0 1rem; flex: 1; width: 100%; box-sizing: border-box; }

/* —— Home (warm landing for staff) —— */
.home-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
  padding: 1.5rem 1.5rem 1.35rem;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 252, 250, .95) 0%, rgba(255, 241, 214, .9) 55%, rgba(248, 228, 168, .55) 100%),
    radial-gradient(ellipse at 90% 20%, rgba(176, 58, 46, .08), transparent 50%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.home-hero-text { max-width: 40rem; }
.home-kicker {
  margin: 0 0 .35rem;
  font-size: .8rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--brick-dark);
  font-weight: 600;
}
.home-hero h1 {
  margin: 0 0 .5rem;
  font-size: clamp(1.45rem, 3.5vw, 2rem);
  color: var(--brick-deep);
  line-height: 1.2;
}
.home-welcome {
  margin: 0 0 .5rem;
  font-size: 1.05rem;
  color: var(--ink);
}
.home-date {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
}
.home-hero-logo {
  flex-shrink: 0;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(110, 36, 28, .12);
}
.home-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem 1rem;
  margin-bottom: .5rem;
}
.home-section-head h2,
.home-actions-title,
.home-saldo h2 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--brick-deep);
}
.home-board-meta {
  margin: 0 0 .65rem;
  color: var(--muted);
  font-size: .88rem;
}
.home-board-body {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
  max-height: 9.5em;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, #000 70%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent);
  margin-bottom: .85rem;
}
.home-board-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 0;
}
.home-actions {
  margin: 1.25rem 0 1rem;
}
.home-actions-title { margin-bottom: .65rem; }
.home-action-links {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem .55rem;
}
.home-action-links a {
  display: inline-block;
  padding: .45rem .85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--brick-deep);
  text-decoration: none;
  font-weight: 600;
  font-size: .9rem;
}
.home-action-links a:hover {
  border-color: var(--brick);
  background: var(--cream-2);
}
.home-soft-summary {
  margin: 0 0 1rem;
  padding: .65rem .85rem;
  background: var(--cream-2);
  border-radius: 8px;
  color: var(--ink);
  font-size: .95rem;
}
.home-soft-summary a {
  margin-left: .35rem;
  color: var(--brick-dark);
  font-weight: 600;
}
.home-formula {
  font-size: .82rem;
  margin: .35rem 0 .75rem;
}
.home-saldo { scroll-margin-top: 1rem; }
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 640px) {
  .home-hero {
    flex-direction: column-reverse;
    align-items: flex-start;
    padding: 1.15rem;
  }
  .home-hero-logo { width: 72px; height: 72px; }
}

.site-footer {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem 1rem 1.75rem;
  box-sizing: border-box;
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
  border-top: 1px solid var(--line);
}
.site-footer p { margin: 0; }
.site-footer a {
  color: var(--brick-dark);
  text-decoration: none;
  font-weight: 600;
}
.site-footer a:hover { color: var(--brick); text-decoration: underline; }
@media print {
  .no-print { display: none !important; }
}

/* —— Tickets —— */
.ticket-form label,
.docs-upload label {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  margin-bottom: .75rem;
  font-weight: 600;
  font-size: .9rem;
}
.ticket-form input[type="text"],
.ticket-form textarea,
.docs-upload input[type="text"] {
  font: inherit;
  font-weight: 400;
  padding: .55rem .7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.ticket-filters { margin-bottom: 1rem; }
.ticket-filters select {
  font: inherit;
  margin-left: .35rem;
  padding: .35rem .5rem;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.tickets-open-hint {
  font-weight: 600;
  color: var(--brick-dark);
}
.ticket-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .85rem 1rem;
  margin-bottom: .75rem;
  background: var(--paper);
  border-left: 4px solid var(--plum-deep);
}
.ticket-card.status-open { border-left-color: var(--brick); }
.ticket-card.status-in_progress { border-left-color: #C47B2B; }
.ticket-card.status-done { border-left-color: var(--ok); }
.ticket-card.status-cancelled { border-left-color: #999; opacity: .85; }
.ticket-head {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  align-items: baseline;
}
.ticket-status {
  display: inline-block;
  margin-right: .4rem;
  padding: .1rem .45rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  background: var(--cream-2);
  color: var(--brick-deep);
  text-transform: uppercase;
  letter-spacing: .03em;
}
.ticket-body {
  white-space: pre-wrap;
  word-break: break-word;
  margin: .5rem 0;
  line-height: 1.45;
}
.ticket-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  margin-top: .65rem;
}
.ticket-status-form {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
  margin: 0;
}
.ticket-status-form select {
  font: inherit;
  padding: .25rem .4rem;
  border-radius: 6px;
  border: 1px solid var(--line);
}
.ticket-comments {
  margin-top: .75rem;
  padding-top: .65rem;
  border-top: 1px solid var(--line);
}
.ticket-comment {
  margin: 0 0 .55rem;
  font-size: .92rem;
  line-height: 1.4;
}
.ticket-comment-form {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .5rem;
}
.ticket-comment-form input[type="text"] {
  flex: 1 1 12rem;
  min-width: 0;
  font: inherit;
  padding: .35rem .5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.home-tickets {
  margin: .35rem 0 0;
  font-size: .95rem;
}
.home-tickets a { font-weight: 600; }
.login-forgot {
  margin: .85rem 0 0;
  text-align: center;
  font-size: .92rem;
}
.laws-disclaimer {
  font-size: .88rem;
  color: var(--muted, #666);
  background: #f7f3ee;
  border-left: 3px solid var(--brick, #8b3a2a);
  padding: .55rem .75rem;
  margin: .75rem 0 1rem;
}
.laws-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
}
.laws-item {
  padding: .85rem 0;
  border-bottom: 1px solid var(--line, #e5ddd3);
}
.laws-item:last-child { border-bottom: 0; }
.laws-item-head {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .65rem;
  align-items: baseline;
}
.laws-badge {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: #efe4d4;
  color: #7a4a1a;
  padding: .15rem .45rem;
  border-radius: 4px;
}
.laws-note { margin: .35rem 0 .55rem; font-size: .9rem; }
.laws-links { margin: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.laws-keypoints h3 {
  font-size: 1.05rem;
  margin: 0 0 .5rem;
}
.laws-keypoints ul {
  margin: 0;
  padding-left: 1.15rem;
}
.laws-keypoints li { margin: .35rem 0; line-height: 1.4; }
.report-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
}
.report-toolbar-actions form { margin: 0; }
.report-doc-head { margin-bottom: 1.25rem; }
.report-kicker {
  font-size: .85rem;
  color: var(--muted, #666);
  margin: 0 0 .35rem;
}
.report-building {
  font-size: 1.15rem;
  font-weight: 600;
  margin: .25rem 0;
}
.report-section { margin: 1.35rem 0; }
.report-section h2 { font-size: 1.1rem; }
.report-doc td.num,
.report-doc th.num { text-align: right; white-space: nowrap; }
.report-sign-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}
.report-foot-note { margin-top: 1.25rem; font-size: .85rem; }
.legal-watch {
  margin: 1rem 0 1.5rem;
  padding: 1rem;
  background: #faf7f3;
  border: 1px solid var(--line, #e5ddd3);
  border-radius: 6px;
}
.legal-watch h3 {
  margin: 0 0 .4rem;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
}
.watch-list { margin-top: .75rem; }
.pack-check { margin: .35rem 0 0; padding-left: 1.2rem; line-height: 1.45; }
.pack-check li { margin: .35rem 0; }
.pack-h { font-size: 1.15rem; margin: 0 0 .35rem; }
.pack-matrix-hint { margin: 0 0 .75rem; }
.pack-legend { display: flex; flex-wrap: wrap; gap: .4rem; margin: .65rem 0; }
.pack-tick {
  display: inline-block;
  min-width: 1.35rem;
  text-align: center;
  font-weight: 700;
  font-size: .8rem;
  padding: .12rem .4rem;
  border-radius: 3px;
  letter-spacing: .02em;
}
.pack-tick-yes { background: #dce8d8; color: #1f5c2e; }
.pack-tick-partial { background: #efe4d4; color: #7a4a1a; }
.pack-tick-no { background: #ead8d4; color: #7a2420; }
.pack-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .65rem;
  margin-bottom: .85rem;
}
.pack-stat {
  background: var(--paper);
  border: 1px solid var(--line, #e5ddd3);
  border-radius: 6px;
  padding: .7rem .85rem;
}
.pack-stat strong { display: block; font-size: 1.45rem; line-height: 1.1; }
.pack-stat span { font-size: .82rem; color: var(--muted, #666); }
.pack-stat-yes { border-left: 4px solid #3d7a48; }
.pack-stat-partial { border-left: 4px solid #c4892a; }
.pack-stat-no { border-left: 4px solid #b4453a; }
.pack-matrix {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin-bottom: .85rem;
}
.pack-q {
  background: var(--paper);
  border: 1px solid var(--line, #e5ddd3);
  border-radius: 6px;
  padding: .85rem .95rem;
  min-height: 8rem;
}
.pack-q h3 { font-size: .92rem; margin: 0 0 .55rem; line-height: 1.3; }
.pack-q ul { list-style: none; margin: 0; padding: 0; }
.pack-q li {
  display: flex;
  gap: .5rem;
  align-items: flex-start;
  margin: 0 0 .7rem;
}
.pack-q li:last-child { margin-bottom: 0; }
.pack-q li p { margin: .2rem 0 0; font-size: .86rem; color: var(--muted, #555); line-height: 1.35; }
.pack-when {
  display: inline-block;
  margin-left: .35rem;
  font-size: .75rem;
  color: var(--muted, #666);
  font-weight: 500;
}
.pack-q-ui { border-top: 4px solid #b4453a; }
.pack-q-uni { border-top: 4px solid #c4892a; }
.pack-q-nui { border-top: 4px solid #3d6e8a; }
.pack-q-nuni { border-top: 4px solid #8a8178; }
.pack-table { width: 100%; border-collapse: collapse; }
.pack-table th, .pack-table td {
  text-align: left;
  vertical-align: top;
  padding: .55rem .4rem;
  border-bottom: 1px solid var(--line, #e5ddd3);
  font-size: .92rem;
}
.pack-td-tick { width: 2.2rem; }
.pack-td-when { white-space: nowrap; font-size: .82rem; color: var(--muted, #555); }
.pack-row-note { font-size: .82rem; margin-top: .2rem; }
.pack-q-pill {
  display: inline-block;
  font-size: .72rem;
  padding: .12rem .4rem;
  border-radius: 3px;
  line-height: 1.3;
}
.pack-q-pill-ui { background: #f3ddd9; color: #7a2420; }
.pack-q-pill-uni { background: #f3e6d0; color: #7a4a1a; }
.pack-q-pill-nui { background: #d9e6ee; color: #1f4a62; }
.pack-q-pill-nuni { background: #ece9e4; color: #5c564e; }
.pack-row-ui td:first-child { border-left: 3px solid #b4453a; }
.pack-row-uni td:first-child { border-left: 3px solid #c4892a; }
.pack-row-nui td:first-child { border-left: 3px solid #3d6e8a; }
.pack-row-nuni td:first-child { border-left: 3px solid #8a8178; }
@media (max-width: 800px) {
  .pack-matrix, .pack-stats { grid-template-columns: 1fr; }
  .pack-td-when { white-space: normal; }
}
@media print {
  .pack-q { break-inside: avoid; }
  .pack-table tr { break-inside: avoid; }
}

@media print {
  .no-print, header.no-print, .site-footer, footer { display: none !important; }
  body { background: #fff; }
  .report-doc {
    box-shadow: none !important;
    border: 0 !important;
  }
  .report-section { break-inside: avoid; }
}
.docs-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
}
.docs-actions form { margin: 0; }
.card {
  background: var(--paper);
  border-radius: 6px;
  padding: 1rem 1.1rem;
  margin-bottom: .85rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  overflow-x: auto;
}
h1, h2 {
  margin-top: 0;
  font-family: var(--font);
  color: var(--brick-deep);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0;
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: .4rem .55rem; text-align: left; border-bottom: 1px solid var(--line); }
th {
  background: var(--cream-2);
  font-weight: 700;
  color: var(--brick-deep);
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}
td { font-variant-numeric: tabular-nums; }
.debt { color: var(--brick); font-weight: 700; }
.dash-summary {
  font-size: 1.05rem;
  margin: .75rem 0 1rem;
  padding: .65rem .85rem;
  background: var(--cream-2);
  border-radius: 8px;
}
.dash-summary .debt { font-size: 1.15rem; }
table tfoot .totals-row th {
  background: var(--cream-2);
  border-top: 2px solid var(--line);
  font-weight: 700;
}
.broadcast-reminder {
  border-left: 4px solid var(--brick);
  background: #FFF8EC;
}
.broadcast-reminder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: .75rem 0 0;
}
.broadcast-day-note {
  background: #FFF8EC;
  border-left: 4px solid var(--brick);
  padding: .75rem 1rem;
}
.settings-check {
  flex-direction: row !important;
  align-items: center;
  gap: .5rem;
}
.settings-check input { width: auto; }
.credit { color: var(--ok); font-weight: 700; }
.btn {
  display: inline-block;
  background: var(--brick);
  color: #fff;
  border: none;
  padding: .45rem .9rem;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  font-size: .9rem;
  font-weight: 650;
  font-family: var(--font);
}
.btn:hover { background: var(--brick-dark); }
.btn-secondary { background: var(--plum-deep); color: var(--ink); }
.btn-danger { background: var(--brick-deep); }
form.inline { display: inline; }
input, select, textarea {
  padding: .4rem .55rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  margin: .2rem .45rem .2rem 0;
  background: #fff;
  font-family: var(--font);
  font-size: .9rem;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--plum);
  border-color: var(--brick);
}
.login-box {
  max-width: 380px;
  margin: 3rem auto;
  border-top: 4px solid var(--brick);
  text-align: center;
  padding: 1.25rem 1.5rem 1.5rem;
}
.login-lang {
  text-align: right;
  margin: 0 0 1rem;
  font-size: .85rem;
}
.login-lang a {
  color: var(--brick);
  text-decoration: none;
  font-weight: 600;
}
.login-lang a.active { font-weight: 700; text-decoration: underline; }
.login-lang span { color: var(--muted); margin: 0 .15rem; }
.login-box h1 {
  font-size: 1.25rem;
  margin: 0 0 .35rem;
}
.login-sub {
  color: var(--muted);
  margin: 0 0 1.1rem;
  font-size: .95rem;
}
.login-public {
  margin: -.5rem 0 1rem;
  font-size: .82rem;
  word-break: break-all;
}
.login-public a { color: var(--brick); font-weight: 600; }
.login-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .65rem;
  max-width: 280px;
  margin: 0 auto;
}
.login-form input {
  width: 100%;
  margin: 0;
  text-align: center;
}
.login-form .btn {
  width: 100%;
  margin-top: .25rem;
}
.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .65rem;
  margin-bottom: .85rem;
  text-align: center;
}
.login-brand img {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  box-shadow: 0 0 0 3px var(--plum), var(--shadow);
}
.login-brand .tag {
  color: var(--brick);
  font-weight: 700;
  font-size: 1.05rem;
}
.error { color: var(--brick); font-weight: 600; }
.badge {
  display: inline-block;
  padding: .12rem .45rem;
  border-radius: 3px;
  font-size: .75rem;
  background: var(--cream-2);
  font-weight: 600;
}
.badge-matched { background: var(--ok-soft); }
.badge-pending { background: var(--plum-soft); }
.badge-imported { background: #FDE8C8; }
.badge-duplicate { background: #F5C6C0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }
@media (max-width: 768px) { .grid-2 { grid-template-columns: 1fr; } }

.creds-box {
  background: #f0fff4;
  border: 1px solid #9ae6b4;
  padding: .75rem 1rem;
  border-radius: 4px;
  margin-bottom: .85rem;
}
.creds-box code { font-family: var(--mono); font-size: 1rem; }

.compact-table th, .compact-table td { padding: .35rem .5rem; font-size: .9rem; }

/* —— year calendar: compact 6×2 grid —— */
.cal-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  margin-bottom: .15rem;
}
.cal-head h2 { margin: 0; }
.cal-years a {
  display: inline-block;
  padding: .2rem .55rem;
  margin-left: .15rem;
  border-radius: 3px;
  background: var(--cream-2);
  color: var(--brick-deep);
  text-decoration: none;
  font-size: .82rem;
  font-weight: 700;
}
.cal-years a.active { background: var(--brick); color: #fff; }
.cal-hint { color: var(--muted); font-size: .82rem; margin: .2rem 0 .65rem; }

.cal-card { padding-bottom: .75rem; }

.month-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}

.month-cell {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px 8px;
  background: #fff;
  min-width: 0;
}
.month-cell.is-paid {
  background: #FFF6D6;
  border-color: var(--plum-deep);
}
.month-cell.is-current {
  box-shadow: inset 0 0 0 2px var(--brick);
}
.month-cell.is-debt {
  background: #FBEAEA;
}

.month-cell-title {
  font-size: .78rem;
  font-weight: 700;
  color: var(--brick-deep);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 4px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--line);
}

.month-cell-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px;
  font-size: .72rem;
  line-height: 1.35;
  margin-top: 2px;
}
.month-cell-line span {
  color: var(--muted);
  font-weight: 500;
  flex-shrink: 0;
}
.month-cell-line strong {
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 600;
  color: var(--ink);
  text-align: right;
}
.month-cell-line.pay strong {
  color: var(--brick);
  font-weight: 700;
}
.month-cell.is-paid .month-cell-line.pay strong {
  color: var(--brick-deep);
}

@media (max-width: 900px) {
  .month-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .month-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* bulletin board */
.board-form textarea {
  width: 100%;
  min-height: 100px;
  font-family: inherit;
  font-size: .95rem;
  padding: .65rem .75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  resize: vertical;
}
.board-form textarea:focus {
  outline: none;
  border-color: var(--brick);
  box-shadow: 0 0 0 2px rgba(176, 58, 46, .15);
}
.board-feed { display: flex; flex-direction: column; gap: .75rem; }
.board-post {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .85rem 1rem;
  background: var(--paper);
}
.board-post-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .75rem;
  margin-bottom: .5rem;
  font-size: .85rem;
  color: var(--ink);
}
.board-post-head time {
  color: var(--brick-deep);
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.board-apt, .board-role {
  display: inline-block;
  margin-left: .35rem;
  padding: .05rem .4rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  background: var(--plum-soft);
  color: var(--brick-deep);
}
.board-role { background: var(--cream-2); }
.board-post-body {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}
.board-post footer { margin-top: .6rem; }
.board-post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  margin-top: .6rem;
}
.board-post-actions form { margin: 0; }
.flash {
  padding: .55rem .75rem;
  border-radius: 8px;
  font-size: .9rem;
  margin: .5rem 0 1rem;
}
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.err { background: #FBEAEA; color: var(--brick); }
.btn-sm { font-size: .8rem; padding: .25rem .55rem; }
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  box-shadow: none;
}
.btn-ghost:hover { color: var(--brick); border-color: var(--brick); }

.settings-card { max-width: 520px; }
.settings-meta { color: var(--muted); font-size: .9rem; margin-bottom: 1rem; }
.settings-form { display: flex; flex-direction: column; gap: .75rem; max-width: 360px; }
.settings-form label {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  font-size: .9rem;
  font-weight: 600;
}
.settings-form input {
  font: inherit;
  padding: .55rem .65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}
.settings-form input:focus {
  outline: none;
  border-color: var(--brick);
  box-shadow: 0 0 0 2px rgba(176, 58, 46, .15);
}
.settings-card h2 { font-size: 1rem; margin: 1.25rem 0 .75rem; }

.perm-fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .65rem .85rem;
  margin: .75rem 0;
}
.perm-fieldset legend { font-weight: 600; padding: 0 .25rem; }
.perm-fieldset label {
  display: block;
  margin: .35rem 0;
  font-size: .92rem;
}
.perm-fieldset input[type="checkbox"] { margin-right: .4rem; }

/* accounting KPI */
.kpi { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1rem; }
.kpi .card { text-align: center; overflow: visible; }
.kpi .val { font-size: 1.5rem; font-weight: 700; }
.income-c { color: #2F6B45; }
.expense-c { color: #B03A2E; }
.neutral { color: #8B2E24; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.filters a {
  display: inline-block; padding: .25rem .7rem; border-radius: 8px;
  background: #FFF1D6; color: #6E241C; text-decoration: none; font-size: .85rem; font-weight: 600;
}
.filters a.active { background: #B03A2E; color: #fff; }
.dir-in { color: #2F6B45; font-weight: 600; }
.dir-out { color: #B03A2E; font-weight: 600; }
.formula { background: #FFF1D6; padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid #E8D5B8; overflow: visible; }

/* contact / apartment forms */
.contact-form input[type="text"],
.contact-form input[type="number"],
.contact-form input[type="date"],
.contact-form input:not([type="checkbox"]) {
  max-width: 100%;
}
.pay-toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }

@media (max-width: 900px) {
  .kpi { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  body { font-size: 14px; }

  body > header {
    flex-direction: column;
    align-items: stretch;
    padding: .6rem .75rem;
    gap: .55rem;
  }
  body > header nav {
    gap: .3rem .45rem;
  }
  body > header nav > span:first-of-type {
    width: 100%;
    margin: 0 0 .15rem;
    font-size: .8rem;
    line-height: 1.3;
    word-break: break-word;
  }
  body > header a { font-size: .78rem; padding: .2rem 0; }
  .lang-switch { margin-left: 0 !important; }

  .brand { gap: .5rem; min-width: 0; }
  .brand-logo { width: 34px; height: 34px; }
  .brand-text strong { font-size: .82rem; line-height: 1.2; }
  .brand-text small { font-size: .65rem; word-break: break-all; }

  main { padding: 0 .65rem; margin-top: .75rem; }
  .page-kicker { font-size: 1rem; line-height: 1.35; word-break: break-word; }
  .card { padding: .85rem .75rem; border-radius: 8px; }

  h1, h2 { font-size: 1.05rem; }
  table { font-size: .82rem; min-width: 520px; }
  th, td { padding: .35rem .4rem; }

  input, select, textarea {
    width: 100%;
    max-width: 100%;
    margin: .35rem 0;
    display: block;
  }
  input[type="checkbox"] { width: auto; display: inline-block; margin-right: .35rem; }
  label { display: block; margin: .25rem 0; }

  .btn {
    display: inline-block;
    width: auto;
    max-width: 100%;
    text-align: center;
    padding: .55rem .85rem;
    margin: .25rem .35rem .25rem 0;
  }
  .contact-form p { margin: .5rem 0; }
  .contact-form input:not([type="checkbox"]) { min-width: 0 !important; width: 100%; }

  .grid-2 { gap: .65rem; }
  .kpi { grid-template-columns: 1fr; gap: .65rem; }
  .kpi .val { font-size: 1.25rem; }

  .month-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .month-cell { padding: 5px 6px; }
  .month-cell-title { font-size: .72rem; }
  .month-cell-line { font-size: .68rem; }
  .month-cell-line strong { font-size: .72rem; }

  .board-post-head { flex-direction: column; gap: .35rem; }
  .board-post-head time { white-space: normal; }

  .pay-toolbar { flex-direction: column; align-items: stretch; }
  .pay-toolbar input[type="number"] { width: 100%; }
  .pay-toolbar .btn { width: 100%; margin: .25rem 0; }

  .settings-card { max-width: none; }
  .settings-form { max-width: none; }
  .login-box { margin: 1.5rem .65rem; max-width: none; }
}

@media (max-width: 380px) {
  .month-grid { grid-template-columns: 1fr 1fr; }
  body > header nav a { font-size: .74rem; }
}
