/* ================================================================
   Harvard Road Property Management — v2 Design System
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Design Tokens ──────────────────────────────────────────── */
:root {
  --navy:        #0D1E2E;
  --navy-mid:    #163552;
  --navy-soft:   #1F4369;
  --gold:        #C07B2C;
  --gold-light:  #F7EDD8;
  --gold-mid:    #D99F5A;
  --bg:          #F6F4F0;
  --surface:     #FFFFFF;
  --surface-alt: #EFF3F7;
  --ink:         #192837;
  --body:        #3C5165;
  --muted:       #6B7F8E;
  --border:      #D8E3EC;
  --border-dark: #B3C7D6;
  --green:       #1A6B4A;
  --green-bg:    #EBF5F0;
  --red:         #B33229;
  --red-bg:      #FBEBE9;
  --amber:       #A56A0A;
  --amber-bg:    #FDF3DC;
  --blue:        #1A57A6;
  --blue-bg:     #E4EDF8;
  --purple:      #6B3FA0;
  --purple-bg:   #F0EAF8;

  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --r-sm:   4px;
  --r:      8px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(13,30,46,.07), 0 1px 2px rgba(13,30,46,.05);
  --shadow:    0 4px 12px rgba(13,30,46,.09), 0 2px 4px rgba(13,30,46,.05);
  --shadow-md: 0 8px 24px rgba(13,30,46,.11), 0 4px 8px rgba(13,30,46,.06);
  --shadow-lg: 0 20px 48px rgba(13,30,46,.13), 0 8px 20px rgba(13,30,46,.08);

  --header-h:  68px;
  --sidebar-w: 236px;
  --max-w:     1200px;

  font-family: var(--font-sans);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); line-height: 1.15; font-weight: 600; }
code { font-family: 'Fira Code', 'Cascadia Code', monospace; background: var(--surface-alt); border-radius: var(--r-sm); padding: 1px 6px; font-size: .88em; }

