﻿:root {
  --bg: #fffbea;
  --surface: #ffffff;
  --line: #eadfbd;
  --text: #17202a;
  --muted: #657282;
  --primary: #ffd400;
  --primary-dark: #f5b700;
  --red: #dc2626;
  --amber: #b7791f;
  --green: #15803d;
  --blue: #0f766e;
  --orange: #c2410c;
  --gray: #64748b;
  font-family: Inter, "Segoe UI", Tahoma, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  padding: 7px 11px;
  cursor: pointer;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  padding: 7px 11px;
  text-decoration: none;
  width: fit-content;
}

button:hover {
  border-color: var(--primary);
}

.table-action-button {
  min-height: 28px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
}

.primary,
.button-link.primary {
  background: var(--primary);
  color: #2f2300;
  border-color: var(--primary);
  font-weight: 700;
}

.primary:hover,
.button-link.primary:hover {
  background: var(--primary-dark);
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: #fff8d6;
  color: #2f2300;
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid #f1d36a;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 6px 8px 18px;
  border-bottom: 1px solid #efd36c;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: #ffe100;
  color: #3a2800;
  border-radius: 8px;
  font-weight: 800;
}

.brand small {
  display: block;
  color: #7c5a00;
  margin-top: 2px;
}

nav {
  display: grid;
  gap: 4px;
  padding-top: 14px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  color: #3f2f08;
  background: transparent;
  border-color: transparent;
  padding: 10px 12px;
}

.nav-group {
  display: grid;
  gap: 3px;
}

.nav-module {
  margin-top: 8px;
}

.nav-parent {
  font-weight: 700;
}

.nav-module-parent {
  background: rgba(15, 118, 110, 0.12);
  border-color: rgba(15, 118, 110, 0.12);
  color: #0f3f35;
}

.nav-caret {
  margin-left: auto;
  color: #7c5a00;
  font-size: 12px;
}

.nav-submenu {
  display: grid;
  gap: 3px;
  padding-left: 18px;
}

.nav-subgroup {
  display: grid;
  gap: 2px;
  padding-left: 6px;
  border-left: 1px solid rgba(15, 118, 110, 0.16);
}

.nav-section-title {
  min-height: 34px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 800;
  color: #214c43;
}

.nav-section-title .nav-icon {
  width: 20px;
  height: 20px;
}

.nav-submenu-nested {
  padding-left: 18px;
  gap: 2px;
}

.nav-subitem {
  min-height: 32px;
  padding: 8px 10px;
  font-size: 13px;
}

.nav-subitem .nav-icon {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  font-size: 11px;
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 6px;
  background: rgba(255, 212, 0, 0.32);
  color: #6b4d00;
  font-weight: 800;
  line-height: 1;
}

.nav-item:hover,
.nav-item.active {
  color: #2f2300;
  background: #ffd400;
  border-color: #eab308;
  box-shadow: 0 1px 0 rgba(47, 35, 0, 0.08);
}

.nav-item.active .nav-icon {
  background: #fff8d6;
}

.main {
  min-width: 0;
}

.topbar {
  height: 64px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 3;
}

.global-search {
  margin-right: auto;
  width: min(520px, 100%);
}

.global-search span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 36px;
  padding: 7px 10px;
  background: #fff;
  color: var(--text);
}

textarea {
  min-height: 84px;
  resize: vertical;
}

.icon-button {
  width: 38px;
  padding: 0;
}

.user-menu {
  font-weight: 600;
}

.page-header {
  display: flex;
  gap: 18px;
  justify-content: space-between;
  align-items: flex-start;
  padding: 26px 24px 18px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
  line-height: 1.2;
  color: #b45309;
}

h2 {
  font-size: 17px;
  color: #0f766e;
}

.page-header h1 {
  display: inline-block;
  padding-bottom: 4px;
  border-bottom: 4px solid #ffd400;
}

.kpi-card:nth-child(4n + 1) strong,
.panel:nth-of-type(4n + 1) h2 {
  color: #d97706;
}

.kpi-card:nth-child(4n + 2) strong,
.panel:nth-of-type(4n + 2) h2 {
  color: #0f766e;
}

.kpi-card:nth-child(4n + 3) strong,
.panel:nth-of-type(4n + 3) h2 {
  color: #2563eb;
}

.kpi-card:nth-child(4n + 4) strong,
.panel:nth-of-type(4n + 4) h2 {
  color: #dc2626;
}

.page-header p {
  margin-top: 7px;
  color: var(--muted);
}

.status-banner {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 16px 24px 0;
  padding: 10px 12px;
  border: 1px solid #ffd400;
  border-radius: 8px;
  background: #fff7cc;
  color: #92400e;
  font-size: 13px;
}

.status-banner span {
  color: #a16207;
}

.header-actions,
.modal-actions,
.table-footer div {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.add-action-menu {
  position: relative;
}

.add-action-menu summary {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 15px;
  border-radius: 8px;
  background: #0f766e;
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.add-action-menu summary::-webkit-details-marker {
  display: none;
}

.add-action-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 12;
  width: 220px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
}

.add-action-list button {
  width: 100%;
  justify-content: flex-start;
  border-color: transparent;
  background: transparent;
  color: #0f3f36;
}

.add-action-list button:hover {
  background: #ecfdf5;
  border-color: #bbf7d0;
}

.leasing-add-modal {
  width: min(680px, 100%);
}

.rental-unit-detail-modal {
  width: min(940px, 100%);
}

.rental-unit-detail-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
}

.rental-unit-photo {
  min-height: 300px;
  padding: 18px;
  border-radius: 8px;
  border: 1px solid rgba(15, 118, 110, 0.16);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.1), rgba(255, 255, 255, 0.74)),
    repeating-linear-gradient(45deg, rgba(15, 118, 110, 0.08) 0 10px, rgba(255, 255, 255, 0.26) 10px 20px);
  display: grid;
  align-content: end;
  gap: 8px;
}

.rental-unit-photo.has-image {
  padding: 0;
  overflow: hidden;
  background: #f8fafc;
}

.rental-unit-photo img {
  width: 100%;
  height: 100%;
  min-height: 300px;
  display: block;
  object-fit: cover;
}

.rental-unit-photo span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.rental-unit-photo strong {
  color: #073b32;
  font-size: 24px;
  line-height: 1.1;
}

.rental-unit-photo small {
  color: #0f766e;
  font-weight: 700;
}

.rental-unit-detail-body {
  min-width: 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detail-grid div {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.detail-grid span,
.detail-grid strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.detail-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.detail-grid strong {
  margin-top: 5px;
  color: #0f172a;
  font-size: 14px;
}

.rental-unit-detail-actions {
  margin-top: 14px;
}

.unit-link-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #dcebe5;
  border-radius: 8px;
  background: #f8fffb;
}

.unit-link-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.unit-link-summary strong {
  padding: 4px 8px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0f513f;
  font-size: 12px;
}

.rental-unit-link-actions {
  margin-top: 10px;
}

.danger-button {
  border-color: #fecaca;
  background: #fff1f2;
  color: #b91c1c;
}

.filter-band,
.kpi-grid,
.dashboard-summary,
.project-grid,
.project-section,
.apartment-legend,
.asset-ledger-grid,
.module-dashboard-grid,
.dashboard-grid,
.operational-notice-layout,
.table-panel,
.panel,
.import-grid,
.tabs,
.empty-state {
  margin: 0 24px 18px;
}

.filter-band {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 10px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.section-search-tools {
  grid-template-columns: minmax(280px, 1.4fr) minmax(260px, 1fr) auto;
  align-items: end;
}

.section-search-tools.no-meta {
  grid-template-columns: minmax(280px, 1fr) auto;
}

.section-search-input {
  min-width: 0;
}

.section-search-meta {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.section-search-meta strong {
  color: var(--text);
  font-size: 13px;
}

.section-search-meta div {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.section-search-meta span,
.section-search-field {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffdf2;
  color: #5f4b12;
}

.section-search-field {
  appearance: none;
  cursor: pointer;
  min-height: 26px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
}

.section-search-field:hover,
.section-search-field:focus-visible {
  border-color: rgba(15, 118, 110, 0.35);
  background: #f0fdfa;
  color: #0f5948;
}

.section-search-field.active,
.section-search-field[aria-pressed="true"] {
  border-color: rgba(15, 118, 110, 0.35);
  background: #dff6ed;
  color: #0f5948;
  font-weight: 700;
}

.section-search-meta .section-search-active {
  border-color: rgba(15, 118, 110, 0.22);
  background: #e7f5ee;
  color: #0f5948;
}

.section-tool-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.section-search-extra {
  display: grid;
  gap: 8px;
  grid-column: 1 / -1;
  min-width: 0;
}

.apartment-detail-filter-band {
  padding: 0;
  gap: 10px;
}

.apartment-detail-column-band {
  padding: 8px 0 0;
  gap: 10px;
  border-top: 1px solid rgba(203, 213, 225, 0.8);
}

.compact-filter-select {
  display: grid;
  gap: 5px;
  min-width: 150px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.compact-filter-select select {
  min-height: 36px;
  padding: 7px 9px;
}

.compact-filter-value {
  min-width: 220px;
}

.apartment-column-band {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 12px 16px;
}

.apartment-column-title {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.apartment-column-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.apartment-column-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 5px 10px 5px 8px;
  border: 1px solid #d8d5cd;
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}

.apartment-column-option:hover {
  border-color: rgba(15, 118, 110, 0.42);
  background: #f8fffb;
}

.apartment-column-option input {
  position: absolute;
  width: 1px;
  min-height: 1px;
  height: 1px;
  opacity: 0;
}

.apartment-column-check {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid #aebbb5;
  border-radius: 5px;
  background: #ffffff;
}

.apartment-column-check::after {
  content: "";
  width: 8px;
  height: 5px;
  border-left: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  transform: rotate(-45deg) scale(0);
  transform-origin: center;
}

.apartment-column-option input:checked + .apartment-column-check {
  border-color: var(--primary);
  background: var(--primary);
}

.apartment-column-option input:checked + .apartment-column-check::after {
  transform: rotate(-45deg) scale(1);
}

.apartment-column-option input:focus-visible + .apartment-column-check {
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.18);
}

.apartment-column-option input:not(:checked) ~ .apartment-column-label {
  color: var(--muted);
}

.check {
  display: flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
  color: var(--muted);
}

.check input {
  width: auto;
  min-height: auto;
}

.permission-table th:not(:first-child),
.permission-table td:not(:first-child) {
  text-align: center;
}

.permission-menu-table {
  min-width: 1680px;
}

.project-permission-table {
  min-width: 1120px;
}

.permission-menu-table th:first-child,
.permission-menu-table th:nth-child(2),
.permission-menu-table td:first-child,
.permission-menu-table td:nth-child(2) {
  text-align: left;
}

.project-permission-table th:first-child,
.project-permission-table th:nth-child(2),
.project-permission-table td:first-child,
.project-permission-table td:nth-child(2) {
  text-align: left;
}

.permission-menu-table td:first-child {
  color: var(--muted);
  font-weight: 700;
}

.permission-role {
  display: grid;
  gap: 4px;
}

.permission-role small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.permission-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 82px;
  font-weight: 700;
  color: var(--text);
}

.permission-toggle input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--primary-dark);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.module-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.module-dashboard-panel {
  min-height: 210px;
}

.module-dashboard-panel .panel-title {
  align-items: flex-start;
}

.module-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.leasing-panel {
  border-left: 5px solid #0f766e;
}

.operations-panel {
  border-left: 5px solid #b7791f;
}

.route-dashboard.operations-hidden .operations-panel,
.route-dashboard.operations-hidden .dashboard-priority .focus-panel:last-child,
.route-dashboard.operations-hidden .dashboard-single {
  display: none;
}

.summary-card {
  min-height: 118px;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  position: relative;
  overflow: hidden;
}

.summary-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
}

.summary-card span,
.summary-card small {
  display: block;
  color: var(--muted);
}

.summary-card strong {
  display: block;
  margin: 10px 0 8px;
  font-size: 24px;
  line-height: 1.15;
}

.summary-card.orange strong {
  color: #d97706;
}

.summary-card.orange::before {
  background: #f59e0b;
}

.summary-card.green strong {
  color: #15803d;
}

.summary-card.green::before {
  background: #22c55e;
}

.summary-card.blue strong {
  color: #0284c7;
}

.summary-card.blue::before {
  background: #0ea5e9;
}

.summary-card.red strong {
  color: #dc2626;
}

.summary-card.red::before {
  background: #ef4444;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.kpi-card,
.project-card,
.panel,
.table-panel,
.upload-box,
.empty-state {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.kpi-card {
  padding: 16px;
  min-height: 92px;
}

.kpi-card span {
  color: var(--muted);
  font-size: 13px;
}

.kpi-card strong {
  display: block;
  margin-top: 10px;
  font-size: 22px;
}

.project-card {
  padding: 16px;
  overflow: hidden;
  position: relative;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
}

.project-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.project-card-head span,
.project-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.project-card-head strong {
  font-size: 18px;
}

.leasing-type-breakdown {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.leasing-type-breakdown span {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.leasing-type-breakdown b,
.leasing-type-breakdown strong {
  display: block;
  min-width: 0;
}

.leasing-type-breakdown b {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.leasing-type-breakdown strong {
  margin-top: 4px;
  color: #0f766e;
  font-size: 18px;
}

.project-card-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.project-card-stats div {
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.75);
}

.project-card-stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.project-card-stats strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

.project-tnt {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #075985;
}

.project-tnt::before,
.project-badge.project-tnt,
.project-card.project-tnt .project-card-head span {
  background: #0284c7;
  color: #ffffff;
}

.project-tn {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.project-tn::before,
.project-badge.project-tn,
.project-card.project-tn .project-card-head span {
  background: #16a34a;
  color: #ffffff;
}

.project-eco {
  background: #fae8ff;
  border-color: #e879f9;
  color: #86198f;
}

.project-eco::before,
.project-badge.project-eco,
.project-card.project-eco .project-card-head span {
  background: #c026d3;
  color: #ffffff;
}

.project-other {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

.project-other::before,
.project-badge.project-other,
.project-card.project-other .project-card-head span {
  background: #64748b;
  color: #ffffff;
}

.project-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.project-section-title {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.7);
}

.project-section-title > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.project-title-group {
  min-width: 0;
  flex-wrap: wrap;
}

.project-section-title h2 {
  margin: 0;
}

.project-section-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
  min-width: 240px;
}

.project-section-actions strong {
  font-size: 14px;
  text-align: right;
}

.project-delete-button {
  min-height: 28px;
  padding: 5px 9px;
  border-color: #fecaca;
  background: #fff1f2;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 800;
}

.project-delete-button:hover {
  background: #fee2e2;
}

.project-type-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-left: 0;
}

.project-type-tab {
  display: inline-grid;
  grid-template-columns: minmax(32px, 1fr) auto;
  align-items: center;
  justify-items: start;
  column-gap: 8px;
  min-width: 78px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  color: #0f513f;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  box-shadow: none;
  white-space: nowrap;
}

.project-type-tab b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  min-width: 24px;
  height: 22px;
  margin-left: 0;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.1);
  color: #0f766e;
  font-size: 12px;
}

.project-type-tab.active {
  border-color: #0f766e;
  background: #0f766e;
  color: #ffffff;
}

.project-type-tab.active b {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.billing-history-action {
  border-color: rgba(14, 165, 233, 0.22);
  color: #075985;
}

.billing-history-action b {
  background: rgba(14, 165, 233, 0.12);
  color: #0369a1;
}

.project-type-empty {
  padding: 18px;
  border: 1px dashed rgba(15, 118, 110, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-weight: 700;
}

.apartment-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.apartment-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.ai-summary-banner {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin: 0 24px 18px;
  padding: 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #0d5748, #1b765f);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(11, 70, 55, 0.22);
}

.ai-summary-banner .ai-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(212, 167, 44, 0.2);
}

.ai-summary-banner .ai-icon .nav-icon {
  background: transparent;
  color: var(--accent);
}

.ai-summary-banner strong {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
  font-size: 15px;
}

.ai-summary-banner strong span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 7px;
  background: var(--accent);
  color: #1c2b23;
  font-size: 12px;
}

.ai-summary-banner p {
  color: #e8fff7;
  line-height: 1.5;
}

.ai-summary-banner b {
  color: #ffe08a;
}

.ai-summary-banner button {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.unit-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.unit-dot.occupied {
  background: #16a34a;
}

.unit-dot.vacant {
  background: #0284c7;
}

.unit-dot.other {
  background: #64748b;
}

.floor-stack {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.62);
}

.floor-row {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.floor-label {
  min-height: 92px;
  padding: 12px 10px;
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-left: 4px solid rgba(15, 118, 110, 0.45);
  border-radius: 8px;
  background: #f8fbfc;
  display: grid;
  align-content: center;
  gap: 5px;
  cursor: default;
  user-select: none;
}

.floor-label strong {
  color: var(--muted);
  font-size: 13px;
}

.floor-label span {
  color: var(--muted);
  font-size: 12px;
}

.unit-map {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 8px;
}

.unit-tile {
  min-height: 92px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 8px;
  background: #fff;
  display: grid;
  gap: 4px;
  align-content: start;
  position: relative;
  cursor: pointer;
}

.unit-tile strong,
.unit-tile span,
.unit-tile small,
.unit-tile em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unit-tile strong {
  font-size: 14px;
}

.unit-tile span,
.unit-tile small {
  color: var(--muted);
  font-size: 12px;
}

.unit-tile em {
  color: #334155;
  font-size: 12px;
  font-style: normal;
}

.unit-tile.occupied {
  border-left-color: #16a34a;
  border-color: #bbf7d0;
  border-left-color: #16a34a;
  background: #ecfdf5;
  color: #14532d;
}

.unit-tile.vacant {
  border-left-color: #0284c7;
  border-color: #bae6fd;
  border-left-color: #0284c7;
  background: #f0f9ff;
  color: #075985;
}

.unit-tile.other {
  border-left-color: #64748b;
}

.dashboard-grid,
.import-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr);
  gap: 12px;
}

.dashboard-single {
  grid-template-columns: 1fr;
}

.setup-import-grid {
  margin-top: 12px;
}

.contract-scan-grid {
  align-items: start;
}

.contract-scan-form textarea {
  min-height: 150px;
}

.contract-scan-result {
  min-width: 0;
}

.contract-scan-kpis {
  margin-bottom: 12px;
}

.contract-scan-match {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.contract-scan-match span {
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid #dcebe5;
  border-radius: 8px;
  background: #f8fffb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.contract-scan-match strong {
  color: var(--text);
}

.contract-scan-text {
  margin-top: 12px;
}

.contract-scan-text summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 800;
}

.contract-scan-text pre {
  max-height: 220px;
  overflow: auto;
  margin: 10px 0 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  white-space: pre-wrap;
}

.setup-import-card {
  align-content: start;
}

.setup-import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.helper-text {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.setup-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.success-text {
  margin-top: 12px;
  color: var(--green);
  font-weight: 700;
}

.warning-list {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(183, 121, 31, 0.24);
  border-radius: 8px;
  background: rgba(251, 191, 36, 0.1);
  color: #7c4a03;
}

.warning-list.error {
  border-color: rgba(220, 38, 38, 0.24);
  background: rgba(254, 226, 226, 0.78);
  color: #991b1b;
}

.warning-list p {
  margin: 0;
  line-height: 1.45;
}

.operational-notice-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.36fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.apartment-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.9fr);
  gap: 12px;
}

