:root {
  color-scheme: light;
  --ink: #101114;
  --deep-navy: #0b111b;
  --deep-navy-rgb: 11, 17, 27;
  --gunmetal: #2f3742;
  --steel: #5a6472;
  --platinum: #c7ccd4;
  --orange: #ff8a00;
  --orange-rgb: 255, 138, 0;
  --page: #ffffff;
  --section: #f7f8fa;
  --panel: #f3f5f7;
  --border: #d9dee5;
  --warm: #fff4e8;
  --heading-font: "Montserrat", "Avenir Next", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --body-font: "Comic Sans MS", "Comic Sans", "Chalkboard SE", "Comic Neue", cursive;
  --body-tracking: 0.045em;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  display: grid;
  min-height: 100vh;
  padding: 24px;
  place-items: center;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(247, 248, 250, 0.66)),
    url("./assets/a2o-estate-background.png");
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  color: var(--ink);
  font-family: var(--body-font);
  letter-spacing: var(--body-tracking);
}

body.is-portal-open {
  display: block;
  min-height: 100vh;
  padding: 0;
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
  letter-spacing: inherit;
}

h1,
h2,
h3,
.brand-mark h1,
.login-heading h2,
.menu-home,
.menu-group h2,
.menu-home.menu-item,
.toolbar-title h1,
.estate-detail-header h2,
.estate-section h3,
.system-list-header h2 {
  font-family: var(--heading-font);
  letter-spacing: 0;
}

a {
  color: var(--gunmetal);
  font-weight: 700;
  text-decoration: none;
}

a:hover {
  color: var(--orange);
}

.portal-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(390px, 0.86fr);
  width: min(1160px, 100%);
  min-height: auto;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--page);
  box-shadow:
    0 28px 60px rgba(var(--deep-navy-rgb), 0.11),
    0 10px 22px rgba(var(--deep-navy-rgb), 0.08);
}

.portal-shell::before {
  content: none;
}

.brand-panel {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: auto;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: 48px;
  background:
    linear-gradient(145deg, rgba(59, 68, 80, 0.96), rgba(31, 38, 48, 0.98)),
    linear-gradient(180deg, var(--gunmetal), var(--deep-navy));
  color: #ffffff;
}

.brand-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0)),
    radial-gradient(circle at 82% 18%, rgba(var(--orange-rgb), 0.18), transparent 28%),
    repeating-linear-gradient(90deg, rgba(199, 204, 212, 0.06) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(0deg, rgba(199, 204, 212, 0.04) 0 1px, transparent 1px 96px);
  pointer-events: none;
}

.brand-copy,
.brand-mark,
.brand-signals {
  position: relative;
  z-index: 1;
}

.brand-mark {
  display: grid;
  gap: 24px;
  width: min(540px, 100%);
  margin: 0;
  text-align: left;
}

.brand-logo {
  display: grid;
  width: min(520px, 100%);
  padding: 16px;
  place-items: center;
  border: 1px solid rgba(199, 204, 212, 0.32);
  border-radius: 14px;
  background: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 18px 34px rgba(0, 0, 0, 0.2);
}

.brand-logo img {
  display: block;
  width: 100%;
  max-height: 96px;
  object-fit: contain;
}

