:root {
  --bg: #f6f7f4;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef1ec;
  --border: #e4e7e1;
  --border-solid: #e0e4dd;
  --text: #1b2620;
  --text-muted: #5f6f66;
  --text-dim: #93a89a;
  --gold: #b0872b;
  --gold-hover: #986f1f;
  --gold-dim: #a98a3e;
  --green-badge-bg: #e7f5ec;
  --green-badge-text: #1f7a45;
  --sold-badge-bg: #fbe9e7;
  --sold-badge-text: #b3261e;
  --danger: #c0392b;
  --danger-hover: #a5301f;
  --shadow-md: 0 4px 14px rgba(20, 30, 24, 0.08);
  --shadow-lg: 0 20px 48px rgba(20, 30, 24, 0.18);
  --radius: 10px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

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

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

[hidden] { display: none !important; }

/* ---------- Top bar ---------- */
.topbar {
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border-solid);
  padding: 16px 0;
  margin-bottom: 28px;
}
.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.brand h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--gold);
}
.brand .sub {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}
.topbar-actions { display: flex; gap: 10px; align-items: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-gold { background: var(--gold); color: #201a08; }
.btn-gold:hover { background: var(--gold-hover); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-solid);
}
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-hover); }
.btn-sm { padding: 6px 12px; font-size: 13px; }

.icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 24px;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* ---------- Inputs ---------- */
.input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-solid);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder { color: var(--text-dim); }
.input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 75, 0.18);
}
select.input { appearance: none; background-image: none; }
textarea.input { resize: vertical; }
input[type="file"] { padding: 8px; font-size: 13px; color: var(--text-muted); }
input[type="file"]::file-selector-button {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border-solid);
  border-radius: 6px;
  padding: 6px 12px;
  margin-right: 10px;
  cursor: pointer;
  font-family: inherit;
}

/* ---------- Segmented toggle ---------- */
.segment {
  display: inline-flex;
  border: 1px solid var(--border-solid);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
}
.segment button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.segment button.active { background: var(--gold); color: #201a08; }

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  align-items: center;
  flex-wrap: wrap;
}
.toolbar .search { flex: 1; min-width: 220px; }

