/* ── TKCA Properties — Design System ─────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600&family=Jost:wght@300;400;500;600&display=swap');

:root {
  /* Logo-extracted palette */
  --teal:        #6BBFBF;
  --sage:        #A8C8A8;
  --yellow:      #EDE87A;
  --salmon:      #E89070;
  --rose:        #D4605A;
  --silver:      #D0D0D0;

  /* Functional tokens */
  --bg:          #F8F6F2;
  --surface:     #FFFFFF;
  --surface-alt: #F2EFE8;
  --border:      #E4E0D8;
  --text-dark:   #2A2A28;
  --text-mid:    #5A5852;
  --text-light:  #9A9690;
  --accent:      var(--teal);
  --accent-2:    var(--rose);

  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   20px;
  --shadow-sm:   0 2px 8px rgba(0,0,0,.06);
  --shadow-md:   0 6px 24px rgba(0,0,0,.10);
  --shadow-lg:   0 16px 48px rgba(0,0,0,.14);

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Jost', system-ui, sans-serif;

  --transition:   .25s cubic-bezier(.4,0,.2,1);
}

/* ── Reset ────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea {
  font-family: var(--font-body);
  font-size: 1rem;
}

/* ── Scrollbar ────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--silver); border-radius: 3px; }

/* ── Typography ───────────────────────────────────────────────────────── */
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 500; }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 500; }
h3 { font-size: 1.25rem; font-weight: 500; }
p  { font-size: .9375rem; }

/* ── Header / Nav ─────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: .875rem 1.5rem;
}
.header-inner {
  max-width: 1320px; margin: 0 auto;
  display: flex; align-items: center; gap: 1rem;
  justify-content: space-between;
}
.logo-wrap { display: flex; align-items: center; gap: .75rem; }
.logo-img   { height: 44px; width: auto; }
.logo-text  { font-family: var(--font-display); font-size: 1.375rem; font-weight: 600; color: var(--text-dark); letter-spacing: .02em; }
.logo-text span { color: var(--teal); }

.nav-search {
  flex: 1; max-width: 420px;
  position: relative;
}
.nav-search input {
  width: 100%;
  padding: .55rem 1rem .55rem 2.75rem;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  background: var(--surface-alt);
  color: var(--text-dark);
  transition: border-color var(--transition), box-shadow var(--transition);
  font-size: .875rem;
}
.nav-search input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(107,191,191,.15);
}
.nav-search svg {
  position: absolute; left: .875rem; top: 50%; transform: translateY(-50%);
  color: var(--text-light); pointer-events: none;
}
.header-actions { display: flex; align-items: center; gap: .75rem; }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .55rem 1.25rem;
  border: none; border-radius: 50px; cursor: pointer;
  font-size: .875rem; font-weight: 500;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--teal); color: #fff;
  box-shadow: 0 3px 12px rgba(107,191,191,.35);
}
.btn-primary:hover { background: #5AAEAE; box-shadow: 0 6px 20px rgba(107,191,191,.45); }
.btn-secondary {
  background: var(--surface-alt); color: var(--text-dark);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }
.btn-danger {
  background: var(--rose); color: #fff;
  box-shadow: 0 3px 12px rgba(212,96,90,.3);
}
.btn-danger:hover { background: #C0504A; }
.btn-sm { padding: .35rem .85rem; font-size: .8125rem; }
.btn-icon { padding: .5rem; border-radius: 8px; background: transparent; border: 1.5px solid var(--border); }
.btn-icon:hover { background: var(--surface-alt); }

/* ── Hero ─────────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, rgba(107,191,191,.12) 0%, rgba(168,200,168,.10) 50%, rgba(237,232,122,.08) 100%);
  padding: 3.5rem 1.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.hero-eyebrow {
  display: inline-block;
  font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--teal); margin-bottom: .75rem;
}
.hero h1 { color: var(--text-dark); margin-bottom: .75rem; }
.hero p { color: var(--text-mid); max-width: 520px; margin: 0 auto 2rem; }
.hero-stats {
  display: flex; justify-content: center; gap: 2.5rem; flex-wrap: wrap; margin-top: 2rem;
}
.stat { text-align: center; }
.stat-num { font-family: var(--font-display); font-size: 2rem; font-weight: 600; color: var(--teal); display: block; }
.stat-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-light); }

/* ── Filter Bar ───────────────────────────────────────────────────────── */
.filter-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: .875rem 1.5rem;
  position: sticky; top: 73px; z-index: 90;
}
.filter-inner {
  max-width: 1320px; margin: 0 auto;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.filter-chips { display: flex; gap: .5rem; flex-wrap: wrap; }
.chip {
  padding: .35rem .875rem;
  border-radius: 50px; border: 1.5px solid var(--border);
  font-size: .8125rem; background: var(--surface);
  cursor: pointer; transition: all var(--transition);
  color: var(--text-mid); font-weight: 500;
}
.chip:hover, .chip.active {
  background: var(--teal); color: #fff; border-color: var(--teal);
}
.filter-count { margin-left: auto; font-size: .8125rem; color: var(--text-light); white-space: nowrap; }

/* ── Grid ─────────────────────────────────────────────────────────────── */
.properties-section { max-width: 1320px; margin: 0 auto; padding: 2.5rem 1.5rem; }
.properties-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.75rem;
}

