:root {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --ink: #08265c;
  --muted: #61718f;
  --line: #d9e2f2;
  --primary: #08265c;
  --primary-dark: #04183d;
  --accent: #ffbd00;
  --accent-dark: #d99b00;
  --blue: #08265c;
  --red: #c94035;
  --orange: #ffbd00;
  --purple: #5d4bbb;
  --green: #1d8a5a;
  --shadow: 0 18px 45px rgba(8, 38, 92, 0.1);
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  overflow-x: hidden;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, select {
  font: inherit;
}

button,
input,
select,
textarea {
  max-width: 100%;
}

button, .file-button, .button-link {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  min-height: 38px;
  padding: 0 14px;
  border-radius: 6px;
  cursor: pointer;
}

button:hover, .file-button:hover, .button-link:hover { border-color: #aeb9b4; }

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--primary);
  font-weight: 800;
}

.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

.ghost { background: transparent; }
.danger { color: var(--red); border-color: rgba(201, 64, 53, 0.35); }

.dashboard-toolbar {
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.dashboard-toolbar .period-label {
  flex: 1 1 260px;
  margin: 0;
}

.dashboard-month-picker {
  position: relative;
  display: inline-flex;
  min-width: 190px;
}

.month-picker-trigger {
  display: inline-flex;
  align-items: center;
  width: 100%;
  min-height: 40px;
  justify-content: space-between;
  gap: 12px;
  border-color: rgba(8, 38, 92, 0.15);
  border-radius: 999px;
  background: #ffffff;
  color: var(--primary);
  padding: 0 14px 0 16px;
  font-weight: 900;
  box-shadow: 0 8px 22px rgba(8, 38, 92, 0.07);
  text-transform: capitalize;
}

.month-picker-caret {
  color: var(--muted);
  font-size: 12px;
}

.month-picker-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 85;
  width: 286px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
  box-shadow: 0 20px 48px rgba(8, 38, 92, 0.18);
}

.month-picker-head {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.month-picker-head strong {
  color: var(--primary);
  font-size: 16px;
  text-align: center;
}

.month-year-button {
  display: grid;
  place-items: center;
  width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 999px;
  background: #f4f7fb;
  color: var(--primary);
  font-size: 24px;
  font-weight: 900;
  box-shadow: none;
}

.month-year-button:hover {
  background: rgba(255, 194, 15, 0.24);
}

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

.month-option-button {
  min-height: 42px;
  border-color: rgba(8, 38, 92, 0.1);
  border-radius: 8px;
  background: #f8fafd;
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
  box-shadow: none;
  text-transform: capitalize;
}

.month-option-button:hover {
  border-color: rgba(255, 194, 15, 0.72);
  background: #fff7da;
}

.month-option-button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--primary);
}

.dashboard-month-picker.is-disabled {
  opacity: 0.52;
}

.dashboard-month-picker.is-disabled button {
  cursor: not-allowed;
}

.icon-button {
  width: 36px;
  padding: 0;
  font-weight: 700;
}

.hidden {
  display: none !important;
}

.portal-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(255, 189, 0, 0.22), transparent 34%),
    linear-gradient(135deg, #04183d 0%, #08265c 46%, #f7f9fd 46%, #ffffff 100%);
}

.portal-card {
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid rgba(8, 38, 92, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 30px 80px rgba(4, 24, 61, 0.26);
  padding: 30px;
}

.welcome-card {
  width: min(540px, 100%);
  min-height: 500px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  text-align: center;
  background:
    linear-gradient(rgba(4, 24, 61, 0.9), rgba(8, 38, 92, 0.94)),
    radial-gradient(circle at 50% 12%, rgba(255, 189, 0, 0.28), transparent 28%);
  color: white;
}

.portal-logo {
  display: block;
  width: 142px;
  height: 142px;
  margin: 0 auto 18px;
  border: 5px solid var(--accent);
  border-radius: 50%;
  object-fit: cover;
  background: white;
  box-shadow: 0 14px 34px rgba(8, 38, 92, 0.18);
}

.welcome-logo {
  width: 170px;
  height: 170px;
  margin-bottom: 22px;
}

.portal-logo.small {
  width: 92px;
  height: 92px;
  margin-bottom: 14px;
}

.portal-card h1 {
  margin-bottom: 20px;
  text-align: center;
}

.portal-card .eyebrow {
  text-align: center;
}

.welcome-card .eyebrow {
  color: var(--accent);
}

.welcome-card h1 {
  color: white;
  font-size: 36px;
}

.portal-copy {
  width: min(360px, 100%);
  margin: 0 auto 22px;
  color: rgba(255, 255, 255, 0.78);
}

.portal-main-button {
  min-width: 160px;
}

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

.company-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 100px;
  padding: 16px;
  text-align: left;
  border-radius: 10px;
  border-color: rgba(8, 38, 92, 0.16);
  background: #f8faff;
}

.company-card img {
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 10px;
  background: white;
}

.company-card strong,
.company-card small {
  display: block;
}

.company-card strong {
  font-size: 18px;
  color: var(--primary);
}

.company-card small {
  margin-top: 4px;
  color: var(--muted);
}

.active-company:hover,
.active-company:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 189, 0, 0.2);
}

.disabled-company {
  opacity: 0.58;
  cursor: not-allowed;
}