/* ---------- Public grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  padding-bottom: 60px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border-solid);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--gold-dim); }
.card-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--bg-elev);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-image .placeholder { color: var(--text-dim); font-size: 13px; text-align: center; }
.card-image .placeholder .ph-icon { font-size: 30px; display: block; margin-bottom: 6px; color: var(--gold-dim); }
.status-pill {
  position: absolute; top: 10px; right: 10px;
  padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.03em;
}
.status-available { background: var(--green-badge-bg); color: var(--green-badge-text); }
.status-sold { background: var(--sold-badge-bg); color: var(--sold-badge-text); }
.watch-pill {
  position: absolute; bottom: 10px; left: 10px;
  padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: rgba(0,0,0,0.62); color: #fff; letter-spacing: 0.02em;
}
.premium-pill {
  position: absolute; top: 10px; left: 10px;
  padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 800;
  letter-spacing: 0.03em;
  background: linear-gradient(135deg, #d8b45c, #a5721c); color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.card-type { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gold); font-weight: 700; }
.card-name { font-size: 16px; font-weight: 600; margin: 0; letter-spacing: -0.01em; color: var(--text); }
.card-price { font-size: 18px; font-weight: 700; color: var(--gold); margin: 2px 0; }
.card-meta { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text-muted); flex-wrap: wrap; }
.card-desc {
  font-size: 13px; color: var(--text-muted); margin: 4px 0 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-actions { padding: 12px 16px; border-top: 1px solid var(--border-solid); background: var(--bg-elev); }
.card-actions .btn { width: 100%; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 80px 20px; color: var(--text-muted); }
.empty-icon { font-size: 44px; color: var(--gold-dim); margin-bottom: 12px; }

/* ---------- Admin: stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border-solid);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.stat-value.gold { color: var(--gold); }

/* ---------- Admin: charts ---------- */
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 24px; }
.chart {
  background: var(--surface);
  border: 1px solid var(--border-solid);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.chart h3 { margin: 0 0 14px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.bar-row { display: grid; grid-template-columns: 120px 1fr 36px; gap: 10px; align-items: center; margin-bottom: 8px; }
.bar-label { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { background: var(--bg); border-radius: 6px; height: 10px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--gold-dim), var(--gold)); border-radius: 6px; }
.bar-count { font-size: 13px; color: var(--text-muted); text-align: right; }
.chart-empty { color: var(--text-dim); font-size: 13px; padding: 8px 0; }

/* ---------- Admin: table ---------- */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border-solid);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 60px;
}
.table-toolbar {
  display: flex; gap: 12px; align-items: center; padding: 14px 16px;
  border-bottom: 1px solid var(--border-solid); flex-wrap: wrap;
}
.table-toolbar .search { flex: 1; min-width: 200px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left; padding: 10px 14px; color: var(--text-muted);
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; font-size: 11px;
  border-bottom: 1px solid var(--border-solid); white-space: nowrap;
}
tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border-solid); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
.td-name { font-weight: 600; color: var(--text); }
.td-price { color: var(--gold); font-weight: 600; white-space: nowrap; }
.badge { padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.bid-open { background: var(--green-badge-bg); color: var(--green-badge-text); }
.bid-responded { background: #fff2d6; color: #8a5a00; }
.bid-closed { background: var(--surface-2); color: var(--text-muted); }
.badge-unread { background: var(--green-badge-bg); color: var(--green-badge-text); }
.badge-muted { background: var(--surface-2); color: var(--text-muted); }
.badge-premium { background: linear-gradient(135deg, #d8b45c, #a5721c); color: #fff; }
.row-unread td { background: rgba(201, 162, 75, 0.06); }
.row-unread .td-name { position: relative; }
.row-unread .td-name::before { content: ""; position: absolute; left: -2px; top: 50%; transform: translateY(-50%); width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.row-unread .td-name, .row-unread .td-message, .row-unread td { font-weight: 600; }
.td-contact { font-size: 12.5px; }
.td-contact a { color: var(--gold); text-decoration: none; }
.td-message { max-width: 340px; color: var(--text-muted); white-space: pre-wrap; word-break: break-word; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.table-empty { text-align: center; padding: 40px; color: var(--text-muted); }

.detail-watch {
  margin-top: 4px; padding: 8px 12px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border-solid);
  font-size: 13px; color: var(--text-muted); text-align: center;
}
.detail-cta { display: flex; gap: 10px; margin-top: 4px; }
.spec-row .v.gold { color: var(--gold); }

.bid-thread {
  max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px;
  margin: 8px 0 14px; padding: 10px; border: 1px solid var(--border-solid);
  border-radius: var(--radius); background: var(--surface-2);
}
.bid-thread-empty { color: var(--text-muted); font-size: 13px; text-align: center; padding: 10px; }
.bid-msg {
  background: var(--bg-elev); border: 1px solid var(--border-solid);
  border-radius: var(--radius); padding: 8px 12px;
}
.bid-msg-body { font-size: 14px; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.bid-msg-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(20, 30, 24, 0.35); animation: fadeIn 0.15s ease-out; }
.modal-panel {
  position: relative; background: var(--bg-elev); border: 1px solid var(--border-solid);
  border-radius: var(--radius-lg); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  box-shadow: var(--shadow-lg); animation: slideUp 0.2s ease-out;
}
.modal-panel-sm { max-width: 440px; }
.modal-panel-lg { max-width: 720px; }
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; padding: 22px 26px 6px; }
.modal-header h2 { margin: 0; font-size: 22px; font-weight: 700; color: var(--gold); }
.modal-header .sub { margin: 4px 0 0; font-size: 14px; color: var(--text-muted); }
.modal-body { padding: 18px 26px; display: flex; flex-direction: column; gap: 16px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px; padding: 16px 26px;
  border-top: 1px solid var(--border-solid); background: var(--surface);
  position: sticky; bottom: 0;
}

/* ---------- Form ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .field > label > span { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.field .hint { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-dim); font-size: 12px; margin-left: 4px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.form-error {
  padding: 10px 14px; background: #fdecea; border: 1px solid #f5c6c2; color: #b3261e;
  border-radius: var(--radius); font-size: 13px;
}
.form-section-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gold-dim); font-weight: 700; margin-top: 4px; }

/* photo previews */
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumb { position: relative; width: 72px; height: 72px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border-solid); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .rm {
  position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: rgba(0,0,0,0.7); color: #fff; border: none; cursor: pointer; font-size: 12px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.thumb .cover-btn {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.66); color: #fff; border: none; cursor: pointer;
  font-size: 10px; font-weight: 700; padding: 3px 0; line-height: 1;
}
.thumb.is-cover { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold) inset; }
.thumb.is-cover .cover-btn { background: linear-gradient(135deg, #d8b45c, #a5721c); }
.field.drag-over { outline: 2px dashed var(--gold); outline-offset: 4px; border-radius: 8px; }
.field-check { flex-direction: row; align-items: center; gap: 10px; cursor: pointer; }
.field-check input { width: 16px; height: 16px; accent-color: var(--gold); cursor: pointer; }
.field-check span { font-weight: 600; }

/* ---------- Detail modal ---------- */
.detail-hero {
  width: 100%; aspect-ratio: 16 / 10; background: var(--surface); border-radius: 12px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; position: relative;
}
.detail-hero img { width: 100%; height: 100%; object-fit: cover; }
.detail-thumbs { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.detail-thumbs img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; cursor: pointer; border: 1px solid var(--border-solid); }
.detail-thumbs img.active { border-color: var(--gold); }
.detail-type { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gold); font-weight: 700; }
.detail-name { font-size: 26px; font-weight: 700; margin: 2px 0; }
.detail-price { font-size: 24px; font-weight: 700; color: var(--gold); margin-bottom: 10px; }
.spec-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border-solid); font-size: 14px; }
.spec-row .k { color: var(--text-muted); }
.spec-row .v { color: var(--text); font-weight: 600; }
.doc-list { display: flex; flex-direction: column; gap: 8px; }
.doc-item {
  display: flex; align-items: center; justify-content: space-between; padding: 10px 14px;
  border: 1px dashed var(--border-solid); border-radius: var(--radius); font-size: 13px; color: var(--text-muted);
}
.doc-item.available { border-style: solid; }
.doc-item a { font-weight: 600; }

/* Image gallery navigation (detail hero) */
.gallery-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(0,0,0,0.5); color: #fff; border: none; cursor: pointer;
  font-size: 26px; line-height: 1; display: flex; align-items: center; justify-content: center;
  z-index: 2; transition: background 0.15s;
}
.gallery-nav:hover { background: rgba(0,0,0,0.75); }
.gallery-nav.prev { left: 10px; }
.gallery-nav.next { right: 10px; }
.gallery-count {
  position: absolute; bottom: 10px; right: 12px; z-index: 2;
  background: rgba(0,0,0,0.6); color: #fff; font-size: 12px; font-weight: 600;
  padding: 3px 8px; border-radius: 12px;
}

/* Document / floor-plan image galleries in the detail view */
.doc-images { margin-top: 12px; }
.doc-images-label {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); font-weight: 700; margin-bottom: 6px;
}
.doc-thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.doc-thumb { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.doc-thumbs img {
  width: 80px; height: 80px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--border-solid); cursor: pointer;
}
.doc-download {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; color: var(--gold, #a5721c);
  text-decoration: none;
}
.doc-download:hover { text-decoration: underline; }

/* ---------- Animations & responsive ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 860px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .charts { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .table-wrap { overflow-x: auto; }
  table { min-width: 720px; }
}

/* ---------- Success banner ---------- */
.form-success {
  padding: 10px 14px; background: #e7f5ec; border: 1px solid #bfe3cd; color: #1f7a45;
  border-radius: var(--radius); font-size: 13px;
}

/* ---------- Bulk import ---------- */
.bulk-help {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  padding: 12px 14px; margin-bottom: 16px;
  background: var(--surface-2); border: 1px solid var(--border-solid); border-radius: var(--radius);
  font-size: 13px; color: var(--text-muted);
}
.bulk-help code {
  flex: 1 1 240px; min-width: 0;
  font-size: 12px; color: var(--text); word-break: break-word;
}
.bulk-note {
  padding: 10px 14px; margin-bottom: 16px;
  background: var(--surface-2); border: 1px dashed var(--border-solid); border-radius: var(--radius);
  font-size: 12.5px; color: var(--text-muted); line-height: 1.6;
}
.bulk-note code { color: var(--text); }
.bulk-preview { margin: 14px 0; overflow-x: auto; }
.bulk-preview-title { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.bulk-preview table { width: 100%; border-collapse: collapse; font-size: 12px; }
.bulk-preview th, .bulk-preview td {
  padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--border-solid);
  white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis;
}
.bulk-preview th { color: var(--text-muted); font-weight: 600; }

/* ---------- Share buttons ---------- */
.share-row { display: flex; gap: 8px; flex-wrap: wrap; }
.share-btn {
  display: inline-flex; align-items: center; justify-content: center; padding: 10px; line-height: 0;
  border-radius: 10px; text-decoration: none;
  border: 1px solid var(--border-solid); color: var(--text); background: var(--surface);
  transition: background 0.15s, border-color 0.15s;
}
.share-btn:hover { background: var(--surface-2); border-color: var(--gold-dim); }
.share-btn.fb { color: #1877f2; }
.share-btn.wa { color: #1eb954; }
.share-btn.tw { color: #1da1f2; }
.share-btn.pdf { color: var(--danger); }

/* ---------- Dark theme (palette from screenshots) ---------- */
:root[data-theme="dark"] {
  --bg: #0e1a14;
  --bg-elev: #12241c;
  --surface: #16281f;
  --surface-2: #1b3127;
  --border: #294336;
  --border-solid: #2b4437;
  --text: #f1ede2;
  --text-muted: #93a89a;
  --text-dim: #6f857a;
  --gold: #c9a24b;
  --gold-hover: #d8b45c;
  --gold-dim: #8a7333;
  --green-badge-bg: #14361f;
  --green-badge-text: #6ee7a0;
  --sold-badge-bg: #3a1c1c;
  --sold-badge-text: #f0a1a1;
  --danger: #c0483f;
  --danger-hover: #a83a32;
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6);
}
[data-theme="dark"] .modal-backdrop { background: rgba(0, 0, 0, 0.65); }
[data-theme="dark"] .form-error { background: #3a1c1c; border-color: #5c2b2b; color: #f0a1a1; }
[data-theme="dark"] .form-success { background: #14361f; border-color: #25543a; color: #6ee7a0; }

/* ---------- App shell + sidebar ---------- */
:root { --sidebar-w: 256px; --sidebar-w-collapsed: 76px; }

.app-shell {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  width: var(--sidebar-w);
  height: 100vh;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-elev);
  border-right: 1px solid var(--border-solid);
  padding: 18px 14px;
  gap: 8px;
  transition: width 0.2s ease;
  z-index: 40;
}
.sidebar.collapsed { width: var(--sidebar-w-collapsed); }

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.logo-mark { flex-shrink: 0; display: block; border-radius: 12px; box-shadow: var(--shadow-md); }
.logo-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.logo-name { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; color: var(--gold); }
.logo-tag { font-size: 11px; color: var(--text-muted); letter-spacing: 0.04em; white-space: nowrap; }

.collapse-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border-solid);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, transform 0.2s;
}
.collapse-btn:hover { color: var(--gold); border-color: var(--gold-dim); }

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; min-height: 0; }
.nav-label-group {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-dim);
  padding: 14px 12px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.nav-item svg { flex-shrink: 0; }
.nav-item .nav-text { white-space: nowrap; overflow: hidden; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--surface-2); color: var(--gold); }
.nav-item-gold { color: var(--gold); }
.nav-item-gold:hover { background: var(--gold); color: #201a08; }

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: auto;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: inherit;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s;
}
.sidebar-profile:hover { border-color: var(--gold-dim); }
.avatar {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: #201a08;
  background: linear-gradient(135deg, #d8b45c, #a5721c);
}
.profile-meta { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; text-align: left; }
.profile-name { font-size: 14px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-role { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Collapsed state: hide text labels, center icons */
.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .nav-label-group,
.sidebar.collapsed .profile-meta { display: none; }
.sidebar.collapsed .sidebar-head { justify-content: center; }
.sidebar.collapsed .collapse-btn svg { transform: rotate(180deg); }
.sidebar.collapsed .logo { justify-content: center; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px; }
.sidebar.collapsed .sidebar-profile { justify-content: center; padding: 10px; }
.sidebar.collapsed .nav-label-group { padding: 8px 0 0; }

/* ---------- Main column ---------- */
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mainbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 24px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border-solid);
  position: sticky;
  top: 0;
  z-index: 20;
}
.mainbar-title h1 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -0.01em; color: var(--text); }
.mainbar-title .sub { font-size: 12px; color: var(--text-muted); letter-spacing: 0.03em; }
.content.container { padding-top: 28px; padding-bottom: 40px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-solid);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
}
.icon-btn:hover { color: var(--gold); border-color: var(--gold-dim); }
.mobile-only { display: none; }