/* ── Property Card ────────────────────────────────────────────────────── */
.property-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
}
.property-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}
.card-image {
  aspect-ratio: 16/10; overflow: hidden; position: relative;
  background: var(--surface-alt);
}
.card-image img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s ease;
}
.property-card:hover .card-image img { transform: scale(1.06); }
.card-badge {
  position: absolute; top: .75rem; left: .75rem;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(6px);
  padding: .25rem .65rem;
  border-radius: 50px; font-size: .72rem; font-weight: 600;
  color: var(--teal); letter-spacing: .05em;
}
.no-photo-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: .5rem;
  color: var(--text-light); font-size: .875rem;
}
.no-photo-placeholder svg { opacity: .4; }

.card-body { padding: 1.25rem; }
.card-title { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; margin-bottom: .35rem; }
.card-location {
  display: flex; align-items: center; gap: .35rem;
  font-size: .8125rem; color: var(--text-light); margin-bottom: 1rem;
}
.card-pills { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.pill {
  padding: .2rem .6rem; border-radius: 50px;
  font-size: .7rem; font-weight: 500; letter-spacing: .04em;
}
.pill-teal   { background: rgba(107,191,191,.12); color: var(--teal); }
.pill-sage   { background: rgba(168,200,168,.15); color: #5A8C5A; }
.pill-yellow { background: rgba(237,232,122,.2);  color: #8A8820; }
.pill-salmon { background: rgba(232,144,112,.15); color: var(--salmon); }

.card-footer {
  padding: .875rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.view-btn {
  font-size: .8125rem; font-weight: 500; color: var(--teal);
  display: flex; align-items: center; gap: .3rem;
  transition: gap var(--transition);
}
.property-card:hover .view-btn { gap: .55rem; }

/* ── Modal ────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(30,28,24,.55);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 780px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(.98);
  transition: transform var(--transition);
}
.modal-overlay.open .modal { transform: none; }

.modal-header {
  position: sticky; top: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  z-index: 1;
}
.modal-header h2 { font-size: 1.5rem; }
.modal-close {
  background: var(--surface-alt); border: none; border-radius: 50%;
  width: 36px; height: 36px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-mid); transition: background var(--transition);
}
.modal-close:hover { background: var(--border); }

.modal-image { aspect-ratio: 16/8; overflow: hidden; }
.modal-image img { width: 100%; height: 100%; object-fit: cover; }

.modal-body { padding: 1.5rem; }
.modal-section { margin-bottom: 1.75rem; }
.modal-section-title {
  font-size: .72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .12em; color: var(--text-light);
  margin-bottom: .875rem; padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.info-item {}
.info-label { font-size: .75rem; color: var(--text-light); font-weight: 500; text-transform: uppercase; letter-spacing: .07em; margin-bottom: .25rem; }
.info-value { font-size: .9375rem; color: var(--text-dark); white-space: pre-line; }
.info-value.monospace { font-family: 'Courier New', monospace; background: var(--surface-alt); padding: .35rem .65rem; border-radius: var(--radius-sm); font-size: .875rem; }
.info-value a { color: var(--teal); text-decoration: underline; }

/* ── Admin Layout ─────────────────────────────────────────────────────── */
.admin-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: auto 1fr;
}
.admin-topbar {
  grid-column: 1 / -1;
  background: var(--text-dark);
  padding: .875rem 1.5rem;
  display: flex; align-items: center; gap: 1rem;
  justify-content: space-between;
}
.admin-topbar .logo-text { color: #fff; }
.admin-topbar .logo-text span { color: var(--teal); }
.topbar-user { display: flex; align-items: center; gap: .75rem; color: rgba(255,255,255,.7); font-size: .875rem; }
.topbar-user a { color: var(--salmon); font-weight: 500; }

.admin-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0;
}
.sidebar-section { margin-bottom: 1.5rem; }
.sidebar-label {
  font-size: .7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .12em; color: var(--text-light);
  padding: 0 1.25rem; margin-bottom: .5rem;
}
.sidebar-link {
  display: flex; align-items: center; gap: .65rem;
  padding: .65rem 1.25rem;
  font-size: .875rem; color: var(--text-mid);
  transition: background var(--transition), color var(--transition);
  border-left: 3px solid transparent;
}
.sidebar-link:hover, .sidebar-link.active {
  background: rgba(107,191,191,.08);
  color: var(--teal);
  border-left-color: var(--teal);
}
.sidebar-link svg { width: 16px; height: 16px; flex-shrink: 0; }

.admin-main { padding: 2rem; overflow-y: auto; }
.admin-page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.75rem; flex-wrap: wrap; gap: 1rem;
}
.admin-page-header h1 { font-size: 1.75rem; }

/* ── Stats Cards ──────────────────────────────────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card {
  background: var(--surface); border-radius: var(--radius-md);
  border: 1px solid var(--border); padding: 1.25rem;
  display: flex; align-items: center; gap: 1rem;
}
.stat-icon {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon.teal   { background: rgba(107,191,191,.15); color: var(--teal); }
.stat-icon.sage   { background: rgba(168,200,168,.2);  color: #5A8C5A; }
.stat-icon.yellow { background: rgba(237,232,122,.25); color: #8A8820; }
.stat-icon.rose   { background: rgba(212,96,90,.12);   color: var(--rose); }
.stat-card-num { font-family: var(--font-display); font-size: 1.75rem; font-weight: 600; line-height: 1; }
.stat-card-label { font-size: .75rem; color: var(--text-light); text-transform: uppercase; letter-spacing: .08em; margin-top: .2rem; }

/* ── Data Table ───────────────────────────────────────────────────────── */
.table-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.table-toolbar {
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.table-search {
  flex: 1; max-width: 320px;
  position: relative;
}
.table-search input {
  width: 100%; padding: .5rem 1rem .5rem 2.5rem;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-alt); font-size: .875rem;
  transition: border-color var(--transition);
}
.table-search input:focus { outline: none; border-color: var(--teal); }
.table-search svg { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--text-light); }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; padding: .75rem 1rem;
  font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-light); background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: .875rem 1rem; border-bottom: 1px solid var(--border);
  font-size: .875rem; vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: rgba(107,191,191,.04); }
