@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
:root {
  --gold: #efb54a;
  --bg: #0b0f13;
  --surface: #141a21;
  --muted: #9ca9b8;
  --border: #293440;
  --green: #7ee1b0;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: #edf2f7;
  font:
    14px Inter,
    system-ui,
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a {
  transition: background 0.15s;
}
button {
  cursor: pointer;
  border: 1px solid var(--border);
  background: #202a35;
  color: white;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 600;
}
button:hover {
  background: #344151;
}
button.primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #17202a;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
input,
select,
textarea {
  width: 100%;
  background: #0e141b;
  border: 1px solid #3e4d5f;
  border-radius: 8px;
  color: white;
  padding: 12px;
  margin-top: 6px;
}
input[type='checkbox'] {
  width: auto;
  margin: 0 8px 0 0;
}
label {
  display: block;
  margin: 15px 0;
  color: #c1cbd7;
  font-size: 13px;
}
textarea {
  min-height: 140px;
}
h1 {
  font-size: 30px;
  letter-spacing: -1px;
  margin: 8px 0 12px;
}
h2 {
  font-size: 20px;
  margin-top: 0;
}
p {
  line-height: 1.7;
  color: var(--muted);
}
a {
  color: var(--gold);
}
.brand {
  font-weight: 800;
  letter-spacing: -0.5px;
  font-size: 24px;
}
.brand span {
  color: var(--gold);
}
.eyebrow {
  letter-spacing: 2px;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}
.login {
  max-width: 460px;
  margin: 10vh auto;
  padding: 32px;
}
.login .brand {
  margin-bottom: 44px;
}
.login button {
  width: 100%;
}
.shell {
  display: grid;
  grid-template-columns: 230px 1fr;
  min-height: 100vh;
}
.sidebar {
  border-right: 1px solid var(--border);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.sidebar nav {
  display: grid;
  gap: 7px;
}
.sidebar nav button {
  background: transparent;
  border: 0;
  text-align: left;
  color: var(--muted);
}
.sidebar nav button.active {
  color: var(--gold);
  background: #30291d;
}
.sidebar small {
  color: var(--muted);
  line-height: 1.7;
}
.main {
  padding: 34px 42px;
  min-width: 0;
}
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}
.top select {
  max-width: 280px;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.between {
  justify-content: space-between;
}
.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 24px 0;
}
.card {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 22px;
  border-radius: 14px;
}
.metric {
  font-size: 32px;
  font-weight: 700;
  margin: 12px 0 5px;
}
.muted,
small {
  color: var(--muted);
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}
th {
  color: var(--muted);
  font-weight: 500;
  background: #19222b;
  padding: 15px;
}
td {
  padding: 16px 15px;
  border-top: 1px solid var(--border);
  vertical-align: top;
}
td a,
td button {
  font-size: 12px;
}
td button {
  padding: 6px 9px;
}
.pill {
  display: inline-block;
  border: 1px solid #405064;
  border-radius: 20px;
  padding: 4px 9px;
  font-size: 11px;
  white-space: nowrap;
}
.pill.good {
  color: var(--green);
  border-color: #31694f;
}
.empty {
  text-align: center;
  padding: 70px 20px;
  color: var(--muted);
}
.empty strong {
  display: block;
  font-size: 19px;
  color: white;
  margin-bottom: 12px;
}
.notice {
  padding: 16px;
  border: 1px solid #615033;
  background: #292318;
  border-radius: 10px;
  color: #efd49e;
  line-height: 1.6;
  margin: 18px 0;
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
dialog {
  width: min(960px, 95vw);
  max-height: 92vh;
  overflow: auto;
  background: var(--surface);
  color: white;
  border: 1px solid #536173;
  border-radius: 16px;
  padding: 32px;
}
dialog::backdrop {
  background: #000b;
}
.close {
  float: right;
  margin: -12px -12px 0 12px;
  font-size: 23px;
  padding: 3px 11px;
}
dialog iframe {
  width: 1080px;
  height: 610px;
  background: white;
  border: 0;
  border-radius: 8px;
}
#toast {
  position: fixed;
  right: 24px;
  top: 20px;
  max-width: 520px;
  z-index: 20;
  background: #263849;
  border: 1px solid #536b82;
  padding: 16px 22px;
  border-radius: 10px;
  display: none;
  white-space: pre-wrap;
}
.error {
  color: #ffb7b7;
}
.form-error {
  color: #ffb7b7;
  line-height: 1.5;
}
.spacer {
  flex: 1;
}
@media (max-width: 1000px) {
  .shell {
    grid-template-columns: 180px 1fr;
  }
  .main {
    padding: 25px;
  }
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 650px) {
  .shell {
    display: block;
  }
  .sidebar {
    padding: 18px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    gap: 14px;
  }
  .sidebar nav {
    display: flex;
    overflow: auto;
  }
  .sidebar small,
  .sidebar .spacer {
    display: none;
  }
  .main {
    padding: 20px 14px;
  }
  .top {
    align-items: flex-start;
    flex-direction: column;
  }
  .grid2 {
    grid-template-columns: 1fr;
  }
  .cards {
    gap: 10px;
  }
  .card {
    padding: 16px;
  }
  h1 {
    font-size: 25px;
  }
  .login {
    margin-top: 3vh;
  }
  dialog {
    padding: 20px;
  }
}

.advanced-nav {
  margin-top: 14px;
}
.advanced-nav summary {
  cursor: pointer;
  color: var(--muted);
  padding: 12px 8px;
  font-size: 12px;
}
.advanced-nav button {
  display: block;
  width: 100%;
}
.preview-assets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin: 20px 0;
}
.preview-assets figure {
  margin: 0;
}
.preview-assets img {
  width: 100%;
  border-radius: 10px;
}
.preview-assets figcaption {
  margin: 8px 0;
  color: var(--muted);
}
.campaign-steps {
  padding-left: 24px;
}
.campaign-steps li {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
details {
  margin: 18px 0;
}
summary {
  cursor: pointer;
  padding: 8px 0;
}
@media (max-width: 650px) {
  .sidebar nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: visible;
  }
  .advanced-nav {
    grid-column: 1 / -1;
  }
}

