:root {
  --ink: #10243e;
  --muted: #6f7d91;
  --panel: #ffffff;
  --line: #e5eaf1;
  --blue: #1557d6;
  --navy: #0b1e36;
  --surface: #f4f7fb;
}

* {
  box-sizing: border-box;
}

body {
  background: var(--surface);
  color: var(--ink);
  min-height: 100vh;
}

.eyebrow {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.staff-login-page {
  background:
    radial-gradient(circle at 10% 10%, rgba(42, 111, 239, 0.28), transparent 32%),
    var(--navy);
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  min-height: calc(100vh - 3rem);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.28);
}

.brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 7vw, 7rem);
  color: white;
  background:
    linear-gradient(145deg, rgba(21, 87, 214, 0.9), rgba(11, 30, 54, 0.94)),
    var(--navy);
}

.brand-panel h1 {
  margin: 0.25rem 0 1rem;
  font-size: clamp(3.2rem, 8vw, 7rem);
  font-weight: 900;
  letter-spacing: -0.07em;
}

.brand-copy {
  max-width: 32rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 1.1rem;
}

.brand-mark {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  font-size: 1.8rem;
  font-weight: 900;
}

.brand-mark-small {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  font-size: 1.25rem;
}

.brand-status {
  margin-top: 2.5rem;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
}

.brand-status span {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 0.45rem;
  border-radius: 50%;
  background: #4ee3a0;
  box-shadow: 0 0 0 5px rgba(78, 227, 160, 0.13);
}

.login-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 6vw, 6rem);
  background: white;
}

.login-card h2 {
  font-weight: 800;
}

.form-control {
  border-color: #dce3ed;
  border-radius: 12px;
}

.form-control:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 0.2rem rgba(21, 87, 214, 0.12);
}

.staff-header {
  padding: 0.9rem 0;
  background: var(--navy);
  color: white;
  box-shadow: 0 8px 28px rgba(16, 36, 62, 0.15);
}

.staff-logo {
  font-weight: 900;
  letter-spacing: 0.04em;
}

.staff-subtitle,
.worker-meta span {
  display: block;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.78rem;
}

.dashboard-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.dashboard-intro h1 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.7rem);
  font-weight: 850;
  letter-spacing: -0.04em;
}

.refresh-button {
  border: 1px solid var(--line);
  box-shadow: 0 5px 16px rgba(30, 54, 82, 0.06);
}

.staff-work-controls {
  display: flex;
  gap: 0.65rem;
  align-items: center;
}

.staff-live-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 42px;
  padding: 0.55rem 0.8rem;
  border: 1px solid #ccebd9;
  border-radius: 12px;
  color: #167246;
  background: #f2fbf6;
  font-size: 0.86rem;
  font-weight: 800;
  white-space: nowrap;
}

.staff-live-status > span {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: #20a865;
  box-shadow: 0 0 0 0.25rem rgba(32, 168, 101, 0.13);
}

.staff-live-update-notice {
  position: fixed;
  z-index: 1085;
  left: 1.25rem;
  bottom: 5.8rem;
  min-width: min(310px, calc(100vw - 2rem));
  padding: 0.9rem 1.1rem;
  border: 0;
  border-radius: 1rem;
  color: #fff;
  background: #1557d6;
  box-shadow: 0 14px 38px rgba(16, 54, 126, 0.3);
  text-align: left;
  animation: staff-live-notice-in 0.2s ease-out;
}

.staff-live-update-notice[hidden] {
  display: none;
}

.staff-live-update-notice strong,
.staff-live-update-notice span {
  display: block;
}

.staff-live-update-notice strong {
  font-size: 1.1rem;
}

.staff-live-update-notice span {
  margin-top: 0.15rem;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.9rem;
}

@keyframes staff-live-notice-in {
  from {
    opacity: 0;
    transform: translateY(0.6rem);
  }
}

.staff-complex-switch {
  min-width: min(260px, 48vw);
}

.staff-complex-switch .form-select {
  border-color: var(--line);
  border-radius: 12px;
  background-color: white;
  box-shadow: 0 5px 16px rgba(30, 54, 82, 0.06);
  font-weight: 700;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}

.stat-card strong {
  color: var(--blue);
  font-size: 1.7rem;
}

.stat-card span {
  color: var(--muted);
  font-size: 0.85rem;
}

.task-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.task-column {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(228, 234, 243, 0.55);
}

.column-heading {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.9rem;
}

.column-heading h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.status-new {
  background: #ff9c35;
}

.status-progress {
  background: #2d79ef;
}

.status-done {
  background: #22ad76;
}

.count-pill {
  margin-left: auto;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: white;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.task-list {
  display: grid;
  gap: 0.85rem;
}

.task-card {
  padding: 1rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 7px 20px rgba(25, 48, 77, 0.05);
}

.task-card h3 {
  margin: 0.85rem 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 800;
}

.task-number {
  margin-right: 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.category-pill {
  display: inline-block;
  padding: 0.22rem 0.48rem;
  border-radius: 7px;
  font-size: 0.68rem;
  font-weight: 800;
}

.category-service {
  background: #e7f0ff;
  color: #1557d6;
}

.category-request {
  background: #e7f8f1;
  color: #147a55;
}

.category-complaint {
  background: #fff0ec;
  color: #bc432c;
}

.task-time {
  color: var(--muted);
  font-size: 0.7rem;
  white-space: nowrap;
}

.task-description {
  color: #46566c;
  font-size: 0.88rem;
  white-space: pre-wrap;
}

.task-details {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}

.task-details div {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 0.5rem;
}

.task-details dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.task-details dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 0.78rem;
  font-weight: 700;
}

.attachment-link {
  display: inline-block;
  margin-top: 0.8rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
}

.empty-state {
  padding: 2rem 1rem;
  border: 1px dashed #c9d2df;
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
  font-size: 0.85rem;
}

.htmx-request {
  opacity: 0.58;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

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

  .task-column:last-child {
    grid-column: 1 / -1;
  }
}

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

  .brand-panel {
    min-height: 36vh;
    padding: 2rem;
  }

  .brand-panel h1 {
    font-size: 3rem;
  }

  .brand-copy,
  .brand-status {
    display: none;
  }

  .login-card {
    padding: 2rem;
  }

  .stats-grid,
  .task-columns {
    grid-template-columns: 1fr;
  }

  .task-column:last-child {
    grid-column: auto;
  }
}

.home-page {
  background:
    radial-gradient(circle at 0 0, rgba(21, 87, 214, 0.13), transparent 30%),
    #f7f9fc;
}

.home-shell {
  min-height: calc(100vh - 3rem);
}

.home-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0 2rem;
}

.home-logo {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.brand-mark-dark {
  border-color: rgba(21, 87, 214, 0.18);
  background: var(--navy);
}

.system-online {
  padding: 0.45rem 0.75rem;
  border: 1px solid #dce5df;
  border-radius: 999px;
  background: white;
  color: #39705b;
  font-size: 0.78rem;
  font-weight: 700;
}

.system-online span {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 0.35rem;
  border-radius: 50%;
  background: #21b577;
}

.home-hero {
  max-width: 820px;
  padding: clamp(2.5rem, 8vh, 6.5rem) 0 clamp(2.5rem, 7vh, 5rem);
}

.home-hero h1 {
  margin: 0.6rem 0 1.2rem;
  font-size: clamp(3rem, 7vw, 6.5rem);
  font-weight: 900;
  letter-spacing: -0.07em;
  line-height: 0.95;
}

.home-hero > p:last-child {
  max-width: 650px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.25rem);
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.portal-card {
  position: relative;
  display: block;
  min-height: 310px;
  padding: clamp(1.5rem, 4vw, 2.75rem);
  overflow: hidden;
  border-radius: 24px;
  color: inherit;
  text-decoration: none;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.portal-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 24px 55px rgba(14, 35, 61, 0.14);
}

.portal-card h2 {
  margin: 0.6rem 0;
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  font-weight: 850;
}

.portal-card p:not(.eyebrow) {
  max-width: 430px;
  opacity: 0.7;
}

.portal-card > span {
  position: absolute;
  bottom: 2rem;
  font-weight: 800;
}

.portal-client {
  border: 1px solid #dfe6f0;
  background: white;
}

.portal-client > span {
  color: var(--blue);
}

.portal-staff {
  background:
    radial-gradient(circle at 90% 10%, rgba(71, 126, 237, 0.38), transparent 30%),
    var(--navy);
  color: white;
}

.portal-icon {
  display: grid;
  width: 50px;
  height: 50px;
  margin-bottom: 1.5rem;
  place-items: center;
  border-radius: 14px;
  background: rgba(21, 87, 214, 0.1);
  color: var(--blue);
  font-size: 1.5rem;
  font-weight: 900;
}

.portal-staff .portal-icon {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

.portal-owner {
  border: 1px solid #d9d0f2;
  background:
    radial-gradient(circle at 90% 10%, rgba(108, 68, 197, 0.15), transparent 34%),
    #f8f5ff;
}

.portal-owner .portal-icon {
  background: #ebe3ff;
  color: #6541b7;
}

.portal-owner > span {
  color: #6541b7;
}

.client-auth-page {
  background: var(--navy);
}

.client-auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(380px, 0.9fr);
  min-height: calc(100vh - 3rem);
  overflow: hidden;
  border-radius: 28px;
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.25);
}

