:root {
  --bg: #f4f6f5;
  --ink: #17211d;
  --muted: #667085;
  --line: #d8e0dc;
  --green: #0b6e4f;
  --red: #b42318;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(16px, 4vw, 42px);
  background: #0b241b;
  color: var(--white);
}

.topbar strong,
.topbar span {
  display: block;
}

.topbar span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

main {
  width: min(1220px, calc(100% - 24px));
  margin: 24px auto 56px;
}

.panel {
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 18px;
}

.section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.12;
}

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

label {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  color: var(--muted);
  font-weight: 700;
}

label span {
  display: flex;
  align-items: center;
  gap: 8px;
}

input,
select,
button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  font: inherit;
}

button {
  background: var(--green);
  color: var(--white);
  cursor: pointer;
  font-weight: 800;
}

.help {
  display: inline-grid;
  min-width: 24px;
  min-height: 24px;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  padding: 0;
  background: #eef6f2;
  color: var(--green);
  font-size: 13px;
}

form button {
  width: 100%;
  margin-top: 16px;
}

.tenant-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.tenant-card {
  min-height: 142px;
  align-items: flex-start;
  background: var(--white);
  color: var(--ink);
  text-align: left;
}

.tenant-card:hover,
.tenant-card.active {
  border-color: var(--green);
  box-shadow: inset 0 4px 0 var(--green);
}

.tenant-card strong,
.tenant-card span {
  display: block;
}

.tenant-card strong {
  margin-bottom: 8px;
  font-size: 18px;
}

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

.details-empty {
  color: var(--muted);
}

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

.detail-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.detail-box h3 {
  margin: 0 0 10px;
}

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

.inline-form button {
  margin-top: 0;
}

.row {
  display: grid;
  gap: 2px;
  border-top: 1px solid var(--line);
  padding: 10px 0;
}

.row:first-of-type {
  border-top: 0;
}

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

.row.inactive {
  opacity: 0.48;
}

.row-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.row-actions button {
  min-height: 36px;
  padding: 7px 8px;
}

.secondary {
  background: #eef6f2;
  color: var(--green);
}

.danger {
  background: var(--red);
}

dialog {
  width: min(520px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.42);
}

dialog form {
  padding: 20px;
}

dialog p {
  color: var(--muted);
}

.form-result {
  min-height: 22px;
  margin: 10px 0 0;
  color: var(--green);
  font-weight: 700;
}

.form-result.error {
  color: var(--red);
}

@media (max-width: 840px) {
  .grid,
  .details-grid {
    grid-template-columns: 1fr;
  }

  .section-title,
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }
}
