:root {
  --re-navy: #102a34;
  --re-navy-deep: #0a1d25;
  --re-copper: #b17b4f;
  --re-copper-soft: #efe4d7;
  --re-green: #3f6b5e;
  --re-green-soft: #dfeae5;
  --re-ivory: #f5f4ef;
  --re-paper: #fffefa;
  --re-ink: #17252c;
  --re-muted: #66757b;
  --re-line: #dfe3df;
  --re-shadow: 0 16px 38px rgba(27, 47, 54, .09);
  --fx-primary: var(--re-green);
  --fx-primary2: var(--re-copper);
  --fx-radius: 6px;
  --fx-radius-lg: 8px;
  --fx-radius-xl: 8px;
}

html[data-theme="light"] {
  --fx-bg: var(--re-ivory);
  --fx-bg-grad: var(--re-ivory);
  --fx-surface: var(--re-paper);
  --fx-surface2: #f0f1ed;
  --fx-surface3: rgba(255, 254, 250, .96);
  --fx-input: #fff;
  --fx-text: var(--re-ink);
  --fx-muted: var(--re-muted);
  --fx-muted2: #7a898d;
  --fx-border: var(--re-line);
  --fx-border2: #d2d8d4;
  --fx-info-soft: #e5eeeb;
  --fx-success-soft: #e1eee7;
  --fx-warning-soft: #f3eadf;
  --fx-danger-soft: #f6e5e1;
  --fx-table-head: #eef0ec;
  --fx-table-row: #fffefa;
  --fx-table-hover: #edf3f0;
  --fx-shadow: var(--re-shadow);
  --fx-shadow2: 0 8px 24px rgba(27, 47, 54, .07);
  color-scheme: light;
}

html[data-theme="dark"] {
  --re-ivory: #0b181e;
  --re-paper: #10232b;
  --re-ink: #edf2ef;
  --re-muted: #a3b1b3;
  --re-line: #294048;
  --re-copper-soft: #3a2d24;
  --re-green-soft: #203d35;
  --fx-bg: #0b181e;
  --fx-bg-grad: #0b181e;
  --fx-surface: #10232b;
  --fx-surface2: #152b34;
  --fx-surface3: rgba(12, 29, 36, .97);
  --fx-input: #0d1f26;
  --fx-text: #edf2ef;
  --fx-muted: #a3b1b3;
  --fx-muted2: #879a9e;
  --fx-border: #294048;
  --fx-border2: #36505a;
  --fx-info-soft: #17363a;
  --fx-success-soft: #173b31;
  --fx-warning-soft: #3b3023;
  --fx-danger-soft: #3d2727;
  --fx-table-head: #162d35;
  --fx-table-row: #10232b;
  --fx-table-hover: #19353d;
  --fx-shadow: 0 18px 48px rgba(0, 0, 0, .24);
  --fx-shadow2: 0 10px 28px rgba(0, 0, 0, .18);
  color-scheme: dark;
}

body.fx-realestate-app {
  background: var(--fx-bg);
  color: var(--fx-text);
  letter-spacing: 0;
}

.fx-svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.re-app-shell {
  min-height: 100vh;
}

.re-sidebar {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  z-index: 55;
  width: 272px;
  display: flex;
  flex-direction: column;
  padding: 22px 16px 16px;
  background: var(--re-navy-deep);
  color: #edf4f1;
  border-inline-end: 1px solid rgba(255,255,255,.07);
  overflow-y: auto;
}

.re-main-shell {
  min-height: 100vh;
  margin-inline-start: 272px;
  display: flex;
  flex-direction: column;
}

.re-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 4px 18px;
  color: #fff;
}