/* ── Accessibility ──────────────────────────────────────────── */
.skip-link { position: absolute; top: -100%; left: 0; z-index: 9999; padding: 12px 20px; background: var(--navy); color: #fff; font-weight: 600; text-decoration: none; border-radius: 0 0 var(--r) 0; }
.skip-link:focus { top: 0; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: var(--r-sm); }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold); }
.lightbox-close:focus-visible, .lightbox-prev:focus-visible, .lightbox-next:focus-visible { outline-color: #fff; }

/* ── Site Header ────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100; height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 0 clamp(20px, 5vw, 64px);
  background: rgba(255,255,255,.96); border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.brand { display: flex; gap: 12px; align-items: center; text-decoration: none; flex-shrink: 0; }
.brand-logo { height: 44px; width: auto; object-fit: contain; }
.brand-text strong { display: block; font-family: var(--font-display); font-size: 16px; color: var(--navy); line-height: 1.2; }
.brand-text small { display: block; font-size: 11px; color: var(--muted); letter-spacing: .03em; margin-top: 2px; }
.brand small { display: block; color: var(--muted); font-size: 11px; }
nav { display: flex; gap: 2px; align-items: center; }
nav a { text-decoration: none; color: var(--body); font-size: 14px; font-weight: 500; padding: 7px 12px; border-radius: var(--r); transition: background .15s, color .15s; }
nav a:hover { background: var(--surface-alt); color: var(--navy); }
.nav-toggle { display: none; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1.5px solid transparent; min-height: 40px; padding: 0 20px;
  border-radius: var(--r); background: var(--navy); color: #fff;
  font-family: var(--font-sans); font-size: 14px; font-weight: 600;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s, box-shadow .15s, transform .1s;
}
.btn:hover { background: var(--navy-mid); box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--navy); border-color: var(--border-dark); }
.btn.ghost:hover { background: var(--surface-alt); border-color: var(--navy); }
.btn.primary { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn.primary:hover { background: #a36522; border-color: #a36522; }
.btn.danger { color: var(--red); border-color: transparent; background: transparent; }
.btn.danger:hover { background: var(--red-bg); }
.btn.small { min-height: 32px; padding: 0 12px; font-size: 13px; }

/* ── Availability Banner ────────────────────────────────────── */
.availability-banner { background: var(--navy); color: #fff; text-align: center; padding: 12px 24px; font-size: 14px; font-weight: 500; letter-spacing: .01em; }
.availability-banner span { display: inline-block; }

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  display: grid; grid-template-columns: minmax(0,1fr) minmax(340px,46%);
  min-height: calc(100vh - var(--header-h)); overflow: hidden;
}
.hero-copy {
  background: var(--navy); color: #fff;
  padding: clamp(48px, 8vw, 96px) clamp(32px, 6vw, 80px);
  display: flex; flex-direction: column; justify-content: center; gap: 28px;
}
.hero-copy .eyebrow { color: var(--gold-mid); text-transform: uppercase; letter-spacing: .1em; font-size: 12px; font-weight: 600; }
.hero-copy h1 { font-size: clamp(36px, 5vw, 60px); color: #fff; line-height: 1.05; letter-spacing: -.01em; }
.hero-copy p { color: rgba(255,255,255,.72); font-size: 17px; line-height: 1.65; max-width: 480px; }
.hero-copy .actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-copy .btn { background: var(--gold); border-color: var(--gold); color: #fff; }
.hero-copy .btn:hover { background: #a36522; border-color: #a36522; }
.hero-copy .btn.ghost { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.3); color: #fff; }
.hero-copy .btn.ghost:hover { background: rgba(255,255,255,.15); }
.hero-media { position: relative; overflow: hidden; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }

/* ── Features Band ──────────────────────────────────────────── */
.features-band { background: var(--surface); border-bottom: 1px solid var(--border); }
.features-band-inner {
  max-width: var(--max-w); margin: 0 auto;
  display: grid; grid-template-columns: repeat(3,1fr);
  padding: 0 clamp(20px,4vw,48px);
}
.feature-item { padding: 40px 32px; border-right: 1px solid var(--border); }
.feature-item:last-child { border-right: none; }
.feature-icon {
  width: 42px; height: 42px; border-radius: var(--r);
  background: var(--gold-light); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin-bottom: 16px;
}
.feature-item h3 { font-size: 17px; color: var(--navy); margin-bottom: 8px; }
.feature-item p { font-size: 14px; color: var(--muted); line-height: 1.65; }

/* ── Snapshot / Property ────────────────────────────────────── */
.snapshot-section {
  max-width: var(--max-w); margin: 0 auto;
  padding: 72px clamp(20px,4vw,48px);
  display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start;
}
.snapshot-copy h2 { font-size: clamp(26px,3vw,38px); color: var(--navy); margin-bottom: 16px; }
.snapshot-copy p { color: var(--muted); line-height: 1.7; margin-bottom: 12px; }
.snapshot-copy a { color: var(--gold); font-weight: 600; text-decoration: none; }
.snapshot-copy a:hover { text-decoration: underline; }
.property-list { list-style: none; display: grid; gap: 0; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; background: var(--border); }
.property-list li { background: var(--surface); padding: 14px 20px; font-size: 14px; color: var(--body); border-bottom: 1px solid var(--border); }
.property-list li:last-child { border-bottom: none; }
.property-list li strong { color: var(--muted); font-weight: 500; margin-right: 6px; }

/* ── CTA Section ────────────────────────────────────────────── */
.cta-section { background: var(--navy); padding: 72px clamp(20px,4vw,48px); text-align: center; }
.cta-section h2 { font-size: clamp(26px,3vw,38px); color: #fff; margin-bottom: 16px; }
.cta-section p { color: rgba(255,255,255,.65); max-width: 500px; margin: 0 auto 32px; font-size: 17px; line-height: 1.65; }
.cta-section .actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.cta-section .btn { background: var(--gold); border-color: var(--gold); color: #fff; }
.cta-section .btn:hover { background: #a36522; }
.cta-section .btn.ghost { border-color: rgba(255,255,255,.3); color: #fff; background: rgba(255,255,255,.08); }
.cta-section .btn.ghost:hover { background: rgba(255,255,255,.15); }

/* ── Page Head ──────────────────────────────────────────────── */
.page-head { max-width: var(--max-w); margin: 0 auto; padding: 56px clamp(20px,4vw,48px) 32px; }
.page-head .eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing: .1em; font-size: 11px; font-weight: 600; margin-bottom: 12px; }
.page-head h1 { font-size: clamp(28px,4vw,46px); color: var(--navy); margin-bottom: 12px; }
.page-head p { color: var(--muted); font-size: 17px; max-width: 640px; line-height: 1.7; }
.eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing: .1em; font-size: 11px; font-weight: 600; }

/* ── Section Wrap ───────────────────────────────────────────── */
.section-wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 clamp(20px,4vw,48px) 72px; }
.band { max-width: var(--max-w); margin: 0 auto; padding: 32px clamp(20px,4vw,48px); }

/* ── Grid ───────────────────────────────────────────────────── */
.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: repeat(2,minmax(0,1fr)); }
.grid.three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.grid article, .info-grid article {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 24px; box-shadow: var(--shadow-sm);
}
.split { max-width: var(--max-w); margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 48px; padding: 56px clamp(20px,4vw,48px) 80px; }
.feature-list { list-style: none; display: grid; gap: 10px; }
.feature-list li { background: var(--gold-light); border-left: 4px solid var(--gold); padding: 12px 16px; border-radius: 0 var(--r) var(--r) 0; color: var(--body); font-size: 14px; }

/* ── Forms ──────────────────────────────────────────────────── */
label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--body); }
input, textarea, select {
  width: 100%; border: 1.5px solid var(--border); border-radius: var(--r);
  padding: 10px 14px; font: inherit; font-size: 15px;
  background: var(--surface); color: var(--ink); transition: border-color .15s;
}
input:hover, textarea:hover, select:hover { border-color: var(--border-dark); }
textarea { min-height: 120px; resize: vertical; }
.form-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: clamp(20px,3vw,32px);
  box-shadow: var(--shadow-sm); margin-bottom: 24px;
}
.form-panel h2 { font-size: 20px; color: var(--navy); margin-bottom: 8px; }
.form-panel p.muted { margin-bottom: 20px; }
.form-panel.compact { margin-top: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin-bottom: 16px; }
fieldset { border: 1.5px solid var(--border); border-radius: var(--r-md); padding: 20px 24px; margin-bottom: 20px; }
fieldset legend { font-size: 15px; font-weight: 600; color: var(--navy); padding: 0 8px; }
.inline-form { display: grid; gap: 8px; margin-top: 12px; }
.checks { display: grid; grid-template-columns: repeat(auto-fit,minmax(200px,1fr)); gap: 10px; margin: 16px 0; }
.check, .checks label { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 14px; }
.check input, .checks input { width: auto; }
.notice { color: var(--green); font-weight: 600; display: block; margin-bottom: 12px; }
.muted { color: var(--muted); font-size: 14px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

/* ── Auth ───────────────────────────────────────────────────── */
.auth {
  min-height: calc(100vh - var(--header-h) - 100px);
  display: flex; align-items: center; justify-content: center;
  padding: 48px 20px;
}
.auth-card {
  width: min(480px,100%);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: clamp(28px,5vw,48px);
  box-shadow: var(--shadow-md);
}
.auth-card .eyebrow { display: block; color: var(--gold); text-transform: uppercase; letter-spacing: .1em; font-size: 11px; font-weight: 600; margin-bottom: 8px; }
.auth-card h1 { font-size: 28px; color: var(--navy); margin-bottom: 24px; }
.auth-card label { margin-bottom: 14px; }
.auth-card .notice { padding: 10px 14px; background: var(--green-bg); border-radius: var(--r); font-size: 14px; }
.auth-card .btn { width: 100%; margin-top: 8px; min-height: 44px; font-size: 15px; }
.auth-card p.muted { margin-top: 16px; }
.auth-card a { color: var(--gold); font-weight: 600; text-decoration: none; }
.auth-card a:hover { text-decoration: underline; }

/* ── FAQ Accordion ──────────────────────────────────────────── */
.accordion { max-width: var(--max-w); margin: 0 auto; padding: 0 clamp(20px,4vw,48px) 64px; }
.accordion details {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--r-md); margin-bottom: 10px; transition: border-color .15s;
}
.accordion details[open] { border-color: var(--border-dark); }
.accordion details summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 22px; cursor: pointer; font-weight: 600; font-size: 15px;
  color: var(--navy); list-style: none; user-select: none;
}
.accordion details summary::-webkit-details-marker { display: none; }
.accordion details summary::marker { display: none; }
.accordion details summary::after {
  content: "+"; flex-shrink: 0; width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-alt); border-radius: 50%;
  font-size: 18px; color: var(--muted); transition: transform .2s, background .15s, color .15s;
}
.accordion details[open] summary::after { transform: rotate(45deg); background: var(--gold-light); color: var(--gold); }
.accordion details p { padding: 0 22px 20px; color: var(--body); line-height: 1.7; font-size: 15px; }

