/* Raaj Illam tenant portal — builds on the main site's style.css (colours, buttons, forms). */

.portal {
  background: var(--cream);
}

.site-logo img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.site-logo small {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  line-height: 1;
}

.portal-nav {
  gap: 0.35rem 1.1rem;
}

.portal-nav a[aria-current="page"] {
  color: var(--green);
  font-weight: 800;
}

/* Office menu: Dashboard + four dropdown groups (desktop); headings in the folded phone menu */
.nav-group {
  position: relative;
}

.nav-group-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--text);
  opacity: 0.82;
  cursor: pointer;
}

.nav-group-btn::after {
  content: "";
  width: 6px;
  height: 6px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg) translateY(-2px);
}

.nav-group-btn:hover,
.nav-group.is-open .nav-group-btn,
.nav-group.is-active .nav-group-btn {
  opacity: 1;
  color: var(--green);
}

.nav-group.is-active .nav-group-btn {
  font-weight: 800;
}

.nav-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: -12px;
  z-index: 60;
  min-width: 190px;
  margin-top: 8px;
  padding: 8px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(31, 64, 55, 0.14);
  flex-direction: column;
}

.nav-menu::before {
  /* keeps the menu open while the pointer crosses the gap under the button */
  content: "";
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 10px;
}

.nav-group.is-open .nav-menu {
  display: flex;
}

@media (hover: hover) {
  .nav-group:hover .nav-menu {
    display: flex;
  }
}

.portal-nav .nav-menu a,
.portal-nav .nav-menu .link-button {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text);
  opacity: 1;
  text-align: left;
  white-space: nowrap;
}

.portal-nav .nav-menu a:hover,
.portal-nav .nav-menu .link-button:hover {
  background: var(--cream);
  color: var(--green);
  text-decoration: none;
}

.portal-nav .nav-menu a[aria-current="page"] {
  color: var(--green);
  font-weight: 800;
}

.nav-menu .inline-form {
  display: block;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

@media (max-width: 860px) {
  .has-nav-toggle .nav-group {
    width: 100%;
  }

  .has-nav-toggle .nav-group-btn {
    display: block;
    width: 100%;
    padding: 12px 8px 4px;
    border-top: 1px solid var(--border);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold);
    opacity: 1;
    pointer-events: none;
  }

  .has-nav-toggle .nav-group-btn::after {
    display: none;
  }

  .has-nav-toggle .nav-menu,
  .has-nav-toggle .nav-group:hover .nav-menu {
    display: flex;
    position: static;
    min-width: 0;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .has-nav-toggle .nav-menu::before {
    display: none;
  }

  .has-nav-toggle .portal-nav .nav-menu a,
  .has-nav-toggle .portal-nav .nav-menu .link-button {
    border-top: 0;
    padding-left: 18px;
    border-radius: 0;
  }

  .has-nav-toggle .nav-menu .inline-form {
    margin: 0;
    padding: 0;
    border: 0;
  }
}

.inline-form {
  display: inline;
  margin: 0;
}

.inline-form.stack {
  display: grid;
  gap: 6px;
  min-width: 170px;
}

.link-button {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
}

.link-button:hover {
  color: var(--green);
  text-decoration: underline;
}

.portal-main {
  padding: 34px 0 60px;
  min-height: 60vh;
}

/* The portal uses more of a wide screen than the main website (1120px): tables and two-column pages need the room. */
.portal .container {
  width: min(1360px, 94%);
}

.portal-flash {
  margin-bottom: 20px;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.88rem;
}

/* ---------------------------------------------------------------- headings & panels */

.portal-hero {
  margin-bottom: 24px;
}

.portal-hero h1 {
  color: var(--green-dark);
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  line-height: 1.1;
  margin-bottom: 8px;
}

.portal-hero .section-label {
  margin-bottom: 6px;
}

.panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 26px;
  box-shadow: 0 10px 26px rgba(31, 64, 55, 0.07);
  margin-bottom: 22px;
  min-width: 0;
}

.panel h2 {
  color: var(--green-dark);
  font-size: 1.25rem;
  margin-bottom: 14px;
}

.panel h3,
.h3 {
  color: var(--green-dark);
  font-size: 1.05rem;
  margin: 0 0 6px;
}

.portal-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  align-items: start;
}

.portal-columns > .panel {
  margin-bottom: 0;
}

.portal-columns + .panel,
.portal-columns + .portal-columns {
  margin-top: 22px;
}

/* ---------------------------------------------------------------- login */

.login-wrap {
  display: flex;
  justify-content: center;
  padding: 10px 0 20px;
}

.login-card {
  width: 100%;
  max-width: 460px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 34px 30px;
  box-shadow: var(--shadow);
}

.login-card h1 {
  color: var(--green-dark);
  font-size: 1.9rem;
  line-height: 1.15;
  margin-bottom: 8px;
}

.login-card .h3 {
  margin-top: 18px;
}

.login-help {
  display: block;
  margin-top: 18px;
}

