:root {
  color-scheme: dark;
  --bg: #0a1128;
  --surface: #131315;
  --panel: #131c3b;
  --panel-2: #1b2447;
  --panel-3: #242f57;
  --text: #e5e2e4;
  --muted: #c6c6ce;
  --fuchsia: #c5007f;
  --fuchsia-2: #e60095;
  --primary: #bfc5e4;
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #fb7185;
  --line: #2d3866;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 78% 3%, rgba(197, 0, 127, 0.18), transparent 28%),
    radial-gradient(circle at 12% 16%, rgba(191, 197, 228, 0.12), transparent 24%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 520px) 1fr;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.login-card,
.card,
.metric,
.table-wrap,
.modal-panel {
  background: rgba(19, 28, 59, 0.78);
  border: 1px solid var(--panel-3);
  border-radius: var(--radius);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(18px);
}

.login-card {
  width: min(100%, 440px);
  padding: 32px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.logo-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--fuchsia);
  color: white;
  font-weight: 800;
}

.eyebrow {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.login-card h1,
.page-title h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.14;
  letter-spacing: 0;
}

.login-card p,
.page-title p,
.muted {
  color: var(--muted);
}

.field {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--panel-3);
  border-radius: 6px;
  background: rgba(10, 17, 40, 0.9);
  color: var(--text);
  padding: 11px 13px;
  outline: none;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--fuchsia);
  box-shadow: 0 0 0 3px rgba(197, 0, 127, 0.16);
}

.btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 10px 14px;
  color: white;
  background: var(--fuchsia);
  font-size: 13px;
  font-weight: 800;
  transition: 160ms ease;
}

.btn:hover {
  background: var(--fuchsia-2);
  transform: translateY(-1px);
}

.btn.secondary {
  background: rgba(191, 197, 228, 0.1);
  border-color: var(--panel-3);
  color: var(--text);
}

.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--primary);
}

.login-hero {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.login-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.42;
  filter: saturate(0.8) contrast(1.08);
}

.hero-copy {
  position: absolute;
  left: 56px;
  right: 56px;
  bottom: 56px;
  max-width: 640px;
}

.hero-copy h2 {
  margin: 10px 0 0;
  font-size: 48px;
  line-height: 1.06;
  letter-spacing: 0;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 14px;
  background: rgba(19, 19, 21, 0.95);
  border-right: 1px solid var(--panel-3);
}

.nav {
  display: grid;
  gap: 6px;
  overflow-y: auto;
}

.nav button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 12px 13px;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
}

.nav button.active {
  color: #ffe0ea;
  background: rgba(197, 0, 127, 0.12);
  border-color: rgba(197, 0, 127, 0.35);
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 14px 28px;
  background: rgba(10, 17, 40, 0.82);
  border-bottom: 1px solid var(--panel-3);
  backdrop-filter: blur(18px);
}

.content {
  padding: 28px;
}

.page-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.grid {
  display: grid;
  gap: 16px;
}

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

.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.35fr) 360px;
}

.metric {
  padding: 18px;
}

.metric small,
.card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 8px;
  color: white;
  font-size: 26px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.trend {
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.card {
  padding: 18px;
}

.card h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--panel-3);
  border-radius: 999px;
  padding: 6px 9px;
  background: rgba(191, 197, 228, 0.08);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.chip.ok {
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.12);
}

.chip.warn {
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.12);
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
}

.activity {
  display: grid;
  gap: 10px;
  max-height: 620px;
  overflow: auto;
}

.activity-item {
  border-left: 3px solid var(--fuchsia);
  border-radius: 6px;
  background: rgba(36, 47, 87, 0.5);
  padding: 12px;
}

.activity-item p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.activity-item span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.agent-card {
  min-height: 190px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  border-top: 3px solid rgba(197, 0, 127, 0.7);
}

.agent-card:hover {
  border-color: var(--fuchsia);
  box-shadow: 0 0 0 1px rgba(197, 0, 127, 0.25), 0 16px 42px rgba(0, 0, 0, 0.24);
}

.progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(191, 197, 228, 0.14);
}

.progress div {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--fuchsia), var(--primary));
  transition: width 400ms ease;
}

.table-wrap {
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(45, 56, 102, 0.78);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.property-card {
  overflow: hidden;
  padding: 0;
}

.property-card img {
  width: 100%;
  height: 150px;
  display: block;
  object-fit: cover;
}

.property-card .body {
  padding: 14px;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(7, minmax(210px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.kanban-col {
  min-height: 520px;
  border: 1px solid var(--panel-3);
  border-radius: 8px;
  background: rgba(19, 28, 59, 0.56);
  padding: 12px;
}

.kanban-col h3 {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.deal-card {
  margin-bottom: 10px;
  border: 1px solid var(--panel-3);
  border-radius: 8px;
  background: rgba(10, 17, 40, 0.76);
  padding: 12px;
}

.deal-card:active {
  cursor: grabbing;
}

.agenda-day {
  display: grid;
  gap: 10px;
}

.event {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--panel-3);
  border-radius: 8px;
  background: rgba(10, 17, 40, 0.48);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.hidden {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.58);
}

.modal-panel {
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 22px;
}

.error-text {
  color: var(--red);
  min-height: 20px;
  font-size: 13px;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

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

  .dashboard-grid,
  .cols-4,
  .cols-3,
  .cols-2 {
    grid-template-columns: 1fr;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-hero {
    display: none;
  }
}

@media (max-width: 620px) {
  .content,
  .topbar,
  .login-panel {
    padding: 18px;
  }

  .page-title {
    align-items: flex-start;
    flex-direction: column;
  }

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