:root {
  --bg: #e6e8ec;
  --panel: #f6f7f9;
  --line: #cfd5dd;
  --text: #1f2430;
  --muted: #6f7889;
  --green: #1f9d7f;
  --green-strong: #167e67;
  --teal-dark: #123d4a;
  --purple: #7b6be7;
  --yellow: #f2c250;
  --cyan: #39b8da;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Heebo", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.hidden {
  display: none !important;
}

.screen {
  min-height: 100vh;
}

.screen-login {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(380px, 470px);
  align-items: center;
  gap: 64px;
  padding: 48px clamp(24px, 6vw, 96px);
}

.login-art {
  position: relative;
}

.art-symbol {
  color: #22d67f;
  font-size: 68px;
  line-height: 1;
  margin-right: 80px;
  margin-bottom: 16px;
}

.art-frame {
  position: relative;
  width: min(680px, 100%);
  aspect-ratio: 4 / 3;
}

.art-image {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.1)),
    radial-gradient(circle at 72% 40%, #5a7381 0, #3f5967 27%, #2b3d48 70%);
  border: 14px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 30px 70px rgba(18, 35, 52, 0.22);
}

.art-block {
  position: absolute;
  width: 88%;
  height: 46%;
  right: 0;
  bottom: -18%;
  background: var(--teal-dark);
  z-index: -1;
}