.portal-form {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.portal-form .form-row.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.portal-form .form-row.two > div {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.portal-form label {
  font-weight: 700;
  color: var(--green-dark);
  font-size: 0.95rem;
}

.portal-form input[type="file"] {
  padding: 10px;
  background: var(--white);
}

.checkbox-row {
  display: flex;
  align-items: end;
}

.checkbox-row label {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 600;
}

.portal-form > .btn {
  justify-self: start;
}

.portal-form > .btn-block,
.btn-block {
  width: 100%;
  justify-self: stretch;
}

.btn-small {
  min-height: 34px;
  padding: 0 14px;
  font-size: 0.85rem;
}

.btn-secondary {
  cursor: pointer;
}

/* buttons on light backgrounds (the site's .btn-secondary is styled for the dark hero) */
.panel .btn-secondary,
.portal-form .btn-secondary,
.login-card .btn-secondary,
.data-table .btn-secondary,
.notice .btn-secondary,
.portal-hero .btn-secondary {
  background: var(--white);
  color: var(--green-dark);
  border: 1px solid var(--border);
}

.panel .btn-secondary:hover,
.portal-hero .btn-secondary:hover {
  border-color: var(--gold);
}

button.btn {
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  border: 0;
}

/* ---------------------------------------------------------------- tiles */

.tile-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.tile {
  display: grid;
  gap: 6px;
  align-content: start;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 10px 24px rgba(31, 64, 55, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.tile-icon {
  font-size: 1.5rem;
}

.tile strong {
  color: var(--green-dark);
  font-size: 1.08rem;
}

.tile-meta {
  color: var(--muted);
  font-size: 0.88rem;
}

/* ---------------------------------------------------------------- badges, lists, notices */

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
  vertical-align: middle;
}

.badge-open,
.badge-submitted {
  background: #fff4dc;
  color: #8a5a00;
}

.badge-in_progress {
  background: #e7f0fb;
  color: #1d4f86;
}

.badge-done,
.badge-verified {
  background: #e3f4ea;
  color: #1f6b43;
}

.badge-query {
  background: #fde8e6;
  color: #8a1c13;
}

.badge-none {
  background: #eeeae3;
  color: var(--muted);
}

.simple-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.simple-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
}

.notice {
  border-left: 4px solid var(--border);
  padding: 4px 0 4px 14px;
  margin-bottom: 16px;
}

.notice-pinned {
  border-left-color: var(--gold);
}

.notice-date {
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 4px;
}

.notice p:last-child {
  margin-bottom: 0;
}

.callout {
  background: #fbf4e8;
  border: 1px solid rgba(197, 157, 95, 0.45);
  border-radius: 16px;
  padding: 14px 18px;
  margin-bottom: 22px;
}

.owner-note {
  background: #eef6f1;
  border-radius: 12px;
  padding: 10px 14px;
  margin: 10px 0 0;
}

/* ---------------------------------------------------------------- requests */

.request-card + .request-card {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 16px;
}

.panel.request-card + .panel.request-card {
  border-top: 1px solid var(--border);
  padding-top: 26px;
  margin-top: 0;
}

.request-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.request-head h2,
.request-head h3 {
  margin: 0;
}

.thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0;
}

.thumbs img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.inline-update {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}

/* ---------------------------------------------------------------- pay */

.pay-option + .pay-option {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.copy-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

code {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 0.95rem;
  word-break: break-all;
}

.qr {
  display: block;
  width: 220px;
  height: 220px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--white);
}

.kv-table {
  width: 100%;
  border-collapse: collapse;
}

.kv-table th,
.kv-table td {
  text-align: left;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.kv-table th {
  width: 40%;
  color: var(--muted);
  font-weight: 600;
  padding-right: 12px;
}

.copied {
  outline: 2px solid var(--gold);
}

/* ---------------------------------------------------------------- tables */

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.data-table tr.inactive td {
  opacity: 0.55;
}

.data-table .actions {
  white-space: nowrap;
}

.data-table input[type="text"],
.data-table .row-edit input[type="tel"],
.data-table .row-edit input[type="email"],
.data-table .row-edit input[type="date"],
.data-table select,
.filter-bar select {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 8px;
  font: inherit;
  font-size: 0.88rem;
  background: var(--cream);
}

.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.filter-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 6px 0 14px;
}

.filter-links a {
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}

.filter-links a[aria-current="page"] {
  color: var(--green);
  text-decoration: underline;
}

/* ---------------------------------------------------------------- documents */

.doc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.doc-list a {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
}

.doc-list a:hover {
  border-color: var(--gold);
}

.doc-list a > span:last-child {
  display: grid;
}

.doc-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(197, 157, 95, 0.18);
  color: var(--green-dark);
  font-size: 0.72rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------------------------------------------------------------- admin */

.unit-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.unit-board-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 20px;
}

.unit-board-card h2 {
  color: var(--green-dark);
  font-size: 1.15rem;
}

.unit-board-card p {
  margin: 8px 0 0;
}

.issued {
  border-color: var(--gold);
}

.issued pre {
  white-space: pre-wrap;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  font: inherit;
  font-size: 0.95rem;
  margin: 10px 0 14px;
}

/* ---------------------------------------------------------------- footer */

.portal-footer {
  padding: 26px 0;
}

.emergency-strip {
  font-size: 0.92rem;
}

.emergency-line {
  margin: 0 0 6px;
}

.emergency-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 28px;
}

.emergency-strip a {
  color: inherit;
  font-weight: 700;
}

.emergency-contact {
  white-space: nowrap;
}

.portal-footer-note {
  margin: 12px 0 0;
  font-size: 0.82rem;
  opacity: 0.8;
}

/* ---------------------------------------------------------------- pay rent flow */

/* phones/tablets (touch, no hover) vs computers */
.touch-only {
  display: none;
}

@media (hover: none) and (pointer: coarse) {
  .touch-only {
    display: block;
  }

  details.touch-only {
    display: block;
  }

  .desktop-only {
    display: none;
  }
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--green);
  color: var(--white);
  font-size: 0.95rem;
  vertical-align: 2px;
}

.amount-due {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 12px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.amount-due {
  display: block;
}

.amount-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.due-line {
  margin: 6px 0 0;
  color: var(--muted);
}

.late-text {
  color: #9a3412;
  font-weight: 700;
}

.amount-big {
  font-size: 1.5rem;
  color: var(--green-dark);
}

.upi-app-btn {
  min-height: 52px;
  font-size: 1.05rem;
  margin-bottom: 6px;
}

/* "Or open in: Google Pay · PhonePe · Paytm" under the UPI button */
.upi-apps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 10px 0 4px;
}

.upi-apps > span {
  flex-basis: 100%;
}

.upi-apps .btn-small {
  flex: 1 1 0;
  width: auto;
  min-height: 42px;
  padding-left: 6px;
  padding-right: 6px;
  white-space: nowrap;
}

.upi-apps + .small-note {
  margin-bottom: 16px;
}

