/* ─────────────────────────────────────────────────────────────
   editor.css — the dark Hub UI (the surface the founders work on)
   ───────────────────────────────────────────────────────────── */

html:has(body.editor) { background: var(--navy-900); }
body.editor {
  background: var(--navy-900);
  color: var(--text-light);
  min-height: 100vh;
}

.editor .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-5);
}

/* Top nav */
.nav {
  background: var(--navy-700);
  border-bottom: 1px solid var(--navy-500);
  padding: var(--space-3) var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}
.nav .brand {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--text-light);
}
.nav .brand .mark { color: var(--gold); margin-right: 6px; }
.nav ul { list-style: none; display: flex; gap: var(--space-5); }
.nav ul a {
  color: var(--text-light);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
  padding: 6px 0;
  border-bottom: 1px solid transparent;
}
.nav ul a:hover, .nav ul a.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* Form fields */
.field { margin-bottom: var(--space-4); }
.field label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--gold);
  margin-bottom: 5px;
  font-weight: 500;
}
.field input, .field select, .field textarea {
  width: 100%;
  background: var(--navy-700);
  border: 1px solid var(--navy-500);
  color: var(--text-light);
  padding: 9px 12px;
  font-family: var(--font-body);
  font-size: 13px;
  border-radius: var(--radius-sm);
  outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--gold);
  background: #333a52;
}

/* Buttons */
.btn {
  display: inline-block;
  background: var(--gold);
  color: var(--navy-900);
  border: none;
  padding: 11px 26px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-button);
  border-radius: var(--radius-sm);
}
.btn:hover { background: #d9b886; }
.btn-secondary {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--navy-500);
}
.btn-secondary:hover { background: var(--navy-700); border-color: var(--gold); }
.btn-danger { background: var(--danger); color: var(--text-light); }

/* Cards / sections */
.card {
  background: var(--navy-700);
  border: 1px solid var(--navy-500);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
}

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--gold);
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--navy-500);
}
.table td {
  padding: 12px;
  border-bottom: 1px solid var(--navy-500);
  font-size: 13px;
  color: var(--text-light);
}
.table tr:hover td { background: rgba(201, 168, 118, 0.04); }

