:root {
  --urban-jungle: #4c5a48;
  --warm-ivory: #e8e3db;
  --oatmeal: #cfc6b6;
  --terracotta: #b55b3b;
  --walnut: #6b4a32;
  --charcoal: #1e1e1e;
  --pine-shadow: #394437;
  --mist: #f5f1ea;
  --surface: rgba(255, 252, 247, 0.82);
  --surface-strong: rgba(255, 250, 244, 0.94);
  --surface-deep: rgba(76, 90, 72, 0.94);
  --line: rgba(107, 74, 50, 0.16);
  --line-strong: rgba(107, 74, 50, 0.28);
  --ink: var(--charcoal);
  --muted: #655a4d;
  --success-bg: rgba(76, 90, 72, 0.14);
  --success-ink: #31402f;
  --danger: #8f402b;
  --danger-bg: rgba(181, 91, 59, 0.14);
  --shadow: 0 24px 60px rgba(49, 35, 22, 0.10);
  --shadow-soft: 0 12px 30px rgba(49, 35, 22, 0.08);
  --radius: 24px;
  --radius-sm: 16px;
  --font-heading: "Cormorant Garamond", Georgia, serif;
  --font-body: "Montserrat", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html {
  background:
    radial-gradient(circle at top left, rgba(181, 91, 59, 0.14), transparent 30%),
    radial-gradient(circle at top right, rgba(76, 90, 72, 0.18), transparent 34%),
    linear-gradient(180deg, #f4eee7 0%, #ece5db 34%, #f7f2eb 100%);
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.65;
  letter-spacing: 0.01em;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.32), rgba(255,255,255,0) 42%),
    repeating-linear-gradient(115deg, rgba(107, 74, 50, 0.03) 0 1px, transparent 1px 18px);
}

a { color: inherit; }

h1, h2, h3, .brand {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: 0.04em;
}

h1, h2, h3, p { margin-top: 0; }

.guest-shell::before,
.auth-shell::before,
.admin-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 18%, rgba(181, 91, 59, 0.10), transparent 20%),
    radial-gradient(circle at 85% 12%, rgba(76, 90, 72, 0.12), transparent 24%),
    radial-gradient(circle at 50% 100%, rgba(107, 74, 50, 0.08), transparent 28%);
  opacity: 0.9;
}

.topbar,
.sidebar,
.hero,
.property-hero,
.content-panel,
.card,
.metric-card,
.table-card,
.auth-card {
  position: relative;
  z-index: 1;
}

.topbar,
.sidebar {
  background:
    linear-gradient(180deg, rgba(250, 245, 239, 0.94), rgba(244, 237, 229, 0.90)),
    rgba(255,255,255,0.75);
  backdrop-filter: blur(14px);
}

.topbar {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.4rem;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 20px rgba(49, 35, 22, 0.05);
}

.brand {
  text-decoration: none;
  font-size: clamp(1.55rem, 1.7vw, 2rem);
  color: var(--charcoal);
  text-transform: uppercase;
}

.topbar-meta {
  color: var(--walnut);
  font-size: 0.78rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.page,
.admin-page {
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.75rem 0 2.5rem;
}

.hero,
.property-hero,
.content-panel,
.card,
.metric-card,
.table-card,
.auth-card {
  background:
    linear-gradient(180deg, rgba(255, 251, 246, 0.96), rgba(247, 241, 233, 0.96));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero,
.property-hero {
  overflow: hidden;
  padding: clamp(1.7rem, 3vw, 2.6rem);
  display: grid;
  gap: 1.25rem;
}

.hero::after,
.property-hero::after,
.card::after,
.table-card::after,
.content-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(145deg, rgba(255,255,255,0.32), transparent 40%);
}

.property-hero {
  grid-template-columns: minmax(0, 1.75fr) minmax(240px, 0.9fr);
  align-items: start;
}

.eyebrow {
  margin: 0 0 0.65rem;
  color: var(--terracotta);
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.74rem;
  font-weight: 600;
}

.hero h1,
.property-hero h1,
.admin-header h1,
.auth-card h1 {
  font-size: clamp(2.6rem, 5vw, 4.8rem);
  line-height: 0.95;
  margin-bottom: 0.9rem;
}

.lead {
  max-width: 60ch;
  color: var(--muted);
  font-size: 1rem;
}

.cards-grid,
.metric-grid,
.service-groups {
  display: grid;
  gap: 1rem;
}

.cards-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 1.25rem;
}