.brand-mark p {
  margin: 0;
  color: var(--orange);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-mark h1 {
  max-width: 520px;
  margin: 12px 0 0;
  color: #ffffff;
  font-size: clamp(34px, 4.6vw, 56px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0;
}

.brand-copy {
  width: min(520px, 100%);
  margin: 28px 0 0;
  padding: 0;
  text-align: left;
}

.brand-copy p {
  max-width: 500px;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.5;
}

.brand-copy span {
  display: block;
  margin-top: 10px;
  color: var(--orange);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
}

.brand-signals span {
  padding: 9px 12px;
  border: 1px solid rgba(199, 204, 212, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--platinum);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.login-panel {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: auto;
  padding: 40px;
  background: rgba(255, 255, 255, 0.88);
}

.login-card {
  width: min(430px, 100%);
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
  box-shadow:
    0 18px 40px rgba(var(--deep-navy-rgb), 0.08),
    0 1px 0 rgba(255, 255, 255, 0.88);
}

.login-heading {
  margin-bottom: 28px;
  text-align: left;
}

.login-heading p {
  margin: 0 0 12px;
  color: var(--orange);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.login-heading h2 {
  margin: 0;
  color: var(--deep-navy);
  font-size: clamp(32px, 3.4vw, 42px);
  font-weight: 700;
  line-height: 1.1;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-message {
  min-height: 18px;
  margin: -4px 0 0;
  color: var(--orange);
  font-size: 13px;
  font-weight: 700;
}

.field {
  display: grid;
  gap: 8px;
}

.field > span:first-child {
  color: var(--gunmetal);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.field input {
  width: 100%;
  height: 50px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  color: var(--deep-navy);
  outline: none;
  padding: 0 16px;
  box-shadow: 0 6px 14px rgba(var(--deep-navy-rgb), 0.04);
}

.field input:focus {
  border-color: rgba(var(--orange-rgb), 0.82);
  box-shadow:
    0 0 0 4px rgba(var(--orange-rgb), 0.12),
    0 10px 18px rgba(var(--deep-navy-rgb), 0.06);
}

.password-control {
  position: relative;
  display: block;
}

.password-control input {
  padding-right: 54px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--gunmetal);
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle:hover {
  background: var(--panel);
  color: var(--orange);
}

.password-toggle svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.password-toggle .eye-closed,
.password-toggle.is-visible .eye-open {
  display: none;
}

.password-toggle.is-visible .eye-closed {
  display: block;
}

.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 14px;
}

.check-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--steel);
  font-weight: 600;
}

.check-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--orange);
}

.submit-button {
  display: grid;
  width: 100%;
  height: 52px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: var(--orange);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 16px 28px rgba(var(--orange-rgb), 0.24);
  cursor: pointer;
  font-weight: 700;
}

.submit-button:hover {
  background: #e77c00;
  transform: translateY(-1px);
}

.submit-button:active {
  transform: translateY(0);
}

.app-shell {
  position: relative;
  display: grid;
  grid-template-columns: 274px minmax(0, 1fr);
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(247, 248, 250, 0.9)),
    url("./assets/a2o-estate-background.png");
  background-position: center;
  background-size: cover;
  color: var(--ink);
}