.re-brand:hover { color: #fff; }
.re-brand > span:last-child { min-width: 0; display: grid; gap: 2px; }
.re-brand strong { font-size: 18px; line-height: 1.2; }
.re-brand small { font-size: 11px; color: #afc1c3; }
.re-brand strong,
.re-brand small,
.fx-page-loader-title,
.fx-page-loader-subtitle {
  direction: ltr;
  text-align: left;
  letter-spacing: 0;
}

.re-brand-mark {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(211, 169, 127, .58);
  background: #183640;
  color: #d3a97f;
  border-radius: 6px;
}
.re-brand-mark .fx-svg { width: 24px; height: 24px; }
.re-brand-mark-loader { margin-inline: auto; }

.re-account-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px;
  margin-bottom: 18px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.045);
  border-radius: 6px;
}
.re-account-chip > span:last-child { min-width: 0; display: grid; gap: 2px; }
.re-account-chip small { color: #9eb1b5; font-size: 10px; }
.re-account-chip strong { font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.re-account-dot, .re-system-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #67a58d;
  box-shadow: 0 0 0 4px rgba(103,165,141,.13);
}

.re-sidebar-nav {
  display: grid;
  gap: 18px;
}
.re-nav-section { display: grid; gap: 4px; }
.re-nav-title {
  padding: 0 10px 7px;
  color: #81989c;
  font-size: 10px;
  font-weight: 800;
}
.re-nav-link {
  min-height: 52px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-inline-start: 3px solid transparent;
  border-radius: 4px;
  color: #c6d3d3;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.re-nav-link:hover {
  background: rgba(255,255,255,.055);
  color: #fff;
}
.re-nav-link.active {
  background: rgba(90, 137, 119, .2);
  border-inline-start-color: #c99b70;
  color: #fff;
}
.re-nav-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94aaa9;
}
.re-nav-link.active .re-nav-icon { color: #d6aa82; }
.re-nav-icon .fx-svg { width: 19px; height: 19px; }
.re-nav-copy { min-width: 0; display: grid; gap: 1px; }
.re-nav-copy strong { font-size: 12px; }
.re-nav-copy small { color: #83999c; font-size: 9px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.re-nav-link.active small { color: #a9bebc; }

.re-sidebar-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 10px 3px;
  color: #c6d3d3;
}
.re-sidebar-foot > span:last-child { display: grid; gap: 2px; }
.re-sidebar-foot strong { font-size: 11px; }
.re-sidebar-foot small { color: #81989c; font-size: 9px; }

.fx-topbar.re-topbar {
  position: sticky;
  top: 0;
  min-height: 74px;
  padding: 12px 28px;
  background: var(--fx-surface3);
  border-bottom: 1px solid var(--fx-border);
  backdrop-filter: blur(16px);
}
.re-topbar .fx-topbar-left { gap: 14px; }
.re-page-context { display: grid; gap: 2px; }
.re-page-context span { color: var(--fx-muted); font-size: 10px; }
.re-page-context strong { font-size: 15px; }

.fx-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  border-color: var(--fx-border);
  background: transparent;
}
.fx-icon-btn:hover {
  background: var(--fx-surface2);
  border-color: var(--fx-border2);
  box-shadow: none;
}
#fxNavToggle { display: none; }

.fx-user {
  max-width: 260px;
  padding: 5px 7px;
  border-radius: 6px;
  background: transparent;
  border-color: var(--fx-border);
}
.fx-user:hover { background: var(--fx-surface2); border-color: var(--fx-border2); box-shadow: none; }
.fx-avatar { width: 32px; height: 32px; }
.re-user-copy { min-width: 0; display: grid; gap: 1px; }
.re-user-copy strong { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.re-user-copy small { font-size: 9px; color: var(--fx-muted); }
.fx-dropdown { border-radius: 7px; }
.re-user-summary { display: grid; gap: 3px; padding: 10px 11px 12px; border-bottom: 1px solid var(--fx-border); }
.re-user-summary strong { font-size: 13px; }
.re-user-summary span, .re-user-summary small { color: var(--fx-muted); font-size: 10px; }
.fx-dropdown a, .fx-dropdown button { border-radius: 5px; }
.fx-dropdown .fx-svg { width: 17px; height: 17px; }

.wrapper.re-content {
  width: 100%;
  max-width: 1460px;
  min-height: calc(100vh - 130px);
  padding: 26px 30px 42px;
}

.re-footer {
  width: 100%;
  max-width: 1460px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 30px 24px;
  text-align: start;
}
.re-footer > span:last-child { display: flex; gap: 14px; }

.fx-page-loader {
  background: var(--fx-bg);
}
.fx-page-loader-inner { gap: 10px; }
.fx-page-loader-orbit { display: none; }
.fx-page-loader-title { color: var(--fx-text); }
.fx-page-loader-subtitle { color: var(--fx-muted); }
.fx-page-loader-bar { border-radius: 2px; background: var(--fx-border); }
.fx-page-loader-bar span { background: var(--re-copper); }

.fx-drawer { padding: 0; background: rgba(5, 18, 23, .7); }
.fx-drawer-panel {
  width: min(340px, 88vw);
  height: 100%;
  margin: 0;
  margin-inline-start: 0;
  border-radius: 0;
  border: 0;
  background: var(--re-navy-deep);
  color: #edf4f1;
}
.fx-drawer-header { border-color: rgba(255,255,255,.1); }
.re-brand-mobile { padding: 0; }
.fx-drawer-search { border-color: rgba(255,255,255,.1); }
.fx-drawer-search input { border-radius: 5px; background: rgba(255,255,255,.07); color: #fff; border-color: rgba(255,255,255,.12); }
.fx-drawer-body { gap: 3px; }
.fx-drawer-link {
  min-height: 46px;
  border-radius: 4px;
  background: transparent;
  color: #c6d3d3;
}
.fx-drawer-link > span { display: flex; align-items: center; gap: 10px; }
.fx-drawer-link .fx-svg { width: 18px; height: 18px; }
.fx-drawer-link.active { background: rgba(90,137,119,.22); border-color: transparent; color: #fff; }

.fx-cmd-panel { border-radius: 8px; }
.fx-cmd-item { border-radius: 5px; }
.fx-badge { border-radius: 4px; }
.fx-bottom-nav { background: var(--fx-surface3); }
.fx-bottom-nav-inner { max-width: none; }
.fx-bottom-nav a, .fx-bottom-nav button { border-radius: 5px; }
.fx-bottom-nav .fx-svg { width: 19px; height: 19px; }

.panel, .card {
  border-radius: 8px;
  box-shadow: var(--fx-shadow2);
}
.btn {
  border-radius: 6px;
  letter-spacing: 0;
}
.btn-primary {
  background: var(--re-green);
  border-color: var(--re-green);
}
.btn-primary:hover { background: #345b50; }

.re-page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.re-page-heading-copy { min-width: 0; }
.re-page-kicker { display: block; margin-bottom: 5px; color: var(--re-copper); font-size: 11px; font-weight: 850; }
.re-page-title { margin: 0; font-size: 27px; line-height: 1.25; }
.re-page-subtitle { max-width: 680px; margin: 7px 0 0; color: var(--fx-muted); font-size: 13px; line-height: 1.8; }
.re-heading-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.re-action-btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid var(--re-green);
  border-radius: 6px;
  background: var(--re-green);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
.re-action-btn .fx-svg { width: 17px; height: 17px; }
.re-action-btn.secondary { background: var(--fx-surface); color: var(--fx-text); border-color: var(--fx-border2); }
.re-action-btn[disabled], .re-action-btn.disabled { opacity: .55; cursor: not-allowed; }

.re-toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px;
  margin-bottom: 18px;
  border-block: 1px solid var(--fx-border);
  background: var(--fx-surface);
}
.re-toolbar-field {
  min-height: 38px;
  min-width: 150px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--fx-border2);
  border-radius: 5px;
  color: var(--fx-muted);
  background: var(--fx-input);
  font-size: 11px;
}
.re-toolbar-field.grow { flex: 1; }
.re-toolbar-field .fx-svg { width: 16px; height: 16px; }

.re-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 22px;
  border: 1px solid var(--fx-border);
  background: var(--fx-border);
}
.re-summary-item {
  min-height: 90px;
  padding: 15px;
  background: var(--fx-surface);
}
.re-summary-item small { display: block; color: var(--fx-muted); font-size: 10px; }
.re-summary-item strong { display: block; margin-top: 7px; font-size: 24px; }
.re-summary-item span { display: block; margin-top: 4px; color: var(--fx-muted); font-size: 10px; }

.re-workspace {
  border-top: 3px solid var(--re-navy);
  background: var(--fx-surface);
  box-shadow: var(--fx-shadow2);
}
.re-workspace-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 17px;
  border-bottom: 1px solid var(--fx-border);
}
.re-workspace-head strong { font-size: 14px; }
.re-workspace-head span { color: var(--fx-muted); font-size: 10px; }

.re-empty-state {
  min-height: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 42px 20px;
  text-align: center;
}
.re-empty-visual {
  width: 76px;
  height: 76px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  border: 1px solid var(--fx-border);
  border-radius: 8px;
  background: var(--re-green-soft);
  color: var(--re-green);
}
.re-empty-visual .fx-svg { width: 36px; height: 36px; }
.re-empty-state h2 { margin: 0; font-size: 18px; }
.re-empty-state p { max-width: 520px; margin: 8px 0 18px; color: var(--fx-muted); font-size: 12px; line-height: 1.8; }

.re-table { width: 100%; border-collapse: collapse; }
.re-table th, .re-table td { padding: 12px 15px; border-bottom: 1px solid var(--fx-border); text-align: start; font-size: 11px; }
.re-table th { color: var(--fx-muted); background: var(--fx-table-head); font-weight: 800; }

.re-pipeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  border-bottom: 1px solid var(--fx-border);
}
.re-pipeline-stage { padding: 14px; border-inline-end: 1px solid var(--fx-border); }
.re-pipeline-stage:last-child { border-inline-end: 0; }
.re-pipeline-stage small { color: var(--fx-muted); font-size: 10px; }
.re-pipeline-stage strong { display: block; margin-top: 5px; font-size: 18px; }
.re-pipeline-stage.new { border-top: 3px solid #6b8da0; }
.re-pipeline-stage.contact { border-top: 3px solid var(--re-copper); }
.re-pipeline-stage.viewing { border-top: 3px solid var(--re-green); }
.re-pipeline-stage.paused { border-top: 3px solid #8b8d89; }

.re-schedule {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  min-height: 360px;
}
.re-schedule-days { border-inline-end: 1px solid var(--fx-border); background: var(--fx-table-head); }
.re-schedule-day { padding: 14px; border-bottom: 1px solid var(--fx-border); }
.re-schedule-day.active { background: var(--re-green-soft); color: var(--re-green); }
.re-schedule-day strong, .re-schedule-day small { display: block; }
.re-schedule-day small { margin-top: 3px; color: var(--fx-muted); font-size: 9px; }

.re-team-grid, .re-source-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 12px;
  padding: 18px;
}
.re-person, .re-source {
  min-height: 170px;
  padding: 18px;
  border: 1px solid var(--fx-border);
  border-radius: 7px;
  background: var(--fx-surface);
}
.re-person-placeholder, .re-source-icon {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--re-copper-soft);
  color: var(--re-copper);
}
.re-person h3, .re-source h3 { margin: 14px 0 5px; font-size: 14px; }
.re-person p, .re-source p { margin: 0; color: var(--fx-muted); font-size: 11px; line-height: 1.7; }