.metric-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin: 1rem 0 1.25rem;
}

.card,
.metric-card,
.table-card,
.content-panel,
.auth-card {
  padding: 1.3rem;
}

.card {
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.96), rgba(241, 233, 224, 0.96));
}

.card h2,
.content-panel h2,
.table-card h2 {
  font-size: clamp(1.5rem, 2vw, 2rem);
  margin-bottom: 0.45rem;
}

.metric-card {
  background:
    linear-gradient(145deg, rgba(76, 90, 72, 0.98), rgba(57, 68, 55, 0.98));
  color: var(--warm-ivory);
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 20px 40px rgba(50, 64, 48, 0.22);
}

.metric-card span {
  display: block;
  margin-bottom: 0.6rem;
  color: rgba(232, 227, 219, 0.76);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 2.1rem;
  letter-spacing: 0.04em;
}

.button,
.ghost-button,
.chip,
input,
textarea,
select {
  transition: 180ms ease;
}

.button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 999px;
  padding: 0.82rem 1.18rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font: inherit;
  font-size: 0.92rem;
}

.button {
  background: linear-gradient(135deg, var(--terracotta), var(--walnut));
  color: #fff9f4;
  box-shadow: 0 12px 24px rgba(107, 74, 50, 0.22);
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(107, 74, 50, 0.26);
}

.ghost-button {
  color: var(--urban-jungle);
  background: rgba(255, 255, 255, 0.36);
  border-color: rgba(76, 90, 72, 0.18);
}

.ghost-button:hover,
.ghost-button:focus-visible {
  background: rgba(76, 90, 72, 0.08);
  border-color: rgba(76, 90, 72, 0.34);
}

.card-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.info-card {
  align-self: stretch;
  display: grid;
  gap: 0.38rem;
  padding: 1.2rem 1.25rem;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(76, 90, 72, 0.96), rgba(57, 68, 55, 0.96));
  color: var(--warm-ivory);
  box-shadow: var(--shadow-soft);
}