.client-auth-aside {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(2rem, 6vw, 5.5rem);
  background:
    linear-gradient(150deg, rgba(15, 46, 84, 0.45), rgba(21, 87, 214, 0.2)),
    var(--navy);
  color: white;
}

.client-auth-aside h1 {
  margin: 0.6rem 0 1rem;
  font-size: clamp(2.5rem, 5vw, 4.8rem);
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 1;
}

.client-auth-aside p:last-child {
  max-width: 460px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 1.05rem;
}

.back-home {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
}

.back-home:hover {
  color: white;
}

.back-home-dark {
  color: var(--muted);
}

.back-home-dark:hover {
  color: var(--ink);
}

.client-auth-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 6vw, 6rem);
  background: white;
}

.client-auth-card h2 {
  font-size: 2rem;
  font-weight: 850;
}

.auth-switch {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

.auth-switch a {
  font-weight: 800;
  text-decoration: none;
}

.client-register-page {
  background:
    radial-gradient(circle at 100% 0, rgba(21, 87, 214, 0.12), transparent 30%),
    var(--surface);
}

.register-shell {
  max-width: 1050px;
  margin: 0 auto;
}

.register-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.register-card {
  padding: clamp(1.5rem, 5vw, 4rem);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: white;
  box-shadow: 0 25px 70px rgba(31, 55, 84, 0.08);
}

.register-copy {
  margin-bottom: 2rem;
}

.register-copy h1 {
  margin: 0.25rem 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 900;
  letter-spacing: -0.05em;
}

.register-copy p:last-child {
  color: var(--muted);
}

.register-form {
  display: grid;
  gap: 1.25rem;
}

.form-section {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 1rem;
  padding: 1.3rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfcfe;
}

.form-step {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  background: var(--blue);
  color: white;
  font-size: 0.8rem;
  font-weight: 900;
}

.form-section-content h2 {
  margin-bottom: 1rem;
  font-size: 1rem;
  font-weight: 850;
}

.register-submit {
  justify-self: end;
  min-width: 220px;
}

.client-header {
  padding: 0.9rem 0;
  background: linear-gradient(110deg, var(--navy), #133a6d);
  color: white;
  box-shadow: 0 8px 28px rgba(16, 36, 62, 0.14);
}

.client-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: white;
  text-decoration: none;
}

.client-brand strong,
.client-brand span {
  display: block;
}

.client-brand strong {
  letter-spacing: 0.04em;
}

.client-brand span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.75rem;
}

.client-welcome {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.client-welcome h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 900;
  letter-spacing: -0.05em;
}

.client-welcome > div > p:last-child {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.client-address {
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.client-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.client-summary-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 125px;
  padding: 1.15rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
}

.summary-icon {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px;
  background: #e9f1ff;
  color: var(--blue);
  font-size: 1.3rem;
  font-weight: 900;
}

.client-summary-card p,
.client-summary-card strong,
.client-summary-card div > span {
  display: block;
}

.client-summary-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.client-summary-card strong {
  margin: 0.15rem 0;
  overflow-wrap: anywhere;
  font-size: 1.1rem;
}

.client-summary-card div > span {
  color: var(--muted);
  font-size: 0.75rem;
}

.debt-summary.has-debt {
  border-color: #f0c7be;
  background: #fffaf8;
}

.debt-summary.has-debt .summary-icon {
  background: #ffebe7;
  color: #c84e38;
}

.client-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 1rem;
}

.client-panel {
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}

.client-broadcast-highlight {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem 1.15rem;
  border-radius: 16px;
  background: linear-gradient(135deg, #5d3a9e, #3157d5);
  color: #fff;
  box-shadow: 0 14px 32px rgba(74, 55, 150, 0.2);
}

.client-broadcast-highlight .eyebrow,
.client-broadcast-highlight small {
  color: rgba(255, 255, 255, 0.74);
}

.client-broadcast-highlight .client-broadcast-text {
  margin: 0.25rem 0;
  font-size: 0.88rem;
  font-weight: 650;
}

.client-broadcast-list {
  display: grid;
  gap: 0.75rem;
}

.client-broadcast-card {
  padding: 1rem;
  border: 1px solid #e1d9ef;
  border-radius: 14px;
  background: #fbf9ff;
}

.client-broadcast-card-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.65rem;
}

.client-broadcast-card-heading strong {
  color: #57359b;
}

.client-broadcast-card-heading time {
  flex: 0 0 auto;
  color: #766c83;
  font-size: 0.7rem;
}

.client-broadcast-text {
  line-height: 1.55;
  white-space: pre-wrap;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.panel-heading h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 850;
}

.client-task-form textarea {
  resize: vertical;
}

.contracts-list {
  display: grid;
  gap: 0.65rem;
}

.contract-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 0.7rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfe;
}

.contract-row span,
.contract-row strong {
  display: block;
}

.contract-row span {
  color: var(--muted);
  font-size: 0.68rem;
}

.contract-row strong {
  margin-top: 0.2rem;
  overflow-wrap: anywhere;
  font-size: 0.78rem;
}

.client-task-list {
  display: grid;
  gap: 0.7rem;
}

.client-task-row {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) 120px;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fcfdff;
}

.client-task-status {
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 850;
  text-align: center;
}

.client-task-status.status-new {
  background: #fff0dc;
  color: #9b5b0e;
}

.client-task-status.status-in_progress {
  background: #e7f0ff;
  color: #1557d6;
}

.client-task-status.status-done {
  background: #e5f7ef;
  color: #147a55;
}

.client-task-status.status-archived {
  background: #eceff4;
  color: #667487;
}

.client-task-main span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.client-task-main h3 {
  margin: 0.12rem 0 0.3rem;
  font-size: 0.95rem;
  font-weight: 850;
}

.client-task-main p {
  margin: 0;
  color: #526176;
  font-size: 0.8rem;
  white-space: pre-wrap;
}

.client-task-meta {
  text-align: right;
}

.client-task-meta span,
.client-task-meta small {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
}

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

  .portal-owner {
    grid-column: 1 / -1;
  }

  .client-auth-shell {
    grid-template-columns: 1fr;
  }

  .client-auth-aside {
    min-height: 35vh;
    padding: 2rem;
  }

  .client-summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .client-content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .portal-grid,
  .client-summary-grid {
    grid-template-columns: 1fr;
  }

  .portal-owner {
    grid-column: auto;
  }

  .home-hero h1 {
    font-size: 3rem;
  }

  .portal-card {
    min-height: 290px;
  }

  .client-auth-aside {
    min-height: 30vh;
  }

  .client-auth-aside h1 {
    font-size: 2.5rem;
  }

  .client-auth-card {
    padding: 2rem;
  }

  .client-welcome {
    align-items: start;
    flex-direction: column;
  }

  .client-broadcast-highlight,
  .client-broadcast-card-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .client-task-row {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  .client-task-status {
    justify-self: start;
  }

  .client-task-meta {
    text-align: left;
  }

  .contract-row {
    grid-template-columns: 1fr;
  }

  .form-section {
    grid-template-columns: 1fr;
  }

  .register-submit {
    width: 100%;
  }

  .dashboard-intro {
    align-items: stretch;
    flex-direction: column;
  }

  .staff-work-controls {
    width: 100%;
  }

  .staff-complex-switch {
    min-width: 0;
    flex: 1;
  }
}

.owner-login-page {
  background:
    radial-gradient(circle at 0 0, rgba(107, 70, 190, 0.35), transparent 34%),
    #10162c;
}

.owner-login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, 0.95fr);
  min-height: calc(100vh - 3rem);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  background: white;
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.3);
}

.owner-login-aside {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(2rem, 6vw, 6rem);
  background:
    linear-gradient(145deg, rgba(74, 42, 145, 0.85), rgba(13, 25, 52, 0.96)),
    var(--navy);
  color: white;
}

.owner-login-aside h1 {
  margin: 0.5rem 0 1rem;
  font-size: clamp(3rem, 7vw, 6.5rem);
  font-weight: 900;
  letter-spacing: -0.07em;
  line-height: 0.88;
}

