:root {
  --bg: #0f1117;
  --surface: #181c27;
  --surface2: #1f2433;
  --border: #2a3044;
  --border2: #353d56;
  --text: #f6f9ff;
  --text2: #c0c9e2;
  --text3: #949fba;
  --accent: #e8f05a;
  --accent2: #c8d63a;
  --green: #3ddc84;
  --red: #ff4d4d;
  --text3-muted: #949fba;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", sans-serif;
  min-height: 100vh;
}

.landing {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.landing[hidden] {
  display: none !important;
}

.landing-header {
  flex-shrink: 0;
  min-height: 78px;
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.landing-title {
  font-family: "DM Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(18px, 2.5vw, 24px);
  line-height: 1.45;
  margin: 0;
  display: inline-block;
  padding-bottom: 0.2em;
  letter-spacing: 0.02em;
  color: var(--text);
}

.status-group {
  display: flex;
  gap: 10px;
  align-items: center;
}

.status-pill {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  font-family: "DM Mono", monospace;
  font-size: 11px;
  color: var(--text2);
  display: flex;
  gap: 7px;
  align-items: center;
}

.status-pill.clickable {
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, transform 0.15s;
}

.status-pill.clickable:hover {
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-1px);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--text3-muted);
}

.dot.active {
  background: var(--green);
  box-shadow: 0 0 7px rgba(61, 220, 132, 0.75);
}

.landing-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 300px;
  min-height: 0;
  min-height: calc(100vh - 78px);
}

.landing-listing {
  overflow-y: auto;
  padding: 24px 28px 32px;
  background: var(--bg);
  border-right: 1px solid var(--border);
}

.landing-listing h2,
.landing-listing .data-view-title {
  font-family: "Syne", sans-serif;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 16px;
}

.landing-listing p {
  color: var(--text2);
  line-height: 1.55;
  margin-bottom: 14px;
  max-width: 72ch;
}

.data-view-intro {
  color: var(--text2);
  line-height: 1.5;
  margin-bottom: 20px;
  max-width: 72ch;
}

.home-mobile-link-wrap {
  margin-bottom: 16px;
}

.home-mobile-link {
  display: inline-block;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: "DM Mono", monospace;
  font-size: 12px;
  color: var(--text2);
  text-decoration: none;
}

.home-mobile-link:hover {
  border-color: var(--accent);
  color: var(--text);
}

.property-filter-panel {
  margin-bottom: 28px;
  max-width: 960px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px 20px;
  margin-bottom: 16px;
}

.filter-field label {
  display: block;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 6px;
}

.filter-field input,
.filter-field select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  padding: 10px;
  font-size: 13px;
  outline: none;
  font-family: "DM Sans", sans-serif;
}

.filter-field input:focus,
.filter-field select:focus {
  border-color: var(--accent);
}

.property-search-btn {
  width: auto;
  min-width: 160px;
  margin-top: 0;
}

.property-search-message {
  margin-top: 14px;
  font-family: "DM Mono", monospace;
  font-size: 12px;
  color: var(--text2);
  min-height: 18px;
}

.property-search-message--error {
  color: var(--red);
}

.property-table-scroll {
  overflow-x: auto;
  max-width: 100%;
}

.property-manager-sections {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 4px;
}

.property-manager-section {
  padding: 12px 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface2);
}

.property-manager-section--scope {
  background: rgba(232, 240, 90, 0.07);
  border-color: rgba(232, 240, 90, 0.32);
}

.property-manager-section--scope .property-manager-section-title {
  color: var(--accent);
}

.property-manager-section--review {
  background: rgba(120, 180, 255, 0.07);
  border-color: rgba(120, 180, 255, 0.32);
}

.property-manager-section--review .property-manager-section-title {
  color: #78b4ff;
}

.property-manager-section--repairs {
  background: rgba(255, 184, 77, 0.09);
  border-color: rgba(255, 184, 77, 0.35);
}

.property-manager-section--repairs .property-manager-section-title {
  color: #ffb84d;
}

.property-manager-section-title {
  font-family: "Syne", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  margin: 0 0 10px;
}

.property-manager-section-count {
  font-family: "DM Mono", monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--text3);
  margin-left: 6px;
}

.property-manager-section .property-table-scroll {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}

.property-manager-section-empty {
  margin-top: 0;
  border: none;
  background: transparent;
  padding: 12px 4px 4px;
  font-size: 12px;
}

.property-results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

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

.property-results-table th {
  background: var(--surface2);
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text3);
  white-space: nowrap;
}

.property-th-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  font: inherit;
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.property-th-sort-btn:hover {
  color: var(--text2);
}

.property-th-sort-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.property-th-sort-indicator {
  font-size: 9px;
  line-height: 1;
  opacity: 0.85;
}

.property-th-sortable.property-th-sort--asc .property-th-sort-indicator::after {
  content: "▲";
}

.property-th-sortable.property-th-sort--desc .property-th-sort-indicator::after {
  content: "▼";
}

.property-results-table td {
  color: var(--text2);
}

.property-results-table .property-table-checklist-col {
  width: 42px;
  max-width: 42px;
  text-align: center;
  vertical-align: middle;
  padding-left: 8px;
  padding-right: 8px;
}

.property-results-table .property-table-lock-col {
  width: 42px;
  max-width: 42px;
  text-align: center;
  vertical-align: middle;
  padding-left: 8px;
  padding-right: 8px;
}

.property-results-table .property-table-repair-col {
  width: 42px;
  max-width: 42px;
  text-align: center;
  vertical-align: middle;
  padding-left: 8px;
  padding-right: 8px;
}