.portal-footer-actions {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.login-card {
  width: min(520px, 100%);
}

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

.login-error {
  min-height: 22px;
  margin-top: 10px;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  min-width: 0;
  padding: 22px 16px;
  background: var(--primary);
  color: white;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 58px;
  height: 58px;
  object-fit: cover;
  object-position: center;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.brand span, .sidebar-note span {
  display: block;
  color: #d9e6ff;
  font-size: 13px;
  margin-top: 2px;
}

.mobile-nav-toggle {
  display: none;
}

.mobile-quick-nav {
  display: none;
}

.company-switcher {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(255, 189, 0, 0.25);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.company-switcher label {
  color: #d9e6ff;
  font-size: 12px;
  font-weight: 800;
}

.company-switcher select {
  width: 100%;
  min-height: 34px;
  border-color: rgba(255, 255, 255, 0.24);
}

.admin-controls,
.admin-only {
  display: none !important;
}

.nav {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.nav-button {
  width: 100%;
  text-align: left;
  color: #dfe9ff;
  border-color: transparent;
  background: transparent;
}

.nav-button.active, .nav-button:hover {
  background: rgba(255, 189, 0, 0.14);
  border-color: rgba(255, 189, 0, 0.38);
  color: white;
}

.sidebar-note {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.sidebar-note span {
  padding: 10px 0 0;
  color: #ffffff;
  font-weight: 700;
}

.sidebar-note .sync-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  width: fit-content;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  padding: 0 10px;
  color: #d9e6ff;
  font-size: 11px;
}

.sync-status.online {
  border-color: rgba(29, 138, 90, 0.38);
  background: rgba(29, 138, 90, 0.18);
}

.sync-status.warning {
  border-color: rgba(255, 189, 0, 0.52);
  background: rgba(255, 189, 0, 0.16);
  color: #fff4c8;
}

#logoutButton {
  width: 100%;
  min-height: 42px;
  border-color: rgba(255, 189, 0, 0.65);
  background: rgba(255, 189, 0, 0.14);
  color: #ffffff;
  font-weight: 800;
}

#logoutButton:hover {
  background: var(--accent);
  color: var(--primary);
}

.shell {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 30px; }
h2 { margin-bottom: 0; font-size: 18px; }

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

.export-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  min-width: 0;
}

.file-button {
  display: inline-grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.backup-actions {
  align-items: center;
}

.backup-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.backup-panel {
  max-width: 820px;
}

.backup-panel .panel-head p,
.backup-restore p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.backup-main-button {
  width: min(360px, 100%);
  min-height: 54px;
  font-size: 16px;
}

.backup-restore {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.backup-restore .file-button {
  width: fit-content;
}

.inline-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.selected-lots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 32px;
}

.selected-lot-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  border: 1px solid rgba(8, 38, 92, 0.16);
  border-radius: 999px;
  background: #f8faff;
  padding: 0 8px 0 12px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
}

.selected-lot-chip button {
  width: 22px;
  min-height: 22px;
  padding: 0;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
}

.sale-date-controls {
  display: grid;
  grid-template-columns: minmax(180px, 240px);
  gap: 8px;
  margin-top: 10px;
}

.sale-date-controls label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.sale-lot-term-card {
  display: grid;
  grid-template-columns: 1.05fr repeat(4, minmax(90px, 1fr));
  gap: 8px;
  align-items: end;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faff;
}

.sale-lot-term-head {
  display: grid;
  gap: 6px;
}

.sale-lot-term-head strong {
  color: var(--primary);
}

.sale-lot-term-head button {
  width: fit-content;
  min-height: 30px;
}

.sale-lot-term-card label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.sale-lot-term-card input {
  min-height: 34px;
  padding: 0 8px;
}

.sale-lot-term-card small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-weight: 700;
}

.view { display: none; }
.view.active { display: block; }

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metrics.narrow {
  grid-template-columns: repeat(3, minmax(150px, 1fr));
}

.metric, .panel, .record {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  padding: 16px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.metric strong {
  font-size: 24px;
  color: var(--primary);
}

.grid.two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.panel {
  padding: 18px;
}

.embedded-panel {
  box-shadow: none;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.toolbar {
  margin-bottom: 14px;
}

input, select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  padding: 0 12px;
  color: var(--ink);
}

#saleClientPicker {
  background: #ffffff;
  color: var(--primary);
  -webkit-text-fill-color: var(--primary);
}

.sale-client-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.sale-client-controls input,
.sale-client-controls select {
  width: 100%;
  min-width: 0;
}

#saleClientPicker option {
  color: var(--primary);
  background: #ffffff;
}

input[type="search"] {
  min-width: min(380px, 100%);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th, td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
}

th {
  color: var(--muted);
  background: #f8faff;
  font-size: 12px;
  text-transform: uppercase;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}

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

.records, .compact-list {
  display: grid;
  gap: 10px;
}

.record {
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.record p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.record-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.doc-thumb {
  display: block;
  width: 120px;
  max-height: 90px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-top: 8px;
}

.client-doc-summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faff;
  padding: 12px;
}

.client-doc-summary p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.client-view-card {
  display: grid;
  gap: 14px;
}

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

.client-view-grid > div,
.client-view-lot {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faff;
  padding: 10px;
}

.client-view-grid span,
.client-view-lot span,
.client-view-docs span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.client-view-grid strong,
.client-view-lot strong {
  display: block;
  margin-top: 3px;
  color: var(--primary);
  overflow-wrap: anywhere;
}

.client-view-actions {
  justify-content: flex-start;
}

.client-view-card h3 {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 15px;
}

.client-view-lots,
.client-view-docs {
  display: grid;
  gap: 8px;
}

.record-alert {
  border-left: 5px solid var(--red);
}

.record-warning {
  border-left: 5px solid var(--accent);
}

.client-payment-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 850;
}

.client-payment-late {
  border-color: rgba(201, 64, 53, 0.35);
  background: rgba(201, 64, 53, 0.1);
  color: var(--red);
}

.client-payment-current {
  border-color: rgba(29, 138, 90, 0.32);
  background: rgba(29, 138, 90, 0.1);
  color: var(--green);
}

.client-lot-accounts {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.client-lot-account-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8faff;
  padding: 9px;
}

.client-lot-account-row strong,
.client-lot-account-row span {
  display: block;
  color: var(--primary);
  font-weight: 800;
}

.client-lot-account-row span {
  color: var(--muted);
  font-size: 12px;
}

.client-lot-account-row button {
  white-space: nowrap;
}

.client-payment-paidFull {
  border-color: rgba(8, 38, 92, 0.22);
  background: rgba(8, 38, 92, 0.08);
  color: var(--primary);
}