/* ── Gallery ────────────────────────────────────────────────── */
.gallery-panel { max-width: var(--max-w); margin: 0 auto; padding: 0 clamp(20px,4vw,48px) 72px; display: grid; gap: 32px; }
.gallery-albums { display: grid; grid-template-columns: repeat(auto-fit,minmax(200px,1fr)); gap: 14px; }
.album-card {
  border: 1.5px solid var(--border); border-radius: var(--r-md);
  overflow: hidden; background: var(--surface); cursor: pointer;
  transition: transform .2s, border-color .2s, box-shadow .2s;
  display: grid; grid-template-rows: 160px auto;
}
.album-card:hover { transform: translateY(-3px); border-color: var(--border-dark); box-shadow: var(--shadow-md); }
.album-card.active { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-light); }
.album-card img { width: 100%; height: 100%; object-fit: cover; }
.album-meta { padding: 14px 16px; }
.album-meta strong { font-size: 15px; color: var(--navy); display: block; }
.album-meta span { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.gallery-view { display: grid; gap: 16px; }
.gallery-title { font-size: clamp(20px,2.5vw,28px); color: var(--navy); margin: 0; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 12px; }
.gallery-grid img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--r-md); border: 1px solid var(--border); cursor: pointer; background: var(--surface-alt); transition: opacity .15s, transform .15s; }
.gallery-grid img:hover { opacity: .88; transform: scale(1.01); }
.lightbox { display: none; position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.9); align-items: center; justify-content: center; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 88vh; object-fit: contain; border-radius: var(--r); box-shadow: 0 24px 80px rgba(0,0,0,.6); }
.lightbox-close { position: absolute; top: 20px; right: 24px; color: #fff; font-size: 24px; cursor: pointer; background: rgba(255,255,255,.1); border: none; border-radius: 50%; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; transition: background .15s; }
.lightbox-close:hover { background: rgba(255,255,255,.2); }
.lightbox-prev, .lightbox-next { position: absolute; top: 50%; transform: translateY(-50%); color: #fff; font-size: 20px; background: rgba(255,255,255,.12); border: none; border-radius: var(--r); padding: 12px 16px; cursor: pointer; transition: background .15s; }
.lightbox-prev:hover, .lightbox-next:hover { background: rgba(255,255,255,.22); }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

/* ── App Layout (Admin / Renter Sidebar) ────────────────────── */
.app-layout { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: calc(100vh - var(--header-h)); }

.app-sidebar {
  background: var(--navy); padding: 20px 0;
  position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h));
  overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent;
}
.app-sidebar::-webkit-scrollbar { width: 4px; }
.app-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }
.app-sidebar-header { padding: 0 16px 16px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 12px; }
.app-sidebar-header h2 { font-family: var(--font-sans); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: rgba(255,255,255,.35); margin-bottom: 10px; }
.sidebar-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.sidebar-actions a { font-size: 12px; font-weight: 500; color: rgba(255,255,255,.65); text-decoration: none; padding: 5px 10px; border: 1px solid rgba(255,255,255,.15); border-radius: var(--r-sm); transition: background .15s, color .15s; }
.sidebar-actions a:hover { background: rgba(255,255,255,.1); color: #fff; }

.app-sidebar-brand {
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 6px;
  display: flex; align-items: center; justify-content: space-between;
}
.app-sidebar-brand > span { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.35); }
.app-sidebar-brand-links { display: flex; gap: 10px; }
.app-sidebar-brand-links a { font-size: 11px; color: rgba(255,255,255,.4); text-decoration: none; transition: color .12s; }
.app-sidebar-brand-links a:hover { color: rgba(255,255,255,.8); }