.sidebar-logo {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 3;
  display: grid;
  width: 242px;
  height: 78px;
  padding: 12px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(199, 204, 212, 0.34);
  border-radius: 16px;
  background: #ffffff;
  box-shadow:
    0 18px 34px rgba(var(--deep-navy-rgb), 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.sidebar-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sidebar {
  position: relative;
  z-index: 2;
  display: flex;
  width: 242px;
  height: calc(100vh - 129px);
  min-height: 0;
  flex-direction: column;
  margin: 113px 0 16px 16px;
  overflow: hidden;
  border: 1px solid rgba(199, 204, 212, 0.22);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(47, 55, 66, 0.98), rgba(11, 17, 27, 0.98)),
    var(--deep-navy);
  box-shadow:
    0 28px 60px rgba(var(--deep-navy-rgb), 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.menu-list {
  display: grid;
  flex: 1;
  gap: 22px;
  align-content: start;
  min-height: 0;
  padding: 20px 16px 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.menu-home,
.menu-group h2 {
  margin: 0;
  padding: 0 0 9px;
  border-bottom: 1px solid rgba(199, 204, 212, 0.16);
  color: #ffffff;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.12;
  text-transform: none;
}

.menu-home {
  display: block;
  border-top: 0;
  border-right: 0;
  border-left: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.menu-home.is-active {
  color: var(--orange);
}

.menu-group h2 {
  margin-bottom: 8px;
}

.menu-group ul {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu-group li {
  min-height: 27px;
  padding: 6px 0 6px 13px;
  border-left: 2px solid transparent;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
}

.menu-group li:hover,
.menu-group li:has(.menu-item.is-active) {
  border-left-color: var(--orange);
  color: #ffffff;
}

.menu-item {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: inherit;
  line-height: inherit;
  padding: 0;
  text-align: left;
}

.menu-item:hover,
.menu-item.is-active {
  color: #ffffff;
}

.menu-home.menu-item {
  color: #ffffff;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.12;
  text-transform: none;
}

.menu-home.menu-item.is-active {
  color: var(--orange);
}

.logout-link {
  width: 100%;
  min-height: 40px;
  margin: 4px 0 0;
  padding: 10px 16px;
  border: 0;
  border-radius: 10px;
  background: var(--orange);
  color: #ffffff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 14px 26px rgba(var(--orange-rgb), 0.22);
}

.workspace {
  display: flex;
  height: 100vh;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  padding: 16px 16px 16px 0;
}

.workspace-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 78px;
  padding: 12px 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow:
    0 18px 40px rgba(var(--deep-navy-rgb), 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
}

.toolbar-title {
  min-width: 0;
}

.toolbar-title p,
.toolbar-title h1 {
  margin: 0;
}

.toolbar-title p {
  color: var(--orange);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.toolbar-title h1 {
  margin-top: 5px;
  color: var(--deep-navy);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.user-chip {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #ffffff;
  color: var(--gunmetal);
  padding: 8px 13px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(var(--deep-navy-rgb), 0.05);
}

.workspace-content {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow:
    0 18px 40px rgba(var(--deep-navy-rgb), 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
}

.blank-content-panel {
  min-height: 100%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(247, 248, 250, 0.82)),
    linear-gradient(90deg, rgba(217, 222, 229, 0.34) 1px, transparent 1px),
    linear-gradient(0deg, rgba(217, 222, 229, 0.28) 1px, transparent 1px);
  background-size: auto, 72px 72px, 72px 72px;
}

.portal-view {
  min-height: 100%;
}

.estate-data-view {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  background: rgba(255, 255, 255, 0.72);
}

.estate-map-view {
  display: block;
  height: 100%;
  min-height: 0;
  background: rgba(255, 255, 255, 0.72);
}

.estate-list-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  border-right: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 248, 250, 0.9)),
    #ffffff;
}

.estate-search-wrap {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.estate-search {
  display: grid;
  gap: 8px;
}

.estate-search span {
  color: var(--gunmetal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.estate-search input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  color: var(--deep-navy);
  outline: none;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 600;
}

.estate-search input:focus {
  border-color: rgba(var(--orange-rgb), 0.8);
  box-shadow: 0 0 0 4px rgba(var(--orange-rgb), 0.12);
}

.estate-region-list {
  min-height: 0;
  overflow-y: auto;
  padding: 10px 10px 18px;
}

.estate-region-group {
  display: grid;
  gap: 4px;
  padding: 8px 0 12px;
}

.estate-region-title {
  margin: 0;
  padding: 6px 8px 8px;
  border-bottom: 1px solid rgba(217, 222, 229, 0.9);
  color: var(--deep-navy);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.estate-list-button {
  display: block;
  width: 100%;
  min-height: 34px;
  padding: 8px 10px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--steel);
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
  text-align: left;
}

.estate-list-button:hover,
.estate-list-button.is-active {
  border-left-color: var(--orange);
  background: var(--warm);
  color: var(--deep-navy);
}

.estate-empty-list {
  margin: 12px 8px;
  color: var(--steel);
  font-size: 13px;
  font-weight: 650;
}

.estate-detail-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
}

.estate-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 78px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
}

.estate-detail-header p,
.estate-detail-header h2 {
  margin: 0;
}

.estate-detail-header p {
  color: var(--orange);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.estate-detail-header h2 {
  margin-top: 4px;
  color: var(--deep-navy);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
}

.update-button {
  min-height: 40px;
  padding: 10px 18px;
  border: 0;
  border-radius: 10px;
  background: var(--orange);
  color: #ffffff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 14px 26px rgba(var(--orange-rgb), 0.2);
}

.estate-detail-content {
  min-height: 0;
  overflow-y: auto;
  padding: 18px 20px 26px;
}

.estate-data-grid {
  display: grid;
  gap: 16px;
}

.estate-section {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
}

.estate-section h3 {
  margin: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--deep-navy);
  font-size: 18px;
  font-weight: 800;
}

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

.estate-field-grid.is-single {
  grid-template-columns: 1fr;
}

.estate-field {
  display: grid;
  gap: 7px;
  border-radius: 12px;
}

.estate-field.is-selected {
  background: rgba(var(--orange-rgb), 0.08);
  box-shadow: 0 0 0 4px rgba(var(--orange-rgb), 0.08);
}

.estate-field label {
  color: var(--gunmetal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.estate-logo-field {
  grid-row: span 2;
}

.estate-logo-preview {
  display: grid;
  min-height: 104px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background:
    linear-gradient(45deg, rgba(217, 222, 229, 0.36) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(217, 222, 229, 0.36) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(217, 222, 229, 0.36) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(217, 222, 229, 0.36) 75%),
    #ffffff;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
  color: var(--steel);
  padding: 12px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.estate-logo-preview img {
  display: block;
  max-width: 100%;
  max-height: 82px;
  object-fit: contain;
}

.estate-properties-field {
  display: grid;
  grid-column: 1 / -1;
  gap: 8px;
}

.estate-properties-field > label {
  color: var(--gunmetal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.properties-table {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
}

.property-header {
  min-height: 36px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--section);
  color: var(--gunmetal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

.property-header + .property-header,
.property-value + .property-value {
  border-left: 1px solid var(--border);
}

.property-value {
  min-width: 0;
  padding: 10px;
}

.property-value .estate-edit-field {
  text-align: center;
}

.estate-edit-field {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--section);
  color: var(--deep-navy);
  outline: none;
  padding: 10px 12px;
  resize: vertical;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

textarea.estate-edit-field {
  min-height: 96px;
}

.estate-edit-field[readonly] {
  cursor: pointer;
}

.estate-edit-field[aria-readonly="true"] {
  cursor: pointer;
}

.estate-edit-field.is-automatic {
  color: var(--steel);
  cursor: default;
}

.estate-edit-field.is-selected {
  border-color: rgba(var(--orange-rgb), 0.82);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(var(--orange-rgb), 0.1);
}

.editable-table {
  display: grid;
  gap: 9px;
  overflow-x: auto;
  padding: 16px;
}

.editable-table-row {
  display: grid;
  align-items: stretch;
  gap: 9px;
  min-width: 720px;
}

.contact-table .editable-table-row {
  grid-template-columns: minmax(150px, 0.95fr) minmax(180px, 1.15fr) minmax(190px, 1.2fr) minmax(145px, 0.9fr);
}

.editable-table-row.is-header {
  min-height: 32px;
  align-items: center;
  color: var(--gunmetal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.systems-table {
  gap: 14px;
}

.system-info-section {
  display: grid;
  gap: 10px;
  min-width: 720px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
}

.system-info-header {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) minmax(210px, 0.62fr);
  gap: 12px;
  align-items: center;
}

.system-info-header h4 {
  margin: 0;
  color: var(--deep-navy);
  font-family: var(--heading-font);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
}

.system-description-field {
  min-height: 88px;
}

.estate-source-note {
  margin: 10px 0 0;
  color: var(--steel);
  font-size: 12px;
  font-weight: 650;
}

.estate-map-stage {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  height: 100%;
  min-height: 0;
  padding: 18px;
  gap: 14px;
}

.estate-map-canvas {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--section);
}

.estate-map-canvas::before {
  content: none;
}

.estate-map-canvas .leaflet-container {
  height: 100%;
  min-height: 100%;
  font-family: var(--body-font);
  letter-spacing: var(--body-tracking);
}

.estate-map-canvas .leaflet-control-attribution,
.estate-map-canvas .leaflet-control-zoom a,
.estate-map-canvas .leaflet-tooltip {
  font-family: var(--body-font);
  letter-spacing: var(--body-tracking);
}

.estate-map-canvas .leaflet-tooltip {
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--deep-navy);
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(var(--deep-navy-rgb), 0.12);
}

.estate-map-detail {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
  padding: 16px;
}

.estate-map-detail p,
.estate-map-detail h3,
.estate-map-detail dl,
.estate-map-detail dd {
  margin: 0;
}

.estate-map-detail p {
  color: var(--orange);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.estate-map-detail h3 {
  margin-top: 4px;
  color: var(--deep-navy);
  font-family: var(--heading-font);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0;
}

.estate-map-detail dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.estate-map-detail div {
  min-width: 0;
}

.estate-map-detail dt {
  color: var(--gunmetal);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.estate-map-detail dd {
  margin-top: 4px;
  color: var(--deep-navy);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.estate-map-empty {
  position: relative;
  z-index: 1;
  margin: 18px;
  color: var(--steel);
  font-size: 14px;
  font-weight: 700;
}

.system-list-view {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  background: rgba(255, 255, 255, 0.72);
}

.system-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 78px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
}

.system-list-header p,
.system-list-header h2 {
  margin: 0;
}

.system-list-header p {
  color: var(--orange);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.system-list-header h2 {
  margin-top: 4px;
  color: var(--deep-navy);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
}

.system-list-content {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
}

.system-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
}

.system-list-row input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--section);
  color: var(--deep-navy);
  outline: none;
  padding: 9px 12px;
  font-size: 14px;
  font-weight: 650;
}

.system-list-row input:not([readonly]) {
  border-color: rgba(var(--orange-rgb), 0.82);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(var(--orange-rgb), 0.1);
}

.system-list-row button {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  color: var(--gunmetal);
  cursor: pointer;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
}

.system-list-row button:hover {
  border-color: rgba(var(--orange-rgb), 0.5);
  color: var(--orange);
}

@media (max-width: 860px) {
  body {
    min-height: 100dvh;
    padding: 24px;
  }

  body.is-portal-open {
    padding: 0;
    overflow: auto;
  }

  .portal-shell {
    grid-template-columns: 1fr;
    width: min(100%, 560px);
    min-height: auto;
    margin: 0;
    border-radius: 16px;
  }

  .brand-panel,
  .login-panel {
    min-height: auto;
    padding: 28px;
  }

  .brand-panel {
    padding-bottom: 26px;
  }

  .brand-logo {
    width: min(430px, 100%);
    padding: 12px;
  }

  .brand-mark,
  .brand-copy {
    margin-right: auto;
    margin-left: auto;
    text-align: center;
  }

  .brand-signals {
    justify-content: center;
  }

  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    overflow: auto;
    padding: 16px;
  }

  .sidebar-logo,
  .sidebar,
  .workspace {
    width: 100%;
    margin: 0;
  }

  .sidebar-logo {
    position: relative;
    top: auto;
    left: auto;
    height: 76px;
  }

  .sidebar {
    height: auto;
    margin-top: 12px;
  }

  .menu-list {
    gap: 16px;
  }

  .workspace {
    height: auto;
    min-height: 560px;
    padding: 12px 0 0;
  }

  .workspace-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .estate-data-view {
    grid-template-columns: 1fr;
  }

  .estate-list-panel {
    max-height: 360px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .estate-map-stage {
    min-height: 620px;
  }

  .estate-map-detail dl {
    grid-template-columns: 1fr;
  }

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

  .estate-field-grid {
    grid-template-columns: 1fr;
  }

  .system-list-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  body {
    padding: 22px;
  }

  .portal-shell {
    width: 100%;
    min-height: auto;
    margin: 0;
    border-radius: 16px;
  }

  .brand-panel,
  .login-panel {
    padding: 22px;
  }

  .login-card {
    padding: 24px 22px;
  }

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

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

  .estate-map-stage {
    padding: 12px;
  }
}