.sidebar-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 39;
}
.sidebar-scrim.show { opacity: 1; pointer-events: auto; }

/* ---------- Settings modal ---------- */
.settings-group { margin-bottom: 20px; display: flex; flex-direction: column; gap: 12px; }
.settings-group:last-child { margin-bottom: 0; }
.settings-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.segment-full { display: flex; width: 100%; }
.segment-full button { flex: 1; padding: 10px 16px; }
.banner {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}
.banner-success { background: var(--green-badge-bg); color: var(--green-badge-text); border: 1px solid var(--gold-dim); }

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  .mobile-only { display: inline-flex; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow-lg);
    width: var(--sidebar-w);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar.collapsed { width: var(--sidebar-w); }
  .sidebar.collapsed .logo-text,
  .sidebar.collapsed .nav-text,
  .sidebar.collapsed .nav-label-group,
  .sidebar.collapsed .profile-meta { display: block; }
  .sidebar .collapse-btn { display: none; }
  .content.container { padding-left: 16px; padding-right: 16px; }
}

/* ---------- Primary button alias ---------- */
.btn-primary { background: var(--gold); color: #201a08; }
.btn-primary:hover { background: var(--gold-hover); }

/* ============ PUBLIC SITE (normal website chrome) ============ */
#public-site { display: flex; flex-direction: column; min-height: 100vh; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border-solid);
}
.site-header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 68px;
}
.site-header .logo { flex-shrink: 0; }
.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 12px;
  flex: 1;
}
.site-link {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 9px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.site-link:hover { color: var(--text); background: var(--surface-2); }
.site-link.active { color: var(--gold); }
.site-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.site-main { flex: 1; }
.site-page { padding-bottom: 56px; }

/* Hero */
.hero {
  background: linear-gradient(160deg, var(--surface-2), var(--bg-elev));
  border-bottom: 1px solid var(--border);
  padding: 64px 0;
  margin-bottom: 40px;
}
.hero-inner { max-width: 760px; }
.hero-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
  margin-bottom: 14px;
}
.hero h1 {
  margin: 0 0 16px;
  font-size: 40px;
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}
.hero p { margin: 0; font-size: 17px; color: var(--text-muted); max-width: 640px; }