.app-sidebar-nav { display: block; }
.app-nav-group { padding: 4px 10px 6px; }
.app-nav-group + .app-nav-group { border-top: 1px solid rgba(255,255,255,.07); margin-top: 6px; padding-top: 10px; }
.app-nav-label { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.3); padding: 4px 10px 6px; display: block; }
.app-nav-item {
  display: flex; align-items: center; width: 100%;
  padding: 7px 10px; border-radius: var(--r-sm);
  border: none; background: transparent; text-align: left;
  font-family: var(--font-sans); font-size: 13px; font-weight: 400;
  color: rgba(255,255,255,.6); cursor: pointer;
  transition: background .12s, color .12s; margin-bottom: 1px;
}
.app-nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.app-nav-item.active, .app-nav-item[aria-selected="true"] { background: rgba(192,123,44,.25); color: #fff; font-weight: 500; }
.nav-count {
  margin-left: auto;
  font-size: 11px; font-weight: 400; font-variant-numeric: tabular-nums;
  color: rgba(255,255,255,.28);
  padding-left: 6px;
}
.app-nav-item:hover .nav-count { color: rgba(255,255,255,.55); }
.app-nav-item.active .nav-count, .app-nav-item[aria-selected="true"] .nav-count { color: rgba(255,255,255,.7); }

.app-content { background: var(--bg); padding: 28px clamp(16px,3vw,40px); min-width: 0; }
.app-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 16px; }
.app-topbar h1 { font-size: 20px; color: var(--navy); margin: 0; }
.app-topbar-actions { display: flex; gap: 8px; align-items: center; }
.app-flash { padding: 10px 16px; background: var(--green-bg); border: 1px solid var(--green); border-left: 4px solid var(--green); border-radius: var(--r); color: var(--green); font-weight: 600; font-size: 14px; margin-bottom: 16px; }