.owner-login-aside > div > p:last-child {
  max-width: 500px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 1.05rem;
}

.owner-dashboard-page {
  background:
    radial-gradient(circle at 100% 0, rgba(103, 65, 183, 0.09), transparent 28%),
    var(--surface);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.owner-header {
  padding: 0.9rem 0;
  background: linear-gradient(105deg, #141d35, #4e2b93);
  color: white;
  box-shadow: 0 8px 28px rgba(16, 24, 55, 0.18);
}

.owner-jump-nav {
  position: sticky;
  z-index: 20;
  top: 0.75rem;
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
  padding: 0.45rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 24px rgba(20, 35, 60, 0.07);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.owner-jump-nav a {
  padding: 0.55rem 0.8rem;
  border-radius: 9px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.owner-jump-nav a:hover {
  background: #eee8fb;
  color: #543499;
}

.owner-section {
  margin-bottom: 1rem;
  padding: clamp(1rem, 2.5vw, 1.6rem);
  scroll-margin-top: 5rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: white;
  box-shadow: 0 10px 35px rgba(26, 44, 70, 0.045);
}

.owner-section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.owner-section-heading h2 {
  margin: 0.1rem 0 0.35rem;
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.owner-section-heading p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.owner-count {
  flex: 0 0 auto;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  background: #f1ecfb;
  color: #5e3aaa;
  font-size: 0.72rem;
  font-weight: 850;
}

.owner-stat-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  gap: 0.75rem;
  overflow-x: auto;
}

.owner-stat-card {
  min-width: 130px;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcfe;
}

.owner-stat-card span,
.owner-stat-card strong,
.owner-stat-card small {
  display: block;
}

.owner-stat-card span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.owner-stat-card strong {
  margin: 0.3rem 0;
  color: #57359b;
  font-size: 1.65rem;
}

.owner-stat-card small {
  color: var(--muted);
  font-size: 0.64rem;
}

.owner-stat-new {
  border-color: #f1d4ad;
  background: #fffaf3;
}

.owner-stat-new strong {
  color: #a4600a;
}

.owner-stat-progress {
  border-color: #c8daf8;
  background: #f6f9ff;
}

.owner-stat-progress strong {
  color: #1557d6;
}

.owner-stat-done {
  border-color: #bfe6d5;
  background: #f5fcf9;
}

.owner-stat-done strong {
  color: #147a55;
}

.owner-create-form {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 0.8rem;
  align-items: end;
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid #d9d0ef;
  border-radius: 16px;
  background: #faf8ff;
}

.owner-form-title {
  grid-column: 1 / -1;
}

.owner-form-title strong,
.owner-form-title span {
  display: block;
}

.owner-form-title span {
  color: var(--muted);
  font-size: 0.72rem;
}

.owner-create-form .form-label,
.owner-worker-card .form-label,
.owner-complex-card .form-label {
  margin-bottom: 0.3rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
}

.broadcast-form {
  display: grid;
  grid-template-columns: minmax(220px, 0.65fr) minmax(320px, 1.35fr);
  gap: 1rem;
  align-items: start;
  max-width: 980px;
  padding: 1rem;
  border: 1px solid #d9d0ef;
  border-radius: 16px;
  background: #faf8ff;
}

.broadcast-form .form-label {
  color: #5f536f;
  font-size: 0.75rem;
  font-weight: 800;
}

.broadcast-form textarea {
  resize: vertical;
}

.broadcast-form > .btn {
  grid-column: 2;
  justify-self: start;
}

.broadcast-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.35rem;
  color: #766c83;
  font-size: 0.7rem;
}

.broadcast-preview {
  display: grid;
  gap: 0.2rem;
  padding: 0.9rem;
  border: 1px dashed #b8a8d6;
  border-radius: 12px;
  background: #fff;
}

.broadcast-preview span {
  color: #766c83;
  font-size: 0.68rem;
}

.broadcast-preview strong {
  color: #57359b;
  font-size: 0.9rem;
}

.owner-create-button {
  min-height: 38px;
}

.owner-worker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.owner-worker-card {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fcfdff;
}

.owner-worker-card.is-disabled,
.owner-complex-card.is-disabled {
  background: #f3f4f7;
  opacity: 0.75;
}

.owner-worker-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.owner-worker-title h3 {
  margin: 0.45rem 0 0.1rem;
  font-size: 1rem;
  font-weight: 850;
}

.owner-worker-title a {
  color: var(--muted);
  font-size: 0.75rem;
  text-decoration: none;
}

.role-badge,
.account-state {
  display: inline-block;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  font-size: 0.63rem;
  font-weight: 850;
}

.role-badge {
  background: #e8effb;
  color: #295a9f;
}

.role-senior {
  background: #eee7fc;
  color: #6842b5;
}

.role-owner {
  background: #262f46;
  color: white;
}

.account-state {
  background: #eceff3;
  color: #6b7584;
}

.account-state.active {
  background: #e2f6ed;
  color: #147a55;
}

.owner-worker-edit {
  display: grid;
  grid-template-columns: 0.8fr 1.1fr 1.2fr;
  gap: 0.65rem;
  align-items: end;
}

.owner-active-switch {
  align-self: center;
  margin: 0;
}

.owner-password-form {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.owner-password-form small,
.owner-self-note {
  display: block;
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.66rem;
}

.owner-table-wrap {
  border: 1px solid var(--line);
  border-radius: 14px;
}

.owner-table {
  font-size: 0.78rem;
}

.owner-table thead th {
  padding: 0.75rem;
  border-bottom-width: 1px;
  background: #f6f8fb;
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.owner-table td {
  padding: 0.75rem;
}

.owner-table td strong,
.owner-table td small {
  display: block;
}

.owner-table td small {
  color: var(--muted);
  font-size: 0.65rem;
}

.owner-table tr.is-blocked td {
  background: #fff5f3;
}

.owner-complex-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.owner-complex-card {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fcfdff;
}

.owner-complex-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.owner-complex-heading small {
  color: var(--muted);
  font-size: 0.65rem;
}

.complex-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin: 0.8rem 0;
}

.complex-metrics div {
  padding: 0.55rem;
  border-radius: 10px;
  background: #f2f5f9;
  text-align: center;
}

.complex-metrics strong,
.complex-metrics span {
  display: block;
}

.complex-metrics strong {
  font-size: 1rem;
}

.complex-metrics span {
  color: var(--muted);
  font-size: 0.6rem;
}

.permission-table td:not(:first-child),
.permission-table th:not(:first-child) {
  text-align: center;
}

.permission-table td:not(:first-child) {
  color: #147a55;
  font-weight: 900;
}

.owner-system-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.owner-system-card {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
}

.owner-system-card span,
.owner-system-card strong,
.owner-system-card small {
  display: block;
}

.owner-system-card span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
}

.owner-system-card strong {
  margin: 0.2rem 0;
  color: #58369e;
  font-size: 1.55rem;
}

.owner-system-card small {
  color: var(--muted);
  font-size: 0.64rem;
}

.owner-system-card.has-error {
  border-color: #efc6bd;
  background: #fff7f5;
}

.owner-system-card.has-error strong {
  color: #bd452f;
}

.owner-reminder-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.8rem;
  padding: 1rem;
  border: 1px solid #d9d0ef;
  border-radius: 14px;
  background: #faf8ff;
}

.owner-reminder-action strong,
.owner-reminder-action span {
  display: block;
}

.owner-reminder-action span {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.7rem;
}

.audit-action {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  background: #eee9f9;
  color: #5b389e;
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}

@media (max-width: 1200px) {
  .owner-create-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .owner-stat-grid {
    grid-template-columns: repeat(4, minmax(130px, 1fr));
  }

  .owner-system-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 850px) {
  .owner-login-shell {
    grid-template-columns: 1fr;
  }

  .owner-login-aside {
    min-height: 38vh;
    padding: 2rem;
  }

  .owner-login-aside h1 {
    font-size: 3.2rem;
  }

  .owner-worker-grid,
  .owner-complex-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .owner-login-aside {
    min-height: 32vh;
  }

  .owner-login-aside > div > p:last-child,
  .owner-login-aside .brand-status {
    display: none;
  }

  .owner-create-form,
  .owner-worker-edit,
  .broadcast-form,
  .owner-stat-grid,
  .owner-system-grid {
    grid-template-columns: 1fr;
  }

  .broadcast-form > .btn {
    grid-column: 1;
    width: 100%;
  }

  .owner-reminder-action {
    align-items: stretch;
    flex-direction: column;
  }

  .owner-section-heading {
    flex-direction: column;
  }

  .complex-metrics {
    grid-template-columns: 1fr 1fr;
  }
}

/* Shared responsive navigation and detail views */
.portal-tabs {
  display: flex;
  gap: 0.45rem;
  margin: 0 0 1.4rem;
  padding: 0.45rem;
  overflow-x: auto;
  border: 1px solid #e2dcef;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  scrollbar-width: thin;
  position: sticky;
  top: 0.5rem;
  z-index: 20;
  box-shadow: 0 10px 28px rgba(44, 26, 83, 0.07);
}

.portal-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 40px;
  padding: 0.55rem 0.85rem;
  border-radius: 11px;
  color: #5e5670;
  font-size: 0.82rem;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.portal-tabs a span {
  min-width: 1.35rem;
  padding: 0.08rem 0.35rem;
  border-radius: 999px;
  background: #eee9f8;
  text-align: center;
}

.portal-tabs a:hover,
.portal-tabs a.active {
  background: #6441a5;
  color: #fff;
}

.portal-tabs a.active span {
  background: rgba(255, 255, 255, 0.2);
}

.owner-stat-card[href] {
  color: inherit;
  text-decoration: none;
}

.owner-stat-card[href]:hover,
.owner-worker-card[href]:hover {
  transform: translateY(-2px);
  border-color: #a895cf;
  box-shadow: 0 14px 34px rgba(63, 38, 112, 0.11);
}

.portal-table {
  border: 1px solid #e6e0ef;
  border-radius: 16px;
  background: #fff;
}

.portal-table .table {
  margin: 0;
}

.portal-table th {
  color: #685e77;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.profile-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem;
}

.payment-builder {
  display: grid;
  gap: 0.75rem;
}

.payment-entry-row {
  display: grid;
  grid-template-columns:
    minmax(125px, 0.75fr)
    minmax(95px, 0.55fr)
    minmax(210px, 1.25fr)
    minmax(155px, 0.9fr)
    minmax(105px, 0.6fr)
    minmax(220px, 1.1fr)
    minmax(90px, 0.5fr)
    minmax(135px, 0.8fr)
    34px;
  gap: 0.4rem;
  align-items: center;
  padding: 0.65rem;
  border: 1px solid #e5deef;
  border-radius: 12px;
  background: #faf9fc;
}

.payment-entry-row > * {
  min-width: 0;
}

.payment-entry-row .form-control,
.payment-entry-row .form-select {
  width: 100%;
  font-size: 0.78rem;
}

.skudik-datetime-control {
  display: grid;
  grid-template-columns: minmax(112px, 1fr) minmax(76px, 0.62fr);
  gap: 0.35rem;
  min-width: 0;
}

.skudik-date-only-control {
  width: 100%;
  min-width: 0;
}

.skudik-date-filter-button {
  width: 100%;
  min-height: 3.1rem;
  padding: 0.65rem 2.25rem 0.65rem 0.8rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.skudik-date-button {
  position: relative;
  overflow: hidden;
  padding-right: 2rem;
  color: var(--ink);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skudik-date-button::after {
  position: absolute;
  top: 50%;
  right: 0.6rem;
  content: "📅";
  font-size: 0.92rem;
  transform: translateY(-50%);
}

.skudik-date-button.is-placeholder {
  color: var(--muted);
}

.skudik-time-input {
  min-width: 0;
  text-align: center;
}

.skudik-calendar-dialog {
  width: min(430px, calc(100vw - 2rem));
  max-width: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 24px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 28px 90px rgba(22, 13, 45, 0.32);
}

.skudik-calendar-dialog::backdrop {
  background: rgba(14, 21, 38, 0.52);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.skudik-calendar-dialog.is-open {
  position: fixed;
  z-index: 10000;
  top: 50%;
  left: 50%;
  display: block;
  transform: translate(-50%, -50%);
}

.skudik-calendar-card {
  padding: 1.25rem;
}

.skudik-calendar-header {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 46px;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 1rem;
}

.skudik-calendar-title {
  font-size: 1.2rem;
  text-align: center;
  text-transform: capitalize;
}

.skudik-calendar-nav {
  display: grid;
  width: 46px;
  height: 46px;
  padding: 0;
  place-items: center;
  border: 1px solid #dcd4eb;
  border-radius: 13px;
  background: #faf8ff;
  color: #54348f;
  font-size: 1.8rem;
  line-height: 1;
}

.skudik-calendar-weekdays,
.skudik-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.38rem;
}

.skudik-calendar-weekdays {
  margin-bottom: 0.45rem;
  color: #786d86;
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
}

.skudik-calendar-day,
.skudik-calendar-spacer {
  min-width: 0;
  aspect-ratio: 1;
}

.skudik-calendar-day {
  display: grid;
  min-height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 13px;
  background: #f6f3fb;
  color: #26364d;
  font-size: 1rem;
  font-weight: 750;
}

.skudik-calendar-day:hover,
.skudik-calendar-day:focus-visible {
  border-color: #8d72c5;
  background: #eee8f8;
  outline: none;
}

.skudik-calendar-day.is-selected {
  border-color: #6541a5;
  background: #6541a5;
  color: #fff;
  box-shadow: 0 6px 16px rgba(101, 65, 165, 0.25);
}

.skudik-calendar-grid.skudik-calendar-month-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.skudik-calendar-month {
  min-height: 58px;
  padding: 0.55rem;
  border: 1px solid transparent;
  border-radius: 13px;
  background: #f6f3fb;
  color: #26364d;
  font-weight: 750;
  text-transform: capitalize;
}

.skudik-calendar-month:hover,
.skudik-calendar-month:focus-visible {
  border-color: #8d72c5;
  background: #eee8f8;
  outline: none;
}

.skudik-calendar-month.is-selected {
  border-color: #6541a5;
  background: #6541a5;
  color: #fff;
  box-shadow: 0 6px 16px rgba(101, 65, 165, 0.25);
}

.skudik-calendar-day:disabled,
.skudik-calendar-month:disabled {
  border-color: transparent;
  background: #f2f2f5;
  color: #a5a9b0;
  cursor: not-allowed;
  box-shadow: none;
}

.skudik-calendar-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1rem;
}

.payment-row-remove {
  width: 34px;
  height: 31px;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
}

.payment-upload-panel {
  border: 1px solid #d9cff0;
  background: linear-gradient(135deg, #fbf9ff, #f4f9ff);
}

.payment-upload-grid {
  display: grid;
  grid-template-columns: minmax(190px, 0.8fr) minmax(260px, 1.4fr) auto;
  gap: 0.8rem;
  align-items: end;
}

.payment-upload-grid label > span {
  display: block;
  margin-bottom: 0.35rem;
  color: #655a73;
  font-size: 0.78rem;
  font-weight: 750;
}

.payment-preview-table {
  max-height: 70vh;
}

.payment-preview-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
}

.payment-preview-table td {
  min-width: 90px;
  vertical-align: top;
}

.payment-preview-table td:nth-child(5),
.payment-preview-table td:nth-child(6),
.payment-preview-table td:nth-child(8) {
  min-width: 190px;
}

.payment-preview-table td.payment-import-account-cell {
  min-width: 285px;
}

.payment-import-account-cell .pay-import-debt-search {
  min-height: 2.55rem;
  border-color: #cfc4e4;
  background: #fff;
  font-size: 0.88rem;
}

.payment-import-account-cell .pay-import-debt-search:focus {
  border-color: #7652bd;
  box-shadow: 0 0 0 0.2rem rgba(98, 64, 164, 0.16);
}

.payment-row-review {
  background: #fffaf0;
}

.payment-row-duplicate {
  opacity: 0.6;
  background: #f3f1f5;
}

.payment-match-badge {
  margin-top: 0.35rem;
  color: #6b5c7c;
  font-size: 0.68rem;
  font-weight: 800;
  text-align: center;
}

.payment-import-row details {
  margin-top: 0.4rem;
  max-width: 260px;
  color: #6d6277;
}

.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.quick-action-grid a {
  padding: 1rem;
  border: 1px solid #e0d7ee;
  border-radius: 14px;
  background: #faf8ff;
  color: #58369e;
  font-weight: 750;
  text-decoration: none;
}

.announcement-public-card,
.vehicle-card {
  padding: 1rem 0;
  border-bottom: 1px solid #ece7f2;
}

.announcement-public-card:last-child,
.vehicle-card:last-child {
  border-bottom: 0;
}

.vehicle-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.vehicle-card strong,
.vehicle-card span {
  display: block;
}

.vehicle-card span {
  color: var(--muted);
  font-size: 0.8rem;
}

.information-copy {
  line-height: 1.7;
  white-space: pre-line;
}

.payment-details {
  display: grid;
  grid-template-columns: minmax(90px, 0.35fr) 1fr;
  gap: 0.55rem 1rem;
}

.payment-details dt {
  color: var(--muted);
}

.payment-details dd {
  margin: 0;
  font-weight: 650;
}

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

  .payment-entry-row {
    grid-template-columns: 1fr 1fr;
  }

  .quick-action-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 700px) {
  .profile-detail-grid {
    grid-template-columns: 1fr;
  }

  .portal-tabs {
    margin-right: -0.75rem;
    margin-left: -0.75rem;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .payment-entry-row {
    grid-template-columns: 1fr;
  }

  .client-content-grid {
    grid-template-columns: 1fr;
  }

  .portal-table td,
  .portal-table th {
    min-width: 115px;
  }
}

/* Workflow cards and receipt review */
.task-card-grid,
.receipt-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1rem;
}

.staff-request-list {
  display: grid;
  gap: 0.8rem;
}

.task-row {
  display: grid;
  grid-template-areas: "main resident actions";
  grid-template-columns:
    minmax(260px, 1.35fr)
    minmax(225px, 0.85fr)
    minmax(260px, 0.95fr);
  gap: 1rem;
  align-items: start;
  width: 100%;
  height: auto;
}

.task-row.has-media {
  grid-template-areas: "main resident media actions";
  grid-template-columns:
    minmax(260px, 1.35fr)
    minmax(225px, 0.85fr)
    minmax(150px, 180px)
    minmax(260px, 0.95fr);
}

.task-row-main {
  grid-area: main;
  min-width: 0;
}

.task-row-main h3 {
  margin-top: 0.55rem;
}

.task-row-main .task-description {
  margin-bottom: 0;
}

.task-row-resident {
  grid-area: resident;
  padding-top: 0;
  border-top: 0;
}

.task-row-media {
  grid-area: media;
  min-width: 0;
}

.task-row-media.is-empty {
  display: none;
}

.task-row-actions {
  grid-area: actions;
  min-width: 0;
}

.task-row-actions .task-resolution-form,
.task-row-actions .resolution-note {
  margin-top: 0 !important;
}

.registration-review-list {
  display: grid;
  gap: 0.85rem;
}

.registration-review-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.42fr);
  gap: 0.85rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border: 1px solid #dbe3ef;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 7px 20px rgba(25, 48, 77, 0.05);
}