/* Hero slider */
.hero-slider { position: relative; padding: 0 56px; }
.hero-viewport { overflow: hidden; }
.hero-track { display: flex; transition: transform 0.5s ease; }
.hero-slide {
  min-width: 100%; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center;
  min-height: 220px; padding: 8px 0;
}
.hero-slide .hero-inner {
  max-width: 680px; margin: 0 auto; text-align: center;
  display: flex; flex-direction: column; align-items: center;
}
.hero-slide .hero-inner p { margin-left: auto; margin-right: auto; }
.hero-stat { font-size: 56px; color: var(--gold); }
.hero-stat span { color: var(--gold); }

/* Portfolio stat slides */
.hero-portfolio { gap: 0; width: 100%; }
.portfolio-pair {
  display: flex; justify-content: center; align-items: stretch;
  gap: 24px; margin-top: 18px; width: 100%;
}
.portfolio-item {
  flex: 1; max-width: 320px;
  display: flex; flex-direction: column; align-items: center;
  padding: 22px 18px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--border-solid);
}
.portfolio-count {
  font-size: 64px; font-weight: 800; line-height: 0.95;
  color: var(--gold); letter-spacing: -0.03em;
}
.portfolio-unit {
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--text-muted); margin-top: 10px;
}
.portfolio-value {
  display: inline-flex; flex-direction: column; align-items: center; gap: 3px;
  margin-top: 16px; padding: 10px 22px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border-solid);
}
.portfolio-value-cap {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--text-muted);
}
.portfolio-value-amt {
  font-size: 30px; font-weight: 800; color: var(--text); letter-spacing: -0.01em;
}
.slider-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--border-solid); background: var(--bg-elev);
  color: var(--text); font-size: 24px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; z-index: 2;
  transition: border-color 0.15s, color 0.15s;
}
.slider-nav.prev { left: 0; }
.slider-nav.next { right: 0; }
.slider-nav:hover { border-color: var(--gold); color: var(--gold); }
.slider-dots { display: flex; justify-content: center; gap: 8px; margin-top: 24px; }
.slider-dots button {
  width: 9px; height: 9px; padding: 0; border: none; border-radius: 50%;
  background: var(--border-solid); cursor: pointer; transition: width 0.2s, background 0.2s;
}
.slider-dots button.active { width: 24px; border-radius: 5px; background: var(--gold); }
@media (max-width: 640px) {
  .hero-slider { padding: 0; }
  .slider-nav { display: none; }
  .hero-stat { font-size: 42px; }
  .portfolio-pair { flex-direction: column; gap: 14px; align-items: center; }
  .portfolio-item { width: 100%; max-width: 340px; padding: 16px; }
  .portfolio-count { font-size: 52px; }
  .portfolio-value-amt { font-size: 22px; }
  .portfolio-unit { font-size: 12px; }
}