.property-results-table .property-table-edit-col {
  width: 42px;
  max-width: 42px;
  text-align: center;
  vertical-align: middle;
  padding-left: 8px;
  padding-right: 8px;
}

.property-checklist-icon {
  display: block;
  width: 18px;
  height: 18px;
  margin: 0 auto;
  color: var(--text3);
}

.property-results-table td .property-checklist-icon {
  color: var(--accent);
}

.property-results-table td .property-repair-icon {
  color: var(--amber);
}

.property-checklist-open-btn,
.property-repair-open-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 6px 4px;
  margin: 0;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  color: inherit;
}

.property-checklist-open-btn:hover {
  background: rgba(232, 240, 90, 0.08);
}

.property-checklist-open-btn:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

.property-repair-open-btn:hover {
  background: rgba(255, 184, 77, 0.12);
}

.property-repair-open-btn:focus-visible {
  outline: 1px solid var(--amber);
  outline-offset: 2px;
}

.property-cost-lock-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 6px 4px;
  margin: 0;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  color: inherit;
}

.property-cost-lock-icon {
  display: block;
  width: 18px;
  height: 18px;
  margin: 0 auto;
}

.property-cost-lock-btn.is-unlocked .property-cost-lock-icon {
  color: var(--green);
}

.property-cost-lock-btn.is-locked .property-cost-lock-icon {
  color: var(--red);
}

.property-cost-lock-btn:hover {
  background: rgba(232, 240, 90, 0.08);
}

.property-cost-lock-btn:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

.property-cost-lock-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.property-edit-open-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 6px 4px;
  margin: 0;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  color: inherit;
}

.property-edit-icon {
  display: block;
  width: 18px;
  height: 18px;
  margin: 0 auto;
  color: var(--text3);
}

.property-results-table td .property-edit-icon {
  color: #7fb3ff;
}

.property-edit-open-btn:hover {
  background: rgba(232, 240, 90, 0.08);
}

.property-edit-open-btn:hover .property-edit-icon {
  color: var(--accent);
}

.property-edit-open-btn:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

.property-results-empty {
  color: var(--text2);
  font-size: 13px;
  margin-top: 8px;
}

.landing-control {
  background: var(--surface);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-content: start;
  overflow-y: auto;
}

.landing-control .panel-title {
  font-family: "Syne", sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 6px;
}

.control-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn {
  width: 100%;
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  font-family: "Syne", sans-serif;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-ghost {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border2);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--text);
}

.btn-primary {
  background: var(--accent);
  color: #10141f;
}

.btn-primary:hover {
  background: var(--accent2);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.is-open {
  display: flex;
}

.modal {
  width: min(480px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
}

.modal-wide {
  width: min(720px, 100%);
}

.property-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

.property-edit-field-span {
  grid-column: 1 / -1;
}

.property-edit-input {
  color: var(--text3);
}

.property-edit-input:focus {
  color: var(--text);
}

.property-edit-textarea {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 10px;
  font-size: 13px;
  font-family: "DM Sans", sans-serif;
  outline: none;
}

.property-edit-textarea:focus {
  border-color: var(--accent);
  color: var(--text);
}

.property-edit-select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 10px;
  font-size: 13px;
  font-family: "DM Sans", sans-serif;
  outline: none;
}

.property-edit-select:focus {
  border-color: var(--accent);
  color: var(--text);
}

.property-status-cell {
  vertical-align: middle;
}

.property-status-change-btn {
  width: 100%;
  max-width: 100%;
  margin-top: 0;
  padding: 4px 8px !important;
  font-size: 12px !important;
  text-align: left;
  white-space: normal;
  line-height: 1.25;
  justify-content: flex-start;
}

.property-row {
  cursor: default;
}

.user-row {
  cursor: pointer;
}

.property-row:hover,
.user-row:hover {
  background: rgba(232, 240, 90, 0.06);
}

.property-row:focus,
.user-row:focus {
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}

.user-manager-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 12px;
}

.user-manager-filter-group {
  margin-right: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.user-manager-filter-select {
  width: 180px;
}

.property-manager-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.manager-create-btn {
  width: auto;
  padding: 6px 12px;
  font-size: 11px;
  letter-spacing: 0.06em;
}

.user-manager-message {
  margin-bottom: 16px;
  font-family: "DM Mono", monospace;
  font-size: 12px;
  color: var(--text2);
  min-height: 18px;
}

.user-manager-message--error {
  color: var(--red);
}

.modal h2 {
  font-family: "Syne", sans-serif;
  font-size: 18px;
  margin-bottom: 4px;
}

.modal-sub {
  color: var(--text2);
  font-family: "DM Mono", monospace;
  font-size: 11px;
  margin-bottom: 12px;
}

label {
  display: block;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text2);
  margin-bottom: 4px;
}

input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  padding: 10px;
  font-size: 13px;
  outline: none;
}

input:focus {
  border-color: var(--accent);
}

.modal-field-spaced {
  margin-top: 10px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 12px;
}

.modal-actions .btn {
  width: auto;
  margin-top: 0;
}

.error {
  min-height: 18px;
  color: var(--red);
  font-family: "DM Mono", monospace;
  font-size: 11px;
  margin-top: 8px;
}

.save-status {
  margin-top: 10px;
  font-family: "DM Mono", monospace;
  font-size: 12px;
  color: var(--text3);
  min-height: 16px;
}

.save-status.error {
  color: var(--red);
}

@media (max-width: 900px) {
  .landing-body {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }

  .landing-listing {
    border-right: none;
    min-height: 50vh;
  }

  .landing-control {
    border-top: 1px solid var(--border);
    max-height: 40vh;
  }
}