/* ── House drawer (side panel) ─────────────────────────────────────────── */
#drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(520px, 94vw);
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  transform: translateX(105%);
  transition: transform 0.22s ease;
  z-index: 70;
  overflow-y: auto;
  padding: 22px 24px 60px;
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.45);
}
#drawer.open {
  transform: translateX(0);
}
#drawer .close {
  position: sticky;
  top: 0;
  float: right;
  font-size: 22px;
}
#drawer h3 {
  margin: 4px 0 2px;
  font-size: 19px;
}
#drawer img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: block;
  margin-top: 8px;
}
#drawer video {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-top: 8px;
  background: #000;
}
#drawer .dmeta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

/* ── House list + filters ──────────────────────────────────────────────── */
.filterbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}
.filterchip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 20px;
  padding: 6px 13px;
  font-size: 12px;
  cursor: pointer;
}
.filterchip:hover {
  color: white;
}
.filterchip.active {
  color: var(--bg);
  background: var(--gold);
  border-color: var(--gold);
  font-weight: 700;
}
.house-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 4px;
}
.house-card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: border-color 0.12s ease;
}
.house-card:hover {
  border-color: #405064;
}
.house-card .addr {
  font-weight: 600;
  font-size: 14px;
}
.house-card .addr small {
  display: block;
  font-weight: 400;
  font-size: 12px;
  margin-top: 3px;
}
.house-card .right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Houses head (summary + search) ────────────────────────────────────── */
.houses-head {
  margin: 16px 0;
}
.summary {
  color: var(--muted);
  font-size: 13px;
  margin: 2px 0 12px;
}
.summary strong {
  color: white;
}
.searchbox {
  width: 100%;
  max-width: 420px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: white;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
}
.searchbox:focus {
  outline: none;
  border-color: var(--gold);
}
.house-card.good {
  background: #12241a;
}
.house-card.busy {
  background: #251f0f;
}
.house-card.warn {
  background: #26180d;
}
.house-card.bad {
  background: #261311;
}
.house-card.muted {
  background: var(--surface);
}
.pill-good {
  color: #4ade80;
  border-color: #2c6a45;
  font-weight: 600;
}
.pill-busy {
  color: #facc15;
  border-color: #6b5a12;
  font-weight: 600;
}
.pill-warn {
  color: #fb923c;
  border-color: #7c4a16;
}
.pill-bad {
  color: #f87171;
  border-color: #7f2c2c;
}

/* House card thumbnail */
.house-card .thumb {
  width: 66px;
  height: 50px;
  object-fit: cover;
  border-radius: 7px;
  border: 1px solid var(--border);
  flex: none;
  background: #0b0f13;
}
.house-card .thumb.none {
  background: #1a222c;
}

