﻿:root {
  --green-950: #102d24;
  --green-900: #173b2f;
  --green-700: #2c644d;
  --green-100: #e9f1eb;
  --green-50: #f4f8f5;
  --clay: #b56c42;
  --gold: #d9aa55;
  --ink: #17201c;
  --muted: #66706b;
  --line: #dfe5e1;
  --surface: #ffffff;
  --page: #f3f5f3;
  --warning-bg: #fff7e8;
  --warning: #87611f;
  --success-bg: #e8f4ec;
  --success: #21613e;
  --shadow: 0 18px 42px rgba(16, 45, 36, 0.1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: 2rem;
  line-height: 1.1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.15rem;
  line-height: 1.3;
  letter-spacing: 0;
}

.section-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.eyebrow,
.section-label {
  display: block;
  margin-bottom: 8px;
  color: var(--green-700);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.primary-button,
.secondary-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 11px 18px;
  font-weight: 800;
  text-align: center;
}

.primary-button {
  border: 1px solid var(--green-900);
  color: #fff;
  background: var(--green-900);
}

.primary-button:hover {
  background: var(--green-700);
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--green-900);
  background: #fff;
}

.secondary-button:hover {
  border-color: var(--green-700);
  background: var(--green-50);
}

.compact {
  min-height: 40px;
  padding: 8px 14px;
  font-size: 0.9rem;
}

.text-button {
  border: 0;
  padding: 0;
  color: var(--green-700);
  background: transparent;
  font-weight: 800;
}

.login-view {
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr;
  background:
    linear-gradient(rgba(16, 45, 36, 0.83), rgba(16, 45, 36, 0.83)),
    url("../assets/intervention-entretien-regulier.jpg") center / cover;
}

.login-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px clamp(20px, 5vw, 72px);
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.84rem;
  font-weight: 800;
}

.login-header a {
  display: inline-flex;
  padding: 10px 14px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
}

.login-header img {
  width: min(270px, 60vw);
  height: 48px;
  object-fit: contain;
  object-position: left center;
}

.login-main {
  width: min(1160px, calc(100% - 40px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.62fr);
  gap: clamp(40px, 7vw, 100px);
  align-items: center;
  margin: 0 auto;
  padding: 46px 0 76px;
}

.login-copy {
  max-width: 630px;
  color: #fff;
}

.login-copy .eyebrow {
  color: var(--gold);
}

.login-copy h1 {
  margin-bottom: 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 3.6rem;
  font-weight: 500;
}

.login-copy > p {
  max-width: 590px;
  color: rgba(255, 255, 255, 0.83);
  font-size: 1.12rem;
}

.login-copy ul {
  display: grid;
  gap: 10px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.login-copy li {
  position: relative;
  padding-left: 24px;
  font-weight: 800;
}

.login-copy li::before {
  content: "";
  position: absolute;
  top: 0.65em;
  left: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
}

.login-form {
  display: grid;
  gap: 18px;
  border-radius: 8px;
  padding: 34px;
  background: #fff;
  box-shadow: var(--shadow);
}

.login-form form,
.stacked-form {
  display: grid;
  gap: 18px;
}

.login-form h2 {
  font-size: 1.65rem;
}

.login-form label,
.profile-form label,
.reply-form label,
.stacked-form label {
  display: grid;
  gap: 7px;
  color: var(--green-900);
  font-size: 0.9rem;
  font-weight: 800;
}

.login-form input,
.profile-form input,
.reply-form input,
.reply-form textarea,
.stacked-form input,
.stacked-form textarea,
.stacked-form select,
.invite-link input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 13px;
  color: var(--ink);
  background: #fbfcfb;
}

.login-form input:focus,
.profile-form input:focus,
.reply-form input:focus,
.reply-form textarea:focus,
.stacked-form input:focus,
.stacked-form textarea:focus,
.stacked-form select:focus,
.invite-link input:focus {
  border-color: var(--green-700);
  outline: 3px solid rgba(44, 100, 77, 0.14);
}

.login-help,
.form-help,
.muted {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.privacy-link {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
  text-decoration: underline;
}

.setup-steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  font-size: 0.92rem;
}

.qr-panel {
  display: grid;
  gap: 12px;
  justify-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--green-50);
  text-align: center;
}