.re-sync-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 1px;
  background: var(--fx-border);
}
.re-sync-step { min-height: 170px; padding: 22px; background: var(--fx-surface); }
.re-sync-step b {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--re-copper-soft);
  color: var(--re-copper);
  font-size: 11px;
}
.re-sync-step h3 { margin: 14px 0 6px; font-size: 14px; }
.re-sync-step p { margin: 0; color: var(--fx-muted); font-size: 11px; line-height: 1.8; }

@media (max-width: 1120px) {
  .re-sidebar { width: 238px; }
  .re-main-shell { margin-inline-start: 238px; }
  .re-summary-strip { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .re-team-grid, .re-source-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 900px) {
  .re-sidebar { display: none; }
  .re-main-shell { margin-inline-start: 0; }
  #fxNavToggle { display: inline-flex; }
  .re-page-context span { display: none; }
  .wrapper.re-content { padding: 20px 15px 100px; }
  .fx-topbar.re-topbar { min-height: 64px; padding: 10px 14px; }
  .re-user-copy, .fx-user-caret { display: none; }
  .re-page-heading { align-items: flex-start; flex-direction: column; }
  .re-heading-actions { width: 100%; }
  .re-action-btn { flex: 1; }
  .re-toolbar { overflow-x: auto; }
  .re-toolbar-field { flex: 0 0 160px; }
  .re-toolbar-field.grow { flex-basis: 230px; }
  .re-pipeline { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .re-schedule { grid-template-columns: 1fr; }
  .re-schedule-days { display: grid; grid-template-columns: repeat(3, 1fr); border-inline-end: 0; border-bottom: 1px solid var(--fx-border); }
  .re-sync-steps { grid-template-columns: 1fr; }
  .re-footer { padding-inline: 15px; padding-bottom: 90px; }
}

@media (max-width: 600px) {
  .re-page-title { font-size: 23px; }
  .re-summary-strip { grid-template-columns: 1fr 1fr; }
  .re-summary-item { min-height: 82px; padding: 13px; }
  .re-summary-item strong { font-size: 21px; }
  .re-team-grid, .re-source-grid { grid-template-columns: 1fr; padding: 12px; }
  .re-pipeline { grid-template-columns: 1fr 1fr; }
  .re-pipeline-stage { padding: 11px; }
  .re-schedule-days { grid-template-columns: 1fr 1fr; }
  .re-empty-state { min-height: 300px; }
  .re-footer { flex-direction: column; }
}