.registration-review-main {
  display: grid;
  grid-template-columns: minmax(190px, 0.55fr) minmax(0, 2fr);
  gap: 0.85rem;
  align-items: center;
  min-width: 0;
}

.registration-review-heading {
  display: grid;
  gap: 0.45rem;
  align-content: center;
  min-width: 0;
  padding-right: 0.85rem;
  border-right: 1px solid var(--line);
}

.registration-review-card h3 {
  margin: 0.25rem 0 0;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.registration-review-heading .status-pill {
  justify-self: start;
}

.registration-review-details.task-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.8rem;
  align-items: baseline;
  margin: 0;
  padding: 0;
  border-top: 0;
}

.registration-review-details.task-details > div {
  display: inline-flex;
  flex: 0 1 auto;
  grid-template-columns: none;
  gap: 0.3rem;
  align-items: baseline;
  min-width: 0;
  padding: 0.2rem 0.8rem 0.2rem 0;
  border-right: 1px solid #e2e8f0;
}

.registration-review-details.task-details > div:last-child {
  padding-right: 0;
  border-right: 0;
}

.registration-review-details dt {
  flex: 0 0 auto;
  white-space: nowrap;
}

.registration-review-details dt::after {
  content: ":";
}

.registration-review-details dd {
  min-width: 0;
}