/* ── KPI Chips (in sidebar app layout) ─────────────────────── */
.app-kpis { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.app-kpis .stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 8px 16px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-sm);
}
.app-kpis .stat strong { font-size: 20px; font-weight: 700; color: var(--navy); display: block; }
.app-kpis .stat span { font-size: 11px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; display: block; }

/* ── Contractor Cards ───────────────────────────────────────── */
.panel-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-select { font-family: var(--font-sans); font-size: 13px; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); cursor: pointer; }
.fav-filter-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--body); cursor: pointer; }

.contractor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 8px; }
.contractor-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 18px;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 10px;
  transition: box-shadow .15s;
}
.contractor-card:hover { box-shadow: var(--shadow-md); }

.contractor-card-head { display: flex; gap: 14px; align-items: flex-start; }
.contractor-photo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 2px solid var(--border); }
.contractor-photo-placeholder {
  width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0;
  background: var(--navy-mid); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; font-family: var(--font-sans); letter-spacing: .02em;
}
.contractor-card-meta { flex: 1; min-width: 0; }
.contractor-name-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.contractor-name { font-size: 15px; font-weight: 600; color: var(--navy); margin: 0; line-height: 1.3; }
.contractor-company { font-size: 12px; color: var(--muted); margin: 2px 0 4px; }
.category-badge {
  display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .04em;
  padding: 2px 8px; border-radius: var(--r-full);
  background: var(--surface-alt); color: var(--body); border: 1px solid var(--border);
}
.fav-form { margin: 0; }
.fav-btn {
  background: none; border: none; font-size: 20px; cursor: pointer; padding: 0 2px;
  color: var(--muted); line-height: 1; transition: color .12s, transform .12s;
}
.fav-btn:hover { color: var(--gold); transform: scale(1.15); }
.fav-btn.active { color: var(--gold); }

.contractor-contacts { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.clink { font-size: 12.5px; color: var(--body); text-decoration: none; }
.clink:hover { color: var(--navy); text-decoration: underline; }
.contractor-notes { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.5; }

.contractor-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); }

.job-thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.job-thumb { width: 52px; height: 52px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--border); display: block; transition: opacity .12s; }
.job-thumb:hover { opacity: .85; }

.add-photo-toggle { font-size: 12px; }
.add-photo-toggle summary { cursor: pointer; color: var(--muted); list-style: none; padding: 4px 0; }
.add-photo-toggle summary:hover { color: var(--navy); }
.add-photo-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 0 4px; }
.add-photo-form input[type="file"] { font-size: 12px; }
.add-photo-form input[type="text"], .add-photo-form input[name="caption"] { font-size: 12px; padding: 4px 8px; border: 1px solid var(--border); border-radius: var(--r-sm); font-family: var(--font-sans); width: 150px; }