/* Page head (Services / About) */
.page-head { max-width: 720px; margin: 48px 0 32px; }
.page-head h1 { margin: 10px 0 12px; font-size: 34px; font-weight: 800; letter-spacing: -0.02em; color: var(--text); }
.page-head p { margin: 0; font-size: 16px; color: var(--text-muted); }

/* Services grid */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.service-card:hover { border-color: var(--gold-dim); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.service-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  background: var(--surface-2);
  margin-bottom: 16px;
}
.service-card h3 { margin: 0 0 8px; font-size: 18px; font-weight: 700; color: var(--text); }
.service-card p { margin: 0; font-size: 14.5px; color: var(--text-muted); line-height: 1.55; }

/* About */
.about-wrap { display: grid; grid-template-columns: 1.7fr 1fr; gap: 32px; align-items: start; }
.about-body p { font-size: 16px; color: var(--text-muted); line-height: 1.7; margin: 0 0 18px; }
.about-stats { display: flex; gap: 32px; margin-top: 28px; flex-wrap: wrap; }
.about-stat { display: flex; flex-direction: column; }
.about-num { font-size: 26px; font-weight: 800; color: var(--gold); letter-spacing: -0.01em; }
.about-cap { font-size: 13px; color: var(--text-muted); }
.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  position: sticky;
  top: 92px;
}
.about-card h3 { margin: 0 0 10px; font-size: 18px; font-weight: 700; color: var(--text); }
.about-card p { margin: 0 0 18px; font-size: 14.5px; color: var(--text-muted); line-height: 1.55; }