.registration-review-actions {
  display: grid;
  grid-template-areas:
    "label buttons"
    "field buttons";
  grid-template-columns: minmax(0, 0.7fr) minmax(210px, 1fr);
  gap: 0.35rem 0.55rem;
  align-self: stretch;
  min-width: 0;
  padding-left: 0.85rem;
  border-left: 1px solid var(--line);
}

.registration-review-actions .form-label {
  grid-area: label;
  align-self: end;
  margin: 0;
}

.registration-review-card .registration-review-actions textarea.form-control {
  grid-area: field;
  min-height: 64px;
  resize: vertical;
}

.registration-review-buttons {
  grid-area: buttons;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-self: stretch;
}

.registration-review-buttons .btn {
  min-width: 0;
}

.registration-review-buttons .btn:last-child {
  grid-column: 1 / -1;
}

.registration-blocked-section {
  margin-top: 1.35rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.registration-blocked-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.75rem;
}

.registration-blocked-heading h3,
.registration-blocked-identity h3 {
  margin: 0;
}

.registration-blocked-heading p {
  margin: 0.2rem 0 0;
  color: var(--muted);
}

.registration-blocked-list {
  display: grid;
  gap: 0.6rem;
}

.registration-blocked-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.55fr) minmax(0, 1.8fr) auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.75rem 0.85rem;
  border: 1px solid #f0c9cd;
  border-radius: 14px;
  background: #fffafa;
}

.registration-blocked-identity {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.55rem;
  align-items: center;
  min-width: 0;
}

.registration-blocked-identity h3 {
  width: 100%;
  overflow-wrap: anywhere;
  font-size: 1rem;
  line-height: 1.25;
}

.registration-blocked-details.task-details {
  margin: 0;
}

.registration-blocked-action .btn {
  white-space: nowrap;
}

.compact-empty-state {
  padding: 0.8rem;
}

.account-charge-card {
  display: grid;
  grid-template-columns: minmax(170px, 0.7fr) minmax(260px, 1.3fr);
  gap: 1rem;
  margin-top: 0.85rem;
  padding: 0.9rem;
  border: 1px solid #dfe5ef;
  border-radius: 14px;
  background: #f8faff;
}

.account-charge-card.is-primary {
  border-color: #b7a2df;
  background: #fbf9ff;
}

.account-charge-card small {
  display: block;
  margin-top: 0.4rem;
  color: var(--muted);
}

.receipt-edit-layout {
  align-items: start;
}

.receipt-locked-media {
  position: sticky;
  top: 1rem;
}

.receipt-media-frame {
  display: grid;
  width: 100%;
  max-height: 560px;
  padding: 0.75rem;
  overflow: hidden;
  place-items: center;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  background: #f5f8fc;
}

.receipt-media-frame img {
  display: block;
  width: 100%;
  max-height: 530px;
  object-fit: contain;
}

.task-tile {
  min-width: 0;
  height: 100%;
}

.urgent-task {
  border: 2px solid #dc3545;
  box-shadow: 0 10px 28px rgba(220, 53, 69, 0.12);
}

.urgent-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #fff0f1;
  color: #b02a37;
  font-size: 0.76rem;
  font-weight: 800;
}

.subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.subtabs a {
  padding: 0.55rem 0.85rem;
  border: 1px solid #dbe3ef;
  border-radius: 999px;
  color: #344054;
  text-decoration: none;
  background: #fff;
}

.subtabs a.active {
  color: #fff;
  border-color: #3157d5;
  background: #3157d5;
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(240px, 1fr) auto auto;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid #e4e9f2;
  border-radius: 1rem;
  background: #fff;
}

.resident-search-panel {
  display: grid;
  grid-template-columns:
    minmax(210px, 1.45fr)
    minmax(175px, 1fr)
    minmax(155px, 0.9fr)
    minmax(82px, 0.42fr)
    auto;
  gap: 0.65rem;
  align-items: end;
  margin-top: 1rem;
  padding: 0.85rem;
  border: 1px solid #e4e9f2;
  border-radius: 1rem;
  background: #fff;
}

.resident-search-field {
  min-width: 0;
}

.resident-search-field > span {
  display: block;
  margin: 0 0 0.28rem 0.15rem;
  color: #68758a;
  font-size: 0.68rem;
  font-weight: 800;
}

.resident-search-apartment .form-control {
  text-align: center;
}

.resident-search-actions {
  display: flex;
  gap: 0.45rem;
}

.resident-search-result {
  margin-top: 0.55rem;
  color: #68758a;
  font-size: 0.76rem;
}

.compact-search-panel,
.owner-search-panel {
  grid-template-columns:
    minmax(150px, 1fr)
    minmax(105px, 0.55fr)
    minmax(90px, 0.45fr)
    minmax(175px, 1fr)
    auto;
}

.owner-search-panel {
  grid-template-columns:
    minmax(185px, 1.15fr)
    minmax(190px, 1.2fr)
    minmax(175px, 1fr)
    minmax(145px, 0.85fr)
    minmax(95px, 0.5fr)
    minmax(82px, 0.42fr)
    auto;
}

.compact-number-field {
  max-width: 120px;
  text-align: center;
}

.resolution-note {
  margin-top: 0.85rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  background: #f4f7fb;
  color: #344054;
}