.client-payment-noSale {
  border-color: rgba(115, 127, 145, 0.28);
  background: rgba(115, 127, 145, 0.1);
  color: var(--muted);
}

.user-record {
  align-items: start;
}

.permission-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.permission-chips span,
.user-role-pill,
.locked-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8faff;
  padding: 0 10px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.locked-pill {
  border-color: rgba(255, 189, 0, 0.45);
  background: rgba(255, 189, 0, 0.16);
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.check-line {
  min-width: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faff;
  padding: 8px 10px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 750;
}

.check-line input {
  min-height: 0;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.check-line span {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.2;
}

.field-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.progress-track {
  width: min(260px, 100%);
  height: 9px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #eaf0fb;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.bars {
  display: grid;
  gap: 12px;
}

.lot-status-panel {
  margin-bottom: 16px;
}

.lot-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.lot-status-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--primary);
  border-radius: 8px;
  background: #f8faff;
  padding: 14px;
}

.lot-status-vendido {
  border-top-color: var(--red);
}

.lot-status-disponible {
  border-top-color: var(--primary);
}

.lot-status-reservado {
  border-top-color: var(--accent);
}

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

.lot-status-head span,
.lot-status-card p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.lot-status-head strong {
  color: var(--primary);
  font-size: 28px;
}

.lot-status-card h3 {
  margin: 0;
  font-size: 18px;
}

.lot-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 30px;
}

.lot-chip-list button,
.lot-chip-list span {
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  background: white;
}

.lot-grouped-list {
  display: grid;
  gap: 16px;
}

.lot-list-section {
  border-top: 5px solid var(--primary);
}

.lot-list-vendido {
  border-top-color: var(--red);
}

.lot-list-disponible {
  border-top-color: var(--primary);
}

.lot-list-reservado {
  border-top-color: var(--accent);
}

.lot-list-section .panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.section-toggle {
  min-height: 32px;
  font-size: 12px;
  font-weight: 800;
}

.is-collapsed .collapsible-body {
  display: none;
}

.lot-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 10px;
}

.lot-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faff;
  padding: 12px;
  cursor: pointer;
}

.lot-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 189, 0, 0.15);
}