/* Contact */
.contact-wrap { display: grid; grid-template-columns: 1.6fr 1fr; gap: 32px; align-items: start; }
.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.contact-actions { display: flex; justify-content: flex-end; margin-top: 4px; }
.contact-info {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.contact-info h3 { margin: 0 0 18px; font-size: 18px; font-weight: 700; color: var(--text); }
.contact-list { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.contact-list li { display: flex; align-items: center; gap: 12px; font-size: 14.5px; color: var(--text); }
.contact-list li svg { flex-shrink: 0; color: var(--gold); }
.contact-note { margin: 0; font-size: 13.5px; color: var(--text-muted); line-height: 1.55; }
.link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--gold);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

@media (max-width: 760px) {
  .contact-wrap { grid-template-columns: 1fr; }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-solid);
  background: var(--bg-elev);
  padding: 22px 0;
}
.site-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 13.5px;
  color: var(--text-muted);
}
.site-footer-nav { display: flex; gap: 4px; }
.site-footer-nav .site-link { font-size: 13.5px; padding: 6px 10px; }

@media (max-width: 900px) {
  .site-header-inner { gap: 12px; }
  .site-nav {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin: 0;
    padding: 8px 12px;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border-solid);
    box-shadow: var(--shadow-md);
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-link { text-align: left; }
  .hero { padding: 44px 0; }
  .hero h1 { font-size: 30px; }
  .about-wrap { grid-template-columns: 1fr; }
  .about-card { position: static; }
}