.info-card strong {
  color: rgba(232, 227, 219, 0.76);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.chip-nav {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.chip {
  padding: 0.72rem 1rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(107, 74, 50, 0.14);
  text-decoration: none;
  color: var(--muted);
  font-size: 0.88rem;
}

.chip:hover,
.chip:focus-visible {
  color: var(--urban-jungle);
  border-color: rgba(76, 90, 72, 0.28);
  background: rgba(255,255,255,0.94);
}

.chip.active {
  color: var(--warm-ivory);
  background: linear-gradient(145deg, var(--urban-jungle), var(--pine-shadow));
  border-color: transparent;
}

.flash {
  padding: 1rem 1.1rem;
  border-radius: 18px;
  margin-bottom: 1rem;
  border: 1px solid transparent;
}

.flash.success {
  background: var(--success-bg);
  color: var(--success-ink);
  border-color: rgba(76, 90, 72, 0.18);
}

.flash.error {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: rgba(181, 91, 59, 0.20);
}

.callout {
  background: linear-gradient(180deg, rgba(255, 247, 241, 0.92), rgba(247, 236, 227, 0.92));
  border-left: 4px solid var(--terracotta);
  padding: 1rem;
  border-radius: 14px;
  margin-bottom: 1rem;
  color: var(--walnut);
}

.callout.danger {
  background: rgba(181, 91, 59, 0.10);
  border-left-color: var(--danger);
  color: #733221;
}

.prose {
  line-height: 1.8;
  color: #312b25;
}

.form-panel { margin-top: 1rem; }

.stack-form {
  display: grid;
  gap: 1rem;
}

.stack-form label {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.92rem;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(107, 74, 50, 0.16);
  border-radius: 14px;
  padding: 0.88rem 0.98rem;
  font: inherit;
  background: rgba(255,255,255,0.84);
  color: var(--ink);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(181, 91, 59, 0.55);
  box-shadow: 0 0 0 4px rgba(181, 91, 59, 0.12);
  background: #fffdfa;
}

.checkbox-row {
  display: flex !important;
  align-items: center;
  gap: 0.75rem;
}

.checkbox-row input { width: auto; }

.admin-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 1.6rem 1.1rem;
  border-right: 1px solid rgba(255,255,255,0.06);
  display: grid;
  align-content: start;
  gap: 1rem;
  background:
    linear-gradient(180deg, rgba(76, 90, 72, 0.98), rgba(57, 68, 55, 0.98));
  color: var(--warm-ivory);
  box-shadow: 14px 0 40px rgba(41, 49, 38, 0.14);
}

.sidebar .brand {
  color: var(--warm-ivory);
  font-size: 2rem;
}

.nav-list {
  display: grid;
  gap: 0.35rem;
}

.nav-list a {
  text-decoration: none;
  padding: 0.78rem 0.9rem;
  border-radius: 14px;
  color: rgba(232, 227, 219, 0.84);
}

.nav-list a:hover,
.nav-list a:focus-visible {
  background: rgba(255,255,255,0.08);
  color: #fffdf9;
}

.sidebar .ghost-button {
  color: var(--warm-ivory);
  border-color: rgba(232, 227, 219, 0.16);
  background: rgba(255,255,255,0.05);
}

.sidebar .ghost-button:hover,
.sidebar .ghost-button:focus-visible {
  background: rgba(255,255,255,0.10);
}

.admin-page {
  width: auto;
  margin: 0;
  padding: 1.75rem;
}

.admin-header {
  margin-bottom: 1rem;
}

.admin-header p {
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.table-card {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

th,
td {
  text-align: left;
  padding: 0.9rem 0.8rem;
  border-bottom: 1px solid rgba(107, 74, 50, 0.10);
  vertical-align: top;
}

th {
  color: var(--walnut);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.inline-form {
  display: grid;
  gap: 0.5rem;
  min-width: 170px;
}

.auth-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 1.5rem;
}

.auth-card-wrap {
  width: min(100%, 460px);
}

.auth-card {
  background:
    linear-gradient(180deg, rgba(255, 250, 245, 0.96), rgba(242, 234, 225, 0.96));
}

.service-group {
  background: linear-gradient(180deg, rgba(255, 251, 247, 0.96), rgba(239, 231, 223, 0.96));
  border: 1px solid rgba(107, 74, 50, 0.14);
  border-radius: 18px;
  padding: 1rem;
}

.service-group h3 {
  margin-bottom: 0.75rem;
  font-size: 1.45rem;
}

.supplier-row {
  display: grid;
  gap: 0.28rem;
  padding: 0.75rem 0;
  border-top: 1px solid rgba(107, 74, 50, 0.10);
}

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

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

code {
  background: rgba(107, 74, 50, 0.08);
  color: var(--walnut);
  padding: 0.18rem 0.38rem;
  border-radius: 6px;
}

@media (max-width: 900px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }

  .property-hero {
    grid-template-columns: 1fr;
  }

  .hero h1,
  .property-hero h1,
  .admin-header h1,
  .auth-card h1 {
    font-size: clamp(2.2rem, 10vw, 3.5rem);
  }
}

@media (max-width: 640px) {
  .page,
  .admin-page {
    width: min(100% - 1rem, 1200px);
    padding-top: 1rem;
  }

  .topbar {
    padding: 0.95rem 1rem;
    align-items: flex-start;
    flex-direction: column;
  }

  .brand {
    font-size: 1.45rem;
  }

  .chip-nav,
  .card-actions {
    gap: 0.55rem;
  }

  .chip,
  .button,
  .ghost-button {
    width: 100%;
  }
}