.lot-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.lot-card p,
.lot-card small {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.lot-card-money {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.lot-card-money span {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  padding: 7px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.bar-track {
  height: 11px;
  background: #eaf0fb;
  border-radius: 99px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
}

.mini-bars {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.role-hidden {
  display: none !important;
}

.map-panel {
  min-width: 0;
}

.map-full {
  min-height: calc(100vh - 124px);
}

.map-legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: #f8faff;
  border-radius: 6px;
  min-height: 32px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.legend-count {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(8, 38, 92, 0.14);
  background: #ffffff;
  border-radius: 6px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.interactive-stage {
  width: 100%;
  height: calc(100vh - 245px);
  min-height: 560px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f2f6ff;
  padding: 24px;
}

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

.plan-document-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faff;
  padding: 14px;
}

.plan-document-card p {
  margin: 4px 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.plan-document-card span,
.plan-document-card small,
.payment-amount small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.interactive-map {
  position: relative;
  width: 972px;
  height: 1062px;
  overflow: hidden;
  transform-origin: 0 0;
  transition: transform 160ms ease;
}

.autocad-plan,
.autocad-click-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.autocad-plan {
  position: absolute;
  max-width: none;
  object-fit: contain;
  background: white;
  box-shadow: 0 16px 36px rgba(8, 38, 92, 0.08);
}

.autocad-click-layer {
  z-index: 4;
}

.autocad-lot-shape {
  cursor: pointer;
  fill: rgba(8, 38, 92, 0.001);
  stroke: transparent;
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
  pointer-events: all;
}

.autocad-lot-shape.visible-division {
  fill: rgba(255, 255, 255, 0.02);
  stroke: rgba(8, 38, 92, 0.74);
  stroke-width: 0.7;
}

.autocad-lot-shape.status-vendido,
.autocad-lot-shape.status-reservado,
.autocad-lot-shape.status-mora,
.autocad-lot-shape.status-bloqueado {
  fill: var(--lot-color);
  fill-opacity: 0.1;
  stroke: var(--lot-color);
  stroke-width: 2;
}

.autocad-lot-shape.dimmed {
  opacity: 0.14;
}

.autocad-lot-number {
  fill: #08265c;
  font-size: 4px;
  font-weight: 900;
  letter-spacing: 0;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 1.35px;
  vector-effect: non-scaling-stroke;
}

.autocad-lot-number.dimmed {
  opacity: 0.2;
}

.autocad-lot-shape:hover,
.autocad-lot-shape:focus-visible {
  fill: #ffbd00;
  fill-opacity: 0.16;
  stroke: #ffbd00;
  stroke-width: 2.4;
  outline: none;
}

.autocad-lot {
  position: absolute;
  width: 38px;
  height: 18px;
  border-radius: 4px;
  background: transparent !important;
  opacity: 1;
  transform-origin: left center;
}

.autocad-lot span {
  display: none;
}

.autocad-lot::after {
  content: "";
  position: absolute;
  right: -5px;
  top: -5px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--lot-color);
  border: 1px solid #fff;
  box-shadow: 0 1px 4px rgba(8, 38, 92, 0.28);
}

.map-lot.autocad-lot.status-disponible::after {
  display: none;
}

.autocad-lot:hover,
.autocad-lot:focus-visible {
  opacity: 1;
  outline: 3px solid #ffbd00;
  outline-offset: 2px;
}

.road {
  position: absolute;
  display: grid;
  place-items: center;
  border: 1px solid #d8e2f1;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.95) 0,
    rgba(255, 255, 255, 0.95) 30px,
    rgba(232, 238, 249, 0.95) 30px,
    rgba(232, 238, 249, 0.95) 60px
  );
  color: #607292;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  z-index: 1;
}

.road-top {
  left: 260px;
  top: 235px;
  width: 910px;
  height: 54px;
  transform: rotate(29deg);
}

.road-center {
  left: 160px;
  top: 505px;
  width: 1080px;
  height: 68px;
  transform: rotate(29deg);
}

.road-lower {
  left: 95px;
  top: 770px;
  width: 1125px;
  height: 62px;
  transform: rotate(29deg);
}

.road-bottom {
  left: 245px;
  top: 1088px;
  width: 870px;
  height: 58px;
  transform: rotate(29deg);
}

.road-access {
  left: 1155px;
  top: 350px;
  width: 790px;
  height: 62px;
  transform: rotate(109deg);
}

.green-area {
  position: absolute;
  display: grid;
  place-items: center;
  border: 1px dashed #7fa1d8;
  background: rgba(8, 38, 92, 0.08);
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  z-index: 2;
}

.green-one {
  left: 650px;
  top: 485px;
  width: 170px;
  height: 110px;
  transform: rotate(29deg);
}

.green-two {
  left: 840px;
  top: 530px;
  width: 160px;
  height: 105px;
  transform: rotate(29deg);
}

.green-three {
  left: 375px;
  top: 1035px;
  width: 185px;
  height: 95px;
  transform: rotate(29deg);
}

.green-four {
  left: 680px;
  top: 785px;
  width: 165px;
  height: 96px;
  transform: rotate(29deg);
}

.green-five {
  left: 1010px;
  top: 655px;
  width: 135px;
  height: 92px;
  transform: rotate(29deg);
}

.block-group {
  position: absolute;
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid rgba(8, 38, 92, 0.12);
  background: rgba(255, 255, 255, 0.86);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(8, 38, 92, 0.12);
  transform-origin: left top;
  z-index: 5;
}

.block-label {
  color: var(--primary);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
}

.block-label span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}

.block-lots {
  display: grid;
  grid-auto-rows: 48px;
  gap: 7px;
}

.map-lot {
  display: grid;
  place-items: center;
  width: 86px;
  height: 48px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  color: white;
  border-radius: 5px;
  padding: 0;
  min-height: 0;
  font-size: 12px;
  font-weight: 900;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
  box-shadow: inset 0 0 0 1px rgba(23, 33, 29, 0.12);
}

.map-lot span {
  display: block;
  max-width: 78px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-lot:hover,
.map-lot:focus-visible {
  outline: 3px solid #f5c84c;
  outline-offset: 2px;
  transform: translateY(-1px);
}

.map-lot.dimmed {
  opacity: 0.25;
}

.map-lot.autocad-lot {
  position: absolute;
  display: block;
  width: 38px;
  height: 18px;
  min-height: 0;
  border: 0;
  border-radius: 4px;
  background: transparent !important;
  padding: 0;
  opacity: 1;
  transform-origin: left center;
  box-shadow: none;
}

.map-lot.autocad-lot.status-vendido,
.map-lot.autocad-lot.status-reservado,
.map-lot.autocad-lot.status-mora,
.map-lot.autocad-lot.status-bloqueado {
  box-shadow: inset 0 0 0 2px var(--lot-color), 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.map-lot.autocad-lot span {
  display: none;
}

.map-lot.autocad-lot:hover,
.map-lot.autocad-lot:focus-visible {
  opacity: 1;
  outline: 3px solid #ffbd00;
  outline-offset: 2px;
  transform: inherit;
}

.lot-info {
  display: grid;
  gap: 12px;
}

.lot-info-main {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f9fbfa;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.lot-info-main span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.lot-info-main strong {
  font-size: 16px;
}

.payment-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.payment-toolbar {
  align-items: stretch;
}

.payment-toolbar input,
.payment-toolbar select {
  min-width: 150px;
}

.payment-main-panel {
  grid-column: 1 / -1;
}

.payment-calendar-panel {
  margin-bottom: 14px;
}

.payment-calendar {
  display: grid;
  gap: 12px;
}

.payment-calendar-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.payment-calendar-controls > div:first-child {
  display: grid;
  gap: 2px;
}

.payment-calendar-controls span,
.payment-calendar-month-summary span,
.payment-day-detail-head span,
.payment-day-payment span,
.payment-day-payment small {
  color: var(--muted);
}

.payment-calendar-controls strong {
  color: var(--primary);
  font-size: 22px;
  text-transform: capitalize;
}

.calendar-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.payment-calendar-month-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.payment-calendar-month-summary span {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8faff;
  padding: 0 12px;
  font-weight: 800;
}

.payment-calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.65fr);
  gap: 14px;
  align-items: start;
}

.payment-calendar-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.payment-weekday {
  min-height: 36px;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f8faff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.payment-weekday:nth-child(7) {
  border-right: 0;
}

.payment-calendar-day {
  min-height: 118px;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  align-content: start;
  gap: 4px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #ffffff;
  padding: 8px;
  text-align: left;
  color: var(--ink);
}

.payment-calendar-day:nth-child(7n) {
  border-right: 0;
}

.payment-calendar-day.empty {
  min-height: 118px;
  background: #f5f7fb;
}

.payment-calendar-day strong {
  color: var(--primary);
  font-size: 13px;
}

.payment-calendar-day small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.calendar-day-number {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: var(--primary);
  font-weight: 900;
}

.payment-calendar-day.today .calendar-day-number {
  background: var(--primary);
  color: #ffffff;
}

.payment-calendar-day.selected {
  position: relative;
  z-index: 1;
  box-shadow: inset 0 0 0 2px var(--accent);
  background: #fffaf0;
}

.payment-calendar-day.pending {
  background: #fffdf7;
}

.payment-calendar-day.late {
  background: #fff7f7;
}

.payment-calendar-day.paid {
  background: #f6fff9;
}

.calendar-event-lines {
  display: grid;
  gap: 3px;
  margin-top: 2px;
}

.calendar-event-lines span {
  overflow: hidden;
  border-radius: 999px;
  background: rgba(8, 38, 92, 0.08);
  padding: 3px 6px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-calendar-day.late .calendar-event-lines span {
  background: rgba(211, 57, 48, 0.1);
  color: var(--red);
}

.payment-calendar-day.paid .calendar-event-lines span {
  background: rgba(29, 138, 78, 0.1);
  color: var(--green);
}

.payment-day-detail {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.payment-day-detail-head {
  display: grid;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.payment-day-detail-head strong {
  color: var(--primary);
  text-transform: capitalize;
}

.payment-day-list {
  display: grid;
  gap: 8px;
}

.payment-day-payment {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  background: #f8faff;
  padding: 10px;
}

.payment-day-payment.late {
  border-left-color: var(--red);
  background: #fff7f7;
}

.payment-day-payment.paid {
  border-left-color: var(--green);
  background: #f6fff9;
}

.payment-day-payment > div:first-child {
  display: grid;
  gap: 3px;
}

.payment-day-payment strong {
  color: var(--primary);
}

.payment-day-amount {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.payment-day-amount button {
  min-height: 32px;
  padding: 0 10px;
}

.payment-calendar-card {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--primary);
  border-radius: 8px;
  background: #ffffff;
}

.payment-calendar-card.pending {
  border-top-color: var(--red);
}

.payment-calendar-card.paid {
  border-top-color: var(--green);
}

.payment-calendar-card.cash-only {
  border-top-color: var(--accent);
}

.payment-calendar-card span,
.payment-calendar-card small {
  color: var(--muted);
}

.payment-calendar-card strong {
  color: var(--primary);
  font-size: 18px;
}

.payment-list-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.payment-list-summary span,
.payment-list-summary strong {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8faff;
  padding: 0 12px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
}

.payment-list-summary strong {
  background: var(--primary);
  color: #ffffff;
}

.payment-collection-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}

.payment-collection-summary div {
  min-width: 0;
  display: grid;
  gap: 3px;
  border-left: 3px solid var(--accent);
  background: #f8faff;
  border-radius: 6px;
  padding: 8px 10px;
}

.payment-collection-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.payment-collection-summary strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--primary);
  font-size: 14px;
}

.payment-target-selector {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faff;
  padding: 12px;
}

.payment-target-head {
  display: grid;
  gap: 3px;
}

.payment-target-head.compact {
  padding-top: 4px;
}

.payment-target-head strong {
  color: var(--primary);
}

.payment-target-head span,
.payment-target-info span,
.payment-target-info small,
.payment-target-summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.payment-target-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.payment-target-actions button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.payment-target-list {
  display: grid;
  gap: 8px;
  max-height: 270px;
  overflow: auto;
  padding-right: 4px;
}

.payment-other-toggle {
  width: 100%;
  min-height: 40px;
  border-style: dashed;
  background: #ffffff;
  color: var(--primary);
  font-weight: 850;
}

.payment-other-section {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.payment-other-section[hidden] {
  display: none;
}

.payment-target-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
  cursor: pointer;
}

.payment-target-row.late {
  border-left-color: var(--red);
}

.payment-target-row input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 2px 0 0;
  padding: 0;
  accent-color: var(--primary);
}

.payment-target-info {
  display: grid;
  gap: 3px;
}

.payment-target-info strong {
  color: var(--primary);
}

.payment-target-preview {
  color: var(--primary) !important;
}

.payment-target-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.payment-target-summary span,
.payment-target-summary small {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  padding: 0 10px;
}

.payment-target-summary small {
  width: 100%;
  border-radius: 8px;
  padding: 8px 10px;
  line-height: 1.35;
}

.payment-group {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faff;
}

.payment-group-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: var(--primary);
}

.payment-group-head span {
  color: var(--muted);
  font-size: 13px;
}

.payment-record {
  display: grid;
  grid-template-columns: minmax(180px, 1.35fr) repeat(4, minmax(110px, 0.8fr)) minmax(95px, 0.7fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 8px;
  background: white;
}

.payment-record span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.payment-record strong {
  font-size: 14px;
}

.payment-main strong {
  display: block;
  color: var(--primary);
}

.payment-amount strong {
  font-size: 16px;
  color: var(--primary);
}

.payment-late {
  border-left-color: var(--red);
}

.payment-pending {
  border-left-color: var(--accent);
}

.payment-paid {
  border-left-color: var(--green);
  opacity: 0.82;
}

.cash-grid {
  align-items: start;
}

.cash-toolbar {
  align-items: stretch;
  display: grid;
  grid-template-columns: minmax(240px, 1.1fr) minmax(220px, 0.8fr) minmax(260px, 1fr);
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  padding: 8px;
}

.toolbar-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.toolbar-month-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.toolbar-month-field input {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--primary);
  font-weight: 850;
}

.cash-section-panel {
  margin-bottom: 14px;
}

.cash-section-panel .panel-head {
  align-items: flex-start;
}

.cash-section-panel .panel-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.cash-summary-panel {
  border-top: 5px solid var(--primary);
}

.cash-report-panel {
  border-top: 5px solid var(--accent);
}

.cash-summary-metrics {
  margin-bottom: 0;
}

.cash-report-metrics {
  margin-bottom: 12px;
}

.cash-report-chart {
  margin-bottom: 14px;
}

.cash-report-chart-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.cash-report-chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.cash-report-chart-head h3 {
  margin: 0;
  font-size: 15px;
}

.cash-report-chart-head span,
.cash-chart-legend span,
.cash-report-lot-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.cash-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

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

.cash-chart-legend i {
  width: 20px;
  height: 4px;
  border-radius: 999px;
}

.cash-chart-legend .income {
  background: var(--green);
}

.cash-chart-legend .expense {
  background: var(--red);
}

.cash-chart-legend .collection {
  background: var(--accent);
}

.cash-line-chart {
  width: 100%;
  height: auto;
  min-height: 160px;
}

.cash-line-chart line {
  stroke: var(--line);
  stroke-width: 2;
}

.cash-line-chart polyline {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cash-line-chart text {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.income-line,
.income-dot {
  stroke: var(--green);
  fill: var(--green);
}

.expense-line,
.expense-dot {
  stroke: var(--red);
  fill: var(--red);
}

.collection-line,
.collection-dot {
  stroke: var(--accent);
  fill: var(--accent);
}

.income-line,
.expense-line,
.collection-line {
  fill: none;
}

.cash-report-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.cash-report-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faff;
  padding: 12px;
}

.cash-report-box h3,
.cash-report-subhead h3 {
  margin: 0;
  font-size: 15px;
}

.cash-report-row {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}

.cash-report-row div:first-child,
.cash-report-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cash-report-row span,
.cash-report-subhead span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.cash-report-row strong {
  color: var(--primary);
  white-space: nowrap;
}

.cash-report-subhead {
  margin: 8px 0 10px;
}

.cash-report-movements {
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.cash-report-lot-payments {
  display: grid;
  gap: 10px;
  max-height: 330px;
  overflow: auto;
  padding-right: 4px;
  margin-bottom: 14px;
}

.cash-report-lot-card {
  border: 1px solid var(--line);
  border-left: 5px solid var(--primary);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}

.cash-report-lot-head,
.cash-report-lot-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.cash-report-lot-head {
  align-items: center;
  margin-bottom: 8px;
}

.cash-report-lot-head strong,
.cash-report-lot-row strong {
  color: var(--primary);
}

.cash-report-lot-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.cash-report-lot-row {
  align-items: flex-start;
  border-top: 1px solid var(--line);
  padding-top: 8px;
  margin-top: 8px;
}

.cash-report-lot-row span,
.cash-report-lot-row small {
  display: block;
}

.cash-report-lot-row span {
  color: var(--ink);
  font-weight: 800;
}

.cash-report-movement {
  align-items: start;
  border-left: 5px solid var(--green);
}

.recurring-alert-panel,
.recurring-panel,
.recurring-calendar-panel {
  margin-top: 14px;
}

.recurring-record {
  border-left: 5px solid var(--primary);
}

.recurring-grid {
  margin-top: 14px;
}

.recurring-payment-card.overdue,
.recurring-payment-card.today {
  border-left-color: var(--red);
  background: #fff7f7;
}

.recurring-payment-card.soon,
.recurring-payment-card.pending {
  border-left-color: var(--accent);
  background: #fffdf4;
}

.recurring-payment-card.paid {
  border-left-color: var(--green);
  background: #f6fff9;
}

.recurring-history-record {
  border-left: 5px solid var(--accent);
}

.record-muted {
  opacity: 0.78;
  border-left-color: var(--muted);
  background: #f6f7f9;
}

.recurring-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8faff;
  padding: 0 10px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 850;
}

.recurring-overdue,
.recurring-today {
  border-color: rgba(201, 64, 53, 0.35);
  background: rgba(201, 64, 53, 0.1);
  color: var(--red);
}

.recurring-soon {
  border-color: rgba(255, 189, 0, 0.45);
  background: rgba(255, 189, 0, 0.16);
  color: var(--primary);
}

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

.recurring-pending {
  border-color: rgba(255, 189, 0, 0.45);
  background: rgba(255, 189, 0, 0.12);
}

.recurring-paid {
  border-color: rgba(29, 138, 78, 0.35);
  background: rgba(29, 138, 78, 0.1);
  color: var(--green);
}

.cash-panel .panel-head strong {
  color: var(--muted);
  font-size: 13px;
}

.cash-records {
  max-height: 560px;
  overflow: auto;
  padding-right: 4px;
}

.cash-record {
  border-left: 5px solid var(--green);
  align-items: start;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 12px;
}

.cash-expense-record {
  border-left-color: var(--red);
}

.cash-record-main {
  min-width: 0;
}

.cash-record-main p {
  color: var(--ink);
  font-weight: 650;
}

.cash-record-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.mini-action {
  width: fit-content;
  min-height: 30px;
  margin-top: 8px;
  padding: 0 10px;
  font-size: 12px;
}

.cash-record-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8faff;
  padding: 0 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.cash-record-amount {
  color: var(--primary);
  white-space: nowrap;
}

.cash-record-side {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.cash-record-actions {
  justify-content: flex-end;
}

.cash-expense-record .cash-record-amount {
  color: var(--red);
}

.cash-income-record .cash-record-amount {
  color: var(--green);
}

.cash-income-panel .panel-head h2 {
  color: var(--green);
}

.cash-expense-panel .panel-head h2 {
  color: var(--red);
}

.quote-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(320px, 1.15fr);
  gap: 16px;
}

.sell-layout {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(320px, 0.82fr);
  gap: 16px;
}

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

.quote-card {
  border: 1px solid var(--line);
  background: #f8faff;
  border-radius: 8px;
  padding: 12px;
}

.quote-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.quote-card strong {
  font-size: 19px;
}

.quote-message {
  width: 100%;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font: inherit;
  resize: vertical;
}

.summary-box {
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  padding: 12px;
}

.summary-box span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.summary-box strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

.period-label {
  margin: 0 0 14px;
  color: var(--muted);
  font-weight: 800;
}

.accounts-toolbar input[type="date"] {
  min-width: 160px;
}

.accounts-toolbar input:disabled {
  color: var(--muted);
  background: #f4f7fb;
}

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

.accounts-visual-panel {
  margin-bottom: 16px;
  border-top: 5px solid var(--accent);
}

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

.accounts-chart-card {
  display: grid;
  gap: 10px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faff;
  padding: 12px;
  overflow: hidden;
}

.accounts-chart-wide {
  grid-column: 1 / -1;
  background: #ffffff;
  overflow-x: auto;
}

.accounts-chart-card h3,
.accounts-table-box h3 {
  margin: 0;
  color: var(--primary);
  font-size: 15px;
}

.report-chart-row {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}

.report-chart-row div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.report-chart-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.report-chart-row strong {
  color: var(--primary);
  white-space: nowrap;
}

.report-stacked-bar {
  display: flex;
  width: 100%;
  height: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #eaf0fa;
}

.report-stacked-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.report-stacked-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  padding: 0 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.report-stacked-legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.accounts-personal-panel {
  grid-column: 1 / -1;
}

.accounts-detail-panel {
  margin-top: 16px;
  border-top: 5px solid var(--primary);
}

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

.accounts-table-box {
  min-width: 0;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faff;
  padding: 12px;
}

.report-table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.report-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

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

.report-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--primary);
  color: #ffffff;
  font-size: 12px;
  text-transform: uppercase;
}

.report-table td {
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.report-table tr:last-child td {
  border-bottom: 0;
}

.report-list {
  display: grid;
  gap: 8px;
}

.report-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8faff;
  padding: 8px 10px;
}

.report-row span {
  color: var(--muted);
  font-size: 13px;
}

.report-row strong {
  color: var(--primary);
  text-align: right;
}

dialog {
  border: 0;
  border-radius: 8px;
  padding: 0;
  width: min(720px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
}

dialog::backdrop {
  background: rgba(13, 24, 20, 0.45);
}

.modal-card {
  padding: 18px;
  max-height: calc(100vh - 24px);
  overflow: auto;
}

.modal-card .panel-head {
  align-items: flex-start;
}

.modal-card .panel-head h2 {
  min-width: 0;
  line-height: 1.2;
}

.modal-card .icon-button {
  flex: 0 0 36px;
}

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

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

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

.field label {
  color: var(--muted);
  font-size: 13px;
}

.field textarea {
  width: 100%;
  min-width: 0;
  min-height: 92px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
}

.field input,
.field select {
  width: 100%;
  min-width: 0;
}

.field input[type="file"] {
  height: auto;
  min-height: 42px;
  padding: 8px 10px;
  line-height: 1.35;
}

menu {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 0 0;
  margin: 0;
}

menu button {
  min-width: 120px;
}

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 60;
    height: auto;
    padding: 14px;
    gap: 12px;
    width: 100%;
    overflow: hidden;
  }

  .brand-logo {
    width: 46px;
    height: 46px;
  }

  .sidebar-note {
    display: none;
  }

  .nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    max-width: 100%;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .nav-button {
    flex: 0 0 auto;
    width: auto;
    min-width: 120px;
    text-align: center;
    white-space: nowrap;
  }

  .metrics, .metrics.narrow, .grid.two, .payment-summary, .quote-layout, .sell-layout, .lot-status-grid, .accounts-grid, .accounts-chart-grid, .accounts-table-grid, .cash-toolbar {
    grid-template-columns: 1fr 1fr;
  }

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

  .shell {
    padding: 18px;
  }

  .topbar {
    align-items: flex-start;
  }

  .toolbar input,
  .toolbar select,
  .toolbar button,
  .toolbar .file-button {
    flex: 1 1 180px;
  }

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

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

  .interactive-stage {
    height: 68vh;
  }
}