.leasing-detail-layout {
  display: block;
}

.apartment-detail-table .table-wrap {
  max-height: 640px;
}

.apartment-detail-table table {
  table-layout: fixed;
  min-width: 1260px;
}

.apartment-detail-table th,
.apartment-detail-table td {
  padding: 8px 9px;
  font-size: 13px;
  line-height: 1.25;
}

.apartment-detail-table th:nth-child(1),
.apartment-detail-table td:nth-child(1) {
  width: 74px;
}

.apartment-detail-table th:nth-child(2),
.apartment-detail-table td:nth-child(2) {
  width: 62px;
}

.apartment-detail-table th:nth-child(3),
.apartment-detail-table td:nth-child(3) {
  width: 126px;
}

.apartment-detail-table th:nth-child(4),
.apartment-detail-table td:nth-child(4) {
  width: 86px;
}

.apartment-detail-table th:nth-child(5),
.apartment-detail-table td:nth-child(5) {
  width: 170px;
}

.apartment-detail-table th:nth-child(6),
.apartment-detail-table td:nth-child(6) {
  width: 210px;
}

.apartment-detail-table th:nth-child(7),
.apartment-detail-table td:nth-child(7) {
  width: 126px;
}

.apartment-detail-table th:nth-child(8),
.apartment-detail-table td:nth-child(8) {
  width: 112px;
}

.apartment-detail-table th:nth-child(9),
.apartment-detail-table td:nth-child(9) {
  width: 188px;
}

.apartment-detail-table th:nth-child(10),
.apartment-detail-table td:nth-child(10) {
  width: 86px;
}

.apartment-detail-table th:nth-child(11),
.apartment-detail-table td:nth-child(11) {
  width: 118px;
}

.apartment-detail-table th.apartment-detail-col-project,
.apartment-detail-table td.apartment-detail-col-project {
  width: 74px;
}

.apartment-detail-table th.apartment-detail-col-floor,
.apartment-detail-table td.apartment-detail-col-floor {
  width: 62px;
}

.apartment-detail-table th.apartment-detail-col-code,
.apartment-detail-table td.apartment-detail-col-code {
  width: 126px;
}

.apartment-detail-table th.apartment-detail-col-type,
.apartment-detail-table td.apartment-detail-col-type {
  width: 86px;
}

.apartment-detail-table th.apartment-detail-col-description,
.apartment-detail-table td.apartment-detail-col-description {
  width: 170px;
}

.apartment-detail-table th.apartment-detail-col-tenant,
.apartment-detail-table td.apartment-detail-col-tenant {
  width: 210px;
}

.apartment-detail-table th.apartment-detail-col-rent,
.apartment-detail-table td.apartment-detail-col-rent {
  width: 126px;
}

.apartment-detail-table th.apartment-detail-col-deposit,
.apartment-detail-table td.apartment-detail-col-deposit {
  width: 112px;
}

.apartment-detail-table th.apartment-detail-col-payment,
.apartment-detail-table td.apartment-detail-col-payment {
  width: 188px;
}

.apartment-detail-table th.apartment-detail-col-area,
.apartment-detail-table td.apartment-detail-col-area {
  width: 86px;
}

.apartment-detail-table th.apartment-detail-col-status,
.apartment-detail-table td.apartment-detail-col-status {
  width: 118px;
}

.apartment-detail-table td:nth-child(3),
.apartment-detail-table td:nth-child(5),
.apartment-detail-table td:nth-child(6),
.apartment-detail-table td:nth-child(8),
.apartment-detail-table td:nth-child(9) {
  overflow: hidden;
  text-overflow: ellipsis;
}

.apartment-detail-table td.apartment-detail-col-code,
.apartment-detail-table td.apartment-detail-col-description,
.apartment-detail-table td.apartment-detail-col-tenant,
.apartment-detail-table td.apartment-detail-col-deposit,
.apartment-detail-table td.apartment-detail-col-payment {
  overflow: hidden;
  text-overflow: ellipsis;
}

.apartment-detail-table .badge,
.apartment-detail-table .project-badge {
  min-height: 22px;
  padding: 3px 7px;
  font-size: 11px;
}

.apartment-detail-table tbody tr {
  cursor: pointer;
}

.leasing-detail-table tbody tr {
  cursor: default;
}

.fee-profile-panel {
  align-self: start;
}

.fee-profile-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.fee-profile-empty strong {
  color: var(--text);
}

.fee-profile-panel .table-wrap {
  max-height: 260px;
  margin-bottom: 12px;
}

.compact-kpis {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fee-profile-issues {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(183, 121, 31, 0.26);
  border-radius: 8px;
  background: rgba(251, 191, 36, 0.1);
  color: #7c4a03;
}

.fee-profile-issues p {
  margin: 0;
  line-height: 1.45;
}

.fee-profile-issues .issue-blocking {
  color: #991b1b;
}

.notice-print-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.notice-print-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #17202a;
}

.notice-print-head div {
  display: grid;
  gap: 4px;
}

.notice-print-head strong {
  font-size: 18px;
}

.notice-print-head span,
.notice-meta-grid span,
.notice-summary-grid span,
.notice-signature-row span {
  color: var(--muted);
  font-size: 12px;
}

.notice-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 14px;
}

.notice-meta-grid div,
.notice-summary-grid div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.notice-meta-grid strong,
.notice-summary-grid strong {
  overflow-wrap: anywhere;
}

.notice-fee-sections {
  display: grid;
  gap: 14px;
}

.notice-fee-section {
  display: grid;
  gap: 8px;
}

.notice-fee-section h3 {
  margin: 0;
  font-size: 14px;
  color: #17202a;
}

.notice-table-wrap {
  overflow-x: auto;
}

.fee-notice-detail-table {
  min-width: 1180px;
  border-collapse: collapse;
  font-size: 12px;
}

.fee-notice-detail-table th,
.fee-notice-detail-table td {
  border: 1px solid #cbd5e1;
  padding: 7px 8px;
  vertical-align: top;
}

.fee-notice-detail-table th {
  background: #f8fafc;
  color: #334155;
  white-space: nowrap;
}

.fee-notice-detail-table td:first-child {
  min-width: 240px;
}

.notice-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.notice-summary-grid .notice-total {
  grid-column: span 2;
  padding: 10px 12px;
  border-radius: 8px;
  background: #ecfdf5;
  color: #065f46;
}

.notice-summary-grid .notice-total strong {
  font-size: 18px;
}

.notice-signature-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 16px;
  align-items: start;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.notice-signature-row p {
  margin: 0;
  color: #334155;
}

.notice-signature-row div {
  min-height: 72px;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 6px;
}

.notice-empty-line {
  margin: 0;
  color: var(--muted);
}

.operational-notice-suggestion-panel {
  align-self: start;
}

.operational-notice-suggestions {
  display: grid;
  gap: 8px;
  max-height: 620px;
  overflow: auto;
  padding-right: 4px;
}

.notice-suggestion-button {
  width: 100%;
  display: grid;
  gap: 7px;
  padding: 10px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

.notice-suggestion-button:hover,
.notice-suggestion-button.active {
  border-color: var(--primary);
  background: #ecfdf5;
}

.notice-suggestion-button.active {
  box-shadow: inset 3px 0 0 var(--primary);
}

.notice-suggestion-head,
.notice-suggestion-head span,
.notice-suggestion-fees {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.notice-suggestion-head {
  justify-content: space-between;
}

.notice-suggestion-head strong,
.notice-suggestion-button small {
  overflow-wrap: anywhere;
}

.notice-suggestion-head b {
  flex: 0 0 auto;
  color: #065f46;
}

.notice-suggestion-button small {
  color: var(--muted);
  line-height: 1.35;
}

.notice-suggestion-fees {
  flex-wrap: wrap;
}

.notice-suggestion-fees em {
  padding: 3px 7px;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
}

.notice-suggestion-more {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.dashboard-priority {
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.85fr);
}

.asset-ledger-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1.22fr);
  gap: 12px;
}

.asset-ledger-tabs {
  display: flex;
  margin: 0 0 12px;
}

.billing-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

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

.contract-project-tabs {
  display: flex;
  margin: 0 0 12px;
}

.asset-unit-panel,
.asset-checklist-panel {
  min-height: 360px;
}

.asset-unit-list,
.asset-checklist {
  display: grid;
  gap: 9px;
}

.asset-unit-list {
  max-height: 560px;
  overflow: auto;
  padding-right: 3px;
}

.asset-unit-button {
  display: grid;
  gap: 6px;
  width: 100%;
  min-height: 76px;
  text-align: left;
  background: #fffdf3;
  border-color: var(--line);
}

.asset-unit-button span {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.asset-unit-button strong,
.asset-unit-button small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-unit-button small,
.asset-unit-button em {
  color: var(--muted);
  font-style: normal;
}

.asset-unit-button em {
  font-size: 12px;
  font-weight: 700;
}

.asset-unit-button.active {
  background: #ffd400;
  border-color: #eab308;
  color: #2f2300;
}

.asset-unit-button.active small,
.asset-unit-button.active em {
  color: #5f4500;
}

.asset-checklist-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf3;
}

.asset-checklist-item input {
  width: 18px;
  min-height: 18px;
}

.asset-checklist-item span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.asset-checklist-item strong,
.asset-checklist-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-checklist-item small {
  color: var(--muted);
}

.asset-type-summary-panel .table-wrap {
  margin-bottom: 0;
}

.asset-type-summary-panel {
  width: min(960px, 100%);
}

.asset-type-summary-table {
  min-width: 0;
  table-layout: fixed;
}

.asset-type-summary-table .asset-type-col-name {
  width: auto;
}

.asset-type-summary-table .asset-type-col-total,
.asset-type-summary-table .asset-type-col-units {
  width: 170px;
}

.asset-type-summary-table th {
  height: 42px;
  padding: 10px 18px;
}

.asset-type-summary-table td {
  height: 54px;
  padding: 10px 18px;
}

.asset-type-summary-row {
  cursor: pointer;
}

.asset-type-summary-row:hover {
  background: #f0fdfa;
}

.asset-type-summary-row:focus-visible {
  outline: 3px solid rgba(20, 184, 166, 0.28);
  outline-offset: -3px;
  background: #f0fdfa;
}

.asset-type-link {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: #ecfeff;
  color: var(--primary-dark);
  font-weight: 850;
  text-align: left;
}

.asset-type-link span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-type-link:hover {
  background: #ccfbf1;
  color: var(--primary);
}

.asset-type-number {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 74px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #f8fafc;
  color: #0f172a;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.asset-type-number.subtle {
  min-width: 54px;
  color: var(--primary-dark);
}

.asset-type-modal {
  width: min(980px, 100%);
}

.asset-type-unit-wrap {
  max-height: 58vh;
  overflow: auto;
}

.asset-bulk-form {
  display: grid;
  gap: 10px;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.asset-bulk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.asset-bulk-head h3 {
  margin: 0;
  color: var(--green-dark);
  font-size: 16px;
}

.asset-bulk-head span,
.asset-code-inline {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.asset-bulk-form textarea {
  min-height: 116px;
  resize: vertical;
}

.asset-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.asset-preset-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 58px auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf3;
}

.asset-preset-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.asset-preset-item input[type="number"] {
  min-height: 34px;
  padding: 6px;
}

.asset-preset-item em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.asset-import-line {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr);
  gap: 10px;
  align-items: end;
}

.asset-bulk-fields {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(120px, 0.8fr) minmax(140px, 0.9fr) auto;
  gap: 10px;
  align-items: end;
}

.asset-empty {
  margin: 0;
  min-height: 220px;
}

.table-link {
  min-height: auto;
  border: 0;
  background: transparent;
  padding: 0;
  color: #0f766e;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.panel {
  padding: 16px;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.panel-title p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.panel-title-actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.contract-action-select {
  margin-bottom: 14px;
}

.focus-panel {
  min-height: 238px;
}

.attention-list {
  display: grid;
  gap: 10px;
}

.attention-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf3;
}

.attention-list span {
  color: var(--muted);
}

.attention-list strong {
  font-size: 20px;
}