.pay-option summary,
.more-details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--green-dark);
  padding: 4px 0;
}

.pay-option[open] summary,
.more-details[open] summary {
  margin-bottom: 12px;
}

.more-details {
  border-top: 1px dashed var(--border);
  padding-top: 12px;
  display: grid;
  gap: 14px;
}

.more-details[open] {
  gap: 14px;
}

.proof-drop {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 2px dashed var(--gold);
  border-radius: 18px;
  padding: 18px;
  background: #fbf4e8;
  cursor: pointer;
  position: relative;
}

.proof-drop.has-file {
  border-style: solid;
  border-color: var(--green);
  background: #eef6f1;
}

.proof-drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
}

.proof-icon {
  font-size: 1.8rem;
}

.proof-text {
  display: grid;
  gap: 2px;
}

.proof-text strong {
  color: var(--green-dark);
  font-size: 1.05rem;
}

.proof-name {
  margin: -8px 0 0;
  color: var(--green);
  font-weight: 700;
}

.dup-warning {
  margin: 0;
}

.checkbox-line[hidden],
[data-item-select] optgroup[hidden] {
  display: none;
}

/* People: a second / third number with its label; email */
.phone-with-label {
  display: grid;
  grid-template-columns: 1fr 110px;
  gap: 6px;
}

.person-number {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 8px;
}

.person-email {
  display: block;
  margin-top: 2px;
}

.checkbox-line {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 700;
  color: var(--green-dark);
}

.proof-thumb {
  width: 88px;
  height: 120px;
  object-fit: cover;
  object-position: top;
  border-radius: 10px;
  border: 1px solid var(--border);
}

/* tables that turn into cards on phones */
@media (max-width: 640px) {
  .stack-on-phone thead {
    display: none;
  }

  .stack-on-phone,
  .stack-on-phone tbody,
  .stack-on-phone tr,
  .stack-on-phone td {
    display: block;
    width: 100%;
  }

  .stack-on-phone tr {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px 14px;
    margin-bottom: 10px;
  }

  .stack-on-phone td {
    border: 0;
    padding: 3px 0;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    text-align: right;
  }

  .stack-on-phone td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.82rem;
    text-align: left;
  }
}

/* ---------------------------------------------------------------- maintenance */

.emergency-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  background: #fdecea;
  border: 1px solid #f3b7b2;
  color: #6b1a12;
  border-radius: 16px;
  padding: 14px 18px;
  margin-bottom: 22px;
}

.emergency-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-danger {
  background: #b42318;
  color: var(--white);
}

.emergency-box .btn-secondary {
  background: var(--white);
  color: #6b1a12;
  border: 1px solid #f3b7b2;
}

.choice-group {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.choice-group legend {
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 10px;
  padding: 0;
}

.tile-choices {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.choice-tile {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 12px 6px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--white);
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--green-dark);
  cursor: pointer;
}

.choice-icon {
  font-size: 1.5rem;
}

.choice-tile input,
.choice-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-tile:has(input:checked) {
  border: 2px solid var(--green);
  background: #eef6f1;
}

.choice-tile:has(input:focus-visible),
.choice-chip:has(input:focus-visible) {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.chip-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice-chip {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--white);
  cursor: pointer;
}

.choice-chip:has(input:checked) {
  background: var(--green);
  border-color: var(--green);
  color: var(--white);
}

.tips {
  background: #eef4fb;
  border: 1px solid #c9dcf2;
  border-radius: 14px;
  padding: 12px 16px;
}

.tips ul {
  margin: 6px 0;
  padding-left: 1.2rem;
}

.tips li {
  margin-bottom: 4px;
}

.request-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.request-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
}

.request-row:hover {
  border-color: var(--gold);
}

.request-row.is-closed {
  opacity: 0.6;
}

.request-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.request-main {
  display: grid;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.request-main strong {
  color: var(--green-dark);
}

.back-link {
  margin: 0 0 14px;
}

.back-link a {
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}

.request-title {
  color: var(--green-dark);
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  margin: 0;
}

.timeline {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin: 18px 0;
  padding: 0;
  counter-reset: step;
}

.timeline li {
  position: relative;
  padding-top: 26px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}

.timeline li span {
  display: block;
  font-weight: 500;
  font-size: 0.76rem;
}

.timeline li::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border-radius: 50%;
  background: var(--border);
  z-index: 1;
}

.timeline li::after {
  content: '';
  position: absolute;
  top: 12px;
  left: -50%;
  width: 100%;
  height: 3px;
  background: var(--border);
}

.timeline li:first-child::after {
  display: none;
}

.timeline li.done,
.timeline li.current {
  color: var(--green-dark);
}

.timeline li.done::before,
.timeline li.done::after,
.timeline li.current::after {
  background: var(--green);
}

.timeline li.current::before {
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(197, 157, 95, 0.3);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
  margin: 10px 0 14px;
}

.detail-grid dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-grid dd {
  margin: 2px 0 0;
}

.request-desc {
  background: var(--cream);
  border-radius: 12px;
  padding: 12px 14px;
}