.qr-frame {
  width: min(240px, 100%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid #d5ddd7;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.qr-code {
  width: 100%;
  height: 100%;
  display: block;
  shape-rendering: crispEdges;
}

.setup-key input {
  color: var(--green-900);
  font-family: "Consolas", "Courier New", monospace;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.setup-manual {
  display: grid;
  gap: 12px;
}

.setup-manual summary {
  color: var(--green-700);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 900;
}

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

.recovery-grid code {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  color: var(--green-900);
  background: var(--green-50);
  font-family: "Consolas", "Courier New", monospace;
  font-size: 1rem;
  font-weight: 900;
  text-align: center;
}

.alert {
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 20px;
  padding: 13px 15px;
  font-size: 0.92rem;
  font-weight: 700;
}

.alert.success {
  border-color: #b9d9c4;
  color: var(--success);
  background: var(--success-bg);
}

.alert.error {
  border-color: #e5b7aa;
  color: #8d352a;
  background: #fff0ec;
}

.alert.info {
  border-color: #d8c69c;
  color: var(--warning);
  background: var(--warning-bg);
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.checkbox-label {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  color: var(--muted) !important;
  font-weight: 600 !important;
}

.checkbox-label input {
  width: 17px;
  height: 17px;
  margin: 0;
}

.form-message {
  min-height: 22px;
  margin: 0;
  color: var(--clay);
  font-size: 0.88rem;
  font-weight: 700;
}

.portal {
  min-height: 100svh;
}

.portal-header {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: 76px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding: 10px 24px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(14px);
}

.portal-brand {
  display: inline-flex;
  width: fit-content;
}

.portal-brand img {
  width: 210px;
  height: 48px;
  object-fit: contain;
  object-position: left center;
}

.portal-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.portal-title span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.portal-title strong {
  display: none;
}

.profile-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--green-900);
  font-weight: 900;
}

.portal-layout {
  min-height: calc(100svh - 76px);
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 76px;
  height: calc(100svh - 76px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 24px 16px;
  color: #fff;
  background: var(--green-950);
}

.sidebar nav {
  display: grid;
  gap: 6px;
}

.mobile-logout {
  display: none;
}

.nav-item {
  min-height: 46px;
  border: 0;
  border-radius: 6px;
  padding: 11px 14px;
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
  font-weight: 750;
  text-align: left;
}

.nav-item:hover,
.nav-item.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.11);
}

.nav-item.is-active {
  box-shadow: inset 4px 0 var(--gold);
}

.sidebar-footer {
  display: grid;
  gap: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 20px 14px 4px;
}

.sidebar-footer span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.82rem;
}

.sidebar-footer a {
  font-weight: 900;
}

.sidebar-footer .sidebar-privacy {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.82rem;
  font-weight: 700;
}

.sidebar-footer button {
  width: fit-content;
  border: 0;
  padding: 10px 0 0;
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
  font-weight: 700;
}

.portal-content {
  min-width: 0;
  padding: 38px clamp(20px, 4vw, 64px) 64px;
}

.panel {
  display: none;
}

.panel.is-active {
  display: block;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
}

.page-heading p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.status-badge {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}

.status-badge.success {
  color: var(--success);
  background: var(--success-bg);
}

.status-badge.planned {
  color: var(--warning);
  background: var(--warning-bg);
}

.next-visit {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 20px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(16, 45, 36, 0.06);
  overflow: hidden;
}

.date-block {
  display: grid;
  place-content: center;
  padding: 24px;
  color: #fff;
  background: var(--green-900);
  text-align: center;
}

.date-block span,
.date-block small {
  font-weight: 800;
}

.date-block strong {
  font-size: 3.7rem;
  line-height: 1;
}

.visit-main {
  padding: 26px 28px;
}

.visit-heading,
.section-heading,
.conversation-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.visit-details,
.invoice-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 24px 0;
}

.visit-details div,
.invoice-details div {
  border-left: 3px solid var(--green-100);
  padding-left: 12px;
}

dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

dd {
  margin: 0;
  font-weight: 800;
}

.visit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.summary-grid.two-columns {
  grid-template-columns: repeat(2, 1fr);
}

.summary-item {
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: var(--surface);
}

.summary-item strong {
  display: block;
  margin-bottom: 6px;
  color: var(--green-900);
  font-size: 1.35rem;
}

.summary-item p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.dashboard-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.7fr);
  gap: 20px;
}

.content-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  background: var(--surface);
}

.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 20px;
  padding: 28px;
  background: var(--surface);
}

.empty-state p {
  margin: 8px 0 0;
  color: var(--muted);
}

.section-heading {
  margin-bottom: 22px;
}

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

.activity-list li {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  border-top: 1px solid var(--line);
  padding: 18px 0;
}

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

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