.form-toggle { }
.form-toggle > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; }
.form-toggle > summary::-webkit-details-marker { display: none; }

/* ── Dashboard Head (Renter public page) ────────────────────── */
.dashboard-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  max-width: var(--max-w); margin: 0 auto;
  padding: 40px clamp(20px,4vw,48px) 0;
}
.dashboard-head h1 { font-size: clamp(26px,4vw,40px); color: var(--navy); }
.dashboard-head .actions { display: flex; gap: 8px; }

/* ── Tabs (underline style for renter / public) ─────────────── */
.tabs {
  max-width: var(--max-w); margin: 0 auto;
  padding: 0 clamp(20px,4vw,48px);
  display: flex; gap: 0; overflow-x: auto;
  border-bottom: 2px solid var(--border);
}
.tabs button {
  white-space: nowrap; border: none; background: transparent;
  padding: 12px 16px; font-family: var(--font-sans); font-size: 14px; font-weight: 500;
  color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  border-radius: 0; transition: color .15s, border-color .15s;
}
.tabs button:hover { color: var(--navy); }
.tabs button.active, .tabs button[aria-selected="true"] { color: var(--navy); border-bottom-color: var(--gold); font-weight: 600; }

/* ── Tab Panels ─────────────────────────────────────────────── */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Tab inner content wrappers ─────────────────────────────── */
.renter-panel-inner { max-width: var(--max-w); margin: 0 auto; padding: 24px clamp(20px,4vw,48px) 48px; }

/* ── Tables ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin: 14px 0 28px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 11px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { background: #F3F7FA; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #FAFCFF; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge { display: inline-flex; border-radius: var(--r-full); padding: 3px 10px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--surface-alt); color: var(--body); }
.badge.open, .badge.new, .badge.pending, .badge.invited { background: var(--amber-bg); color: var(--amber); }
.badge.closed, .badge.signed, .badge.approved, .badge.active, .badge.done, .badge.acknowledged, .badge.sent { background: var(--green-bg); color: var(--green); }
.badge.rejected, .badge.urgent, .badge.failed { background: var(--red-bg); color: var(--red); }
.badge.in-progress, .badge.reviewing, .badge.waitlisted, .badge.waiting-on-renter { background: var(--blue-bg); color: var(--blue); }
.badge.former, .badge.cancelled { background: var(--purple-bg); color: var(--purple); }
.badge.missing, .badge.not-acknowledged { background: var(--red-bg); color: var(--red); }

/* ── Cards ──────────────────────────────────────────────────── */
.card-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit,minmax(280px,1fr)); }
.mini-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 20px; box-shadow: var(--shadow-sm); }
.mini-card strong { font-size: 16px; color: var(--navy); display: block; margin-bottom: 6px; }
.mini-card span { display: block; color: var(--muted); margin-bottom: 8px; font-size: 13px; }
.mini-card p { color: var(--body); font-size: 14px; line-height: 1.6; margin-bottom: 10px; }

/* ── Maintenance ────────────────────────────────────────────── */
.maint-header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.maint-responses { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 14px; display: grid; gap: 10px; }
.maint-response { background: var(--surface-alt); border-radius: var(--r); padding: 12px 16px; }
.maint-response strong { font-size: 13px; color: var(--navy); }
.maint-response span { margin-left: 8px; font-size: 12px; color: var(--muted); }
.maint-response p { margin-top: 6px; font-size: 14px; color: var(--body); }

/* ── Checklists ─────────────────────────────────────────────── */
.checklist-view { list-style: none; display: grid; gap: 8px; }
.checklist-view li { display: flex; justify-content: space-between; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 12px 18px; font-size: 14px; }