.receipt-card {
  padding: 1rem;
  border: 1px solid #e4e9f2;
  border-radius: 1rem;
  background: #fff;
}

.client-history-wide {
  grid-column: 1 / -1;
}

.status-rejected {
  color: #b02a37;
  background: #fff0f1;
}

.status-revision {
  color: #69500d;
  background: #fff5cf;
}

@media (max-width: 768px) {
  .task-card-grid,
  .receipt-card-grid {
    grid-template-columns: 1fr;
  }

  .search-panel {
    grid-template-columns: 1fr;
  }

  .resident-search-panel {
    grid-template-columns: minmax(0, 1fr) minmax(95px, 0.55fr);
  }

  .compact-search-panel,
  .owner-search-panel {
    grid-template-columns: minmax(0, 1fr) minmax(95px, 0.55fr);
  }

  .resident-search-name,
  .resident-search-phone {
    grid-column: 1 / -1;
  }

  .resident-search-actions {
    grid-column: 1 / -1;
  }

  .resident-search-actions .btn {
    flex: 1;
  }

  .task-resolution-form .d-flex {
    flex-direction: column;
  }
}

/* Resident ↔ guard task chats */
.client-chat-layout {
  align-items: start;
}

.client-chat-list {
  display: grid;
  gap: 0.55rem;
}

.client-chat-list-item {
  display: grid;
  gap: 0.15rem;
  padding: 0.8rem;
  border: 1px solid #dfe5ef;
  border-radius: 12px;
  color: #27364b;
  background: #fff;
  text-decoration: none;
}

.client-chat-list-item.active {
  border-color: #7652bd;
  background: #f7f3ff;
}

.client-chat-list-item span,
.client-chat-list-item small {
  color: #68758a;
}

.chat-message-list,
.staff-chat-messages {
  display: grid;
  gap: 0.7rem;
  max-height: 500px;
  overflow-y: auto;
  padding: 0.75rem;
  border-radius: 14px;
  background: #f4f6fa;
}

.chat-message {
  width: min(86%, 620px);
  padding: 0.65rem 0.75rem;
  border-radius: 12px 12px 12px 3px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(31, 42, 61, 0.06);
}

.chat-message.resident {
  justify-self: end;
  border-radius: 12px 12px 3px 12px;
  background: #e9f2ff;
}

.staff-chat-messages .chat-message.worker {
  justify-self: end;
  border-radius: 12px 12px 3px 12px;
  background: #e9f2ff;
}

.staff-chat-messages .chat-message.resident {
  justify-self: start;
  border-radius: 12px 12px 12px 3px;
  background: #fff;
}

.staff-chat-messages .chat-message {
  width: min(90%, 720px);
  padding: 0.8rem 0.9rem;
  font-size: 1.02rem;
  line-height: 1.5;
}

.staff-chat-messages .chat-message > div {
  align-items: baseline;
  font-size: 0.82rem;
}

.chat-message > div {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  color: #667085;
  font-size: 0.72rem;
}

.chat-message p {
  margin: 0.25rem 0 0;
  white-space: pre-wrap;
}

.chat-reply-form,
.staff-chat-reply {
  margin-top: 0.7rem;
}

.staff-chat-widget {
  position: fixed;
  right: 1.1rem;
  bottom: 1rem;
  z-index: 1050;
  width: min(590px, calc(100vw - 2rem));
  border: 1px solid #cfc4e6;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 55px rgba(32, 38, 55, 0.24);
}

.staff-chat-widget > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0.9rem 1.15rem;
  border-radius: 15px;
  color: #fff;
  background: #57359b;
  cursor: pointer;
  font-size: 1.08rem;
  font-weight: 850;
  list-style: none;
}

.staff-chat-widget > summary::-webkit-details-marker {
  display: none;
}

.staff-chat-widget > summary strong,
.staff-chat-list-item b {
  display: inline-grid;
  min-width: 25px;
  min-height: 25px;
  place-items: center;
  border-radius: 999px;
  color: #7b2634;
  background: #ffd7dd;
}

.staff-chat-window {
  max-height: min(790px, calc(100vh - 105px));
  overflow-y: auto;
  padding: 1rem;
}

.staff-chat-list {
  display: grid;
  gap: 0.45rem;
}

.staff-chat-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 58px;
  padding: 0.85rem;
  border: 1px solid #dde3ed;
  border-radius: 11px;
  color: #27364b;
  background: #fff;
  text-align: left;
}

.staff-chat-list-item span,
.staff-chat-list-item strong,
.staff-chat-list-item small,
.staff-chat-heading strong,
.staff-chat-heading span {
  display: block;
}

.staff-chat-list-item small,
.staff-chat-heading span {
  color: #68758a;
  font-size: 0.86rem;
}

.staff-chat-heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.8rem;
}

.staff-chat-heading strong {
  font-size: 1.08rem;
}

.staff-chat-heading .btn {
  min-width: 44px;
  min-height: 44px;
  font-size: 1.15rem;
}

.staff-chat-reply {
  display: grid;
  gap: 0.7rem;
}

.staff-chat-reply textarea {
  min-height: 108px;
  padding: 0.8rem;
  font-size: 1.05rem;
  line-height: 1.45;
  resize: vertical;
}

.staff-chat-send {
  min-height: 48px;
  font-size: 1rem;
  font-weight: 800;
}

.staff-chat-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.staff-chat-actions form,
.staff-chat-actions .btn {
  width: 100%;
}

.staff-chat-actions .btn {
  min-height: 46px;
  font-size: 0.95rem;
  font-weight: 750;
}

@media (max-width: 600px) {
  .staff-chat-widget {
    right: 0.5rem;
    bottom: 0.5rem;
    width: calc(100vw - 1rem);
  }

  .staff-chat-window {
    max-height: calc(100vh - 90px);
    padding: 0.75rem;
  }

  .staff-chat-actions {
    grid-template-columns: 1fr;
  }
}

/* Resident access requests */
.access-request-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.access-request-card,
.access-mode-option {
  border: 1px solid #ded6ec;
  border-radius: 14px;
  background: #faf8ff;
}

.access-request-card > summary,
.access-mode-option > summary {
  padding: 0.9rem 1rem;
  color: #57359b;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.access-request-card > summary::-webkit-details-marker,
.access-mode-option > summary::-webkit-details-marker {
  display: none;
}

.access-request-card > summary::after,
.access-mode-option > summary::after {
  float: right;
  content: "+";
}

.access-request-card[open] > summary::after,
.access-mode-option[open] > summary::after {
  content: "−";
}

.access-request-body {
  display: grid;
  gap: 0.7rem;
  padding: 0 0.85rem 0.85rem;
}

.access-mode-option {
  background: #fff;
}

.access-mode-option form {
  padding: 0 0.8rem 0.8rem;
}

/* Inline attachments in the staff task cards */
.task-attachment-preview {
  margin-top: 0;
  padding: 0.65rem;
  overflow: hidden;
  border: 1px solid #d8e0ec;
  border-radius: 14px;
  background: #f5f8fc;
}

.task-attachment-preview img,
.task-attachment-preview video {
  display: block;
  width: 100%;
  height: 108px;
  max-height: 108px;
  border-radius: 10px;
  background: #0f172a;
  object-fit: contain;
}

.task-row-media .attachment-link {
  display: block;
  margin-top: 0.45rem;
  overflow-wrap: anywhere;
  text-align: center;
}

@media (max-width: 1250px) {
  .task-row {
    grid-template-areas:
      "main resident"
      "actions actions";
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.85fr);
  }

  .task-row.has-media {
    grid-template-areas:
      "main resident"
      "media actions";
  }

  .task-row-media:not(.is-empty) {
    max-width: 230px;
  }
}