.td-thumb {
  width: 48px; height: 36px; border-radius: var(--radius-sm);
  object-fit: cover; background: var(--surface-alt);
}
.td-name { font-weight: 500; }
.td-loc { color: var(--text-mid); font-size: .8125rem; }
.actions { display: flex; gap: .5rem; }

/* ── Forms ────────────────────────────────────────────────────────────── */
.form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 2rem;
  box-shadow: var(--shadow-sm); max-width: 860px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.form-group { display: flex; flex-direction: column; gap: .45rem; }
.form-group.full { grid-column: 1 / -1; }
.form-label { font-size: .8125rem; font-weight: 500; color: var(--text-mid); }
.form-label .required { color: var(--rose); }
.form-control {
  padding: .625rem .875rem;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-dark);
  font-size: .9375rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(107,191,191,.15);
}
textarea.form-control { resize: vertical; min-height: 80px; }
.form-hint { font-size: .75rem; color: var(--text-light); }
.form-section-title {
  font-size: .72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .12em; color: var(--text-light);
  border-bottom: 1px solid var(--border); padding-bottom: .5rem;
  margin-bottom: .25rem; grid-column: 1 / -1;
}
.form-actions { display: flex; gap: 1rem; margin-top: 1.5rem; flex-wrap: wrap; }

