@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700&family=DM+Sans:wght@400;500;700&display=swap');

:root {
  --bg: #f4f8ff;
  --bg-soft: #edf4ff;
  --text: #101935;
  --muted: #5f6f93;
  --card: rgba(255, 255, 255, 0.84);
  --surface: rgba(255, 255, 255, 0.95);
  --line: #d6e2fb;
  --primary: #0d63f3;
  --primary-soft: #dce9ff;
  --secondary: #0ea5a0;
  --accent: #ff8b4a;
  --ok: #0ca678;
  --shadow: 0 18px 48px rgba(20, 48, 106, 0.14);
}

body.dark {
  --bg: #071224;
  --bg-soft: #0b1b33;
  --text: #e9f0ff;
  --muted: #9eb0d3;
  --card: rgba(13, 25, 48, 0.82);
  --surface: rgba(14, 29, 56, 0.96);
  --line: #243a63;
  --primary: #6aa6ff;
  --primary-soft: #1b355f;
  --secondary: #3fd0cc;
  --accent: #ff9d65;
  --ok: #43d4a1;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 8% -5%, #dbeaff 0%, var(--bg) 32%, var(--bg-soft) 100%);
  position: relative;
  overflow-x: hidden;
}

body.dark {
  background: radial-gradient(circle at 14% -8%, #11294d 0%, var(--bg) 36%, var(--bg-soft) 100%);
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(50px);
  pointer-events: none;
  z-index: 0;
}

.orb-a {
  width: 300px;
  height: 300px;
  top: -100px;
  right: -80px;
  background: color-mix(in srgb, var(--primary) 28%, transparent);
}

.orb-b {
  width: 280px;
  height: 280px;
  bottom: 8%;
  left: -110px;
  background: color-mix(in srgb, var(--accent) 24%, transparent);
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(to right, rgba(120, 144, 192, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(120, 144, 192, 0.08) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(circle at 50% 40%, black 40%, transparent 85%);
  pointer-events: none;
  z-index: 0;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1,
h2,
h3,
h4,
.menu-tab,
button {
  font-family: 'Sora', sans-serif;
}

.hidden {
  display: none !important;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: calc(100vw - 2rem);
  max-width: 1800px;
  margin: 1rem auto 2rem;
  display: grid;
  gap: 1rem;
}

#appView {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  grid-auto-rows: min-content;
  gap: 1rem;
  align-items: start;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 1.1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  animation: card-in 380ms ease both;
}

.eyebrow {
  color: var(--secondary);
  text-transform: uppercase;
  font-size: 0.74rem;
  letter-spacing: 1.5px;
  margin-bottom: 0.45rem;
  font-weight: 700;
}

.auth-view {
  max-width: 620px;
  margin: 2.6rem auto 0;
  padding: 1.35rem;
}

.auth-brand h1 {
  font-size: clamp(1.6rem, 3.6vw, 2.35rem);
  margin-bottom: 0.4rem;
  line-height: 1.15;
}

.auth-brand p {
  color: var(--muted);
  max-width: 48ch;
}

.auth-form {
  margin-top: 1rem;
  display: grid;
  gap: 0.7rem;
}

.auth-help {
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: 0.92rem;
  border-left: 3px solid var(--line);
  padding-left: 0.6rem;
}

.top-header {
  grid-column: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  background: linear-gradient(130deg, color-mix(in srgb, var(--primary) 14%, transparent) 0%, color-mix(in srgb, var(--secondary) 11%, transparent) 100%);
}

.top-header h2 {
  font-size: clamp(1.2rem, 2.7vw, 1.7rem);
  max-width: 34ch;
  line-height: 1.2;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
}

.user-badge {
  border-radius: 999px;
  padding: 0.5rem 0.78rem;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
}

.role-menu {
  grid-column: 1;
  grid-row: 1 / span 6;
  position: sticky;
  top: 1rem;
  display: grid;
  gap: 0.5rem;
  padding: 0.6rem;
}

.menu-tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 12px;
  padding: 0.72rem 0.95rem;
  width: 100%;
  text-align: left;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.menu-tab:hover {
  transform: translateY(-1px);
  background: var(--primary-soft);
  color: var(--primary);
}

.menu-tab.is-active {
  color: #fff;
  background: linear-gradient(100deg, var(--primary) 0%, color-mix(in srgb, var(--primary) 70%, var(--secondary) 30%) 100%);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--primary) 40%, transparent);
}

.role-panel {
  grid-column: 2;
  display: grid;
  gap: 1rem;
}

.wizard-form {
  display: grid;
  gap: 0.9rem;
}

.wizard-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.wizard-steps .step {
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  font-size: 0.82rem;
  font-weight: 600;
}

.wizard-steps .step.is-active {
  color: #fff;
  background: linear-gradient(100deg, var(--primary) 0%, color-mix(in srgb, var(--primary) 70%, var(--secondary) 30%) 100%);
}

.wizard-pane {
  display: block;
}

.wizard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.card h3 {
  font-size: 1.07rem;
  margin-bottom: 0.25rem;
}

.card-sub {
  color: var(--muted);
  margin-bottom: 0.9rem;
  font-size: 0.93rem;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.76rem;
}

.features-block {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.45rem;
  border: 1px dashed var(--line);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  border-radius: 14px;
  padding: 0.78rem;
}

.features-block label {
  display: flex;
  gap: 0.42rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.compare-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.8rem;
}

input,
select,
textarea,
button {
  font: inherit;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 0.64rem 0.72rem;
}

textarea {
  min-height: 96px;
}

input::placeholder,
textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 74%, #96a7ca 26%);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--primary) 25%, transparent);
  border-color: var(--primary);
}