/* Inline link-styled buttons (table row actions) */
.btn-link, .btn-link-danger {
  background: transparent;
  border: none;
  color: var(--gold);
  font-family: var(--font-body);
  font-size: 11px;
  cursor: pointer;
  padding: 0;
  letter-spacing: 0.05em;
}
.btn-link:hover { color: #d9b886; text-decoration: underline; }
.btn-link-danger { color: #d0a0a0; }
.btn-link-danger:hover { color: #f0c0c0; text-decoration: underline; }

/* Mode pill (radio cards on property form) */
.mode-pill {
  flex: 1;
  display: block;
  cursor: pointer;
  padding: var(--space-3) var(--space-4);
  background: var(--navy-700);
  border: 1px solid var(--navy-500);
  border-radius: var(--radius-md);
  transition: border-color 120ms ease, background 120ms ease;
}
.mode-pill input { display: none; }
.mode-pill strong {
  display: block;
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.18em;
  margin-bottom: 4px;
}
.mode-pill span {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.45;
}
.mode-pill.active {
  border-color: var(--gold);
  background: #333a52;
}

/* Stat cards (dashboard) */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
}
.stat {
  display: block;
  background: var(--navy-700);
  border: 1px solid var(--navy-500);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  transition: border-color 120ms ease, transform 120ms ease;
  color: var(--text-light);
}
.stat:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
  color: var(--text-light);
}
.stat-value {
  font-family: var(--font-display);         /* numbers in Fraunces for editorial weight */
  font-optical-sizing: auto;
  font-variation-settings: "SOFT" 30;
  font-size: 38px;
  color: var(--gold);
  margin-top: 6px;
  font-weight: 400;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* Empty state */
.empty {
  text-align: center;
  padding: var(--space-7) var(--space-5);
  color: #a0a4b0;
  font-style: italic;
}
.empty .display { color: var(--gold); font-size: 28px; margin-bottom: var(--space-3); font-style: normal; }

/* ─────────────────────────────────────────────────────────────
   Mobile (≤ 720px) — iPhone usable.
   The hub is designed desktop-first for daily ops; mobile is for
   quick wins like logging a service on the go.
   ───────────────────────────────────────────────────────────── */
@media (max-width: 720px) {

  .editor .container {
    padding: var(--space-4) var(--space-3);
  }

  /* Nav: brand left, hamburger right, sections drop into a slide-down menu */
  .nav {
    flex-wrap: wrap;
    padding: var(--space-3);
    gap: var(--space-3);
  }
  .nav .brand { font-size: 18px; flex: 1; }
  /* Hide the inline section list and show the toggle */
  .nav ul {
    order: 99;
    flex-basis: 100%;
    flex-direction: column;
    gap: 0;
    display: none;
    border-top: 1px solid var(--navy-500);
    padding-top: var(--space-3);
    margin-top: var(--space-2);
  }
  .nav ul a {
    padding: 10px 4px;
    border-bottom: 1px solid var(--navy-500);
    font-size: 13px;
    letter-spacing: 0.1em;
  }
  /* When the body has .nav-open class (toggled by the hamburger), show it. */
  body.nav-open .nav ul { display: flex; }
  .nav-toggle {
    background: transparent;
    border: 1px solid var(--navy-500);
    color: var(--gold);
    padding: 6px 12px;
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
  }
  .nav .nav-right { display: flex; align-items: center; gap: var(--space-2); }
  .nav .nav-right .eyebrow { display: none; } /* user name eats too much width */

  /* Forms: stack everything */
  .card { padding: var(--space-4); }
  div[style*="grid-template-columns: 1fr 1fr"],
  div[style*="grid-template-columns: 1fr 2fr"],
  div[style*="grid-template-columns: 1fr 1fr 1fr"],
  div[style*="grid-template-columns: 1fr 2fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Quick-add forms (services + bookings): collapse the 8-col row into stacked rows */
  #service-quick-add > div,
  #booking-quick-add > div {
    grid-template-columns: 1fr 1fr !important;
  }
  /* Submit button takes the full final row */
  #service-quick-add .field:last-child,
  #booking-quick-add .field:last-child {
    grid-column: 1 / -1;
  }
  #service-quick-add .field:last-child .btn,
  #booking-quick-add .field:last-child .btn { width: 100%; }

  /* Stat grid: 2 columns on mobile, not 4 */
  .stat-grid { grid-template-columns: 1fr 1fr; gap: var(--space-3); }
  .stat-value { font-size: 26px; }

  /* Page headings */
  h1.display, .display { font-size: 26px !important; }

  /* Tables: let them horizontally scroll inside their card rather than reflow,
     so all the columns stay readable. */
  .card:has(table) { overflow-x: auto; }
  .table th, .table td { padding: 8px 10px; font-size: 12px; }

  /* Mode pills (STR/PM toggle): stack instead of side-by-side */
  div[style*="display: flex; gap: var(--space-3)"]:has(.mode-pill) { flex-direction: column; }
}

/* ─── Inline SVG icons (Lucide-style, currentColor stroke) ─────────── */
.icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  vertical-align: -2px;
  display: inline-block;
}
.nav ul a .icon { width: 15px; height: 15px; vertical-align: -3px; margin-right: 8px; opacity: 0.7; transition: opacity 120ms ease; }
.nav ul a:hover .icon, .nav ul a.active .icon { opacity: 1; }
.nav .brand .icon { width: 22px; height: 22px; vertical-align: -5px; margin-right: 8px; }

/* Icon in buttons: a touch smaller, slight right margin */
.btn .icon, .btn-secondary .icon { margin-right: 6px; width: 14px; height: 14px; vertical-align: -2px; }