.confirm-box {
  background: #fff4dc;
  border: 1px solid #f0d49a;
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.confirm-box .portal-form {
  margin-top: 10px;
}

.confirm-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.thread {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: grid;
  gap: 10px;
}

.msg {
  border-radius: 14px;
  padding: 10px 14px;
  background: var(--cream);
  border: 1px solid var(--border);
  max-width: 88%;
}

.msg-admin,
.msg-staff {
  background: #eef6f1;
  border-color: #cfe5d8;
}

.msg-tenant {
  margin-left: auto;
}

.msg-system {
  max-width: 100%;
  background: transparent;
  border-style: dashed;
  color: var(--muted);
  font-size: 0.9rem;
}

.msg-meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.reply-form {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.private-heading {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
}

@media (max-width: 640px) {
  .tile-choices {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .choice-tile {
    padding: 10px 2px;
    font-size: 0.72rem;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .timeline li {
    font-size: 0.7rem;
  }

  .timeline li span {
    font-size: 0.66rem;
  }

  .msg {
    max-width: 100%;
  }
}

/* ---------------------------------------------------------------- electricity */

.bill-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  background: var(--cream);
}

.bill-card.bill-soon {
  background: #fff4dc;
  border-color: #f0d49a;
}

.bill-card.bill-overdue {
  background: #fdecea;
  border-color: #f3b7b2;
}

.bill-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.bill-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 6px 0;
  color: var(--muted);
}

.bill-status {
  font-weight: 700;
  margin: 6px 0 12px;
}

.code-big {
  font-size: 1.15rem;
  letter-spacing: 0.04em;
}

.pay-steps {
  padding-left: 1.2rem;
  margin: 14px 0 8px;
}

.pay-steps li {
  margin-bottom: 6px;
}

/* EB bill graphs (inline SVG from app/charts.php) */

.chart-switch {
  margin: 10px 0 4px;
}

.chart-radio {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.chart-radio + label {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--border);
  background: var(--white);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  margin: 0 -1px 10px 0;
}

.chart-radio:first-of-type + label {
  border-radius: 999px 0 0 999px;
}

.chart-radio:last-of-type + label {
  border-radius: 0 999px 999px 0;
}

.chart-radio:checked + label {
  background: var(--green);
  border-color: var(--green);
  color: var(--white);
}

.chart-radio:focus-visible + label {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* With the switch, show only the pane matching the checked button. */
.chart-radio ~ .chart-pane {
  display: none;
}

.chart-radio:first-of-type:checked ~ .chart-pane:first-of-type,
.chart-radio:last-of-type:checked ~ .chart-pane:last-of-type {
  display: block;
}

.line-chart {
  display: block;
  width: 100%;
  height: auto;
  max-height: 300px;
  font-family: inherit;
}

.chart-grid {
  stroke: var(--border);
  stroke-width: 1;
}

.chart-axis {
  font-size: 12px;
  fill: var(--muted);
}

.chart-value {
  font-size: 12px;
  font-weight: 700;
  fill: var(--green-dark);
}

.chart-area {
  fill: var(--gold);
  opacity: 0.16;
}

.chart-line {
  fill: none;
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart-dot {
  stroke: var(--white);
  stroke-width: 2;
}

.chart-avg {
  stroke: var(--muted);
  stroke-width: 1;
  stroke-dasharray: 5 5;
}

.chart-avg-label {
  font-size: 11px;
  fill: var(--muted);
}

/* Series colours: a single series uses s0 (gold); the owner's all-flats graph uses s0-s5. */
.chart-line.s0 { stroke: #b4883f; }
.chart-dot.s0, .chart-key.s0 { fill: #b4883f; background: #b4883f; }
.chart-line.s1 { stroke: #2f5d50; }
.chart-dot.s1, .chart-key.s1 { fill: #2f5d50; background: #2f5d50; }
.chart-line.s2 { stroke: #3b7dd8; }
.chart-dot.s2, .chart-key.s2 { fill: #3b7dd8; background: #3b7dd8; }
.chart-line.s3 { stroke: #c2410c; }
.chart-dot.s3, .chart-key.s3 { fill: #c2410c; background: #c2410c; }
.chart-line.s4 { stroke: #7c3aed; }
.chart-dot.s4, .chart-key.s4 { fill: #7c3aed; background: #7c3aed; }
.chart-line.s5 { stroke: #0f9b8e; }
.chart-dot.s5, .chart-key.s5 { fill: #0f9b8e; background: #0f9b8e; }

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 8px 0 0;
  font-size: 0.88rem;
  font-weight: 700;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-key {
  display: inline-block;
  width: 14px;
  height: 4px;
  border-radius: 2px;
}

.chart-note {
  margin: 12px 0 0;
  font-weight: 600;
}

.chart-note-warn {
  background: #fff4dc;
  border: 1px solid #f0d49a;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 500;
}

/* Phones: the SVG scales down to about half size, so draw its text larger and keep only the last value label. */
@media (max-width: 560px) {
  .chart-axis,
  .chart-value {
    font-size: 21px;
  }

  .chart-avg-label {
    font-size: 19px;
  }

  .line-chart.many .chart-value {
    display: none;
  }

  .line-chart.many .chart-value:last-of-type {
    display: inline;
  }

  .chart-dot {
    r: 7px;
  }

  .chart-line {
    stroke-width: 4;
  }
}

.move-in-form {
  display: flex;
  gap: 6px;
  align-items: center;
}

.move-in-form input {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 5px 8px;
  font: inherit;
  font-size: 0.85rem;
  background: var(--cream);
}

.utility-list li {
  align-items: flex-start;
  flex-wrap: nowrap;
}

.guides-heading {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.portal-form .form-row.three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.portal-form .form-row.three > div {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.eb-info-form {
  margin: 8px 0 16px;
}

.bill-row-form {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.bill-row-form input {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 8px;
  font: inherit;
  font-size: 0.88rem;
  background: var(--cream);
  width: 120px;
}

.bill-row-form input[type="text"] {
  width: 90px;
}

@media (max-width: 640px) {
  .portal-form .form-row.three {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------------------------------------- pay rent v2 */

.rent-status {
  border-left: 6px solid var(--border);
}

.rent-status-verified,
.rent-status-settled {
  border-left-color: #2e7d4f;
}

.rent-status-sent,
.rent-status-due {
  border-left-color: var(--gold);
}

.rent-status-partial,
.rent-status-overdue,
.rent-status-query {
  border-left-color: #c2410c;
  background: #fffaf5;
}

.rent-status-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.rent-status-title {
  margin: 2px 0 6px;
}

.rent-status-verified .amount-big,
.rent-status-settled .amount-big {
  color: #2e7d4f;
}

.rent-status p {
  margin: 6px 0 0;
}

.query-card {
  border: 2px solid #f0b48a;
  background: #fff7f0;
}

/* Paying next month ahead: a heading over the pay steps (they are never folded away) */
.pay-ahead-heading {
  margin: 8px 0 14px;
  color: var(--green-dark);
}

.pay-ahead-heading .small {
  font-weight: 400;
}

/* "Pay … rent" button in the status card jumps here; keep it clear of the sticky header */
#pay,
#record,
#pay-ahead {
  scroll-margin-top: 90px;
}

.rent-calendar {
  list-style: none;
  padding: 0;
  margin: 6px 0 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}

.rc > a,
.rc > span {
  display: grid;
  gap: 1px;
  padding: 10px 10px 9px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--white);
  text-decoration: none;
  color: var(--text);
  height: 100%;
}

.rc > a:hover {
  border-color: var(--green);
}

.rc-month {
  font-weight: 800;
}

.rc-year {
  font-size: 0.75rem;
  color: var(--muted);
}

.rc-state {
  font-size: 0.8rem;
  font-weight: 700;
  margin-top: 4px;
}

.rc-verified > *,
.rc-settled > * {
  background: #eef7f1;
  border-color: #b9dcc6;
}

.rc-verified .rc-state,
.rc-settled .rc-state {
  color: #2e7d4f;
}

.rc-sent .rc-state,
.rc-due .rc-state {
  color: #8a6420;
}

.rc-partial > *,
.rc-overdue > *,
.rc-query > * {
  background: #fdf0ea;
  border-color: #f3c3a8;
}

.rc-partial .rc-state,
.rc-overdue .rc-state,
.rc-query .rc-state {
  color: #b23c0a;
}

.history-details {
  margin-top: 4px;
}

.tenant-reply {
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #fff4dc;
}

.rent-board .actions > * {
  display: inline-block;
  margin: 2px 4px 2px 0;
}

.rent-board .record-inline {
  display: block;
  margin-bottom: 6px;
}

.record-inline > summary {
  list-style: none;
  cursor: pointer;
}

.record-inline > summary::-webkit-details-marker {
  display: none;
}

.record-inline[open] > summary {
  margin-bottom: 8px;
}

.record-inline label {
  display: grid;
  gap: 2px;
}

/* ---------------------------------------------------------------- maintenance admin v2 */

/* Date/time pickers have a wide built-in minimum; let them shrink to their column. */
.portal-form .form-row.two > div {
  min-width: 0;
}

.portal-form input[type="datetime-local"],
.portal-form input[type="date"] {
  width: 100%;
  min-width: 0;
}

.attention-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 6px;
}

.attention-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
}

.attention-chip strong {
  font-size: 1rem;
}

.attention-chip.has-items {
  color: var(--text);
}

.attention-chip.chip-query.has-items {
  border-color: #f3c3a8;
  background: #fdf0ea;
}

.attention-chip.chip-query.has-items strong {
  color: #b23c0a;
}

.attention-chip.chip-submitted.has-items {
  border-color: #f0d49a;
  background: #fff4dc;
}

.attention-chip.is-current {
  outline: 2px solid var(--green);
}

.request-row.is-stale {
  border-left: 4px solid #c2410c;
}

.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 8px;
  align-items: center;
}

.chip-button {
  border: 1px solid var(--border);
  background: var(--cream);
  border-radius: 999px;
  padding: 5px 11px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green-dark);
  cursor: pointer;
}

.chip-button:hover {
  border-color: var(--green);
}

.wa-prompt {
  border: 2px solid #b9dcc6;
  background: #f3faf5;
}

.wa-preview {
  white-space: pre-wrap;
  font: inherit;
  font-size: 0.92rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 8px 0;
}

.vendor-list,
.plan-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.vendor-list > li,
.plan-list > li {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.vendor-list > li:last-child,
.plan-list > li:last-child {
  border-bottom: 0;
}

.vendor-list > li.inactive {
  opacity: 0.6;
}

.plan-list .panel-actions {
  margin-top: 8px;
}

.total-row td {
  border-top: 2px solid var(--border);
}

/* ---------------------------------------------------------------- tenants admin v2 */

.flat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.flat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.flat-card.is-vacant {
  background: var(--cream);
  box-shadow: none;
  border-style: dashed;
}

.flat-card h2 {
  font-size: 1.15rem;
  margin: 0;
}

.flat-card h2 a {
  color: var(--green-dark);
}

.flat-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
  margin: 10px 0;
}

.flat-facts dt {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.flat-facts dd {
  margin: 0;
  font-size: 0.92rem;
}

.flat-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.flat-links a {
  color: var(--green);
}

.row-edit summary {
  cursor: pointer;
  color: var(--green);
  margin-top: 4px;
}

.row-edit form {
  display: grid;
  gap: 6px;
  min-width: 240px;
  margin-top: 8px;
}

.row-edit label {
  display: grid;
  gap: 2px;
}

.row-edit .row-login {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.tenant-table .nowrap {
  white-space: nowrap;
}

/* ---------------------------------------------------------------- expenses */

.data-table .num {
  text-align: right;
}

.expense-table .nowrap {
  white-space: nowrap;
}

.expense-table tr.to-check td {
  background: #fff9ec;
}

.expense-table .cat-link {
  font-weight: 700;
  color: var(--green-dark);
}

.expense-table .actions {
  white-space: normal;
}

.expense-table .actions > * {
  margin-right: 6px;
}

.month-bars {
  list-style: none;
  padding: 0;
  margin: 10px 0 14px;
  display: grid;
  gap: 6px;
}

.month-bars li {
  display: grid;
  grid-template-columns: 52px 1fr 92px;
  gap: 10px;
  align-items: center;
  font-size: 0.88rem;
}

.month-bars .mb-bar {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: var(--cream);
  overflow: hidden;
}

.month-bars .mb-bar span {
  display: block;
  height: 100%;
  background: var(--gold);
  border-radius: 6px;
}

.month-bars .mb-value {
  text-align: right;
  white-space: nowrap;
}

.plan-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.plan-list li > details {
  grid-column: 1 / -1;
}

.plan-list li.is-due > div > strong {
  color: var(--green-dark);
}

.expense-form .checkbox-line {
  font-weight: 400;
}

/* ---------------------------------------------------------------- agreements */

.new-agreement {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.new-agreement select {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  background: var(--white);
}

.agreement-form {
  gap: 20px;
}

.agreement-form .panel {
  margin: 0;
}

.portal-form .form-row.three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.portal-form .form-row.three > div {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.tenant-block {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px 16px;
  margin: 0 0 14px;
  display: grid;
  gap: 12px;
}

.tenant-block legend {
  font-weight: 800;
  color: var(--green-dark);
  padding: 0 6px;
}

.tenant-block label {
  display: grid;
  gap: 6px;
}

.inventory-table input {
  width: 100%;
  min-width: 90px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  font: inherit;
  font-size: 0.88rem;
  background: var(--cream);
}

.inventory-table input.qty {
  min-width: 48px;
  width: 56px;
  text-align: center;
}

.inventory-table td {
  padding: 6px 4px;
}

/* Furniture & appliances tables (same look as the agreement inventory) */
.items-table input.year {
  width: 64px;
  min-width: 64px;
}

.items-table td [data-age] {
  display: block;
  white-space: nowrap;
  margin-top: 2px;
}

.items-table .row-tools {
  white-space: nowrap;
}

.icon-btn.small {
  width: 30px;
  height: 30px;
  font-size: 0.9rem;
  cursor: pointer;
}

.item-row.is-removed input {
  text-decoration: line-through;
  opacity: 0.5;
}

.item-more td {
  background: #faf9f6;
}

.item-more-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 14px;
  align-items: end;
}

.item-more-grid label {
  display: grid;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--green-dark);
}

.item-more-grid input,
.item-more-grid select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  font: inherit;
  font-size: 0.88rem;
  background: var(--white);
}

.item-more-grid .item-extra {
  grid-column: 1 / -1;
}

.item-money {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-size: 0.9rem;
  line-height: 1.5;
}

.item-money .item-spend {
  display: block;
  margin-top: 2px;
}

.item-money-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.receipt-count {
  margin-left: 2px;
  white-space: nowrap;
}

.item-history {
  display: block;
}

.furnishing-summary p {
  margin: 0;
}

@media (max-width: 760px) {
  .item-more-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.agreement-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.steps-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.steps-list li.done {
  color: var(--green-dark);
}

.steps-list li.done::before {
  content: "✓ ";
}

@media (max-width: 980px) {
  .portal-form .form-row.three {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .portal-form .form-row.three {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------------------------------------- people directory */

.people-hero {
  padding-bottom: 10px;
}

.people-add {
  margin-bottom: 16px;
}

.people-add > summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--green);
}

.people-add[open] > summary {
  margin-bottom: 8px;
}

.people-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.people-search {
  flex: 1 1 200px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 16px;
  font: inherit;
  font-size: 0.95rem;
  background: var(--cream);
  min-width: 0;
}

.people-chips {
  margin: 0 0 6px;
}

.people-chips .chip-button span {
  opacity: 0.6;
  font-weight: 400;
}

.people-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.person-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 14px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.person-row[hidden] {
  display: none;          /* the search / chips hide rows with the hidden attribute; display: grid would win otherwise */
}

.person-row.is-preferred {
  box-shadow: inset 3px 0 0 var(--gold);
  padding-left: 10px;
}

.person-row.is-hidden-person {
  opacity: 0.75;
}

.person-name {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
}

.person-meta {
  line-height: 1.4;
}

.person-contact {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.person-tel {
  font-weight: 700;
  color: var(--green-dark);
}

.person-hidden-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
  align-items: center;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--white);
  text-decoration: none;
  font-size: 1rem;
  color: var(--green-dark);
}

.icon-btn:hover {
  border-color: var(--green);
}

@media (max-width: 560px) {
  .person-row {
    grid-template-columns: 1fr;
  }

  .person-contact {
    justify-content: flex-start;
  }
}

@media print {
  .people-hero,
  .person-meta .print-hide {
    display: none !important;
  }

  .person-row {
    break-inside: avoid;
    padding: 4px 0;
  }
}

.tenant-table .move-in-form {
  flex-wrap: wrap;
}

.tenant-table .tenant-cell .small {
  margin-top: 2px;
}

.tenant-table .tenant-email {
  white-space: nowrap;
}

.tenant-table .tenant-email a {
  display: inline-block;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.check-item {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.check-item input[type="date"] {
  width: auto;
  max-width: 170px;
}

.deduction-row {
  margin-bottom: 6px;
}

.past-tenancy {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 90px;
}

.past-tenancy:last-child {
  border-bottom: 0;
}

.past-tenancy h3 {
  margin: 0 0 4px;
}

.rent-change-note {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #fff4dc;
}

.account-section {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

/* ---------------------------------------------------------------- documents v2 */

.badge-new {
  background: #e3efff;
  color: #1d4f91;
}

.flat-card.has-gaps {
  border-color: #f3c3a8;
}

.doc-flats .flat-card p.small {
  margin: 4px 0 0;
}

.doc-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.doc-filters input[type="search"] {
  flex: 1 1 180px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 10px;
  font: inherit;
  background: var(--cream);
}

.eb-round input[type="text"] {
  width: 90px;
}

.eb-round input[type="date"] {
  width: 150px;
}

.eb-round input[type="file"] {
  max-width: 220px;
  font-size: 0.85rem;
}

.doc-table .row-edit form {
  min-width: 260px;
}

/* ---------------------------------------------------------------- notices v2 */

.notice.notice-important {
  border-left: 5px solid #c2410c;
  background: #fffaf5;
}

.notice.notice-important h3 {
  color: #9a3412;
}

.notice.notice-expired {
  opacity: 0.75;
}

.flat-picks {
  border: 0;
  padding: 0;
  margin: 0 0 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}

.flat-picks legend {
  width: 100%;
  margin-bottom: 4px;
}

.notice-flags {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.ack-status a {
  margin-right: 6px;
}

.ack-done {
  color: #2e7d4f;
  font-weight: 700;
  margin-right: 6px;
}

/* ---------------------------------------------------------------- utilities v2 */

.bill-card.bill-paid {
  background: #eef7f1;
  border-color: #b9dcc6;
}

.attention-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.attention-list li:last-child {
  border-bottom: 0;
}

.att-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meter-box {
  margin: 4px 0 14px;
}

.meter-box .reading-form {
  margin-top: 10px;
}

.add-bill {
  margin: 4px 0 14px;
}

.chart-bar {
  fill: var(--green);
  opacity: 0.85;
}

.chart-bar:hover {
  opacity: 1;
}

.meter-box .chart-caption {
  margin: 10px 0 4px;
}

.add-bill .portal-form {
  margin-top: 10px;
}

.paid-cell {
  white-space: nowrap;
}

.paid-form {
  margin-top: 10px;
}

/* ---------------------------------------------------------------- handbook / terms */

.handbook-section {
  scroll-margin-top: 90px;
}

.handbook-section ul {
  padding-left: 1.2rem;
  margin: 8px 0 12px;
}

.handbook-section li {
  margin-bottom: 6px;
}

.handbook-section h3 {
  margin-top: 16px;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
}

/* ---------------------------------------------------------------- tenant home: to do, coming up, at a glance, help, app */

.hero-with-action {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.todo-card h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.todo-count {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--green-dark);
  color: var(--white);
  font-size: 0.85rem;
}

.todo-clear {
  padding-top: 20px;
  padding-bottom: 20px;
}

.todo-clear h2 {
  margin-bottom: 6px;
}

.all-set {
  color: #1f6b43;
  font-weight: 700;
  margin: 0;
}

.todo-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.todo {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 6px 14px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  border-left-width: 5px;
  background: var(--cream);
}

.todo-urgent {
  border-left-color: #c0392b;
  background: #fff6f5;
}

.todo-soon {
  border-left-color: var(--gold);
  background: #fbf4e8;
}

.todo-info {
  border-left-color: #1d4f86;
  background: #f1f6fc;
}

.todo-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.todo-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.todo-text strong {
  color: var(--green-dark);
  overflow-wrap: anywhere;
}

.todo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.todo-actions .inline-form {
  display: inline;
}

.todo-actions .btn {
  font-size: 0.85rem;
  min-height: 36px;
}

.todo-nudge {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: #eef6f1;
  font-size: 0.92rem;
}

.badge-scheduled {
  background: #e7f0fb;
  color: #1d4f86;
}

.coming-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
}

.coming-list li {
  display: grid;
  grid-template-columns: 88px auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.coming-list li:first-child {
  border-top: 0;
  padding-top: 0;
}

.coming-when {
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--green-dark);
  padding-top: 2px;
  white-space: nowrap;
}

.coming-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.coming-text a,
.coming-text strong {
  font-weight: 700;
  color: var(--green-dark);
}

.glance-list {
  margin: 0 0 12px;
  display: grid;
}

.glance-list > div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}

.glance-list > div:first-child {
  border-top: 0;
  padding-top: 0;
}

.glance-list dt {
  color: var(--muted);
  font-size: 0.88rem;
}

.glance-list dd {
  margin: 0;
  font-weight: 600;
  min-width: 0;
}

.glance-list .badge {
  margin-left: 6px;
}

.help-panel .panel-actions {
  margin-top: 4px;
}

.emergency-note {
  margin: 14px 0 18px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #fff6f5;
  border: 1px solid #f1cfcb;
}

.emergency-note a {
  font-weight: 800;
  color: #8a1c13;
  white-space: nowrap;
}

.numbers-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: grid;
  gap: 8px;
}

.numbers-list li {
  display: grid;
  gap: 2px;
}

.numbers-list a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
}

.numbers-list a:hover {
  border-color: var(--gold);
}

.numbers-list a strong {
  color: var(--green-dark);
  white-space: nowrap;
}

.numbers-list .small {
  padding-left: 14px;
}

.install-steps {
  margin: 4px 0 12px;
  padding-left: 22px;
}

.install-steps li {
  margin-bottom: 4px;
}

.share-glyph {
  display: inline-block;
  padding: 0 5px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: #1d6fd8;
  font-weight: 800;
}

/* ---------------------------------------------------------------- pay rent v3 */

.shared-proof {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 2px solid #9fd1b4;
  background: #eef8f2;
  border-radius: 14px;
}

.shared-proof img {
  width: 72px;
  height: 96px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.shared-proof > div {
  display: grid;
  gap: 2px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.waiver-line {
  margin-top: 6px;
}

.waiver-line p {
  margin: 0;
}

.mates-list {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
  display: grid;
}

.mates-list li {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
}

.mates-list li:first-child {
  border-top: 0;
}

.mates-list li.me {
  font-weight: 700;
}

.edit-payment {
  margin-top: 8px;
}

.edit-payment .portal-form {
  margin-top: 8px;
  gap: 10px;
}

.edit-payment label {
  display: grid;
  gap: 4px;
  font-size: 0.85rem;
}

.pay-sticky,
.pay-sticky-spacer {
  display: none;
}

.home-news {
  padding: 10px 16px;
  margin-bottom: 14px;
  background: #eef8f2;
  border-color: #b9dfc8;
}

.home-news a {
  color: #1f6b43;
  font-weight: 700;
  text-decoration: none;
}

/* ---------------------------------------------------------------- maintenance v3 */

.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}

.tabs a {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--green-dark);
  font-weight: 700;
  font-size: 0.9rem;
  background: var(--white);
}

.tabs a[aria-current="page"] {
  background: var(--green-dark);
  border-color: var(--green-dark);
  color: var(--white);
}

.report-form .dup-warning a {
  font-weight: 700;
}

.items-heading {
  margin-top: 18px !important;
}

.item-list {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
  display: grid;
  gap: 8px;
}

.item-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.item-main {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.item-list li .btn {
  flex: 0 0 auto;
  width: auto;
  padding: 0 12px;
}

.item-qty {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
}

.slot-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.stars {
  color: #c98a00;
  letter-spacing: 1px;
}

.star-input {
  display: inline-flex;
  flex-direction: row-reverse;
  gap: 4px;
}

.star-input input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.star-input label {
  font-size: 2rem;
  line-height: 1;
  color: #d8d2c6;
  cursor: pointer;
}

.star-input label:hover,
.star-input label:hover ~ label,
.star-input input:checked ~ label {
  color: #c98a00;
}

.star-input input:focus-visible + label {
  outline: 2px solid var(--gold);
  border-radius: 4px;
}

.back-box {
  margin: 0 0 16px;
}

.offer-times {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.offer-times input[type="datetime-local"] {
  max-width: 260px;
}

.tenant-plans .request-head {
  align-items: baseline;
}

/* ---------------------------------------------------------------- electricity v3 */

.power-notice {
  background: #fff6e0;
  border-color: #f0c96a;
}

.calendar-links {
  margin: 10px 0 0;
}

.usage-box {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 16px;
  margin-bottom: 12px;
}

.usage-box p {
  margin: 0 0 6px;
}

.usage-big {
  font-size: 1.3rem;
  color: var(--green-dark);
}

.tip-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.tip-list li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.explain-list {
  margin: 0;
  display: grid;
  gap: 10px;
}

.explain-list dt {
  font-weight: 800;
  color: var(--green-dark);
}

.explain-list dd {
  margin: 2px 0 0;
}

/* ---------------------------------------------------------------- documents v3 */

.needed-card {
  border-color: #f0d49a;
  background: #fffaf0;
}

.needed-card h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.needed-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.needed-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--white);
}

.needed-list li > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.upload-inline {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.upload-inline input[type="file"] {
  max-width: 220px;
  font-size: 0.85rem;
}

.doc-list li .doc-ack {
  margin: 4px 0 0 54px;
}

.lease-status {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--cream);
}

.owner-note-inline {
  color: var(--green-dark);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin: 8px 0 12px;
}

.photo-grid figure {
  margin: 0;
}

.photo-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: block;
}

.photo-grid figcaption {
  margin-top: 4px;
}

.where-list li {
  display: block;
}

.papers-list .inline-form.stack {
  margin-top: 6px;
}

.letter-sheet {
  max-width: 720px;
  font-size: 1rem;
  line-height: 1.6;
}

.letter-sheet p {
  margin: 0 0 14px;
}

.letter-head {
  text-align: right;
  margin-bottom: 18px;
}

.letter-meta {
  margin-bottom: 18px;
}

.letter-sign {
  margin-top: 36px;
}

.sign-line {
  margin-top: 40px;
  padding-top: 6px;
  border-top: 1px solid var(--text);
  max-width: 260px;
}

.letter-foot {
  margin-top: 28px;
}

.sign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  margin-top: 28px;
}

.sign-grid p {
  margin: 0;
}

.inventory-table td:nth-child(5),
.inventory-table td:nth-child(6) {
  min-width: 120px;
}

@media print {
  .site-header,
  .portal-footer,
  .no-print,
  .portal-flash {
    display: none !important;
  }

  .print-sheet {
    box-shadow: none;
    border: 0;
    padding: 0;
  }

  body.portal {
    background: #fff;
  }
}

/* ---------------------------------------------------------------- tenant home: activity, building info */

.activity-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  gap: 10px;
}

.activity-list li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.activity-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.activity-list a {
  color: var(--text);
  text-decoration: none;
}

.activity-list a:hover {
  color: var(--green);
  text-decoration: underline;
}

.activity-list .muted {
  white-space: nowrap;
}

.home-stack {
  display: grid;
  gap: 22px;
  align-content: start;
  min-width: 0;
}

.home-stack > .panel {
  margin-bottom: 0;
}

.building-info .simple-list li {
  padding: 4px 0;
}

/* ---------------------------------------------------------------- responsive */

@media (max-width: 980px) {
  .tile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .unit-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .portal-columns > .panel + .panel {
    margin-top: 0;
  }

  .panel {
    padding: 20px;
    border-radius: 18px;
  }

  .portal-main {
    padding-top: 22px;
  }

  .emergency-numbers {
    flex-direction: column;
  }

  /* Pay Rent: the pay buttons stay at the bottom of the screen on phones */
  .pay-sticky {
    display: flex;
    gap: 8px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--border);
    box-shadow: 0 -6px 18px rgba(31, 64, 55, 0.12);
    transition: transform 0.2s ease;
  }

  .pay-sticky.is-hidden {
    transform: translateY(110%);
  }

  .pay-sticky .btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    padding: 0 10px;
    white-space: nowrap;
  }

  .pay-sticky .btn-secondary {
    background: var(--white);
    color: var(--green-dark);
    border: 1px solid var(--border);
  }

  .pay-sticky-spacer {
    display: block;
    height: 72px;
  }
}

@media (max-width: 520px) {
  .tile-grid {
    gap: 10px;
  }

  .tile {
    padding: 14px;
    border-radius: 16px;
    gap: 4px;
  }

  .tile strong {
    font-size: 1rem;
  }

  .tile-meta .badge {
    white-space: normal;
  }

  .unit-board,
  .portal-form .form-row.two {
    grid-template-columns: 1fr;
  }

  .login-card {
    padding: 26px 20px;
  }

  .todo {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .todo-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    flex-wrap: nowrap;
  }

  .todo-actions > .btn,
  .todo-actions > .inline-form {
    flex: 1 1 0;
    min-width: 0;
  }

  .todo-actions .btn {
    width: 100%;
    padding: 0 10px;
    white-space: nowrap;
  }

  .coming-list li {
    grid-template-columns: 78px auto minmax(0, 1fr);
    gap: 8px;
  }

  .coming-when {
    font-size: 0.8rem;
  }

  .glance-list > div {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 8px;
  }
}