.activity-date {
  color: var(--green-700);
  font-size: 0.86rem;
  font-weight: 900;
}

.activity-list p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.invoice-number {
  margin: 26px 0 14px;
  color: var(--green-900);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
}

.invoice-details {
  grid-template-columns: 1fr;
  margin: 0 0 24px;
}

.filter-row {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.filter-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  color: var(--muted);
  background: var(--surface);
  font-weight: 800;
}

.filter-button.is-active {
  border-color: var(--green-900);
  color: #fff;
  background: var(--green-900);
}

.intervention-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) 120px auto;
  gap: 20px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 20px 0;
}

.intervention-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.intervention-row:last-child {
  padding-bottom: 0;
}

.intervention-row.upcoming {
  color: var(--green-950);
}

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

.row-date strong {
  font-size: 1.5rem;
}

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

.row-main p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.table-section {
  padding-top: 8px;
}

.document-row,
.payment-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) 150px 120px 110px;
  gap: 18px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 18px 8px;
}

.payment-row {
  grid-template-columns: minmax(0, 1.6fr) minmax(112px, max-content) minmax(96px, max-content) minmax(92px, max-content);
}

.document-row:first-child,
.payment-row:first-child {
  border-top: 0;
}

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

.document-row strong,
.document-row small,
.payment-row strong {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.payment-row > :nth-child(2),
.payment-row > :nth-child(3) {
  white-space: nowrap;
}

.document-row small {
  display: block;
  color: var(--muted);
}

.table-head {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.message-layout {
  min-height: 580px;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.message-list {
  border-right: 1px solid var(--line);
}

.message-preview {
  width: 100%;
  display: grid;
  gap: 3px;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 20px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.message-preview.is-active {
  box-shadow: inset 4px 0 var(--green-700);
  background: var(--green-50);
}

.message-preview span,
.conversation-heading span {
  color: var(--muted);
  font-size: 0.78rem;
}

.message-preview p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.conversation {
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 24px;
}

.conversation-heading {
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.conversation-heading strong,
.conversation-heading span {
  display: block;
}

.message-bubble {
  max-width: 620px;
  align-self: start;
  margin-top: 28px;
  border-radius: 8px;
  padding: 16px 18px;
  background: var(--green-50);
}

.message-bubble span {
  color: var(--muted);
  font-size: 0.75rem;
}

.message-bubble p {
  margin: 6px 0 0;
}

.reply-form {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.reply-form textarea {
  resize: vertical;
}

.reply-form .primary-button {
  justify-self: end;
}

.messages-section {
  display: grid;
  gap: 24px;
}

.message-thread {
  display: grid;
  gap: 12px;
}

.message-card {
  width: min(720px, 92%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  background: var(--green-50);
}

.message-card.mine {
  justify-self: end;
  border-color: #d7c398;
  background: var(--warning-bg);
}

.message-card > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
}

.message-card span {
  color: var(--muted);
  font-size: 0.76rem;
  white-space: nowrap;
}

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

.profile-form {
  display: grid;
  gap: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.full-field {
  grid-column: 1 / -1;
}

.profile-form input:disabled {
  color: var(--muted);
  background: #edf0ee;
}

.profile-form > .primary-button {
  justify-self: end;
}

.admin-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
  gap: 20px;
  align-items: start;
}

.admin-client-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.admin-history {
  margin-top: 20px;
}

.clients-list {
  display: grid;
  gap: 10px;
}

.client-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding: 16px 0;
}

.client-card:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.client-card div {
  min-width: 0;
}

.client-card-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.client-card-main small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.client-card-actions {
  display: grid;
  justify-items: end;
  gap: 6px;
  flex: 0 0 auto;
}

.client-card-actions form {
  margin: 0;
}

.client-card-actions .text-button {
  font-size: 0.82rem;
}

.client-row-actions {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.client-card strong,
.client-card span:not(.status-badge),
.client-row small {
  display: block;
}

.client-card span:not(.status-badge),
.client-card-main small,
.client-row small {
  color: var(--muted);
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

.client-card .card-action,
.client-row span.card-action {
  color: var(--green-700);
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.client-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(120px, 0.8fr) minmax(140px, 0.9fr) auto;
  gap: 18px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 18px 8px;
}

.client-row:hover,
.client-card:hover {
  color: var(--green-700);
}

.invite-link {
  display: grid;
  gap: 7px;
}

.invite-link span {
  font-weight: 500;
}

.setup-page,
.setup-required {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(rgba(16, 45, 36, 0.86), rgba(16, 45, 36, 0.86)),
    url("../assets/intervention-entretien-regulier.jpg") center / cover;
}

.setup-card,
.setup-required {
  width: min(760px, 100%);
}

.setup-card {
  border-radius: 8px;
  padding: clamp(24px, 5vw, 46px);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.setup-card > img,
.setup-required > img {
  width: min(270px, 75vw);
  height: 56px;
  margin-bottom: 28px;
  object-fit: contain;
  object-position: left center;
}

.setup-required {
  min-height: auto;
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

  .login-copy {
    max-width: 760px;
  }

  .login-copy h1 {
    font-size: 3rem;
  }

  .login-form {
    width: min(560px, 100%);
  }

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

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

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

  .summary-grid.two-columns {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 820px) {
  .portal-header {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 10px 16px;
  }

  .portal-title {
    display: none;
  }

  .portal-layout {
    display: block;
  }

  .sidebar {
    position: sticky;
    z-index: 15;
    top: 76px;
    width: 100%;
    height: auto;
    display: block;
    border: 0;
    padding: 8px 12px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .sidebar::-webkit-scrollbar {
    display: none;
  }

  .sidebar nav {
    display: flex;
    width: max-content;
  }

  .mobile-logout {
    display: block;
  }

  .mobile-logout .nav-item {
    height: 100%;
  }

  .nav-item {
    white-space: nowrap;
  }

  .nav-item.is-active {
    box-shadow: inset 0 -3px var(--gold);
  }

  .sidebar-footer {
    display: none;
  }

  .portal-content {
    padding: 28px 18px 54px;
  }

  .next-visit {
    grid-template-columns: 110px minmax(0, 1fr);
  }

  .visit-details {
    grid-template-columns: 1fr;
  }

  .intervention-row {
    grid-template-columns: 70px minmax(0, 1fr) auto;
  }

  .intervention-row > span:not(.status-badge) {
    display: none;
  }

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

  .document-row > :nth-child(2),
  .payment-row > :nth-child(2) {
    display: none;
  }

  .table-head {
    display: none;
  }

  .message-layout {
    grid-template-columns: 1fr;
  }

  .message-list {
    display: none;
  }

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

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

  .client-row > :nth-child(2),
  .client-row > :nth-child(3) {
    display: none;
  }
}

@media (max-width: 620px) {
  h1 {
    font-size: 1.7rem;
  }

  .login-header {
    align-items: flex-start;
    gap: 8px;
    padding: 14px 16px;
  }

  .login-header a {
    min-width: 0;
    padding: 8px 10px;
  }

  .login-header span {
    max-width: 110px;
    text-align: right;
  }

  .login-header img {
    width: min(190px, 50vw);
    height: 44px;
  }

  .login-main {
    width: min(100% - 28px, 560px);
    gap: 30px;
    padding: 28px 0 40px;
  }

  .login-copy h1 {
    max-width: 100%;
    font-size: 2.15rem;
  }

  .login-copy ul {
    display: none;
  }

  .login-form {
    padding: 24px 20px;
  }

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

  .login-options {
    align-items: flex-start;
    flex-direction: column;
  }

  .portal-brand img {
    width: min(210px, calc(100vw - 100px));
    height: 42px;
  }

  .page-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .page-heading > .primary-button,
  .page-heading > .status-badge {
    align-self: flex-start;
  }

  .next-visit {
    grid-template-columns: 1fr;
  }

  .date-block {
    grid-template-columns: auto auto auto;
    gap: 8px;
    align-items: baseline;
    justify-content: start;
    padding: 16px 20px;
    text-align: left;
  }

  .date-block strong {
    font-size: 2rem;
  }

  .visit-main,
  .content-section {
    padding: 20px;
  }

  .visit-heading,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .visit-actions,
  .visit-actions .primary-button,
  .visit-actions .secondary-button {
    width: 100%;
  }

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

  .activity-list li {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .activity-list .status-badge {
    grid-column: 2;
    justify-self: start;
  }

  .intervention-row {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .intervention-row .status-badge {
    grid-column: 2;
    justify-self: start;
  }

  .document-row,
  .payment-row {
    align-items: start;
  }

  .message-card {
    width: 100%;
  }

  .message-card > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .document-row > :nth-child(3) {
    display: none;
  }

  .payment-row > :nth-child(3) {
    display: block;
    grid-column: 1;
    color: var(--muted);
    font-weight: 800;
  }

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

  .full-field {
    grid-column: auto;
  }
}