/* ── Stats (standalone, e.g. payments page) ─────────────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fit,minmax(160px,1fr)); gap: 14px; margin-bottom: 24px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.stat strong { display: block; font-size: 28px; font-weight: 700; color: var(--navy); }
.stat span { font-size: 13px; color: var(--muted); margin-top: 4px; display: block; }
.payment-summary { margin-bottom: 24px; }

/* ── Payment Layout ─────────────────────────────────────────── */
.payment-layout { max-width: var(--max-w); margin: 0 auto; padding: 0 clamp(20px,4vw,48px) 80px; display: grid; grid-template-columns: minmax(0,1.3fr) minmax(280px,.7fr); gap: 28px; align-items: start; }
.payment-layout h2 { font-size: 22px; color: var(--navy); margin-bottom: 16px; }
.payment-layout aside { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 22px; box-shadow: var(--shadow-sm); }
.deposit-list { display: grid; gap: 14px; }
.deposit-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 18px; box-shadow: var(--shadow-sm); display: grid; gap: 10px; }
.deposit-card div { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.deposit-card span { color: var(--muted); font-size: 13px; }
.deposit-card strong { text-align: right; font-size: 14px; color: var(--ink); }
.deposit-card p { color: var(--muted); font-size: 14px; margin: 0; }

/* ── Editable Grid ──────────────────────────────────────────── */
.editable-grid table { font-size: 13px; }
.editable-grid th, .editable-grid td { padding: 8px 10px; vertical-align: middle; }
.editable-grid input, .editable-grid select, .editable-grid textarea { min-width: 110px; border-radius: var(--r-sm); padding: 6px 8px; font-size: 13px; border-width: 1px; }
.editable-grid textarea { width: 200px; min-height: 40px; max-height: 80px; }
.editable-grid input[type="checkbox"] { min-width: 0; width: 16px; height: 16px; }
.editable-grid .actions-col { width: 110px; }
.grid-actions { display: flex; align-items: center; gap: 5px; position: sticky; left: 0; z-index: 1; background: var(--surface); }
.grid-actions form { margin: 0; }
.editable-grid tbody tr:hover td, .editable-grid tbody tr:hover .grid-actions { background: #F6FAFD; }
.editable-grid .add-row td, .editable-grid .add-row .grid-actions { background: #FFFBF2; }
.table-link { color: var(--gold); font-weight: 600; text-decoration: none; }
.table-link:hover { text-decoration: underline; }
.search { margin: 0 0 12px; max-width: 320px; }
.thumb { height: 72px; width: auto; object-fit: cover; border-radius: var(--r-sm); cursor: pointer; border: 1px solid var(--border); }

/* ── Info Frame ─────────────────────────────────────────────── */
.info-frame { width: 100%; min-height: 640px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }

/* ── Legal / Privacy ────────────────────────────────────────── */
.legal { max-width: 800px; margin: 0 auto; padding: 48px clamp(20px,4vw,48px) 80px; }
.legal h2 { font-size: 22px; color: var(--navy); margin: 32px 0 12px; }
.legal h2:first-child { margin-top: 0; }
.legal p, .legal li { color: var(--body); line-height: 1.75; margin-bottom: 12px; font-size: 15px; }
.legal ul, .legal ol { padding-left: 24px; margin-bottom: 12px; }

/* ── Counter ────────────────────────────────────────────────── */
.counter { position: fixed; right: 14px; bottom: 14px; z-index: 50; background: rgba(13,30,46,.88); color: rgba(255,255,255,.8); border-radius: var(--r); padding: 7px 12px; font-size: 12px; backdrop-filter: blur(8px); box-shadow: var(--shadow); }

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding: 36px clamp(20px,5vw,64px); border-top: 1px solid var(--border); background: var(--surface); color: var(--muted); }
.site-footer p { margin: 0 0 6px; max-width: 600px; font-size: 13.5px; line-height: 1.7; }
.site-footer-right { text-align: right; flex-shrink: 0; }
.site-footer-right a { color: var(--gold); text-decoration: none; font-weight: 500; font-size: 13.5px; }
.site-footer-right a:hover { text-decoration: underline; }
.accessibility-statement { font-size: 12px !important; margin-top: 8px !important; }
.accessibility-statement a { color: var(--gold) !important; text-decoration: none; }

/* ── Print ──────────────────────────────────────────────────── */
.no-print { display: flex; }
@media print {
  .site-header, .site-footer, .counter, .no-print, .app-sidebar { display: none !important; }
  .app-layout { grid-template-columns: 1fr; }
  body { background: white; color: black; }
  .table-wrap { border: none; overflow: visible; }
  table { font-size: 12px; }
  .band, .stats, .payment-summary, .page-head { max-width: 100%; padding: 0; }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 960px) {
  .app-layout { grid-template-columns: 1fr; }
  .app-sidebar { position: static; height: auto; padding: 12px 0; overflow: visible; max-height: 50vh; overflow-y: auto; }
  .app-nav-item { padding: 6px 10px; font-size: 13px; }
  .snapshot-section { grid-template-columns: 1fr; gap: 32px; }
  .features-band-inner { grid-template-columns: 1fr; }
  .feature-item { border-right: none; border-bottom: 1px solid var(--border); padding: 28px 24px; }
  .feature-item:last-child { border-bottom: none; }
  .payment-layout { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; padding-bottom: 48px; }
}

@media (max-width: 768px) {
  :root { --header-h: 60px; }
  .nav-toggle { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; background: none; border: 1.5px solid var(--border); border-radius: var(--r); font-size: 18px; cursor: pointer; color: var(--navy); }
  nav { display: none; position: absolute; top: calc(var(--header-h) + 4px); left: 12px; right: 12px; flex-direction: column; align-items: stretch; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--r-md); padding: 8px; box-shadow: var(--shadow-md); z-index: 200; }
  nav.open { display: flex; }
  nav a { padding: 10px 14px; border-radius: var(--r-sm); }
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-media { height: 260px; order: -1; }
  .dashboard-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .grid.two, .grid.three, .form-grid { grid-template-columns: 1fr; }
  .site-footer { flex-direction: column; }
  .site-footer-right { text-align: left; }
  .tabs button { padding: 10px 12px; font-size: 13px; }
  .app-topbar { flex-direction: column; align-items: flex-start; }
}

/* ── Dark Mode ──────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #0F1923;
    --surface:     #172233;
    --surface-alt: #1D2D3F;
    --ink:         #D8E5F0;
    --body:        #8BA8BE;
    --muted:       #5A7890;
    --border:      #24374A;
    --border-dark: #2E475F;
    --gold:        #D49B4A;
    --gold-light:  #2A2015;
    --gold-mid:    #C48A38;
  }
  body { background: var(--bg); color: var(--ink); }
  .site-header { background: rgba(15,25,35,.96); border-color: var(--border); }
  .features-band { background: #0D1720; border-color: var(--border); }
  .feature-item { border-color: var(--border); }
  .accordion details, .form-panel, .mini-card, .stat, .deposit-card { background: var(--surface); border-color: var(--border); }
  .table-wrap { background: var(--surface); border-color: var(--border); }
  th { background: #0D1720; color: var(--muted); }
  tbody tr:hover td { background: #1A2D40; }
  .app-sidebar { background: #0A1520; }
  .snapshot-section { background: transparent; }
  .property-list li { background: var(--surface); border-color: var(--border); }
  .property-list { background: var(--border); border-color: var(--border); }
  .cta-section { background: #0A1520; }
  input, textarea, select { background: var(--surface); color: var(--ink); border-color: var(--border); }
  .btn.ghost { background: transparent; border-color: var(--border-dark); color: var(--ink); }
  .nav-toggle { background: var(--surface); border-color: var(--border); color: var(--ink); }
  nav { background: var(--surface); border-color: var(--border); }
  .site-footer { background: var(--surface); border-color: var(--border); }
  .auth-card { background: var(--surface); border-color: var(--border); }
  .album-card { background: var(--surface); border-color: var(--border); }
  .grid-actions { background: var(--surface); }
  .editable-grid tbody tr:hover td, .editable-grid tbody tr:hover .grid-actions { background: var(--surface-alt); }
  .editable-grid .add-row td, .editable-grid .add-row .grid-actions { background: #1A2015; }
  .hero-copy { background: #0A1520; }
  .checklist-view li { background: var(--surface); border-color: var(--border); }
  .counter { background: rgba(23,34,51,.9); }
  .availability-banner { background: #0A1520; }
  .payment-layout aside { background: var(--surface); border-color: var(--border); }
  .app-content { background: var(--bg); }
  .app-topbar { border-color: var(--border); }
  .app-kpis .stat { background: var(--surface); border-color: var(--border); }
  .maint-response { background: var(--surface-alt); }
}