.legend {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.legend.due {
  background: var(--blue);
}

.legend.paid {
  background: var(--green);
}

.legend.balance {
  background: var(--red);
}

.bar-chart {
  display: grid;
  gap: 13px;
  margin-top: 16px;
}

.bar-row {
  display: grid;
  grid-template-columns: 120px minmax(120px, 1fr) 120px;
  gap: 12px;
  align-items: center;
  font-size: 13px;
}

.bar-row div,
.progress {
  height: 10px;
  background: #eef2f7;
  border-radius: 999px;
  overflow: hidden;
}

.bar-row i,
.progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.bar-row b {
  text-align: right;
}

.bar-row .red,
.badge.red {
  background: #fee2e2;
  color: var(--red);
}

.bar-row .amber,
.badge.amber {
  background: #fef3c7;
  color: var(--amber);
}

.bar-row .green,
.badge.green {
  background: #dcfce7;
  color: var(--green);
}

.bar-row .blue,
.badge.blue {
  background: #dbeafe;
  color: var(--blue);
}

.bar-row .orange,
.badge.orange {
  background: #ffedd5;
  color: var(--orange);
}

.bar-row .gray,
.badge.gray,
.badge.neutral {
  background: #f1f5f9;
  color: var(--gray);
}

.mini-chart {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  align-items: end;
  height: 230px;
  padding-top: 18px;
}

.mini-chart span {
  background: #ffe100;
  border-radius: 6px 6px 0 0;
  position: relative;
  min-height: 40px;
}

.mini-chart b {
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 12px;
}

.table-panel {
  overflow: hidden;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 980px;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  font-size: 12px;
  color: var(--muted);
  background: #f8fafc;
  position: sticky;
  top: 0;
  z-index: 1;
}

td {
  font-size: 14px;
}

th:last-child,
td:last-child {
  padding-right: 22px;
}

.numeric {
  text-align: right;
}

.fee-tariff-compact-header {
  margin-bottom: 8px;
}

.fee-tariff-compact-table {
  min-width: 720px;
}

.fee-tariff-compact-table th,
.fee-tariff-compact-table td {
  white-space: normal;
  vertical-align: top;
}

.fee-tariff-compact-table th:first-child,
.fee-tariff-compact-table td:first-child {
  width: 220px;
}

.fee-tariff-type {
  background: #fffdf3;
  border-right: 1px solid var(--line);
}

.fee-tariff-compact-table td strong {
  display: block;
  color: var(--text);
}

.fee-tariff-compact-table td small,
.fee-tariff-type span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.fee-tariff-price {
  width: 210px;
}

.fee-tariff-sheet-panel {
  background: #fff;
  border-color: #d7c89f;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.fee-tariff-sheet-table {
  min-width: 880px;
  border-collapse: collapse;
  border-spacing: 0;
  border: 1px solid #475569;
  font-family: Cambria, "Times New Roman", Times, serif;
}

.fee-tariff-sheet-table th,
.fee-tariff-sheet-table td {
  border: 1px solid #64748b;
  padding: 5px 7px;
  color: #000;
  background: #fff;
  font-size: 15px;
  line-height: 1.15;
  vertical-align: middle;
  white-space: normal;
}

.fee-tariff-sheet-table th {
  position: static;
  z-index: auto;
  background: #e2e8f0;
  font-weight: 700;
  text-align: left;
  color: #0f172a;
  border-bottom: 2px solid #334155;
}

.fee-tariff-sheet-table th:nth-child(1),
.fee-tariff-sheet-table td:nth-child(1) {
  width: 145px;
}

.fee-tariff-sheet-table th:nth-child(2),
.fee-tariff-sheet-table td:nth-child(2) {
  width: 360px;
}

.fee-tariff-sheet-table th:nth-child(3),
.fee-tariff-sheet-table td:nth-child(3) {
  width: 86px;
}

.fee-tariff-sheet-table th:nth-child(4),
.fee-tariff-sheet-table td:nth-child(4),
.fee-tariff-sheet-table th:nth-child(5),
.fee-tariff-sheet-table td:nth-child(5),
.fee-tariff-sheet-table th:nth-child(6),
.fee-tariff-sheet-table td:nth-child(6) {
  width: 128px;
}

.fee-tariff-sheet-table th:nth-child(4),
.fee-tariff-sheet-table th:nth-child(5),
.fee-tariff-sheet-table th:nth-child(6) {
  text-align: center;
}

.fee-tariff-sheet-table .fee-sheet-major td,
.fee-tariff-sheet-table .fee-sheet-subgroup td {
  font-weight: 700;
}

.fee-tariff-sheet-table .fee-sheet-major td {
  background: #fef3c7;
  color: #713f12;
  border-top: 2px solid #92400e;
  border-bottom: 2px solid #92400e;
}

.fee-tariff-sheet-table .fee-sheet-subgroup td {
  background: #f8fafc;
  color: #0f172a;
}

.fee-tariff-sheet-table .fee-sheet-tax-head {
  text-align: center;
  color: #0f172a;
}

.fee-tariff-sheet-table tbody tr:not(.fee-sheet-major):not(.fee-sheet-subgroup):hover td {
  background: #f8fafc;
}

.fee-tariff-sheet-table td.numeric {
  font-variant-numeric: tabular-nums;
}

.fee-tariff-name-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.fee-tariff-name-cell span {
  min-width: 0;
}

.fee-tariff-name-cell button {
  min-height: 26px;
  padding: 4px 9px;
  border-color: #d7c89f;
  color: #0f766e;
  background: #f8fafc;
  font-family: inherit;
  font-size: 13px;
  flex: 0 0 auto;
}

.danger {
  color: var(--red);
  font-weight: 700;
}

.sticky {
  position: sticky;
  right: 0;
  background: var(--surface);
  box-shadow: -8px 0 12px rgba(15, 23, 42, 0.06);
}

.sticky button {
  margin-right: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  color: var(--muted);
  gap: 8px;
  flex-wrap: wrap;
}

.table-export-button {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
}

.active-page {
  background: #fff7cc;
  color: #7c4a00;
  border-color: #ffd400;
}

.billing-detail-table tbody tr[data-select-billing-schedule] {
  cursor: pointer;
}

.billing-detail-table tbody tr[data-select-billing-schedule]:hover {
  background: #fffdf0;
}

.billing-notice-panel {
  margin-top: 14px;
}

.billing-debt-summary-card {
  display: grid;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.debt-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 18px;
}

.debt-summary-grid div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.debt-summary-grid span {
  color: var(--muted);
  font-size: 12px;
}

.debt-summary-grid strong {
  overflow-wrap: anywhere;
}

.billing-notice-modal {
  width: min(1040px, 100%);
}

.billing-debt-action-modal {
  width: min(1180px, calc(100vw - 32px));
}

.billing-debt-action-modal .debt-summary-grid {
  margin-bottom: 16px;
}

.billing-debt-action-buttons {
  justify-content: flex-end;
  padding-top: 4px;
}

.leasing-notice-card .notice-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.notice-message {
  margin: 0;
  color: #334155;
  line-height: 1.5;
}

.panel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.finance-assistant-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  margin: 0 24px 18px;
  padding: 16px 18px;
  border: 1px solid #dcebe5;
  border-radius: 8px;
  background: #fbfefc;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.finance-assistant-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #0f766e;
  color: #ffffff;
}

.finance-assistant-card strong {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
  color: #0f3f3a;
}

.finance-assistant-card small {
  color: var(--muted);
  font-weight: 600;
}

.finance-assistant-card p {
  margin: 4px 0;
  color: #334155;
  line-height: 1.45;
}

.finance-assistant-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.invoice-ledger-panel {
  overflow: hidden;
}

.invoice-ledger-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.invoice-ledger-head h2 {
  color: var(--text);
}

.invoice-ledger-head p {
  margin-top: 4px;
  color: var(--muted);
}

.invoice-ledger-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) 150px 180px;
  gap: 8px;
  align-items: end;
  min-width: min(640px, 100%);
}

.invoice-ledger-table {
  min-width: 980px;
}

.invoice-ledger-table tbody tr {
  cursor: pointer;
}

.invoice-ledger-table tbody tr:hover td {
  background: #fffdf0;
}

.invoice-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 260px;
}

.invoice-row-actions button {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
  background: #fff;
}

.operational-project-list {
  display: grid;
  gap: 14px;
  padding: 12px;
}