/* ── Login Page ───────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(107,191,191,.08), rgba(168,200,168,.06), rgba(237,232,122,.06));
  padding: 1.5rem;
}
.login-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  width: 100%; max-width: 420px;
  text-align: center;
}
.login-logo { margin: 0 auto 1.5rem; }
.login-logo img { height: 60px; margin: 0 auto; }
.login-card h2 { margin-bottom: .35rem; }
.login-card .subtitle { color: var(--text-light); font-size: .875rem; margin-bottom: 2rem; }
.login-form { text-align: left; }
.alert {
  padding: .75rem 1rem; border-radius: var(--radius-sm);
  font-size: .875rem; margin-bottom: 1rem;
}
.alert-error { background: rgba(212,96,90,.1); color: var(--rose); border: 1px solid rgba(212,96,90,.2); }
.alert-success { background: rgba(107,191,191,.1); color: #2A7A7A; border: 1px solid rgba(107,191,191,.2); }
.alert-warning { background: rgba(237,232,122,.2); color: #6A6820; border: 1px solid rgba(237,232,122,.4); }

/* ── Breadcrumb ───────────────────────────────────────────────────────── */
.breadcrumb { display: flex; align-items: center; gap: .5rem; font-size: .8125rem; color: var(--text-light); margin-bottom: 1.5rem; }
.breadcrumb a:hover { color: var(--teal); }
.breadcrumb-sep { opacity: .4; }

/* ── Empty State ──────────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 4rem 2rem; color: var(--text-light);
}
.empty-state svg { margin: 0 auto .875rem; opacity: .3; }
.empty-state h3 { font-family: var(--font-body); color: var(--text-mid); margin-bottom: .35rem; }

/* ── Pagination ───────────────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; justify-content: center; gap: .5rem; margin-top: 2.5rem; }
.page-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border); background: var(--surface);
  font-size: .875rem; cursor: pointer; transition: all var(--transition);
  color: var(--text-mid);
}
.page-btn:hover, .page-btn.active { background: var(--teal); color: #fff; border-color: var(--teal); }
.page-btn.disabled { opacity: .35; pointer-events: none; }

/* ── Footer ───────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--text-dark); color: rgba(255,255,255,.55);
  text-align: center; padding: 1.5rem;
  font-size: .8125rem; margin-top: auto;
}
.site-footer a { color: var(--teal); }

/* ── Map link ─────────────────────────────────────────────────────────── */
.map-link {
  display: inline-flex; align-items: center; gap: .35rem;
  color: var(--teal); font-size: .8125rem; font-weight: 500;
}
.map-link:hover { text-decoration: underline; }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .admin-layout { grid-template-columns: 220px 1fr; }
}
@media (max-width: 768px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .admin-sidebar.open { display: block; position: fixed; inset: 0; z-index: 200; padding-top: 60px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-group.full { grid-column: 1; }
  .hero { padding: 2.5rem 1rem; }
  .filter-bar { top: 65px; }
  .properties-grid { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr 1fr; }
  .admin-main { padding: 1rem; }
  .data-table th, .data-table td { padding: .6rem .75rem; }
}
@media (max-width: 480px) {
  .info-grid { grid-template-columns: 1fr; }
  .login-card { padding: 1.75rem 1.25rem; }
  .nav-search { display: none; }
  .hero-stats { gap: 1.5rem; }
}

/* ── Loader ───────────────────────────────────────────────────────────── */
.loading { display: flex; align-items: center; justify-content: center; padding: 3rem; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--teal); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Fade in ──────────────────────────────────────────────────────────── */
.fade-in { animation: fadeIn .4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── No results ───────────────────────────────────────────────────────── */
#no-results { display: none; }
