:root {
  --ink: #2B2A28;
  --paper: #F7F3EC;
  --white: #FFFFFF;
  --brick: #8C3B2E;
  --brick-dark: #6E2E23;
  --ivy: #445239;
  --brass: #A88A54;
  --stone: #DCD5C6;
  --stone-dark: #C7BEA9;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  margin: 0 0 0.4em;
  color: var(--ink);
}

h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }

p { max-width: 62ch; }

a { color: var(--brick); }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Top nav --- */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
  border-bottom: 1px solid var(--stone-dark);
}

.brand {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.brand small {
  display: block;
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--brass);
  letter-spacing: 0.08em;
  margin-top: 2px;
}

.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  border-bottom: 1px solid transparent;
}
.nav-links a:hover { border-bottom-color: var(--brick); }

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 12px 22px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 3px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-primary { background: var(--brick); color: var(--white); }
.btn-primary:hover { background: var(--brick-dark); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-secondary:hover { background: var(--ink); color: var(--white); }
.btn-small { padding: 8px 14px; font-size: 0.85rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* --- Hero (public site) --- */
.hero {
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--stone-dark);
}
.hero-eyebrow {
  font-family: var(--font-body);
  color: var(--brass);
  font-size: 0.95rem;
  margin-bottom: 10px;
}
.hero p.lede {
  font-size: 1.15rem;
  color: #4a4844;
}

/* --- Plaque (property nameplate) --- */
.plaque {
  border-top: 3px solid var(--brick);
  padding-top: 14px;
  margin-bottom: 22px;
}
.plaque .addr {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--brass);
  letter-spacing: 0.03em;
}

/* --- Property listing --- */
.listings {
  display: grid;
  grid-template-columns: 1fr;
  gap: 56px;
  padding: 56px 0;
}
.listing {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  align-items: start;
  border-bottom: 1px solid var(--stone-dark);
  padding-bottom: 56px;
}
.listing:last-child { border-bottom: none; }
.listing-photos {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  border: 1px solid var(--stone-dark);
  background: var(--white);
  min-height: 220px;
  align-items: center;
  justify-content: center;
  color: var(--brass);
  font-size: 0.9rem;
}
.listing-facts {
  display: flex;
  gap: 24px;
  margin: 18px 0;
  padding-top: 14px;
  border-top: 1px solid var(--stone);
}
.fact-label { font-size: 0.78rem; color: var(--brass); }
.fact-value { font-family: var(--font-display); font-size: 1.3rem; }

@media (max-width: 800px) {
  .listing { grid-template-columns: 1fr; }
}

/* --- Forms --- */
.form-panel {
  max-width: 420px;
  margin: 64px auto;
  padding: 36px;
  background: var(--white);
  border: 1px solid var(--stone-dark);
}
label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 18px 0 6px;
}
label:first-of-type { margin-top: 0; }
input, select, textarea {
  width: 100%;
  padding: 11px 12px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  border: 1px solid var(--stone-dark);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--brick);
  outline-offset: 1px;
}
textarea { resize: vertical; min-height: 90px; }
.form-msg {
  margin-top: 14px;
  font-size: 0.9rem;
  padding: 10px 12px;
  border-radius: 3px;
}
.form-msg.error { background: #f3d9d4; color: var(--brick-dark); }
.form-msg.success { background: #dde5d8; color: var(--ivy); }

/* --- App shell (portal / admin) --- */
.app-shell { min-height: 100vh; }
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--stone-dark);
  background: var(--white);
}
.app-body { padding: 32px 24px; max-width: 960px; margin: 0 auto; }

.panel {
  background: var(--white);
  border: 1px solid var(--stone-dark);
  padding: 24px;
  margin-bottom: 24px;
}
.panel h3 { margin-bottom: 16px; }

/* --- Tickets --- */
.ticket-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--stone);
  cursor: pointer;
}
.ticket-row:last-child { border-bottom: none; }
.ticket-title { font-weight: 600; }
.ticket-meta { font-size: 0.82rem; color: #6b675f; margin-top: 3px; }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-open { background: #f3d9d4; color: var(--brick-dark); }
.badge-in_progress { background: #ede0c2; color: #7a5b1e; }
.badge-resolved { background: #dde5d8; color: var(--ivy); }
.badge-closed { background: var(--stone); color: #6b675f; }

.priority-urgent { color: var(--brick); font-weight: 700; }

.updates-thread { margin-top: 18px; border-top: 1px solid var(--stone); padding-top: 14px; }
.update-item { padding: 10px 0; border-bottom: 1px solid var(--stone); font-size: 0.92rem; }
.update-item:last-child { border-bottom: none; }
.update-meta { font-size: 0.78rem; color: #6b675f; margin-bottom: 4px; }

/* --- Tables (admin) --- */
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--stone); }
th { color: var(--brass); font-weight: 600; font-size: 0.78rem; }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #6b675f;
}

.tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--stone-dark); }
.tab {
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-weight: 600;
  color: #6b675f;
  font-size: 0.92rem;
}
.tab.active { color: var(--ink); border-bottom-color: var(--brick); }

.hidden { display: none !important; }

footer {
  padding: 32px 0;
  border-top: 1px solid var(--stone-dark);
  font-size: 0.85rem;
  color: #6b675f;
}