.operational-project-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.operational-project-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.operational-project-head div {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.operational-project-head strong,
.operational-project-head span {
  white-space: nowrap;
}

.operational-project-table {
  min-width: 780px;
}

.operational-project-table tr[data-operational-apartment-id] {
  cursor: pointer;
}

.fee-project-table {
  min-width: 920px;
}

.fee-project-grouped-panel .table-footer {
  padding: 0 12px 12px;
}

.empty-state {
  display: grid;
  gap: 6px;
  place-items: center;
  min-height: 220px;
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

.empty-state strong {
  color: var(--text);
}

.upload-box {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.progress {
  height: 12px;
}

.debt-amount {
  color: var(--amber);
}

.debt-cleared {
  color: var(--green);
  font-weight: 700;
}

.task-detail-panel {
  padding: 18px 20px;
}

.task-detail-title {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.task-detail-title button {
  width: 34px;
  padding: 0;
  font-size: 20px;
}

.task-form {
  margin-top: 18px;
}

.form-section-title {
  padding: 13px 0 12px;
  border-bottom: 1px solid #cbd5e1;
  color: #334155;
  font-size: 14px;
}

.tag-select,
.date-range-control {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 4px 6px;
}

.tag-select {
  flex-wrap: wrap;
}

.tag-select select,
.date-range-control input {
  width: auto;
  flex: 1 1 130px;
  min-height: 26px;
  border: 0;
  padding: 3px 4px;
  background: transparent;
}

.date-range-control input {
  min-width: 180px;
}

.tag-select select:focus,
.date-range-control input:focus {
  outline: none;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  min-height: 24px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.tag-chip button {
  min-height: 16px;
  width: 16px;
  padding: 0;
  border: 0;
  background: #cbd5e1;
  color: #475569;
  border-radius: 999px;
  line-height: 1;
}

.date-range-control button {
  width: 36px;
  min-height: 34px;
  padding: 0;
  border-color: transparent;
  background: #0284c7;
}

.date-range-control button .nav-icon {
  background: transparent;
  color: #fff;
}

.error-list {
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--red);
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tabs .active {
  background: #fff7cc;
  color: #7c4a00;
  border-color: #ffd400;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal {
  width: min(760px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: var(--surface);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-header button {
  width: 34px;
  padding: 0;
  font-size: 22px;
}

.fee-tariff-modal {
  width: min(980px, 100%);
}

.fee-tariff-modal .modal-actions {
  padding-top: 4px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-grid label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
}

.required-star {
  color: #dc2626;
}

.tenant-unit-picker input[type="search"] {
  margin-bottom: 2px;
}

.compact-form {
  gap: 10px;
}

.checkbox-row {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 8px !important;
  font-weight: 600 !important;
}

.checkbox-row input {
  width: 16px;
  min-height: 16px;
  flex: 0 0 auto;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 260px;
}

.row-actions button {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 12px;
}

td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.invoice-status-stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.invoice-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid #dcebe5;
  border-radius: 8px;
  background: #f8fffb;
}

.invoice-detail-actions button {
  font-weight: 700;
}

.wide {
  grid-column: 1 / -1;
}

.warning {
  margin: 14px 0;
  padding: 10px 12px;
  border-radius: 6px;
  background: #fef3c7;
  color: #92400e;
  font-size: 13px;
}

.notice-preview {
  white-space: pre-wrap;
  font-family: "Times New Roman", serif;
  line-height: 1.55;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px;
  min-height: 420px;
}

.tenant-create-modal {
  width: min(980px, 100%);
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover td {
  background: rgba(14, 127, 110, 0.06);
}

.tenant-detail-modal {
  width: min(1040px, 100%);
}

.tenant-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.tenant-detail-grid > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.tenant-detail-grid .wide {
  grid-column: span 2;
}

.tenant-detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.tenant-detail-grid strong {
  display: block;
  min-height: 20px;
  line-height: 1.35;
}

.tenant-draft-card {
  margin-top: 14px;
}

.tenant-draft-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.tenant-draft-header h3 {
  margin: 2px 0 0;
}

.contract-detail-modal {
  width: min(1040px, 100%);
}

.contract-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 14px;
}

.contract-detail-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.contract-dialog-form {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.contract-scan-panel {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

.contract-scan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.contract-scan-head h3 {
  margin: 0;
  color: #0f172a;
  font-size: 15px;
}

.contract-scan-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.contract-scan-upload-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.contract-scan-upload-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.contract-scan-upload-form input {
  width: 100%;
}

.contract-scan-file-picker {
  position: relative;
}

.contract-scan-file-picker > span {
  display: block;
}

.contract-scan-file-picker input[type="file"] {
  position: absolute;
  inset: 24px 0 0;
  z-index: 2;
  width: 100%;
  height: 42px;
  opacity: 0;
  cursor: pointer;
}

.contract-scan-file-picker b {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px dashed var(--ctg-teal-soft-2);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ctg-teal-dark);
  font-size: 13px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.contract-scan-file-picker:hover b,
.contract-scan-file-picker:focus-within b {
  border-color: var(--ctg-teal);
  background: var(--ctg-teal-soft);
}

.contract-scan-upload-form button {
  min-height: 42px;
  white-space: nowrap;
}

.contract-scan-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.contract-scan-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.contract-scan-file strong,
.contract-scan-file span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.contract-scan-file strong {
  color: #0f172a;
  font-size: 13px;
}

.contract-scan-file span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.contract-scan-file button {
  flex: 0 0 auto;
}

.contract-scan-empty {
  margin-top: 10px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.contract-sample-preview {
  font-family: "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.36;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 22px 26px;
  min-height: 620px;
  max-height: min(72vh, 820px);
  overflow: auto;
  color: #111827;
}

.contract-cover-page {
  position: relative;
  min-height: 760px;
  padding-top: 4px;
  margin-bottom: 24px;
  border-bottom: 1px dashed #cbd5e1;
}

.contract-body-page {
  padding-top: 4px;
}

.contract-preview-line {
  margin: 0 0 5px;
  text-align: justify;
}

.contract-preview-line.center {
  text-align: center;
}

.contract-preview-line.title {
  margin-top: 22px;
  margin-bottom: 6px;
  font-size: 18px;
  font-weight: 700;
}

.contract-preview-line.heading {
  margin-top: 10px;
  font-weight: 700;
  text-align: left;
}

.contract-preview-line.cover-strong {
  font-weight: 700;
}

.contract-preview-line.cover-date {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 28px;
  text-align: center;
}

.contract-preview-space {
  height: 12px;
}

.contract-signature-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  margin-top: 10px;
  font-weight: 700;
  text-align: center;
}

@media (max-width: 900px) {
  .tenant-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contract-scan-upload-form {
    grid-template-columns: minmax(0, 1fr);
  }
}

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

  .tenant-detail-grid .wide {
    grid-column: auto;
  }

  .contract-scan-head,
  .contract-scan-file {
    align-items: stretch;
    flex-direction: column;
  }
}

@page {
  size: A4;
  margin: 18mm 20mm;
}

@media print {
  .sidebar,
  .topbar,
  .page-header,
  .filter-band,
  .table-panel {
    display: none !important;
  }

  .app-shell,
  .dashboard-grid {
    display: block;
  }

  .panel {
    border: 0;
  }

  .notice-print-card {
    border: 0;
    padding: 0;
  }

  .modal-backdrop {
    position: static;
    display: block;
    padding: 0;
    background: #fff;
  }

  .modal {
    width: 100%;
    max-height: none;
    overflow: visible;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .modal-header,
  .modal-actions {
    display: none !important;
  }

  .tenant-detail-modal > .tenant-detail-grid,
  .tenant-draft-header,
  .tenant-draft-card > .tenant-detail-grid,
  .tenant-draft-card > .warning-list,
  .tenant-draft-card > .success-text,
  .tenant-create-modal > .warning-list,
  .tenant-create-modal > .success-text {
    display: none !important;
  }

  .tenant-create-modal,
  .tenant-detail-modal,
  .tenant-draft-card {
    width: 100%;
    margin: 0;
  }

  .notice-table-wrap {
    overflow: visible;
  }

  .fee-notice-detail-table {
    min-width: 0;
    width: 100%;
    font-size: 10px;
  }

  .fee-notice-detail-table th,
  .fee-notice-detail-table td {
    padding: 5px;
  }

  .contract-sample-preview {
    max-height: none;
    overflow: visible;
    border: 0;
    padding: 0;
    min-height: 0;
    font-size: 12pt;
    line-height: 1.25;
    color: #000;
  }

  .contract-cover-page {
    position: relative;
    height: calc(297mm - 36mm);
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    break-after: page;
    page-break-after: always;
  }

  .contract-body-page {
    padding: 0;
  }

  .contract-preview-line {
    margin-bottom: 4.5pt;
  }

  .contract-cover-page .contract-preview-line {
    text-align: center;
  }

  .contract-cover-page .contract-preview-line.cover-strong {
    font-weight: 700;
  }

  .contract-preview-line.cover-date {
    bottom: 0;
  }

  .contract-preview-line.title {
    margin-top: 20pt;
    margin-bottom: 6pt;
    font-size: 14.5pt;
  }

  .contract-preview-line.heading {
    margin-top: 8pt;
    margin-bottom: 5pt;
  }

  .contract-preview-space {
    height: 10pt;
  }

  .contract-signature-row {
    margin-top: 10pt;
    gap: 32pt;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar,
  .page-header,
  .status-banner,
  .table-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-band,
  .kpi-grid,
  .module-dashboard-grid,
  .module-kpi-grid,
  .dashboard-summary,
  .project-grid,
  .project-section,
  .floor-row,
  .asset-ledger-grid,
  .ai-summary-banner,
  .rental-unit-detail-layout,
  .detail-grid,
  .dashboard-grid,
  .import-grid,
  .operational-notice-layout,
  .notice-meta-grid,
  .notice-summary-grid,
  .leasing-notice-card .notice-summary-grid,
  .debt-summary-grid,
  .notice-signature-row,
  .section-search-tools,
  .finance-assistant-card,
  .invoice-ledger-filters,
  .asset-bulk-fields,
  .asset-import-line,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .finance-assistant-actions,
  .invoice-ledger-head {
    flex-direction: column;
    align-items: stretch;
  }

  .section-tool-actions {
    justify-content: flex-start;
  }

  .apartment-column-band {
    align-items: flex-start;
  }

  .rental-unit-photo {
    min-height: 190px;
  }

  .rental-unit-photo img {
    min-height: 190px;
  }
}

@media (max-width: 520px) {
  .topbar,
  .page-header {
    padding-left: 14px;
    padding-right: 14px;
  }

  .filter-band,
  .kpi-grid,
  .module-dashboard-grid,
  .module-kpi-grid,
  .dashboard-summary,
  .project-grid,
  .project-section,
  .apartment-legend,
  .ai-summary-banner,
  .asset-ledger-grid,
  .dashboard-grid,
  .table-panel,
  .panel,
  .import-grid,
  .tabs,
  .status-banner,
  .empty-state {
    margin-left: 14px;
    margin-right: 14px;
  }

  nav {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 22px;
  }

  .apartment-column-band {
    flex-direction: column;
  }

  .apartment-column-option {
    flex: 1 1 calc(50% - 8px);
  }
}

/* PropOps visual theme */
:root {
  --bg: #f6f4ee;
  --surface: #ffffff;
  --surface-soft: #fbfaf6;
  --line: #dedbd2;
  --text: #111827;
  --muted: #667085;
  --primary: #0f766e;
  --primary-dark: #0b5d56;
  --sidebar: #0b4637;
  --sidebar-2: #0f5948;
  --sidebar-muted: #88ad9f;
  --accent: #d4a72c;
  --accent-soft: #fff1c9;
  --red: #b43a3a;
  --amber: #b7801f;
  --green: #157a61;
  --blue: #176b91;
  --orange: #c27a16;
  --gray: #64748b;
  font-family: Inter, "Segoe UI", Tahoma, Arial, sans-serif;
}

body {
  background: var(--bg);
}

button {
  border-color: var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
}

button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.primary,
.button-link.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.primary:hover,
.button-link.primary:hover {
  background: var(--primary-dark);
  color: #fff;
}

.app-shell {
  grid-template-columns: 292px minmax(0, 1fr);
  background: var(--bg);
}

.sidebar {
  background: linear-gradient(180deg, var(--sidebar), #073c31);
  color: #e8fff7;
  padding: 20px 16px;
  border-right: 0;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.06);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(255, 255, 255, 0.24) transparent;
}

.brand {
  padding: 0 6px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #fff;
  color: var(--sidebar);
  font-size: 20px;
}

.brand strong {
  color: #ffffff;
  letter-spacing: 0;
}

.brand strong span {
  color: var(--accent);
  font-size: 13px;
}

.brand small {
  color: var(--sidebar-muted);
}

nav {
  gap: 10px;
  padding-top: 20px;
  padding-bottom: 24px;
}

.nav-item {
  color: #d8eee7;
  border-radius: 9px;
  padding: 10px 12px;
  min-height: 42px;
  font-size: 15px;
  line-height: 1.28;
  font-weight: 700;
}

.nav-parent {
  color: #cde7dd;
  text-transform: none;
  margin-top: 4px;
  background: rgba(255, 255, 255, 0.04);
}

.nav-submenu {
  position: relative;
  padding-left: 20px;
  margin: 3px 0 4px 17px;
  gap: 2px;
}

.nav-group.collapsed > .nav-submenu,
.nav-subgroup.collapsed > .nav-submenu {
  display: none;
}

.nav-submenu::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 8px;
  width: 1px;
  background: rgba(216, 238, 231, 0.22);
}

.nav-subitem {
  min-height: 34px;
  padding: 7px 9px;
  color: #e3f6f0;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.28;
  background: transparent;
}

.nav-caret {
  color: #9ec5b6;
}

.nav-icon {
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
  color: #cae7dd;
  border-radius: 7px;
}

.nav-subitem .nav-icon {
  width: 18px;
  height: 18px;
  font-size: 11px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  color: #d8eee7;
}

.nav-item span:not(.nav-icon):not(.nav-caret) {
  min-width: 0;
  overflow-wrap: anywhere;
}

.nav-item:hover,
.nav-item.active {
  color: #ffffff;
  background: #17735f;
  border-color: transparent;
  box-shadow: none;
}

.nav-item.active .nav-icon {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.nav-subitem.active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.nav-subitem:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.main {
  background: var(--bg);
}

.topbar {
  height: 102px;
  padding: 18px 24px 10px;
  gap: 14px;
  background: #f3f1eb;
  border-bottom: 1px solid #dfddd5;
  box-shadow: 0 1px 0 rgba(17, 24, 39, 0.03);
}

.project-switch {
  flex: 0 0 300px;
}

.project-switch span,
.global-search span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.project-switch select,
.global-search input {
  min-height: 42px;
  border-radius: 8px;
  border-color: #d8d5cd;
  background: #fff;
  box-shadow: 0 1px 0 rgba(17, 24, 39, 0.02);
}

.project-switch select {
  font-weight: 700;
}

.global-search {
  width: min(430px, 100%);
  margin-right: auto;
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #fff;
}

.user-menu {
  width: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 999px;
  background: var(--accent);
  border-color: var(--accent);
  color: #1c2b23;
}

input,
select,
textarea {
  border-color: #d8d5cd;
  border-radius: 8px;
  min-height: 38px;
  background: #fff;
}

.page-header {
  padding: 8px 24px 18px;
  align-items: center;
}

h1 {
  color: #101828;
  font-size: 25px;
  font-weight: 800;
}

h2 {
  color: #0f766e;
}

.page-header h1 {
  border-bottom: 0;
  padding-bottom: 0;
}

.page-header p {
  color: #667085;
}

.filter-band,
.kpi-card,
.summary-card,
.project-card,
.panel,
.table-panel,
.upload-box,
.empty-state,
.project-section,
.apartment-legend {
  border-color: #dedbd2;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
}

.filter-band {
  padding: 16px;
}

.summary-card,
.kpi-card,
.project-card,
.panel {
  padding: 18px;
}

.summary-card::before,
.project-card::before {
  width: 5px;
}

.summary-card.orange strong,
.kpi-card:nth-child(4n + 1) strong,
.panel:nth-of-type(4n + 1) h2 {
  color: var(--orange);
}

.summary-card.green strong,
.kpi-card:nth-child(4n + 2) strong,
.panel:nth-of-type(4n + 2) h2 {
  color: var(--green);
}

.summary-card.blue strong,
.kpi-card:nth-child(4n + 3) strong,
.panel:nth-of-type(4n + 3) h2 {
  color: var(--blue);
}

.status-banner {
  background: #e7f5ee;
  border-color: #9ad4bf;
  color: #0f5948;
}

.badge {
  border-radius: 999px;
  font-size: 12px;
}

.badge.blue {
  background: #dbeafe;
  color: var(--primary);
}

.badge.green {
  background: #dff5e9;
  color: var(--green);
}

.badge.amber {
  background: var(--accent-soft);
  color: var(--amber);
}

.badge.red {
  background: #fde8e8;
  color: var(--red);
}

.project-tnt {
  background: #e4f1f8;
  border-color: #bad8e6;
  color: #176b91;
}

.project-tn {
  background: #e4f4e6;
  border-color: #b9dfc0;
  color: #166534;
}

.project-eco {
  background: #f5e8fb;
  border-color: #dfc0ee;
  color: #7c2d92;
}

.project-tnt::before,
.project-badge.project-tnt,
.project-card.project-tnt .project-card-head span {
  background: #176b91;
}

.project-tn::before,
.project-badge.project-tn,
.project-card.project-tn .project-card-head span {
  background: #157a61;
}

.project-eco::before,
.project-badge.project-eco,
.project-card.project-eco .project-card-head span {
  background: #a33bb8;
}

.floor-stack {
  background: #ffffff;
  border-radius: 0 0 12px 12px;
}

.floor-label {
  background: #fff;
  border-color: transparent;
}

.unit-tile {
  min-height: 74px;
  border-radius: 8px;
  border-left-width: 1px;
  box-shadow: none;
}

.unit-tile.other {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.attention-list div,
.asset-unit-button,
.asset-checklist-item {
  background: var(--surface-soft);
  border-color: #dedbd2;
}

.asset-unit-button.active {
  background: #17735f;
  color: #ffffff;
  border-color: #17735f;
}

.asset-unit-button.active small,
.asset-unit-button.active em {
  color: #d8eee7;
}

.table-wrap {
  border-radius: 12px 12px 0 0;
}

th {
  background: #f6f7f8;
  color: #667085;
}

td,
th {
  border-bottom-color: #e5e2da;
}

.active-page {
  background: #fff6d8;
  color: #7a4a00;
}

.table-link {
  color: var(--primary);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  nav {
    grid-template-columns: 1fr;
  }

  .topbar {
    height: auto;
  }

  .project-switch {
    flex: 1 1 100%;
  }
}

/* Future Ops mockup theme */
:root {
  --sidebar-width: 280px;
  --bg: #f4f7f9;
  --surface: #ffffff;
  --surface-soft: #eef5f6;
  --line: #d9e4e9;
  --line-strong: #b9ccd4;
  --text: #152028;
  --muted: #667786;
  --primary: #007d73;
  --primary-dark: #005f57;
  --sidebar: #101820;
  --sidebar-2: #17232d;
  --sidebar-muted: rgba(233, 245, 245, 0.68);
  --accent: #2dd4bf;
  --accent-soft: #ccfbf1;
  --red: #dc2626;
  --amber: #d97706;
  --green: #15803d;
  --blue: #2563eb;
  --orange: #c27a16;
  --gray: #64748b;
  --shadow: 0 18px 50px rgba(21, 32, 40, 0.08);
  color-scheme: light;
}

html {
  min-width: 320px;
}

body {
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(8, 145, 178, 0.06) 1px, transparent 1px),
    linear-gradient(180deg, rgba(0, 125, 115, 0.05) 1px, transparent 1px),
    var(--bg);
  background-size: 44px 44px;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
.button-link,
input,
select,
textarea {
  font: inherit;
}

button,
.button-link {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  font-weight: 750;
  box-shadow: none;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

button:hover,
.button-link:hover {
  border-color: rgba(0, 125, 115, 0.42);
  color: var(--primary-dark);
}

button:focus-visible,
.button-link:focus-visible,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(0, 125, 115, 0.14);
}

button:disabled,
button[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
}

.primary,
.button-link.primary,
.add-action-menu summary {
  color: #ffffff;
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--primary), #0f9f93 62%, #2563eb);
  box-shadow: 0 14px 28px rgba(0, 125, 115, 0.2);
}

.primary:hover,
.button-link.primary:hover,
.add-action-menu summary:hover {
  color: #ffffff;
  border-color: var(--primary-dark);
  background: linear-gradient(135deg, var(--primary-dark), #087f76 62%, #1d4ed8);
}

.danger-button {
  border-color: #fecaca;
  background: #fff1f2;
  color: #b91c1c;
}

.app-shell {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  background: transparent;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 14px;
  color: #e9f5f5;
  background:
    linear-gradient(180deg, rgba(0, 125, 115, 0.22), transparent 34%),
    linear-gradient(135deg, var(--sidebar), var(--sidebar-2));
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: none;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-color: rgba(255, 255, 255, 0.26) transparent;
}

.sidebar::after {
  content: "";
  position: absolute;
  top: 0;
  right: -1px;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, transparent, rgba(45, 212, 191, 0.85), transparent);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 6px 8px 18px;
  border-bottom: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(45, 212, 191, 0.7);
  border-radius: 8px;
  color: #c8fffb;
  background: rgba(0, 125, 115, 0.28);
  font-size: 14px;
  font-weight: 850;
}

.brand strong {
  display: block;
  overflow: hidden;
  color: #ffffff;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand strong span {
  color: inherit;
  font-size: inherit;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: var(--sidebar-muted);
  font-size: 12px;
}

.sidebar nav {
  display: grid;
  gap: 6px;
  padding-top: 8px;
  padding-bottom: 24px;
}

.nav-group,
.nav-subgroup {
  display: grid;
  gap: 3px;
}

.nav-module {
  margin-top: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: rgba(233, 245, 245, 0.78);
  background: transparent;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.3;
  text-align: left;
  box-shadow: none;
}

.nav-parent,
.nav-module-parent {
  color: rgba(233, 245, 245, 0.84);
  background: rgba(255, 255, 255, 0.035);
}

.nav-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  color: #cae7dd;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 850;
}

.nav-icon svg {
  display: block;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-subitem,
.nav-section-title {
  min-height: 34px;
  padding: 7px 10px;
  color: rgba(233, 245, 245, 0.72);
  font-size: 12px;
  font-weight: 700;
}

.nav-subitem .nav-icon,
.nav-section-title .nav-icon {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  font-size: 10px;
}

.nav-subitem .nav-icon svg,
.nav-section-title .nav-icon svg {
  width: 12px;
  height: 12px;
}

.nav-item span:not(.nav-icon):not(.nav-caret) {
  min-width: 0;
  overflow-wrap: anywhere;
}

.nav-caret {
  margin-left: auto;
  color: rgba(233, 245, 245, 0.48);
  font-size: 12px;
}

.nav-submenu {
  position: relative;
  display: grid;
  gap: 3px;
  margin: 3px 0 4px 16px;
  padding-left: 18px;
}

.nav-submenu-nested {
  margin-left: 12px;
}

.nav-submenu::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 7px;
  width: 1px;
  background: rgba(216, 238, 231, 0.22);
}

.nav-group.collapsed > .nav-submenu,
.nav-subgroup.collapsed > .nav-submenu {
  display: none;
}

.nav-item:hover,
.nav-item:focus-visible {
  color: #ffffff;
  border-color: rgba(45, 212, 191, 0.25);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.nav-item.active,
.nav-subitem.active,
.nav-section-title.active {
  color: #ffffff;
  border-color: rgba(45, 212, 191, 0.55);
  background: linear-gradient(90deg, rgba(0, 125, 115, 0.42), rgba(37, 99, 235, 0.18));
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-item.active .nav-icon {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
}

.main {
  min-width: 0;
  background: transparent;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 76px;
  height: auto;
  padding: 18px 32px 10px;
  border-bottom: 1px solid rgba(217, 228, 233, 0.78);
  background: rgba(244, 247, 249, 0.9);
  box-shadow: none;
  backdrop-filter: blur(14px);
}

.project-switch {
  flex: 0 1 300px;
  min-width: 210px;
}

.global-search {
  position: relative;
  flex: 1 1 420px;
  width: auto;
  max-width: 520px;
  margin-right: auto;
}

.global-search::before {
  content: "⌕";
  position: absolute;
  left: 13px;
  top: 50%;
  z-index: 1;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  transform: translateY(-53%);
}

.project-switch span,
.global-search span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.project-switch select,
.global-search input,
input,
select,
textarea {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  box-shadow: 0 12px 30px rgba(21, 32, 40, 0.04);
}

.global-search input {
  padding-left: 38px;
}

textarea {
  min-height: 88px;
}

.icon-button,
.user-menu {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 8px;
}

.user-menu {
  border-color: #99f6e4;
  background: #a7f3d0;
  color: #073b38;
  font-size: 12px;
  font-weight: 850;
}

.page-header {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: start;
  gap: 22px;
  padding: 16px 32px 24px;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  color: var(--text);
  font-size: 28px;
  font-weight: 850;
  line-height: 1.2;
}

h2 {
  color: var(--text);
}

.page-header h1 {
  display: block;
  padding-bottom: 0;
  border-bottom: 0;
}

.page-header p {
  max-width: 760px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.header-actions,
.modal-actions,
.section-tool-actions,
.table-footer div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.status-banner {
  margin: 0 32px 18px;
  padding: 11px 13px;
  border-color: #99f6e4;
  border-radius: 8px;
  background: #ccfbf1;
  color: #0f766e;
}

.status-banner span {
  color: #0f766e;
}

.filter-band,
.kpi-grid,
.dashboard-summary,
.project-grid,
.project-section,
.apartment-legend,
.asset-ledger-grid,
.module-dashboard-grid,
.dashboard-grid,
.operational-notice-layout,
.table-panel,
.panel,
.import-grid,
.tabs,
.billing-tabs,
.contract-project-tabs,
.asset-ledger-tabs,
.empty-state {
  margin: 0 32px 18px;
}

.filter-band,
.kpi-card,
.summary-card,
.project-card,
.panel,
.table-panel,
.upload-box,
.empty-state,
.project-section,
.apartment-legend,
.modal {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.filter-band {
  gap: 12px;
  padding: 16px;
}

.dashboard-summary,
.kpi-grid,
.module-kpi-grid,
.project-grid,
.dashboard-grid,
.import-grid {
  gap: 16px;
}

.dashboard-grid,
.import-grid {
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr);
}

.dashboard-single {
  grid-template-columns: minmax(0, 1fr);
}

.module-dashboard-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.module-kpi-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.kpi-card,
.summary-card {
  min-height: 118px;
  padding: 16px;
  overflow: hidden;
}

.summary-card::before,
.project-card::before {
  width: 4px;
}

.kpi-card span,
.summary-card span,
.kpi-card small,
.summary-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.kpi-card strong,
.summary-card strong {
  display: block;
  margin: 6px 0 3px;
  color: var(--text) !important;
  font-size: 26px;
  line-height: 1.12;
}

.summary-card.orange::before {
  background: #f59e0b;
}

.summary-card.green::before {
  background: #22c55e;
}

.summary-card.blue::before {
  background: #3b82f6;
}

.summary-card.red::before {
  background: #ef4444;
}

.panel,
.summary-card,
.kpi-card,
.project-card {
  padding: 16px;
}

.leasing-panel,
.operations-panel {
  border-left: 1px solid var(--line);
  box-shadow: inset 3px 0 0 rgba(45, 212, 191, 0.82), var(--shadow);
}

.operations-panel {
  box-shadow: inset 3px 0 0 rgba(37, 99, 235, 0.58), var(--shadow);
}

.panel-title {
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.panel-title h2,
.panel:nth-of-type(4n + 1) h2,
.panel:nth-of-type(4n + 2) h2,
.panel:nth-of-type(4n + 3) h2,
.panel:nth-of-type(4n + 4) h2 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  line-height: 1.25;
}

.panel-title p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.attention-list {
  gap: 10px;
}

.attention-list div,
.asset-unit-button,
.asset-checklist-item,
.unit-link-summary,
.invoice-detail-actions {
  border-color: var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.bar-chart {
  gap: 12px;
}

.bar-row {
  grid-template-columns: 128px minmax(120px, 1fr) 128px;
  color: var(--muted);
}

.bar-row div,
.progress {
  height: 10px;
  background: #e8f0f3;
}

.bar-row i,
.progress i {
  background: linear-gradient(90deg, var(--primary), #2563eb);
}

.badge,
.project-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.badge.blue {
  border-color: #bae6fd;
  background: #e0f2fe;
  color: #075985;
}

.badge.green {
  border-color: #bbf7d0;
  background: #dcfce7;
  color: #166534;
}

.badge.amber {
  border-color: #fde68a;
  background: #fef3c7;
  color: #92400e;
}

.badge.red {
  border-color: #fecaca;
  background: #fee2e2;
  color: #991b1b;
}

.badge.orange {
  border-color: #fed7aa;
  background: #ffedd5;
  color: #9a3412;
}

.badge.gray,
.badge.neutral {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: #475569;
}

.project-tnt {
  border-color: #bae6fd;
  background: #e0f2fe;
  color: #075985;
}

.project-tn {
  border-color: #bbf7d0;
  background: #dcfce7;
  color: #166534;
}

.project-eco {
  border-color: #e9d5ff;
  background: #f3e8ff;
  color: #6b21a8;
}

.project-other {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: #334155;
}

.project-tnt::before,
.project-badge.project-tnt,
.project-card.project-tnt .project-card-head span {
  background: #0284c7;
  color: #ffffff;
}

.project-tn::before,
.project-badge.project-tn,
.project-card.project-tn .project-card-head span {
  background: #16a34a;
  color: #ffffff;
}

.project-eco::before,
.project-badge.project-eco,
.project-card.project-eco .project-card-head span {
  background: #a855f7;
  color: #ffffff;
}

.project-other::before,
.project-badge.project-other,
.project-card.project-other .project-card-head span {
  background: #64748b;
  color: #ffffff;
}

.table-panel {
  overflow: hidden;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.table-panel > .table-wrap {
  border: 0;
  border-radius: 8px 8px 0 0;
}

table {
  min-width: 920px;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  color: var(--muted);
  background: #f8fbfc;
  font-size: 12px;
  font-weight: 850;
}

td {
  color: var(--text);
  font-size: 14px;
}

tbody tr:hover td {
  background: rgba(204, 251, 241, 0.22);
}

tr:last-child td {
  border-bottom: 0;
}

.table-footer {
  align-items: center;
  min-height: 52px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.active-page {
  background: #ecfeff;
  color: var(--primary-dark);
}

.table-link {
  color: var(--primary-dark);
  font-weight: 800;
}

.tabs {
  gap: 8px;
}

.tabs .active,
.project-type-tab.active {
  border-color: #99f6e4;
  background: #ccfbf1;
  color: var(--primary-dark);
}

.section-search-meta span,
.section-search-field,
.chip,
.apartment-column-option {
  border-color: var(--line);
  background: #f8fbfc;
  color: var(--muted);
}

.section-search-field.active,
.section-search-field[aria-pressed="true"],
.apartment-column-option input:checked + .apartment-column-check {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.apartment-column-check {
  border-color: var(--line-strong);
  border-radius: 5px;
}

.floor-stack,
.floor-label,
.unit-tile,
.detail-grid div,
.document-shell,
.contract-preview,
.notice-preview {
  border-color: var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.unit-tile {
  box-shadow: none;
}

.unit-tile.vacant,
.unit-tile.available {
  border-color: #99f6e4;
  background: #ecfdf5;
}

.modal-backdrop {
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(4px);
}

.modal {
  border-radius: 8px;
}

.modal-header {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.form-grid label,
.compact-filter-select {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.warning,
.warning-list {
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fef3c7;
  color: #92400e;
}

.success-text {
  color: var(--green);
}

@media (max-width: 1180px) {
  .page-header,
  .topbar {
    grid-template-columns: 1fr;
  }

  .page-header {
    grid-template-columns: 1fr;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .module-dashboard-grid,
  .dashboard-grid,
  .import-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-summary,
  .kpi-grid,
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: relative;
    height: auto;
    padding: 14px 16px;
  }

  .sidebar::after {
    display: none;
  }

  .brand {
    padding: 0 0 12px;
  }

  .sidebar nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 0 0 10px;
  }

  .sidebar nav::-webkit-scrollbar {
    display: none;
  }

  .nav-group {
    flex: 0 0 230px;
  }

  .nav-item {
    min-width: max-content;
  }

  .nav-group > .nav-item {
    min-width: 100%;
  }

  .nav-submenu {
    max-height: 220px;
    overflow: auto;
  }

  .topbar {
    position: static;
    align-items: stretch;
    padding: 18px 16px 10px;
  }

  .project-switch,
  .global-search {
    flex: 1 1 100%;
    min-width: 0;
    max-width: none;
  }

  .page-header {
    padding: 18px 16px 22px;
  }

  h1 {
    font-size: 24px;
  }

  .filter-band,
  .kpi-grid,
  .dashboard-summary,
  .project-grid,
  .project-section,
  .apartment-legend,
  .asset-ledger-grid,
  .module-dashboard-grid,
  .dashboard-grid,
  .operational-notice-layout,
  .table-panel,
  .panel,
  .import-grid,
  .tabs,
  .billing-tabs,
  .contract-project-tabs,
  .asset-ledger-tabs,
  .status-banner,
  .empty-state {
    margin-left: 16px;
    margin-right: 16px;
  }

  .dashboard-summary,
  .kpi-grid,
  .project-grid,
  .module-kpi-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .panel-title,
  .invoice-ledger-head,
  .document-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .topbar,
  .page-header {
    padding-left: 12px;
    padding-right: 12px;
  }

  .filter-band,
  .kpi-grid,
  .module-dashboard-grid,
  .module-kpi-grid,
  .dashboard-summary,
  .project-grid,
  .project-section,
  .apartment-legend,
  .ai-summary-banner,
  .asset-ledger-grid,
  .dashboard-grid,
  .table-panel,
  .panel,
  .import-grid,
  .tabs,
  .status-banner,
  .empty-state {
    margin-left: 12px;
    margin-right: 12px;
  }

  .topbar > button,
  .topbar .icon-button,
  .topbar .user-menu,
  .header-actions button,
  .section-tool-actions button {
    width: 100%;
  }

  .bar-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

.route-dashboard.operations-hidden .module-dashboard-grid {
  grid-template-columns: minmax(0, 1fr);
}

.route-dashboard.operations-hidden .leasing-panel .module-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 980px) {
  .route-dashboard.operations-hidden .leasing-panel .module-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .topbar {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .topbar .project-switch,
  .topbar .global-search {
    flex: 1 1 100%;
  }

  .topbar .icon-button,
  .topbar .user-menu {
    flex: 0 0 42px;
    width: 42px;
  }

  .bar-row b {
    justify-self: start;
    max-width: 100%;
    text-align: left;
    overflow-wrap: anywhere;
  }

  .route-dashboard.operations-hidden .leasing-panel .module-kpi-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.ai-assistant-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 16px;
  align-items: stretch;
  margin: 0 24px 18px;
  padding: 18px;
  border: 1px solid #cfe7df;
  border-left: 6px solid #0f766e;
  border-radius: 8px;
  background: #f8fffb;
}

.ai-assistant-hero > div:first-child {
  display: grid;
  gap: 8px;
}

.ai-assistant-hero > div:first-child > span {
  width: fit-content;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  font-size: 12px;
  font-weight: 800;
}

.ai-assistant-hero h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.35;
}

.ai-assistant-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.ai-key-status {
  display: grid;
  gap: 8px;
  align-content: center;
  padding: 14px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffbeb;
}

.ai-key-status.ready {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.ai-key-status strong {
  color: #0f513f;
}

.ai-key-status span {
  color: var(--muted);
  line-height: 1.45;
}

.ai-assistant-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 18px;
  align-items: start;
  margin: 0 24px 18px;
}

.ai-assistant-layout > .panel,
.ai-scan-result > .panel {
  margin: 0;
}

.ai-chat-panel {
  min-width: 0;
}

.ai-chat-messages {
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
  padding: 2px;
}

.ai-chat-message {
  max-width: 88%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #dcebe5;
  border-radius: 8px;
  background: #f8fafc;
}

.ai-chat-message.user {
  justify-self: end;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.ai-chat-message.assistant {
  justify-self: start;
  background: #fbfefc;
}

.ai-chat-message strong {
  display: block;
  margin-bottom: 4px;
  color: #0f3f3a;
  font-size: 12px;
}

.ai-chat-message p {
  margin: 0;
  color: #334155;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.ai-chat-message small {
  display: block;
  margin-top: 6px;
  color: #b45309;
}

.ai-chat-source {
  width: fit-content;
  margin: 0 0 10px;
  padding: 5px 8px;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  background: #f0fdf4;
  color: #166534;
  font-size: 12px;
  font-weight: 800;
}

.ai-chat-attachments {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.ai-chat-attachment {
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: 48px;
  padding: 9px 11px;
  border: 1px solid #99d6cf;
  border-radius: 8px;
  background: #ecfdf5;
  color: #0f766e;
  text-align: left;
}

.ai-chat-attachment strong {
  margin: 0;
  color: #0f513f;
  font-size: 13px;
}

.ai-chat-attachment span {
  color: #475569;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.ai-chat-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.ai-chat-prompts button {
  min-height: 34px;
  white-space: normal;
}

.ai-chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}

.ai-chat-form textarea,
.ai-scan-form textarea {
  resize: vertical;
  line-height: 1.5;
}

.ai-reminder-panel .table-wrap {
  max-height: 520px;
  overflow: auto;
}

.ai-scan-layout {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.55fr);
}

.ai-guide-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ai-guide-list li {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.ai-guide-list li:last-child {
  border-bottom: 0;
}

.ai-guide-list strong {
  color: var(--text);
}

.ai-guide-list span {
  color: var(--muted);
  line-height: 1.45;
}

.ai-scan-result {
  display: grid;
  gap: 18px;
  margin: 0 24px 18px;
}

.ai-field-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.ai-field-grid > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid #dcebe5;
  border-radius: 8px;
  background: #fbfdfb;
}

.ai-field-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ai-field-grid strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  overflow-wrap: anywhere;
}

@media (max-width: 980px) {
  .ai-assistant-hero,
  .ai-assistant-layout,
  .ai-scan-layout,
  .ai-field-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-chat-form {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 520px) {
  .ai-assistant-hero,
  .ai-assistant-layout,
  .ai-scan-result {
    margin-left: 12px;
    margin-right: 12px;
  }

.ai-chat-message {
  max-width: 100%;
}
}

.app-shell {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) minmax(240px, 280px);
}

.app-shell.ai-chat-collapsed {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.ai-right-chat {
  position: sticky;
  top: 0;
  height: 100vh;
  min-width: 0;
  padding: 10px 8px;
  overflow: auto;
  border-left: 1px solid #dbe7df;
  background: #f7fbf8;
}

.ai-right-chat.collapsed {
  position: fixed;
  top: auto;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
}

.ai-chat-open-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  width: 58px;
  height: 58px;
  min-height: 0;
  padding: 0;
  border: 1px solid #99d6cf;
  border-radius: 999px;
  background: #0f766e;
  color: #ffffff;
  font-weight: 900;
  letter-spacing: 0;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(15, 63, 58, 0.24);
}

.ai-chat-open-tab:hover {
  background: #0f5f59;
}

.ai-chat-open-tab svg {
  width: 18px;
  height: 18px;
}

.ai-chat-open-tab span {
  font-size: 12px;
  line-height: 1;
}

.ai-right-chat .ai-chat-panel {
  display: grid;
  grid-template-rows: auto auto minmax(140px, 1fr) auto auto;
  min-height: calc(100vh - 20px);
  margin: 0;
  border-radius: 8px;
}

.ai-right-chat .panel-title {
  align-items: start;
  gap: 8px;
}

.ai-right-chat .panel-title h2 {
  font-size: 16px;
}

.ai-right-chat .panel-title p {
  display: none;
}

.ai-chat-title-actions {
  display: flex;
  flex-shrink: 0;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}

.ai-chat-toggle {
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #0f3f3a;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.ai-chat-toggle:hover {
  background: #f8fafc;
}

.ai-right-chat .ai-chat-messages {
  max-height: none;
  min-height: 160px;
}

.ai-right-chat .ai-chat-message {
  max-width: 100%;
  padding: 9px 10px;
}

.ai-right-chat .ai-chat-prompts {
  max-height: 94px;
  overflow: auto;
}

.ai-right-chat .ai-chat-prompts button {
  flex: 1 1 100%;
  justify-content: flex-start;
  text-align: left;
}

.ai-right-chat .ai-chat-form {
  grid-template-columns: minmax(0, 1fr);
}

.ai-right-chat .ai-chat-form textarea {
  min-height: 68px;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(255, 212, 0, 0.18), rgba(15, 118, 110, 0.12) 52%, rgba(248, 250, 252, 0.95)),
    #f8fafc;
}

.login-panel {
  width: min(860px, 100%);
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(300px, 1fr);
  overflow: hidden;
  border: 1px solid #d8e2da;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(16, 24, 40, 0.14);
}

.login-brand {
  display: grid;
  align-content: space-between;
  gap: 24px;
  padding: 28px;
  background: #0f5948;
  color: #ffffff;
}

.login-brand .brand-mark {
  width: 48px;
  height: 48px;
  background: #ffd400;
  color: #1c2b23;
}

.login-brand strong {
  display: block;
  margin-top: 18px;
  font-size: 24px;
  line-height: 1.2;
}

.login-brand span {
  display: block;
  margin-top: 8px;
  color: #dbece5;
  line-height: 1.5;
}

.login-form {
  display: grid;
  gap: 16px;
  padding: 32px;
}

.login-form h1 {
  font-size: 26px;
  color: #101828;
}

.login-form p {
  margin-top: 8px;
  color: #667085;
  line-height: 1.5;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-weight: 700;
}

.login-form input {
  min-height: 44px;
  border-color: #cfd8d3;
}

.login-form input:focus {
  outline: 2px solid rgba(15, 118, 110, 0.24);
  border-color: #0f766e;
}

.login-error {
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff1f2;
  color: #b91c1c;
  font-size: 14px;
  line-height: 1.4;
}

.login-submit {
  min-height: 44px;
}

.topbar-user {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.topbar-user span {
  flex: 0 0 auto;
  max-width: 160px;
  overflow: hidden;
  color: #344054;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-button {
  min-height: 38px;
  border-color: #cfd8d3;
  background: #ffffff;
  color: #344054;
  font-weight: 800;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr) minmax(230px, 260px);
  }

  .app-shell.ai-chat-collapsed {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-shell.ai-chat-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-right-chat {
    position: relative;
    height: auto;
    padding: 12px 16px;
    border-left: 0;
    border-top: 1px solid #dbe7df;
  }

  .ai-right-chat.collapsed {
    right: 12px;
    bottom: 12px;
    z-index: 50;
  }

  .ai-right-chat.collapsed .ai-chat-open-tab {
    width: 56px;
    height: 56px;
  }

  .ai-right-chat .ai-chat-panel {
    min-height: 0;
  }

  .ai-right-chat .ai-chat-messages {
    max-height: 280px;
  }
}

@media (max-width: 720px) {
  .login-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .login-brand {
    padding: 22px;
  }

  .login-form {
    padding: 24px;
  }
}

@media (max-width: 520px) {
  .login-shell {
    padding: 14px;
  }

  .topbar-user {
    flex: 1 1 100%;
  }

  .topbar-user span {
    max-width: none;
  }

  .topbar .logout-button {
    width: auto;
    flex: 1 1 auto;
  }
}

/* CTG unified UI override */
:root {
  --ctg-teal: #16a899;
  --ctg-teal-dark: #0e8a7d;
  --ctg-teal-soft: #e4f6f3;
  --ctg-teal-soft-2: #d2efea;
  --ctg-orange: #f39200;
  --ctg-orange-dark: #e07f00;
  --ctg-orange-soft: #fdefd9;
  --ctg-navy: #1f4e79;
  --bg: #f5f8f7;
  --surface: #ffffff;
  --surface-soft: #eff3f2;
  --line: #e6eceb;
  --line-strong: #d2dedb;
  --text: #272c33;
  --muted: #76828b;
  --primary: var(--ctg-teal);
  --primary-dark: var(--ctg-teal-dark);
  --accent: var(--ctg-orange);
  --accent-soft: var(--ctg-orange-soft);
  --green: #23a26b;
  --amber: #e0a415;
  --red: #e1564a;
  --blue: #2e86c9;
  --orange: var(--ctg-orange);
  --gray: #76828b;
  --sidebar-width: 272px;
  --shadow: 0 1px 2px rgba(20, 40, 40, 0.06), 0 12px 28px rgba(20, 60, 55, 0.06);
  --shadow-soft: 0 1px 2px rgba(20, 40, 40, 0.06);
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
}

html,
body {
  min-width: 320px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 12px;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: none;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

button:hover,
.button-link:hover {
  border-color: var(--ctg-teal);
  color: var(--ctg-teal-dark);
}

button:focus-visible,
.button-link:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.nav-item:focus-visible {
  border-color: var(--ctg-teal);
  outline: 3px solid var(--ctg-teal-soft-2);
  outline-offset: 2px;
}

button[disabled],
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.primary,
.button-link.primary,
.add-action-menu summary {
  border-color: var(--ctg-orange);
  background: linear-gradient(135deg, var(--ctg-orange), var(--ctg-orange-dark));
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(243, 146, 0, 0.24);
}

.primary:hover,
.button-link.primary:hover,
.add-action-menu summary:hover {
  border-color: var(--ctg-orange-dark);
  background: linear-gradient(135deg, #f59a12, var(--ctg-orange-dark));
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(243, 146, 0, 0.28);
}

.danger-button {
  border-color: #f4c2bd;
  background: #fce7e5;
  color: #b42318;
}

input,
select,
textarea {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 8px 10px;
  font-weight: 600;
  box-shadow: none;
}

textarea {
  min-height: 92px;
}

.app-shell {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) minmax(250px, 280px);
  min-height: 100vh;
  background: var(--bg);
}

.app-shell.ai-chat-collapsed {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 100vh;
  padding: 18px 14px;
  overflow: auto;
  border-right: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  box-shadow: none;
  scrollbar-color: rgba(118, 130, 139, 0.35) transparent;
}

.sidebar::after {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 8px 18px;
  border-bottom: 1px solid var(--line);
}

.brand-mark,
.login-brand .brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 3px solid var(--ctg-teal);
  border-radius: 50%;
  background: #ffffff;
  color: transparent;
  font-size: 0;
  font-weight: 900;
  letter-spacing: 0;
}

.brand-mark::before,
.login-brand .brand-mark::before {
  content: "CTG";
  color: var(--ctg-teal);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.brand-mark::after,
.login-brand .brand-mark::after {
  content: "";
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 16px;
  height: 16px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: var(--ctg-orange);
}

.brand strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand strong span {
  color: inherit;
  font-size: inherit;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.sidebar nav {
  display: grid;
  gap: 4px;
  padding: 16px 0 24px;
}

.nav-group,
.nav-subgroup {
  display: grid;
  gap: 3px;
}

.nav-module {
  margin-top: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.32;
  text-align: left;
  box-shadow: none;
}

.nav-parent,
.nav-module-parent {
  background: transparent;
  color: var(--text);
}

.nav-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--line-2);
  color: var(--ctg-teal-dark);
  font-size: 12px;
  font-weight: 900;
}

.nav-subitem,
.nav-section-title {
  min-height: 34px;
  padding: 7px 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
}

.nav-subitem .nav-icon,
.nav-section-title .nav-icon {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  font-size: 10px;
}

.nav-caret {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.nav-submenu {
  position: relative;
  display: grid;
  gap: 3px;
  margin: 2px 0 4px 15px;
  padding-left: 18px;
}

.nav-submenu::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 7px;
  width: 1px;
  background: var(--line);
}

.nav-group.collapsed > .nav-submenu,
.nav-subgroup.collapsed > .nav-submenu {
  display: none;
}

.nav-item span:not(.nav-icon):not(.nav-caret) {
  min-width: 0;
  overflow-wrap: anywhere;
}

.nav-item:hover,
.nav-item:focus-visible {
  border-color: var(--ctg-teal-soft-2);
  background: var(--ctg-teal-soft);
  color: var(--ctg-teal-dark);
}

.nav-item.active,
.nav-subitem.active,
.nav-section-title.active {
  border-color: var(--ctg-teal-soft-2);
  background: var(--ctg-teal-soft);
  color: var(--ctg-teal-dark);
  box-shadow: none;
}

.nav-item.active .nav-icon,
.nav-subitem.active .nav-icon,
.nav-section-title.active .nav-icon {
  background: var(--ctg-teal);
  color: #ffffff;
}

.main {
  min-width: 0;
  background: var(--bg);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  min-height: 80px;
  height: auto;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: none;
  backdrop-filter: blur(14px);
}

.project-switch {
  position: relative;
  flex: 0 1 220px;
  min-width: 220px;
}

.global-search {
  position: relative;
  flex: 1 1 460px;
  width: auto;
  max-width: 560px;
  margin-right: auto;
}

.global-search::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 12px;
  height: 12px;
  border: 2px solid var(--muted);
  border-radius: 50%;
  transform: translateY(-58%);
  pointer-events: none;
}

.global-search::after {
  content: "";
  position: absolute;
  left: 25px;
  top: calc(50% + 5px);
  width: 6px;
  height: 2px;
  border-radius: 999px;
  background: var(--muted);
  transform: rotate(45deg);
  pointer-events: none;
}

.project-switch span,
.global-search span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.project-switch select,
.global-search input {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.project-switch select {
  padding-left: 44px;
  font-weight: 800;
}

.project-switch::before {
  content: "CT";
  position: absolute;
  left: 12px;
  top: 50%;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--line-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  transform: translateY(-50%);
  pointer-events: none;
}

.global-search input {
  min-height: 40px;
  border-radius: 999px;
  background: var(--bg);
  padding-left: 42px;
}

.topbar .icon-button,
.topbar .user-menu,
.ai-chat-toggle {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 8px;
}

.topbar-user {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.topbar-user span {
  max-width: 140px;
  color: var(--text);
  font-weight: 800;
}

.user-menu {
  position: relative;
  border: 2px solid var(--ctg-teal);
  border-radius: 50%;
  background: #ffffff;
  color: var(--ctg-teal-dark);
  font-size: 12px;
  box-shadow: none;
}

.user-menu::after {
  content: "";
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 14px;
  height: 14px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: var(--ctg-orange);
}

.logout-button {
  min-height: 36px;
  border-color: var(--line);
  background: #ffffff;
  color: var(--text);
  white-space: nowrap;
}

.page-header {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: end;
  gap: 18px;
  padding: 26px 24px 16px;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  color: var(--text);
  font-size: 26px;
  font-weight: 850;
  line-height: 1.18;
}

h2 {
  color: var(--text);
}

.page-header h1 {
  display: block;
  padding-bottom: 0;
  border-bottom: 0;
}

.page-header p {
  max-width: 780px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.header-actions,
.modal-actions,
.section-tool-actions,
.table-footer div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.report-action-menu {
  position: relative;
}

.report-action-menu summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--ctg-orange);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--ctg-orange), var(--ctg-orange-dark));
  color: #ffffff;
  font-weight: 850;
  line-height: 1.2;
  cursor: pointer;
  list-style: none;
  box-shadow: 0 4px 12px rgba(243, 146, 0, 0.24);
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.report-action-menu summary::-webkit-details-marker {
  display: none;
}

.report-action-menu summary::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform 160ms ease;
}

.report-action-menu[open] summary::after {
  transform: rotate(180deg);
}

.report-action-menu summary:hover {
  border-color: var(--ctg-orange-dark);
  background: linear-gradient(135deg, #f59a12, var(--ctg-orange-dark));
  box-shadow: 0 6px 16px rgba(243, 146, 0, 0.28);
}

.report-action-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  display: grid;
  gap: 6px;
  min-width: 248px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
}

.report-action-list button {
  width: 100%;
  justify-content: flex-start;
  border-color: transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
  box-shadow: none;
  white-space: nowrap;
}

.report-action-list button:hover {
  border-color: var(--ctg-teal-soft-2);
  background: var(--ctg-teal-soft);
  color: var(--ctg-teal-dark);
}

.status-banner {
  margin: 0 24px 18px;
  border-color: var(--ctg-teal-soft-2);
  border-radius: 8px;
  background: var(--ctg-teal-soft);
  color: var(--ctg-teal-dark);
}

.status-banner span {
  color: var(--ctg-teal-dark);
}

.filter-band,
.kpi-grid,
.dashboard-summary,
.project-grid,
.project-section,
.apartment-legend,
.asset-ledger-grid,
.module-dashboard-grid,
.dashboard-grid,
.operational-notice-layout,
.table-panel,
.panel,
.import-grid,
.tabs,
.billing-tabs,
.contract-project-tabs,
.asset-ledger-tabs,
.empty-state,
.ai-assistant-hero,
.ai-assistant-layout,
.ai-scan-result {
  margin: 0 24px 18px;
}

.filter-band,
.kpi-card,
.summary-card,
.project-card,
.panel,
.table-panel,
.upload-box,
.empty-state,
.project-section,
.apartment-legend,
.modal {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.filter-band {
  gap: 12px;
  padding: 14px;
}

.dashboard-summary,
.kpi-grid,
.module-kpi-grid,
.project-grid,
.dashboard-grid,
.import-grid {
  gap: 12px;
}

.dashboard-grid,
.import-grid {
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.78fr);
}

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

.route-dashboard.operations-hidden .module-dashboard-grid {
  grid-template-columns: minmax(0, 1fr);
}

.route-dashboard.operations-hidden .dashboard-priority {
  grid-template-columns: minmax(0, 1fr);
}

.module-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kpi-card,
.summary-card {
  min-height: 116px;
  padding: 16px;
  overflow: hidden;
}

.panel,
.project-card {
  padding: 16px;
}

.summary-card::before,
.project-card::before {
  width: 0;
}

.kpi-card span,
.summary-card span,
.kpi-card small,
.summary-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
  text-transform: none;
}

.kpi-card strong,
.summary-card strong {
  display: block;
  margin: 8px 0 5px;
  color: var(--text) !important;
  font-size: 26px;
  line-height: 1.1;
}

.leasing-panel,
.operations-panel {
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.leasing-panel {
  box-shadow: inset 4px 0 0 var(--ctg-teal), var(--shadow-soft);
}

.operations-panel {
  box-shadow: inset 4px 0 0 var(--ctg-orange), var(--shadow-soft);
}

.panel-title,
.table-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-title h2,
.table-title h2,
.panel:nth-of-type(4n + 1) h2,
.panel:nth-of-type(4n + 2) h2,
.panel:nth-of-type(4n + 3) h2,
.panel:nth-of-type(4n + 4) h2 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  line-height: 1.25;
}

.panel-title p,
.table-title p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.badge,
.project-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 10px;
  border: 0;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.badge.blue {
  background: #e5f1fb;
  color: var(--blue);
}

.badge.green {
  background: #e2f6ec;
  color: var(--green);
}

.badge.amber {
  background: #fcf3da;
  color: #946400;
}

.badge.red {
  background: #fce7e5;
  color: var(--red);
}

.badge.orange {
  background: var(--ctg-orange-soft);
  color: var(--ctg-orange-dark);
}

.badge.gray,
.badge.neutral {
  background: #eef1f1;
  color: var(--muted);
}

.bar-chart {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: 150px minmax(120px, 1fr) 112px;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-size: 13px;
}

.bar-row div,
.progress {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: var(--line-2);
}

.bar-row i,
.progress i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--ctg-teal);
}

.bar-row:nth-child(3) i {
  background: var(--ctg-orange);
}

.bar-row:nth-child(4) i {
  background: var(--red);
}

.bar-row b {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.report-insight-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.45fr) minmax(280px, 1fr);
  align-items: stretch;
  gap: 12px;
  margin: 0 24px 18px;
}

.report-insight-grid > .panel {
  margin: 0;
}

.report-target-card {
  display: grid;
  align-content: start;
  gap: 14px;
  box-shadow: inset 4px 0 0 var(--ctg-orange), var(--shadow-soft);
}

.report-target-number {
  display: grid;
  gap: 2px;
}

.report-target-number strong {
  color: var(--text);
  font-size: 42px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

.report-target-number span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.report-target-meter {
  overflow: hidden;
  height: 14px;
  border-radius: 999px;
  background: var(--line-2);
}

.report-target-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ctg-orange), var(--ctg-orange-dark));
}

.report-target-meter.vacancy i {
  background: linear-gradient(90deg, var(--ctg-teal), #18a99c);
}

.report-target-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.report-target-stats div,
.report-collection-strip,
.report-empty-line {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.report-target-stats div {
  padding: 10px;
}

.report-target-stats span,
.report-collection-strip span,
.report-rank-item small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.report-target-stats strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.1;
}

.report-legend {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

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

.report-legend span::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--ctg-teal);
}

.report-legend .plan::before {
  background: var(--ctg-orange);
}

.report-legend .gap::before {
  background: var(--red);
}

.report-comparison-chart,
.report-rank-list {
  display: grid;
  gap: 10px;
}

.report-comparison-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.78fr) minmax(220px, 1.4fr) 58px;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.report-comparison-label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.report-comparison-label .project-badge {
  width: fit-content;
}

.report-comparison-label span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-comparison-bars {
  display: grid;
  gap: 6px;
  min-width: 0;
}

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

.report-comparison-line i {
  display: block;
  min-width: 4px;
  height: 9px;
  border-radius: 999px;
  background: var(--ctg-teal);
}

.report-comparison-line.plan i {
  background: var(--ctg-orange);
}

.report-comparison-line.gap i {
  background: var(--red);
}

.report-comparison-line span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.report-rate {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.report-rank-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.report-rank-item:first-child {
  padding-top: 0;
}

.report-rank-item:last-child {
  border-bottom: 0;
}

.report-rank-item span {
  min-width: 0;
}

.report-rank-item strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-rank-item b {
  color: var(--ctg-orange-dark);
  font-size: 14px;
  font-weight: 900;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.report-rank-item b small {
  margin-top: 2px;
  text-align: right;
}

.report-collection-strip,
.report-empty-line {
  margin-top: 12px;
  padding: 12px;
}

.report-collection-strip strong {
  display: block;
  margin: 2px 0;
  color: var(--text);
  font-size: 24px;
  font-weight: 900;
  line-height: 1.1;
}

.report-collection-strip.vacancy strong {
  color: var(--ctg-teal-dark);
}

.report-empty-line {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

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

.attention-list div,
.asset-unit-button,
.asset-checklist-item,
.unit-link-summary,
.invoice-detail-actions,
.ai-key-status {
  border-color: var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.table-panel {
  overflow: hidden;
}

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

.table-panel > .table-wrap {
  border: 0;
  border-radius: 0;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 13px;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  background: var(--ctg-teal);
  color: #ffffff;
  font-size: 12px;
  font-weight: 850;
  text-align: left;
  white-space: nowrap;
}

td {
  color: var(--text);
  font-size: 13px;
}

tbody tr:nth-child(even) td {
  background: var(--line-2);
}

tbody tr:hover td {
  background: var(--ctg-teal-soft);
}

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

.table-footer {
  align-items: center;
  min-height: 50px;
  border-top: 1px solid var(--line);
  padding: 10px 16px;
  color: var(--muted);
  font-size: 12px;
}

.table-link,
.active-page {
  color: var(--ctg-teal-dark);
}

.active-page {
  background: var(--ctg-teal-soft) !important;
}

.tabs,
.billing-tabs,
.contract-project-tabs,
.asset-ledger-tabs {
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.tabs button,
.billing-tabs button,
.contract-project-tabs button,
.asset-ledger-tabs button,
.project-type-tab {
  min-width: max-content;
  border-radius: 999px;
  background: #ffffff;
  color: var(--text);
}

.tabs .active,
.billing-tabs .active,
.contract-project-tabs .active,
.asset-ledger-tabs .active,
.project-type-tab.active {
  border-color: var(--ctg-teal);
  background: var(--ctg-teal);
  color: #ffffff;
}

.section-search-meta span,
.section-search-field,
.chip,
.apartment-column-option {
  border-color: var(--line);
  background: var(--line-2);
  color: var(--muted);
}

.section-search-field.active,
.section-search-field[aria-pressed="true"],
.apartment-column-option input:checked + .apartment-column-check {
  border-color: var(--ctg-teal);
  background: var(--ctg-teal);
  color: #ffffff;
}

.floor-stack,
.floor-label,
.unit-tile,
.detail-grid div,
.document-shell,
.contract-preview,
.notice-preview {
  border-color: var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.unit-tile {
  box-shadow: var(--shadow-soft);
}

.unit-tile.occupied {
  border-color: var(--ctg-teal-soft-2);
  background: var(--ctg-teal-soft);
}

.unit-tile.vacant,
.unit-tile.available {
  border-color: #f0d9a8;
  background: var(--ctg-orange-soft);
}

.unit-tile.risk {
  border-color: #f4c2bd;
  background: #fce7e5;
}

.asset-unit-button.active {
  border-color: var(--ctg-teal);
  background: var(--ctg-teal);
  color: #ffffff;
}

.asset-unit-button.active small,
.asset-unit-button.active em {
  color: #dff7f3;
}

.project-tnt,
.project-ctn {
  border-color: #c7e0f4;
  background: #e5f1fb;
  color: #1f4e79;
}

.project-tn {
  border-color: #c6ead9;
  background: #e2f6ec;
  color: #176d4b;
}

.project-eco {
  border-color: var(--ctg-teal-soft-2);
  background: var(--ctg-teal-soft);
  color: var(--ctg-teal-dark);
}

.project-other {
  border-color: var(--line-strong);
  background: #eef1f1;
  color: var(--text);
}

.project-tnt::before,
.project-badge.project-tnt,
.project-card.project-tnt .project-card-head span {
  background: var(--blue);
  color: #ffffff;
}

.project-tn::before,
.project-badge.project-tn,
.project-card.project-tn .project-card-head span {
  background: var(--green);
  color: #ffffff;
}

.project-eco::before,
.project-badge.project-eco,
.project-card.project-eco .project-card-head span {
  background: var(--ctg-teal);
  color: #ffffff;
}

.project-other::before,
.project-badge.project-other,
.project-card.project-other .project-card-head span {
  background: var(--muted);
  color: #ffffff;
}

.modal-backdrop {
  background: rgba(39, 44, 51, 0.46);
  backdrop-filter: blur(4px);
}

.modal {
  border-radius: 8px;
}

.modal-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.form-grid label,
.compact-filter-select,
label {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.warning,
.warning-list {
  border: 1px solid #f0d9a8;
  border-radius: 8px;
  background: var(--ctg-orange-soft);
  color: #7a4f00;
}

.success-text {
  color: var(--green);
}

.ai-right-chat {
  position: sticky;
  top: 0;
  height: 100vh;
  min-width: 0;
  padding: 10px 8px;
  overflow: auto;
  border-left: 1px solid var(--line);
  background: var(--bg);
}

.ai-right-chat .ai-chat-panel {
  border-color: var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.ai-right-chat .panel-title h2 {
  font-size: 16px;
}

.ai-chat-source,
.ai-chat-attachment,
.ai-chat-message.user {
  border-color: var(--ctg-teal-soft-2);
  background: var(--ctg-teal-soft);
  color: var(--ctg-teal-dark);
}

.ai-chat-message.assistant {
  border-color: var(--line);
  background: #ffffff;
}

.ai-chat-form .primary,
.ai-chat-open-tab,
.ai-assistant-hero .primary {
  border-color: var(--ctg-teal);
  background: var(--ctg-teal);
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(22, 168, 153, 0.22);
}

.ai-chat-form .primary:hover,
.ai-chat-open-tab:hover,
.ai-assistant-hero .primary:hover {
  border-color: var(--ctg-teal-dark);
  background: var(--ctg-teal-dark);
  color: #ffffff;
}

.ai-assistant-hero {
  border: 1px solid var(--ctg-teal-soft-2);
  border-left: 4px solid var(--ctg-teal);
  background: linear-gradient(135deg, #ffffff, var(--ctg-teal-soft));
}

.login-shell {
  background: var(--bg);
}

.login-panel {
  border-color: var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-brand {
  background: var(--ctg-teal-dark);
  color: #ffffff;
}

.login-brand span {
  color: #dff7f3;
}

.login-submit {
  border-color: var(--ctg-orange);
  background: linear-gradient(135deg, var(--ctg-orange), var(--ctg-orange-dark));
  color: #ffffff;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 232px minmax(0, 1fr) minmax(230px, 260px);
  }

  .app-shell.ai-chat-collapsed {
    grid-template-columns: 232px minmax(0, 1fr);
  }

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

  .dashboard-summary,
  .kpi-grid,
  .project-grid,
  .module-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .app-shell,
  .app-shell.ai-chat-collapsed {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    height: auto;
    max-height: 42vh;
    padding: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: auto;
  }

  .brand {
    min-height: 48px;
    padding: 4px 4px 10px;
  }

  .sidebar nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 0 2px;
    scrollbar-width: none;
  }

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

  .nav-group {
    flex: 0 0 auto;
  }

  .nav-group > .nav-item,
  .nav-item {
    min-width: max-content;
  }

  .nav-submenu {
    max-height: 220px;
    overflow: auto;
    min-width: 210px;
    padding: 8px;
    margin: 4px 0 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow);
  }

  .nav-submenu::before {
    display: none;
  }

  .topbar {
    position: static;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }

  .project-switch,
  .global-search {
    flex: 1 1 100%;
    min-width: 0;
    max-width: none;
  }

  .topbar .icon-button,
  .topbar .user-menu {
    flex: 0 0 42px;
    width: 42px;
    min-height: 42px;
  }

  .topbar-user {
    flex: 1 1 100%;
  }

  .topbar-user span {
    flex: 1 1 auto;
    max-width: none;
  }

  .logout-button {
    flex: 0 0 auto;
  }

  .page-header {
    grid-template-columns: 1fr;
    align-items: start;
    padding: 18px 12px 16px;
  }

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

  .report-action-menu,
  .report-action-menu summary,
  .report-action-list {
    width: 100%;
  }

  .report-action-list {
    position: static;
    margin-top: 8px;
    min-width: 0;
  }

  .report-action-list button {
    justify-content: flex-start;
    white-space: normal;
  }

  h1 {
    font-size: 24px;
  }

  .filter-band,
  .kpi-grid,
  .dashboard-summary,
  .project-grid,
  .project-section,
  .apartment-legend,
  .asset-ledger-grid,
  .module-dashboard-grid,
  .dashboard-grid,
  .operational-notice-layout,
  .table-panel,
  .panel,
  .import-grid,
  .tabs,
  .billing-tabs,
  .contract-project-tabs,
  .asset-ledger-tabs,
  .status-banner,
  .empty-state,
  .ai-assistant-hero,
  .ai-assistant-layout,
  .ai-scan-result {
    margin-left: 12px;
    margin-right: 12px;
  }

  .dashboard-summary,
  .kpi-grid,
  .project-grid,
  .module-kpi-grid,
  .module-dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .bar-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .bar-row b {
    text-align: left;
  }

  .panel-title,
  .table-title,
  .invoice-ledger-head,
  .document-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .ai-right-chat {
    position: relative;
    height: auto;
    padding: 12px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .ai-right-chat.collapsed {
    position: fixed;
    right: 12px;
    bottom: 12px;
    z-index: 50;
    width: auto;
    height: auto;
    padding: 0;
    overflow: visible;
    border: 0;
    background: transparent;
  }
}

@media (max-width: 520px) {
  .page-header {
    padding-left: 10px;
    padding-right: 10px;
  }

  .topbar {
    padding-left: 10px;
    padding-right: 10px;
  }

  .filter-band,
  .kpi-grid,
  .module-dashboard-grid,
  .module-kpi-grid,
  .dashboard-summary,
  .project-grid,
  .project-section,
  .apartment-legend,
  .ai-summary-banner,
  .asset-ledger-grid,
  .dashboard-grid,
  .table-panel,
  .panel,
  .import-grid,
  .tabs,
  .billing-tabs,
  .contract-project-tabs,
  .asset-ledger-tabs,
  .status-banner,
  .empty-state,
  .ai-assistant-hero,
  .ai-assistant-layout,
  .ai-scan-result {
    margin-left: 10px;
    margin-right: 10px;
  }

  .header-actions button,
  .section-tool-actions button,
  .topbar > button,
  .topbar .icon-button,
  .topbar .user-menu {
    width: auto;
  }

  .header-actions {
    gap: 8px;
  }

  .header-actions button {
    flex: 1 1 auto;
  }

  .kpi-card,
  .summary-card,
  .panel,
  .project-card {
    padding: 14px;
  }

  .login-shell {
    padding: 14px;
  }
}

/* Sidebar information architecture refinement */
.sidebar {
  padding-left: 12px;
  padding-right: 12px;
}

.sidebar nav {
  gap: 8px;
  padding-top: 14px;
}

.sidebar nav > .nav-item {
  min-height: 42px;
  padding: 9px 12px;
}

.sidebar nav > .nav-item.active {
  border-color: var(--ctg-teal-soft-2);
  background: var(--ctg-teal-soft);
  color: var(--ctg-teal-dark);
}

.sidebar nav > .nav-module + .nav-module {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.nav-module {
  gap: 5px;
}

.nav-module > .nav-parent {
  min-height: 42px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text);
}

.nav-module.open > .nav-parent {
  border-color: var(--line);
  background: #f8fbfa;
}

.nav-module.active > .nav-parent {
  border-color: var(--ctg-teal-soft-2);
  background: var(--ctg-teal-soft);
  color: var(--ctg-teal-dark);
}

.nav-module > .nav-submenu {
  gap: 3px;
  margin: 4px 0 10px 12px;
  padding: 4px 0 4px 12px;
  border-left: 1px solid var(--ctg-teal-soft-2);
}

.nav-module > .nav-submenu::before,
.nav-submenu-nested::before {
  display: none;
}

.nav-subgroup {
  gap: 2px;
}

.nav-section-title {
  position: relative;
  min-height: 38px;
  padding: 8px 9px 8px 14px;
  border-radius: 7px;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.nav-section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: var(--ctg-teal);
  opacity: 0.75;
}

.nav-subgroup.open > .nav-section-title {
  border-color: transparent;
  background: #f8fbfa;
}

.nav-subgroup.active > .nav-section-title {
  border-color: var(--ctg-teal-soft-2);
  background: var(--ctg-teal-soft);
  color: var(--ctg-teal-dark);
}

.nav-submenu-nested {
  gap: 2px;
  margin: 2px 0 8px 12px;
  padding: 3px 0 3px 14px;
  border-left: 1px solid var(--line);
}

.nav-subitem {
  position: relative;
  min-height: 34px;
  padding: 7px 9px 7px 18px;
  border-radius: 7px;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 750;
}

.nav-subitem::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--line-strong);
  transform: translateY(-50%);
}

.nav-subitem:hover,
.nav-section-title:hover {
  border-color: transparent;
  background: #f8fbfa;
  color: var(--ctg-teal-dark);
}

.nav-subitem.active {
  border-color: transparent;
  background: #ffffff;
  color: var(--ctg-teal-dark);
  box-shadow: inset 3px 0 0 var(--ctg-teal);
}

.nav-subitem.active::before {
  background: var(--ctg-teal);
}

.nav-item span:not(.nav-icon):not(.nav-caret) {
  line-height: 1.25;
}

.nav-caret {
  display: inline-grid;
  place-items: center;
  width: 16px;
  color: var(--muted);
  font-size: 10px;
}

.nav-icon {
  font-size: 0;
}

.nav-icon::before {
  content: "";
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: currentColor;
}

.sidebar nav > .nav-item .nav-icon,
.nav-module > .nav-parent .nav-icon {
  background: var(--ctg-teal-soft);
  color: var(--ctg-teal-dark);
}

.sidebar nav > .nav-item.active .nav-icon,
.nav-module.active > .nav-parent .nav-icon {
  background: var(--ctg-teal);
  color: #ffffff;
}

.nav-section-title .nav-icon,
.nav-subitem .nav-icon {
  display: none;
}

@media (max-width: 860px) {
  .sidebar nav > .nav-module + .nav-module {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  .nav-module > .nav-submenu {
    margin: 4px 0 0;
    padding: 8px;
    border-left: 0;
  }

  .nav-submenu-nested {
    margin-left: 8px;
  }
}

/* Contract asset overview layout */
.asset-overview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
  margin: 0 24px 18px;
}

.asset-overview-layout > .table-panel,
.asset-overview-layout > .panel {
  margin: 0;
}

.asset-type-summary-panel {
  width: 100%;
  min-width: 0;
}

.asset-overview-title {
  align-items: center;
  padding: 16px 16px 12px;
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.asset-overview-title h2 {
  font-size: 20px;
}

.asset-type-summary-panel .table-wrap {
  border: 0;
  border-radius: 0;
}

.asset-type-summary-table {
  min-width: 0;
  width: 100%;
}

.asset-type-summary-table th,
.asset-type-summary-table td {
  padding-left: 18px;
  padding-right: 18px;
}

.asset-type-link {
  background: var(--ctg-teal-soft);
  color: var(--ctg-teal-dark);
}

.asset-type-link:hover {
  background: var(--ctg-teal-soft-2);
}

.asset-type-number {
  background: #f6f8f8;
}

.asset-overview-aside {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 96px;
}

.asset-overview-kpis {
  display: grid;
  gap: 10px;
}

.asset-overview-kpis > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.asset-overview-kpis span,
.asset-overview-kpis small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.asset-overview-kpis strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 20px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.asset-overview-kpis small {
  margin-top: 4px;
  font-weight: 700;
}

.asset-top-list {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.asset-top-list h3 {
  margin: 0 0 2px;
  color: var(--text);
  font-size: 15px;
}

.asset-top-list button {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 8px;
  border-color: var(--line);
  background: #ffffff;
  text-align: left;
}

.asset-top-list button span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--ctg-teal-soft);
  color: var(--ctg-teal-dark);
  font-size: 12px;
  font-weight: 900;
}

.asset-top-list button strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-top-list button em {
  color: var(--ctg-teal-dark);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.asset-top-list button:hover {
  border-color: var(--ctg-teal-soft-2);
  background: var(--ctg-teal-soft);
}

@media (max-width: 1180px) {
  .asset-overview-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .asset-overview-aside {
    position: static;
  }

  .asset-overview-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .asset-overview-layout {
    margin-left: 12px;
    margin-right: 12px;
  }
}

@media (max-width: 560px) {
  .asset-overview-layout {
    margin-left: 10px;
    margin-right: 10px;
  }

  .asset-overview-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .asset-overview-kpis {
    grid-template-columns: minmax(0, 1fr);
  }

  .asset-type-summary-table {
    min-width: 620px;
  }
}

/* Keep asset unit rows aligned across different project badge widths. */
.asset-unit-button {
  grid-template-columns: minmax(0, 1fr);
  justify-items: stretch;
  align-content: center;
  padding: 9px 12px;
}

.asset-unit-button .asset-unit-main,
.asset-unit-button .asset-unit-meta,
.asset-unit-button .asset-unit-count {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  column-gap: 10px;
  align-items: center;
  min-width: 0;
}

.asset-unit-button .asset-unit-main {
  gap: 10px;
}

.asset-unit-button .project-badge {
  justify-content: center;
  width: 52px;
  min-height: 24px;
  padding-inline: 8px;
}

.asset-unit-button .asset-unit-meta::before,
.asset-unit-button .asset-unit-count::before {
  content: "";
}

.asset-unit-button .asset-unit-meta,
.asset-unit-button .asset-unit-count {
  overflow: hidden;
}

.asset-unit-button .asset-unit-main strong,
.asset-unit-button .asset-unit-meta span,
.asset-unit-button .asset-unit-count span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-checklist-form {
  gap: 12px;
}

.asset-checklist-table {
  display: grid;
  gap: 6px;
}

.asset-entry-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.asset-entry-toolbar span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.asset-entry-toolbar button,
.asset-row-remove {
  min-height: 32px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
}

.asset-checklist-rows {
  display: grid;
  gap: 6px;
}

.asset-checklist-header,
.asset-checklist-row {
  display: grid;
  grid-template-columns: minmax(118px, 1.25fr) 56px 64px minmax(96px, 0.85fr) minmax(96px, 1fr) 42px;
  gap: 6px;
  align-items: center;
}

.asset-checklist-header {
  padding: 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.asset-checklist-row {
  min-height: 46px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.asset-checklist-row.has-value {
  border-color: var(--ctg-teal-soft-2);
  background: #fffdf3;
}

.asset-checklist-row input,
.asset-checklist-row select {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 6px;
}

.asset-checklist-row:focus-within {
  border-color: var(--ctg-teal);
  box-shadow: 0 0 0 2px var(--ctg-teal-soft);
}

.asset-row-remove {
  color: var(--muted);
}

.asset-checklist-summary {
  align-self: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.asset-checklist-form .asset-bulk-fields {
  grid-template-columns: minmax(150px, 220px) minmax(180px, 1fr) auto;
}

@media (max-width: 960px) {
  .asset-checklist-header {
    display: none;
  }

  .asset-checklist-row {
    grid-template-columns: minmax(0, 1fr) 70px 46px;
  }

  .asset-checklist-row [data-asset-unit],
  .asset-checklist-row [data-asset-status],
  .asset-checklist-row [data-asset-note] {
    grid-column: 1 / -1;
  }

  .asset-checklist-form .asset-bulk-fields {
    grid-template-columns: minmax(0, 1fr);
  }
}

.muted-text {
  color: var(--muted);
  font-size: 12px;
}

.audit-log-table tbody tr[data-view-audit-log] {
  cursor: pointer;
}

.audit-log-table tbody tr[data-view-audit-log]:hover {
  background: #f8fbfa;
}

.audit-log-table .tag-chip {
  margin: 1px 4px 1px 0;
}

.audit-log-modal {
  width: min(1120px, 100%);
}

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

.audit-detail-grid > div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfa;
}

.audit-detail-grid span {
  color: var(--muted);
  font-size: 12px;
}

.audit-detail-grid strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

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

.audit-payload-grid h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.audit-payload-grid pre {
  min-height: 260px;
  max-height: 52vh;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .audit-detail-grid,
  .audit-payload-grid {
    grid-template-columns: 1fr;
  }
}

/* Sidebar icon polish */
.nav-icon {
  border: 1px solid var(--ctg-teal-soft-2);
  background: #eefaf8;
  color: var(--ctg-teal-dark);
}

.nav-icon::before {
  display: none;
}

.nav-icon svg {
  display: block;
  width: 15px;
  height: 15px;
}

.sidebar nav > .nav-item.active .nav-icon,
.nav-module.active > .nav-parent .nav-icon {
  border-color: var(--ctg-teal);
  background: var(--ctg-teal);
  color: #ffffff;
}

.nav-module > .nav-submenu,
.nav-submenu-nested {
  position: relative;
  border-left: 0;
}

.nav-module > .nav-submenu {
  margin: 6px 0 10px 10px;
  padding: 4px 0 4px 20px;
}

.nav-submenu-nested {
  margin: 2px 0 8px 10px;
  padding: 3px 0 3px 20px;
}

.nav-module > .nav-submenu::after,
.nav-submenu-nested::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: 6px;
  top: 9px;
  bottom: 9px;
  width: 1px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(17, 171, 153, 0.16), rgba(17, 171, 153, 0.42), rgba(17, 171, 153, 0.16));
}

.nav-section-title,
.nav-subitem {
  position: relative;
  z-index: 1;
}

.nav-section-title {
  padding-left: 24px;
}

.nav-subitem {
  padding-left: 28px;
}

.nav-section-title::before,
.nav-subitem::before {
  content: "";
  position: absolute;
  z-index: 2;
  left: 2px;
  top: 50%;
  width: 9px;
  height: 9px;
  border: 1.5px solid #b9ddd6;
  border-radius: 3px;
  background: #ffffff;
  box-shadow: 0 0 0 3px #f6fbfa;
  transform: translateY(-50%);
}

.nav-subgroup.active > .nav-section-title::before,
.nav-section-title.active::before,
.nav-subitem.active::before {
  border-color: var(--ctg-teal);
  background: var(--ctg-teal);
  box-shadow: 0 0 0 3px var(--ctg-teal-soft);
}

.nav-subgroup.open > .nav-section-title,
.nav-subitem:hover,
.nav-section-title:hover {
  background: #f6fbfa;
}

.nav-subitem.active {
  border-color: var(--ctg-teal-soft-2);
  background: var(--ctg-teal-soft);
  box-shadow: none;
}

.nav-caret {
  font-size: 0;
}

.nav-caret::before {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  transform-origin: center;
}

.nav-module.collapsed > .nav-parent .nav-caret::before,
.nav-subgroup.collapsed > .nav-section-title .nav-caret::before {
  transform: rotate(-45deg);
}

@media (max-width: 860px) {
  .nav-module > .nav-submenu {
    margin: 4px 0 0;
    padding: 6px 0 6px 20px;
  }

  .nav-submenu-nested {
    margin-left: 8px;
  }
}

/* Sidebar nested icon cleanup */
.nav-section-title,
.nav-subitem {
  padding-left: 10px;
}

.nav-section-title::before,
.nav-subitem::before {
  display: none;
}

.nav-section-title .nav-icon,
.nav-subitem .nav-icon {
  display: inline-grid;
  flex: 0 0 auto;
  border: 1px solid #d8eeea;
  background: #f6fbfa;
  color: #087f73;
}

.nav-section-title .nav-icon {
  width: 20px;
  height: 20px;
  border-radius: 6px;
}

.nav-subitem .nav-icon {
  width: 18px;
  height: 18px;
  border-color: #d8eeea;
  background: #ffffff;
  color: #188b7f;
}

.nav-section-title .nav-icon svg,
.nav-subitem .nav-icon svg {
  width: 12px;
  height: 12px;
}

.nav-subitem .nav-icon svg {
  width: 11px;
  height: 11px;
}

.nav-subgroup.active > .nav-section-title .nav-icon,
.nav-section-title.active .nav-icon,
.nav-subitem.active .nav-icon {
  border-color: var(--ctg-teal);
  background: var(--ctg-teal);
  color: #ffffff;
}

.nav-subitem.active {
  background: #e4f5f2;
}

/* Modal stacking fix */
.modal-backdrop {
  z-index: 100;
}

/* AI chat popup: floats over content, never reserves layout space */
.app-shell,
.app-shell.ai-chat-collapsed {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.ai-chat-layer {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 90;
  width: min(420px, calc(100vw - 36px));
  pointer-events: none;
}

.ai-chat-layer.collapsed {
  width: auto;
}

.ai-chat-layer > * {
  pointer-events: auto;
}

.ai-chat-popover {
  width: 100%;
}

.ai-chat-layer .ai-chat-panel {
  display: grid;
  grid-template-rows: auto auto minmax(160px, 1fr) auto auto;
  max-height: min(720px, calc(100vh - 36px));
  min-height: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.22);
}

.ai-chat-layer .panel-title {
  align-items: start;
  gap: 10px;
}

.ai-chat-layer .panel-title h2 {
  font-size: 16px;
}

.ai-chat-layer .panel-title p {
  display: none;
}

.ai-chat-layer .ai-chat-title-actions {
  flex-wrap: wrap;
}

.ai-chat-layer .ai-chat-source {
  max-width: 100%;
  white-space: normal;
}

.ai-chat-layer .ai-chat-messages {
  max-height: min(420px, calc(100vh - 300px));
  min-height: 160px;
  overflow: auto;
}

.ai-chat-layer .ai-chat-message {
  max-width: 100%;
}

.ai-chat-layer .ai-chat-prompts {
  max-height: 96px;
  overflow: auto;
}

.ai-chat-layer .ai-chat-prompts button {
  flex: 1 1 100%;
  justify-content: flex-start;
  text-align: left;
}

.ai-chat-layer .ai-chat-form {
  grid-template-columns: minmax(0, 1fr);
}

.ai-chat-layer .ai-chat-form textarea {
  min-height: 72px;
  max-height: 160px;
}

.ai-chat-layer .ai-chat-open-tab {
  box-shadow: 0 16px 36px rgba(15, 63, 58, 0.28);
}

@media (max-width: 860px) {
  .app-shell,
  .app-shell.ai-chat-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .ai-chat-layer {
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
  }

  .ai-chat-layer.collapsed {
    left: auto;
  }

  .ai-chat-layer .ai-chat-panel {
    max-height: calc(100vh - 20px);
  }

  .ai-chat-layer .ai-chat-messages {
    max-height: calc(100vh - 310px);
  }
}

/* Sidebar hierarchy alignment */
.sidebar nav {
  gap: 8px;
}

.nav-group,
.nav-subgroup {
  min-width: 0;
  padding-left: 0;
  border-left: 0;
}

.nav-item,
.nav-section-title,
.nav-subitem {
  display: grid;
  align-items: center;
  width: 100%;
  min-width: 0;
  text-align: left;
}

.sidebar nav > .nav-item,
.nav-module > .nav-parent {
  grid-template-columns: 22px minmax(0, 1fr) 14px;
  column-gap: 10px;
  min-height: 42px;
  padding: 9px 12px;
}

.nav-section-title {
  grid-template-columns: 22px minmax(0, 1fr) 14px;
  column-gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
}

.nav-subitem {
  grid-template-columns: 22px minmax(0, 1fr);
  column-gap: 10px;
  min-height: 36px;
  padding: 8px 10px;
}

.nav-module > .nav-submenu,
.nav-submenu-nested {
  position: relative;
  display: grid;
  gap: 4px;
  border-left: 0;
}

.nav-module > .nav-submenu {
  margin: 6px 0 10px 16px;
  padding: 4px 0 4px 14px;
}

.nav-submenu-nested {
  margin: 3px 0 8px 18px;
  padding: 3px 0 3px 14px;
}

.nav-module > .nav-submenu::after,
.nav-submenu-nested::after {
  left: 0;
  top: 7px;
  bottom: 7px;
}

.nav-icon,
.nav-section-title .nav-icon,
.nav-subitem .nav-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.nav-section-title .nav-icon,
.nav-subitem .nav-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}

.nav-section-title .nav-icon svg,
.nav-subitem .nav-icon svg {
  width: 12px;
  height: 12px;
}

.nav-caret {
  justify-self: end;
  width: 14px;
}

.nav-item span:not(.nav-icon):not(.nav-caret) {
  min-width: 0;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

@media (max-width: 860px) {
  .nav-module > .nav-submenu {
    margin: 5px 0 8px 14px;
    padding-left: 12px;
  }

  .nav-submenu-nested {
    margin-left: 16px;
    padding-left: 12px;
  }
}

@media (max-width: 1180px) {
  .report-insight-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .report-comparison-row {
    grid-template-columns: minmax(120px, 0.62fr) minmax(220px, 1fr) 58px;
  }
}

@media (max-width: 640px) {
  .report-insight-grid {
    margin-left: 12px;
    margin-right: 12px;
  }

  .report-target-stats {
    grid-template-columns: minmax(0, 1fr);
  }

  .report-comparison-row,
  .report-comparison-line,
  .report-rank-item {
    grid-template-columns: minmax(0, 1fr);
  }

  .report-comparison-line span,
  .report-rate,
  .report-rank-item b,
  .report-rank-item b small {
    text-align: left;
  }

  .report-comparison-label span,
  .report-rank-item strong {
    white-space: normal;
  }
}

/* Dashboard rent bars */
.bar-row.debt i {
  background: var(--red);
}