@media (max-width: 760px) {
  .metrics,
  .metrics.narrow,
  .lot-status-grid,
  .payment-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .toolbar {
    gap: 8px;
  }

  .dashboard-toolbar {
    align-items: stretch;
  }

  .dashboard-month-picker {
    flex: 1 1 320px;
    width: 100%;
  }

  .month-picker-popover {
    width: min(310px, calc(100vw - 34px));
  }

  button,
  .file-button,
  input,
  select {
    min-height: 44px;
  }

  .record,
  .metric,
  .panel {
    box-shadow: 0 10px 24px rgba(8, 38, 92, 0.08);
  }

  .sale-lot-term-card {
    grid-template-columns: 1fr;
  }

  .client-lot-account-row {
    grid-template-columns: 1fr;
  }

  .payment-calendar-controls {
    align-items: flex-start;
    flex-direction: column;
  }

  .calendar-nav {
    justify-content: flex-start;
  }

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

  .payment-day-amount {
    justify-items: start;
  }
}

@media (max-width: 640px) {
  body {
    min-width: 0;
    display: block;
    padding-bottom: 86px;
    background: #eef3fb;
  }

  .portal-screen {
    padding: 14px;
  }

  .shell {
    padding: 12px 12px 18px;
  }

  .topbar {
    position: sticky;
    top: 82px;
    z-index: 40;
    align-items: center;
    flex-direction: row;
    min-height: 58px;
    margin: -2px 0 12px;
    border: 1px solid rgba(217, 226, 242, 0.86);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    padding: 10px 12px;
    box-shadow: 0 12px 28px rgba(8, 38, 92, 0.08);
    backdrop-filter: blur(12px);
  }

  .topbar .actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 23px;
  }

  h2 {
    font-size: 16px;
  }

  .panel {
    padding: 13px;
    border-radius: 8px;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .record {
    grid-template-columns: 1fr;
    align-items: stretch;
    border-radius: 8px;
    padding: 12px;
  }

  .record-actions {
    justify-content: flex-start;
  }

  .metrics, .metrics.narrow, .grid.two, .payment-summary, .form-grid, .lot-info-main, .quote-layout, .sell-layout, .lot-status-grid, .quote-result, .permission-grid, .accounts-grid, .accounts-chart-grid, .accounts-table-grid, .plan-document-grid, .cash-toolbar, .cash-report-layout, .client-view-grid {
    grid-template-columns: 1fr;
  }

  .toolbar-group {
    align-items: stretch;
  }

  .toolbar-label {
    flex-basis: 100%;
  }

  .cash-records {
    max-height: 430px;
  }

  .cash-record {
    grid-template-columns: 1fr;
  }

  .cash-record-amount {
    justify-self: flex-start;
  }

  .cash-record-side {
    justify-items: start;
  }

  .cash-record-actions {
    justify-content: flex-start;
  }

  .metric strong {
    font-size: 20px;
  }

  .payment-calendar-month-grid {
    overflow-x: auto;
  }

  .payment-weekday {
    min-width: 78px;
    min-height: 32px;
  }

  .payment-calendar-day,
  .payment-calendar-day.empty {
    min-width: 78px;
    min-height: 84px;
    padding: 6px;
  }

  .payment-calendar-day strong {
    font-size: 11px;
  }

  .payment-calendar-day small,
  .calendar-event-lines span {
    font-size: 10px;
  }

  .calendar-event-lines span:nth-child(n + 2) {
    display: none;
  }

  .brand {
    align-items: center;
    min-width: 0;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 70;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 189, 0, 0.24);
    box-shadow: 0 14px 30px rgba(4, 24, 61, 0.2);
  }

  .sidebar.nav-open {
    max-height: calc(100vh - 74px);
    overflow-y: auto;
  }

  .brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 8px;
  }

  .brand strong {
    font-size: 15px;
  }

  .brand span {
    font-size: 12px;
  }

  .mobile-nav-toggle {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 12px;
    border-color: rgba(255, 189, 0, 0.55);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    text-align: left;
  }

  .company-switcher {
    display: none !important;
  }

  .mobile-nav-toggle span {
    color: var(--accent);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .mobile-nav-toggle strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
  }

  .mobile-nav-toggle::after {
    content: "+";
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    grid-column: 3;
    border-radius: 50%;
    background: rgba(255, 189, 0, 0.18);
    color: var(--accent);
    font-weight: 900;
  }

  .sidebar.nav-open .mobile-nav-toggle::after {
    content: "-";
  }

  .nav {
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin: 0;
    overflow: visible;
    max-height: 52vh;
    padding: 2px 0 4px;
    overflow-y: auto;
  }

  .sidebar.nav-open .nav {
    display: grid;
  }

  .sidebar.nav-open .sidebar-note {
    display: grid;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 189, 0, 0.24);
  }

  .sidebar.nav-open .sidebar-note span {
    padding-top: 0;
    font-size: 12px;
  }

  .sidebar.nav-open #logoutButton {
    min-height: 38px;
  }

  .nav-button {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 0 10px;
    font-size: 13px;
    white-space: normal;
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
  }

  .mobile-quick-nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 90;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
    border: 1px solid rgba(255, 255, 255, 0.38);
    border-radius: 8px;
    background: rgba(4, 24, 61, 0.94);
    padding: 7px;
    box-shadow: 0 18px 40px rgba(4, 24, 61, 0.32);
    backdrop-filter: blur(14px);
  }

  .mobile-quick-button {
    min-width: 0;
    min-height: 46px;
    border-color: transparent;
    border-radius: 7px;
    background: transparent;
    color: #d9e6ff;
    padding: 0 4px;
    font-size: 11px;
    font-weight: 850;
  }

  .mobile-quick-button.active {
    background: var(--accent);
    color: var(--primary);
  }

  .mobile-quick-button span {
    display: block;
    overflow: visible;
    line-height: 1.05;
    white-space: normal;
  }

  .actions,
  .toolbar {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .toolbar input,
  .toolbar select,
  .toolbar button,
  .toolbar .file-button {
    width: 100%;
    min-width: 0;
  }

  .backup-main-button,
  .backup-restore .file-button {
    width: 100%;
  }

  .inline-picker {
    grid-template-columns: 1fr;
  }

  .portal-card {
    width: 100%;
    max-height: calc(100vh - 28px);
    padding: 20px;
  }

  .welcome-card {
    min-height: min(430px, calc(100vh - 28px));
  }

  .portal-logo {
    width: 104px;
    height: 104px;
  }

  .welcome-logo {
    width: 132px;
    height: 132px;
  }

  .company-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .company-card {
    min-height: 92px;
  }

  .lot-card-grid {
    grid-template-columns: 1fr;
  }

  .lot-card-money {
    grid-template-columns: 1fr;
  }

  .section-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .payment-toolbar input,
  .payment-toolbar select,
  .payment-toolbar button {
    width: 100%;
  }

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

  .payment-target-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .payment-target-actions button {
    width: 100%;
  }

  .payment-target-list {
    max-height: 230px;
  }

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

  .payment-target-summary span,
  .payment-target-summary small {
    width: 100%;
    justify-content: space-between;
    border-radius: 8px;
  }

  .cash-report-chart-head,
  .cash-report-lot-head,
  .cash-report-lot-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .cash-line-chart {
    min-width: 420px;
  }

  .cash-report-chart-box,
  .accounts-chart-wide {
    overflow-x: auto;
  }

  .report-table {
    min-width: 560px;
  }

  .plan-document-card {
    grid-template-columns: 1fr;
  }

  .payment-group-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .cash-grid,
  .payment-grid {
    gap: 12px;
  }

  .quote-message {
    min-height: 170px;
  }

  .map-panel {
    padding: 12px;
  }

  .map-panel .panel-head {
    gap: 10px;
  }

  .map-panel .panel-head .actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px 44px;
    gap: 8px;
  }

  #exportPlanPdf {
    grid-column: 1 / -1;
  }

  #planPdfStatus {
    grid-column: 1 / -1;
    align-self: center;
    justify-self: start;
    min-height: 18px;
    font-size: 12px;
    text-align: left;
  }

  #planPdfStatus:empty {
    display: none;
  }

  #mapStatusFilter {
    grid-column: 1 / 2;
    min-width: 0;
  }

  #zoomOut,
  #zoomIn {
    width: 44px;
    min-width: 44px;
    padding: 0;
    font-size: 16px;
    font-weight: 900;
  }

  .map-legend {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    margin: 0 0 10px;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .legend-item,
  .legend-count {
    flex: 0 0 auto;
    min-height: 30px;
    padding: 0 9px;
    font-size: 12px;
  }

  dialog {
    width: calc(100vw - 18px);
    max-height: calc(100vh - 18px);
  }

  .modal-card {
    max-height: calc(100vh - 18px);
    overflow: auto;
    padding: 14px;
  }

  menu {
    display: grid;
    grid-template-columns: 1fr;
  }

  .interactive-stage {
    height: 52vh;
    min-height: 390px;
    padding: 8px;
    overscroll-behavior: contain;
  }
}

@media (max-width: 420px) {
  .metrics {
    gap: 8px;
  }

  .metric,
  .summary-box,
  .quote-card {
    padding: 10px;
  }

  .payment-summary {
    gap: 8px;
  }
}