button {
  font-weight: 600;
  border: none;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(100deg, var(--primary) 0%, color-mix(in srgb, var(--primary) 72%, var(--secondary) 28%) 100%);
  box-shadow: 0 12px 22px color-mix(in srgb, var(--primary) 35%, transparent);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

button:hover {
  transform: translateY(-1px);
  filter: saturate(1.08);
  box-shadow: 0 15px 26px color-mix(in srgb, var(--primary) 40%, transparent);
}

button:active {
  transform: translateY(0);
}

.btn-secondary {
  color: var(--text);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: none;
}

.notice {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 0.85rem;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  color: var(--muted);
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}

.profit-box {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  padding: 0.65rem;
  display: grid;
  gap: 0.25rem;
}

.profit-box p {
  color: var(--muted);
  font-size: 0.88rem;
}

.simple-list {
  margin: 0;
  padding-left: 1rem;
  color: var(--muted);
  display: grid;
  gap: 0.35rem;
}

.offers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.86rem;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  margin-top: 0.35rem;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.74rem;
  font-weight: 700;
  border: 1px solid var(--line);
}

.status-tag.submitted {
  color: var(--secondary);
  background: color-mix(in srgb, var(--secondary) 16%, transparent);
}

.status-tag.approved {
  color: var(--ok);
  background: color-mix(in srgb, var(--ok) 16%, transparent);
}

.status-tag.rejected {
  color: #c44536;
  background: color-mix(in srgb, #c44536 16%, transparent);
}

.approve-offer-btn {
  margin-top: 0.65rem;
}

.offer-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.88rem;
  background: var(--surface);
  position: relative;
  overflow: hidden;
}

.offer-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--secondary) 100%);
}

.offer-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.offer-head h3 {
  font-size: 1rem;
}

.offer-head p {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.score-pill {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.88rem;
  white-space: nowrap;
  background: var(--primary-soft);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
}

.metrics-grid {
  display: grid;
  gap: 0.48rem;
  margin: 0.72rem 0;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--muted);
}

.metric-row strong {
  color: var(--text);
}

.metric-track {
  height: 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary-soft) 80%, transparent);
  overflow: hidden;
}

.metric-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--secondary) 0%, var(--primary) 100%);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  margin-bottom: 0.38rem;
  font-size: 0.76rem;
  font-weight: 700;
  background: color-mix(in srgb, var(--ok) 20%, transparent);
  color: var(--ok);
}

.rating-line,
.marketing-note {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.services-list {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.service-tag {
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 0.14rem 0.5rem;
  font-size: 0.76rem;
}

.service-tag.on {
  color: var(--secondary);
  background: color-mix(in srgb, var(--secondary) 16%, transparent);
}

.service-tag.off {
  color: var(--muted);
}

.agent-requests-grid,
.admin-users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.86rem;
}

.property-card,
.admin-user-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.82rem;
  background: var(--surface);
  display: grid;
  gap: 0.64rem;
}

.property-card.compact .property-cover {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  min-height: 140px;
  display: grid;
  place-items: center;
}

.property-card.compact .property-cover img {
  width: 100%;
  height: 170px;
  object-fit: cover;
}

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

.property-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.property-header h3 {
  font-size: 0.95rem;
  line-height: 1.3;
}

.property-type {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--primary-soft);
  color: var(--primary);
  padding: 0.1rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.property-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.3rem 0.55rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.property-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
}

.property-gallery img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.no-photo {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 10px;
  text-align: center;
  color: var(--muted);
  padding: 0.55rem;
  font-size: 0.86rem;
}

.property-notes {
  color: var(--muted);
  font-size: 0.88rem;
}

.admin-user-card h4 {
  font-size: 0.96rem;
}

.admin-user-card p {
  color: var(--muted);
  font-size: 0.88rem;
}

.admin-role-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 1240px) {
  .app-shell {
    width: calc(100vw - 1.25rem);
  }
}

@media (max-width: 1024px) {
  #appView {
    grid-template-columns: 1fr;
  }

  .top-header,
  .role-panel,
  .role-menu {
    grid-column: 1;
  }

  .role-menu {
    grid-row: auto;
    position: static;
    display: flex;
    flex-wrap: wrap;
  }

  .menu-tab {
    width: auto;
    min-width: 0;
    text-align: center;
    flex: 1;
  }

  .top-header {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: calc(100vw - 1rem);
    margin-top: 0.6rem;
  }

  .card {
    border-radius: 16px;
    padding: 0.85rem;
  }

  .grid-form {
    grid-template-columns: 1fr;
  }

  .top-actions {
    width: 100%;
  }

  .btn-secondary {
    flex: 1;
  }

  .admin-role-row {
    flex-direction: column;
    align-items: stretch;
  }

  .wizard-actions button {
    flex: 1;
  }

  .property-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 460px) {
  .menu-tab {
    flex-basis: 100%;
  }

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