@media (max-width: 760px) {
  .task-row {
    grid-template-areas:
      "main"
      "resident"
      "media"
      "actions";
    grid-template-columns: minmax(0, 1fr);
  }

  .task-row-media:not(.is-empty) {
    width: min(100%, 260px);
    max-width: none;
  }

  .registration-review-card,
  .account-charge-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .registration-review-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .registration-review-heading {
    padding-right: 0;
    padding-bottom: 0.75rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .registration-review-actions {
    padding-top: 0.75rem;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .receipt-locked-media {
    position: static;
  }

  .registration-review-main .task-details {
    grid-template-columns: minmax(0, 1fr);
  }

  .registration-blocked-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .registration-blocked-action .btn {
    width: 100%;
    white-space: normal;
  }
}

@media (max-width: 520px) {
  .registration-blocked-heading {
    flex-direction: column;
  }

  .registration-review-actions {
    grid-template-areas:
      "label"
      "field"
      "buttons";
    grid-template-columns: minmax(0, 1fr);
  }

  .registration-review-buttons {
    grid-template-columns: minmax(0, 1fr);
  }

  .registration-review-buttons .btn:last-child {
    grid-column: auto;
  }
}

/* True presence is separate from whether an account is administratively active. */
.presence-state {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  flex: 0 0 auto;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 850;
}

.presence-state i {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
}

.presence-state.online {
  color: #0d7048;
  background: #e8f8f0;
}

.presence-state.online i {
  background: #16a36a;
  box-shadow: 0 0 0 4px rgba(22, 163, 106, 0.13);
}

.presence-state.offline {
  color: #6c7380;
  background: #eef1f5;
}

.presence-state.offline i {
  background: #8a94a3;
}

.worker-profile-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.worker-profile-heading h1 {
  margin: 0;
}

.owner-resident-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.owner-edit-field {
  display: grid;
  gap: 0.35rem;
}

.owner-edit-field > span {
  color: #55657a;
  font-size: 0.85rem;
  font-weight: 800;
}

.owner-edit-wide {
  grid-column: 1 / -1;
}

@media (max-width: 680px) {
  .owner-resident-edit-grid {
    grid-template-columns: 1fr;
  }

  .owner-edit-wide {
    grid-column: auto;
  }
}

/* Distance-readable typography and controls for the guard work panel. */
.staff-dashboard-page {
  --staff-copy-size: 1.125rem;
  --staff-meta-size: 1rem;
  --staff-control-height: 50px;
  font-size: var(--staff-copy-size);
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.staff-dashboard-page .staff-header {
  line-height: 1.35;
}

.staff-dashboard-page .staff-logo {
  font-size: 1.4rem;
}

.staff-dashboard-page .staff-subtitle,
.staff-dashboard-page .worker-meta span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 1rem;
}

.staff-dashboard-page .worker-meta strong {
  font-size: 1.15rem;
}

.staff-dashboard-page .dashboard-intro h1 {
  font-size: clamp(2.1rem, 4vw, 3.1rem);
  line-height: 1.12;
}

.staff-dashboard-page .eyebrow {
  font-size: 1rem;
  letter-spacing: 0.09em;
}

.staff-dashboard-page .btn,
.staff-dashboard-page .form-control,
.staff-dashboard-page .form-select {
  min-height: var(--staff-control-height);
  font-size: var(--staff-copy-size);
  line-height: 1.4;
}

.staff-dashboard-page .form-control,
.staff-dashboard-page .form-select {
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

.staff-dashboard-page .btn {
  padding: 0.65rem 1rem;
  font-weight: 700;
}

.staff-dashboard-page .btn-sm {
  min-height: 44px;
  padding: 0.5rem 0.8rem;
  font-size: 1.05rem;
}

.staff-dashboard-page .form-label,
.staff-dashboard-page .owner-edit-field > span,
.staff-dashboard-page .resident-search-field > span {
  color: #4f5e72;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.35;
}

.staff-dashboard-page .staff-live-status {
  min-height: var(--staff-control-height);
  padding: 0.65rem 0.9rem;
  font-size: 1.05rem;
}

.staff-dashboard-page .staff-live-update-notice strong {
  font-size: 1.2rem;
}

.staff-dashboard-page .staff-live-update-notice span {
  font-size: 1.05rem;
}

.staff-dashboard-page .portal-tabs a {
  min-height: 52px;
  padding: 0.65rem 1rem;
  font-size: var(--staff-copy-size);
  line-height: 1.35;
}

.staff-dashboard-page .portal-tabs a span {
  min-width: 1.75rem;
  padding: 0.15rem 0.45rem;
  font-size: var(--staff-meta-size);
}

.staff-dashboard-page .subtabs a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0.65rem 1rem;
  font-size: var(--staff-copy-size);
  font-weight: 700;
  line-height: 1.35;
}

.staff-dashboard-page .column-heading {
  flex-wrap: wrap;
}

.staff-dashboard-page .column-heading h2,
.staff-dashboard-page .client-panel h2 {
  font-size: 1.5rem;
  line-height: 1.25;
}

.staff-dashboard-page .client-panel h1 {
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  line-height: 1.2;
}

.staff-dashboard-page .column-heading small,
.staff-dashboard-page .resident-search-result,
.staff-dashboard-page .client-panel small {
  color: #526176;
  font-size: var(--staff-meta-size);
  line-height: 1.45;
}

.staff-dashboard-page .task-card h3 {
  font-size: 1.4rem;
  line-height: 1.3;
}

.staff-dashboard-page .task-description {
  color: #2f4057;
  font-size: 1.15rem;
  line-height: 1.55;
}

.staff-dashboard-page .task-number,
.staff-dashboard-page .task-time,
.staff-dashboard-page .category-pill,
.staff-dashboard-page .urgent-badge,
.staff-dashboard-page .status-pill,
.staff-dashboard-page .presence-state {
  font-size: var(--staff-meta-size);
  line-height: 1.35;
}

.staff-dashboard-page .category-pill,
.staff-dashboard-page .urgent-badge,
.staff-dashboard-page .status-pill,
.staff-dashboard-page .presence-state {
  padding: 0.35rem 0.65rem;
}

.staff-dashboard-page .task-details {
  gap: 0.7rem;
}

.staff-dashboard-page .task-details div {
  grid-template-columns: 105px minmax(0, 1fr);
  gap: 0.75rem;
  line-height: 1.45;
}

.staff-dashboard-page .task-details dt,
.staff-dashboard-page .task-details dd,
.staff-dashboard-page .attachment-link,
.staff-dashboard-page .empty-state,
.staff-dashboard-page .resolution-note,
.staff-dashboard-page .alert {
  font-size: 1.08rem;
}

.staff-dashboard-page .task-details dt {
  color: #526176;
  font-weight: 750;
}

.staff-dashboard-page .task-details dd {
  color: #182f4c;
  font-weight: 750;
}

.staff-dashboard-page .portal-table .table {
  font-size: 1.1rem;
  line-height: 1.5;
}

.staff-dashboard-page .portal-table th {
  color: #4f5e72;
  font-size: 1rem;
  line-height: 1.35;
}

.staff-dashboard-page .portal-table th,
.staff-dashboard-page .portal-table td {
  padding: 0.85rem;
}

.staff-dashboard-page textarea.form-control {
  min-height: 104px;
}

.staff-dashboard-page .staff-chat-widget > summary {
  min-height: 68px;
  font-size: 1.2rem;
}

.staff-dashboard-page .staff-chat-list-item {
  min-height: 64px;
  font-size: 1.1rem;
  line-height: 1.4;
}

.staff-dashboard-page .staff-chat-list-item small,
.staff-dashboard-page .staff-chat-heading span,
.staff-dashboard-page .staff-chat-messages .chat-message > div {
  font-size: 1rem;
  line-height: 1.4;
}

.staff-dashboard-page .staff-chat-heading strong,
.staff-dashboard-page .staff-chat-messages .chat-message {
  font-size: var(--staff-copy-size);
}

.staff-dashboard-page .staff-chat-messages .chat-message {
  line-height: 1.55;
}

/* The login remains readable before the worker reaches the scoped dashboard. */
.staff-login-page .login-card {
  font-size: 1.1rem;
  line-height: 1.55;
}

.staff-login-page .login-card h2 {
  font-size: 2rem;
}

.staff-login-page .login-card .eyebrow,
.staff-login-page .login-card .form-label,
.staff-login-page .login-card .form-text,
.staff-login-page .login-card .alert {
  font-size: 1.05rem;
}

.staff-login-page .login-card .form-control,
.staff-login-page .login-card .form-select,
.staff-login-page .login-card .btn {
  min-height: 54px;
  font-size: 1.125rem;
}

.staff-login-page .brand-copy {
  font-size: 1.25rem;
  line-height: 1.55;
}

.staff-login-page .brand-status {
  font-size: 1.05rem;
}

@media (max-width: 800px) {
  .access-request-grid {
    grid-template-columns: 1fr;
  }

  .worker-profile-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .staff-dashboard-page .task-details div {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .staff-dashboard-page .staff-work-controls {
    flex-wrap: wrap;
    align-items: stretch;
  }

  .staff-dashboard-page .staff-complex-switch {
    flex: 1 1 100%;
  }

  .staff-dashboard-page .staff-live-status,
  .staff-dashboard-page .refresh-button {
    flex: 1 1 auto;
    justify-content: center;
  }
}

/* Owner controls are intentionally a little larger for daily office work. */
.owner-dashboard-page .portal-tabs a,
.owner-dashboard-page .btn,
.owner-dashboard-page .form-control,
.owner-dashboard-page .form-select,
.owner-dashboard-page .form-label,
.owner-dashboard-page .table,
.owner-dashboard-page .empty-state {
  font-size: 0.94rem;
}

.owner-dashboard-page button,
.owner-dashboard-page input,
.owner-dashboard-page select,
.owner-dashboard-page textarea {
  font-family: inherit;
}

.owner-dashboard-page .form-control,
.owner-dashboard-page .form-select {
  min-height: 2.65rem;
  line-height: 1.35;
}

.owner-dashboard-page .form-control-sm,
.owner-dashboard-page .form-select-sm {
  min-height: 2.35rem;
}

.owner-dashboard-page input[type="date"],
.owner-dashboard-page input[type="month"],
.owner-dashboard-page input[type="time"],
.owner-dashboard-page input[type="datetime-local"] {
  min-width: 0;
}

.owner-dashboard-page input[type="date"]::-webkit-date-and-time-value,
.owner-dashboard-page input[type="month"]::-webkit-date-and-time-value,
.owner-dashboard-page input[type="time"]::-webkit-date-and-time-value,
.owner-dashboard-page input[type="datetime-local"]::-webkit-date-and-time-value {
  min-height: 1.35em;
  text-align: left;
}

.owner-dashboard-page .table-responsive,
.owner-dashboard-page .portal-tabs,
.owner-dashboard-page .owner-jump-nav {
  -webkit-overflow-scrolling: touch;
}

.owner-dashboard-page .owner-section-heading p,
.owner-dashboard-page .resident-search-field > span,
.owner-dashboard-page .payment-upload-grid label > span {
  font-size: 0.82rem;
}

.owner-dashboard-page .portal-table th {
  font-size: 0.79rem;
}

.payment-history-filters {
  display: grid;
  grid-template-columns:
    minmax(180px, 1fr)
    minmax(145px, 0.75fr)
    minmax(120px, 0.55fr)
    minmax(145px, 0.75fr)
    minmax(120px, 0.55fr)
    minmax(190px, 1.1fr)
    minmax(190px, 1.1fr)
    minmax(120px, 0.6fr)
    auto;
  gap: 0.65rem;
  align-items: end;
  margin-bottom: 1rem;
  padding: 0.9rem;
  border: 1px solid #e1d9ef;
  border-radius: 1rem;
  background: #faf8ff;
}

.payment-history-filters label > span {
  display: block;
  margin-bottom: 0.3rem;
  color: #655a73;
  font-size: 0.78rem;
  font-weight: 800;
}

.payment-history-filters .payment-date-input {
  min-height: 3.1rem;
  padding: 0.65rem 0.8rem;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
}

.payment-history-filters .payment-date-input::-webkit-calendar-picker-indicator {
  width: 1.55rem;
  height: 1.55rem;
  padding: 0.15rem;
  opacity: 0.9;
  cursor: pointer;
}

.payment-history-filters .payment-date-input:focus {
  border-color: #7652bd;
  box-shadow: 0 0 0 0.22rem rgba(98, 64, 164, 0.18);
}

.payment-row-reversed {
  opacity: 0.68;
  background: #f4f5f7;
  text-decoration-color: #9aa3b0;
}

.payment-row-storno {
  background: #fff4f1;
}

.reconciliation-builder {
  overflow: visible;
  border-color: #d8cdec;
  background: linear-gradient(145deg, #fff, #faf8ff);
}

.reconciliation-form {
  display: grid;
  grid-template-columns:
    minmax(180px, 0.8fr)
    minmax(300px, 1.45fr)
    minmax(165px, 0.72fr)
    minmax(165px, 0.72fr)
    auto
    auto;
  gap: 0.75rem;
  align-items: end;
}

.reconciliation-form label > span:not(.form-check-label) {
  display: block;
  margin-bottom: 0.32rem;
  color: #655a73;
  font-size: 0.82rem;
  font-weight: 800;
}

.reconciliation-form .reconciliation-month-input {
  min-height: 2.75rem;
  font-weight: 700;
}

.reconciliation-current-check {
  min-height: 2.75rem;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.65rem 0.8rem 0.65rem 2.15rem;
  border: 1px solid #d8d2e5;
  border-radius: 0.65rem;
  background: #fff;
  white-space: nowrap;
}

.reconciliation-current-check .form-check-input {
  margin-top: 0.15rem;
}

.reconciliation-preview {
  padding-top: 1rem;
  border-top: 1px solid #e2dcef;
}

.reconciliation-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.reconciliation-preview-head h3,
.reconciliation-preview-head p {
  margin-bottom: 0.2rem;
}

.reconciliation-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.reconciliation-summary > div {
  display: grid;
  gap: 0.2rem;
  padding: 0.8rem;
  border: 1px solid #dfd8eb;
  border-radius: 0.8rem;
  background: #fff;
}

.reconciliation-summary span {
  color: #697386;
  font-size: 0.8rem;
  font-weight: 750;
}

.reconciliation-summary strong {
  font-size: 1.05rem;
}

.reconciliation-table-wrap {
  max-height: 32rem;
}

.reconciliation-table {
  min-width: 780px;
  margin: 0;
}

.reconciliation-table th,
.reconciliation-table td {
  border: 1px solid #77808d;
  text-align: right;
  white-space: nowrap;
}

.reconciliation-table thead th {
  text-align: center;
  vertical-align: middle;
}

.reconciliation-table th:first-child,
.reconciliation-table td:first-child {
  text-align: left;
}

.reconciliation-year-row > * {
  background: #d2d4d7 !important;
  font-weight: 800;
}

.reconciliation-total-row > * {
  color: #fff !important;
  background: #676b72 !important;
  font-weight: 850;
}

.reconciliation-open-row td:first-child {
  color: #d21e38;
  font-weight: 750;
}

.reconciliation-details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.reconciliation-details-grid details {
  overflow: hidden;
  border: 1px solid #dfd8eb;
  border-radius: 0.8rem;
  background: #fff;
}

.reconciliation-details-grid summary {
  padding: 0.8rem 0.9rem;
  color: #4d327e;
  font-weight: 800;
  cursor: pointer;
}

.reconciliation-details-grid .table-responsive {
  max-height: 20rem;
  border-top: 1px solid #e6e0ef;
}

.reconciliation-details-grid .table {
  margin: 0;
}

.commercial-payer-grid,
.reminder-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.commercial-payer-card,
.reminder-editor,
.reminder-card {
  padding: 1rem;
  border: 1px solid #ded6ec;
  border-radius: 1rem;
  background: #fcfbfe;
}

.commercial-payer-card {
  display: grid;
  gap: 0.75rem;
}

.commercial-payer-create {
  grid-template-columns: minmax(190px, 1fr) minmax(160px, 0.7fr) minmax(220px, 1.1fr);
  align-items: end;
}

.commercial-payer-create .commercial-accounts {
  grid-column: 1 / -1;
}

.commercial-accounts small {
  display: block;
  margin-top: 0.3rem;
  color: #68758a;
}

.reminder-editor,
.reminder-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 0.75rem;
  align-items: end;
}

.reminder-editor .reminder-days,
.reminder-editor .reminder-message {
  grid-column: 1 / -1;
}

.reminder-days {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.8rem 0;
}

.reminder-days > span {
  width: 100%;
}

.reminder-days label {
  padding: 0.4rem 0.55rem;
  border: 1px solid #d8dfea;
  border-radius: 0.6rem;
  background: #fff;
}

.reminder-message {
  margin-top: 0.75rem;
}

@media (max-width: 1300px) {
  .payment-history-filters {
    grid-template-columns: repeat(4, minmax(140px, 1fr));
  }

  .reconciliation-form {
    grid-template-columns: repeat(3, minmax(170px, 1fr));
  }

  .payment-history-filters .resident-search-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .commercial-payer-grid,
  .reminder-grid,
  .commercial-payer-create,
  .reminder-editor,
  .reminder-fields {
    grid-template-columns: 1fr;
  }

  .commercial-payer-create .commercial-accounts,
  .reminder-editor .reminder-days,
  .reminder-editor .reminder-message {
    grid-column: 1;
  }

  .payment-history-filters {
    grid-template-columns: 1fr 1fr;
  }

  .reconciliation-form,
  .reconciliation-summary,
  .reconciliation-details-grid {
    grid-template-columns: 1fr 1fr;
  }

  .reconciliation-account-field {
    grid-column: span 2;
  }
}

@media (max-width: 560px) {
  .payment-history-filters {
    grid-template-columns: 1fr;
  }

  .reconciliation-form,
  .reconciliation-summary,
  .reconciliation-details-grid {
    grid-template-columns: 1fr;
  }

  .reconciliation-account-field {
    grid-column: auto;
  }

  .reconciliation-preview-head {
    align-items: stretch;
    flex-direction: column;
  }
}