.art-grid {
  position: absolute;
  width: 200px;
  height: 132px;
  left: 12px;
  bottom: -10px;
  background-image: linear-gradient(45deg, transparent 46%, #fff 47%, #fff 53%, transparent 54%),
    linear-gradient(-45deg, transparent 46%, #fff 47%, #fff 53%, transparent 54%);
  background-size: 40px 40px;
  opacity: 0.85;
}

.login-card-wrap {
  padding-inline: 16px;
}

.logo {
  font-size: 52px;
  font-weight: 800;
  color: #16bb76;
  letter-spacing: -0.5px;
}

.logo span {
  color: #0f4d4e;
}

h1 {
  margin: 18px 0 8px;
  font-size: 48px;
  font-weight: 500;
}

p {
  margin: 0;
  color: var(--muted);
  font-size: 20px;
}

.login-form {
  margin-top: 24px;
  display: grid;
  gap: 10px;
}

.login-form label {
  font-size: 17px;
  color: #5e6780;
}

.login-form input {
  width: 100%;
  border: 1px solid #abb4c9;
  border-radius: 8px;
  background: transparent;
  font-family: inherit;
  font-size: 20px;
  padding: 14px 16px;
  color: #283247;
}

.login-form button {
  margin-top: 18px;
  border: 0;
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  font-size: 28px;
  font-family: inherit;
  padding: 13px 14px;
  cursor: pointer;
}

.login-form button:hover {
  background: var(--green-strong);
}

.login-error {
  color: #d54052;
  min-height: 26px;
  font-size: 16px;
}

.login-hint {
  margin-top: 10px;
  color: #5f6780;
  font-size: 14px;
  display: grid;
  gap: 6px;
}

.login-hint code {
  background: #ecf0f5;
  border-radius: 6px;
  padding: 6px 8px;
  direction: ltr;
}

.screen-dashboard {
  padding: 0 24px 24px;
}

.topbar {
  margin: 0 -24px;
  padding: 10px 32px;
  min-height: 78px;
  background: #f8f8f9;
  border-bottom: 1px solid #d9dee6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.topbar-right .small {
  font-size: 40px;
}

.topbar-right h2 {
  margin: 0;
  font-size: 42px;
  font-weight: 500;
}

.mode-switch {
  background: #eceef2;
  border-radius: 8px;
  padding: 4px;
  display: flex;
  gap: 6px;
}

.mode-btn {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #68738e;
  padding: 10px 24px;
  font-family: inherit;
  font-size: 18px;
}

.mode-btn.active {
  background: #fff;
  color: #4068cf;
  font-weight: 700;
}

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

.icon-pill,
.avatar,
.logout-btn {
  border: 1px solid #bcd0cb;
  background: #e6f4ef;
  color: #1d3c4b;
  border-radius: 12px;
  min-width: 46px;
  height: 46px;
  padding: 0 12px;
  font: inherit;
}

.avatar {
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #163f4c;
  color: #fff;
}

.logout-btn {
  background: #fff;
  border-color: #cad2de;
}

.subnav {
  margin-top: 14px;
  border-bottom: 1px solid #bcc4d1;
  display: flex;
  gap: 26px;
  align-items: center;
  overflow-x: auto;
  padding: 0 8px;
}

.subnav a {
  text-decoration: none;
  color: #667089;
  font-size: 31px;
  padding: 14px 0;
  white-space: nowrap;
}

.subnav a.active {
  color: #187f66;
  border-bottom: 6px solid #1f9d7f;
}

.hero-grid,
.charts-grid {
  margin-top: 18px;
  display: grid;
  gap: 18px;
  grid-template-columns: 2.8fr 1fr;
}

.panel {
  background: var(--panel);
  border-radius: 18px;
  padding: 18px;
}

.panel h3 {
  margin: 0 0 10px;
  font-size: 36px;
}

.metric-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  border: 1px solid #cad2de;
  border-radius: 12px;
  min-height: 128px;
  padding: 18px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
}

.metric-card span {
  color: #5f6880;
  font-size: 25px;
}

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

.total-box {
  background: linear-gradient(145deg, #1f9d7f, #20a88a 60%, #26b79b);
  color: #fff;
  display: grid;
  place-content: center;
  text-align: center;
}

.total-box p {
  color: #dffcf2;
  font-size: 40px;
}

.total-box strong {
  font-size: 76px;
}

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

.chart-wrap {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  align-items: center;
}

.donut {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  position: relative;
  display: grid;
  place-items: center;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 25px;
  border-radius: 50%;
  background: var(--panel);
}

.donut span {
  position: relative;
  z-index: 1;
  text-align: center;
  font-size: 34px;
  color: #69738a;
  line-height: 1.2;
}

.donut span b {
  color: #111721;
  font-size: 52px;
}

.donut.empty {
  background: #e3e6ec;
}

.donut.filled {
  background: conic-gradient(var(--purple) 0 84.6%, var(--yellow) 84.6% 100%);
}

.legend {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 20px;
  font-size: 31px;
}

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

.dot {
  width: 8px;
  height: 36px;
  border-radius: 4px;
}

.dot.purple {
  background: var(--purple);
}

.dot.yellow {
  background: var(--yellow);
}

.dot.cyan {
  background: var(--cyan);
}

.dot.green {
  background: #85cc83;
}

.legend em {
  margin-right: auto;
  font-style: normal;
  background: #eec0c5;
  color: #9f2032;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 24px;
}

.savings-panel {
  margin-top: 18px;
}

.savings-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.coverage {
  border: 1px solid #cad2de;
  border-radius: 12px;
  min-height: 220px;
  font-size: 31px;
  padding: 14px;
  display: grid;
  align-content: space-between;
}

.coverage span {
  justify-self: start;
  background: #f2c4cb;
  color: #9e2032;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 26px;
}

/* Embedded widget section centered in normal page flow. */
.kwry-chat {
  width: min(980px, 100%);
  margin: 20px auto;
  position: relative;
  z-index: 2;
}

@media (max-width: 1280px) {
  .screen-login {
    grid-template-columns: 1fr;
    gap: 24px;
  }

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

  .metric-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .chart-wrap {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .legend {
    width: 100%;
    font-size: 20px;
  }

  .subnav a,
  .coverage,
  .metric-card span {
    font-size: 20px;
  }

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

  .topbar-right h2 {
    font-size: 28px;
  }

  .kwry-chat {
    width: min(980px, calc(100vw - 1rem));
  }
}
