:root {
  --bg: #eef2f7;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-strong: #ffffff;
  --text: #162033;
  --muted: #708095;
  --line: rgba(22, 32, 51, 0.1);
  --blue: #2563eb;
  --green: #12a66a;
  --gold: #b98510;
  --red: #d94a38;
  --shadow: 0 24px 70px rgba(39, 54, 83, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Manrope", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 8% 10%, rgba(37, 99, 235, 0.18), transparent 28rem),
    radial-gradient(circle at 86% 4%, rgba(18, 166, 106, 0.16), transparent 26rem),
    linear-gradient(145deg, #f7f1e8 0%, #eef2f7 44%, #e6edf6 100%);
}

button {
  font: inherit;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 18px;
}

.login-screen[hidden] {
  display: none;
}

.login-card {
  display: grid;
  gap: 16px;
  width: min(100%, 420px);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.login-brand {
  margin-bottom: 8px;
}

.login-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.login-field input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.86);
  font: inherit;
  outline: none;
}

.login-field input:focus {
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.login-error {
  padding: 11px 12px;
  border-radius: 14px;
  color: #9f2417;
  background: rgba(217, 74, 56, 0.12);
  font-size: 13px;
}

.login-submit {
  width: 100%;
}

.crm-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
  padding: 18px;
  gap: 18px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: calc(100vh - 36px);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 18px;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(145deg, #172033, #2563eb);
}

.brand-title {
  font-size: 18px;
  font-weight: 900;
}

.brand-subtitle,
.eyebrow,
.hero-label,
.metric-card span,
.empty-panel p,
.sidebar-note {
  color: var(--muted);
}

.brand-subtitle {
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  width: 100%;
  padding: 13px 14px;
  border: 0;
  border-radius: 16px;
  color: #344258;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.is-active {
  color: #fff;
  background: #172033;
}

.sidebar-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 12px;
  border-radius: 16px;
  background: rgba(22, 32, 51, 0.06);
  font-size: 12px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(18, 166, 106, 0.14);
}

.workspace {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.46);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1;
  letter-spacing: -0.06em;
}

h2 {
  margin-bottom: 14px;
  font-size: 22px;
}

.topbar-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.current-user {
  max-width: 240px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-button,
.ghost-button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 14px;
  cursor: pointer;
}

.primary-button {
  border: 0;
  color: #fff;
  background: #172033;
}

.ghost-button {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.62);
}

.section {
  display: none;
}

.section.is-active {
  display: block;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 18px;
}

.hero-card,
.status-card,
.metric-card,
.empty-panel {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: 0 12px 34px rgba(39, 54, 83, 0.08);
}

.hero-card {
  min-height: 260px;
  padding: 32px;
  background:
    linear-gradient(145deg, rgba(23, 32, 51, 0.94), rgba(37, 99, 235, 0.78)),
    var(--panel-strong);
  color: #fff;
}

.hero-value {
  margin-bottom: 10px;
  font-size: clamp(54px, 10vw, 126px);
  font-weight: 950;
  line-height: 0.92;
  letter-spacing: -0.08em;
}

.hero-card .hero-label,
.hero-card p {
  color: rgba(255, 255, 255, 0.76);
}

.hero-card p {
  max-width: 680px;
  margin: 28px 0 0;
  font-size: 18px;
}

.status-card {
  padding: 26px;
}

.stage-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stage-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #344258;
}

.stage-list span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  color: #fff;
  background: #172033;
  font-size: 13px;
  font-weight: 900;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.metric-card {
  display: grid;
  gap: 8px;
  min-height: 130px;
  padding: 22px;
}

.metric-card strong {
  font-size: 24px;
}

.accent-blue {
  border-top: 5px solid var(--blue);
}

.accent-green {
  border-top: 5px solid var(--green);
}

.accent-gold {
  border-top: 5px solid var(--gold);
}

.accent-red {
  border-top: 5px solid var(--red);
}

.empty-panel {
  min-height: 420px;
  padding: 32px;
}

.empty-panel p {
  max-width: 620px;
  font-size: 17px;
}

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

  .sidebar {
    min-height: 0;
  }

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

  .nav-item {
    text-align: center;
  }

  .hero-grid,
  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .crm-shell {
    padding: 10px;
    gap: 10px;
  }

  .sidebar,
  .workspace {
    border-radius: 22px;
    padding: 14px;
  }

  .nav-list,
  .hero-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

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

  .topbar-actions {
    width: 100%;
  }

  .primary-button,
  .ghost-button {
    flex: 1;
  }
}
