:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --panel: #ffffff;
  --ink: #202234;
  --muted: #74798a;
  --soft: #e6e9f0;
  --line: #e8ebf2;
  --nav: #262a3d;
  --nav-muted: #bac0d1;
  --primary: #4452d9;
  --primary-dark: #3340ad;
  --mint: #1d9875;
  --amber: #c17925;
  --rose: #c6536d;
  --blue: #2476bf;
  --shadow: 0 18px 45px rgba(42, 48, 70, .08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button, input, select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(68, 82, 217, .12), transparent 38%),
    linear-gradient(315deg, rgba(29, 152, 117, .13), transparent 35%),
    var(--bg);
}

.login-card {
  width: min(100%, 430px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 30px;
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 23px;
  font-weight: 800;
  color: #fff;
}

.brand > span:last-child > span {
  color: #aeb7ff;
}

.login-brand {
  color: var(--ink);
  margin-bottom: 26px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 3px solid #aeb7ff;
  border-radius: 50%;
  color: var(--primary);
  font-size: 14px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
}

h1, h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.1;
}

h2 {
  font-size: 17px;
}

.sub, .panel-title p, .form-message {
  color: var(--muted);
  font-size: 14px;
}

.sub {
  margin: 8px 0 0;
}

label {
  display: grid;
  gap: 7px;
  margin-top: 15px;
  color: #4d5364;
  font-size: 13px;
  font-weight: 700;
}

input, select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--soft);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

input:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(68, 82, 217, .12);
}

.primary, .secondary, .ghost {
  min-height: 40px;
  border-radius: 6px;
  padding: 0 14px;
  font-weight: 700;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

.primary {
  background: var(--primary);
  color: #fff;
}

.primary:hover {
  background: var(--primary-dark);
}

.secondary {
  background: #eef1ff;
  color: var(--primary);
}

.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.full {
  width: 100%;
}

.login-submit {
  width: 100%;
  margin-top: 18px;
}

.error {
  color: #b9344a;
}

.app {
  min-height: 100vh;
  display: flex;
}

.sidebar {
  position: sticky;
  top: 0;
  width: 265px;
  height: 100vh;
  background: var(--nav);
  color: #fff;
  padding: 25px 16px;
  display: flex;
  flex-direction: column;
}

.workspace {
  margin: 34px 10px 18px;
  color: #8991a9;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
}

.workspace strong {
  display: block;
  margin-top: 7px;
  color: #fff;
  font-size: 14px;
  letter-spacing: 0;
}

.nav {
  display: grid;
  gap: 5px;
}

.nav button {
  height: 43px;
  border-radius: 7px;
  background: transparent;
  color: var(--nav-muted);
  text-align: left;
  padding: 0 12px;
}

.nav button span {
  display: inline-block;
  width: 28px;
  color: #d9def0;
}

.nav button.active {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-weight: 800;
}

.sidebar-bottom {
  margin-top: auto;
  display: grid;
  gap: 14px;
}

.profile {
  border-top: 1px solid rgba(255, 255, 255, .13);
  padding: 17px 4px 0;
  display: flex;
  gap: 10px;
  align-items: center;
}

.profile > span, .avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  background: #d98e63;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.profile strong, .profile small {
  display: block;
  font-size: 12px;
}

.profile small {
  color: var(--nav-muted);
  margin-top: 3px;
}

.content {
  width: calc(100% - 265px);
  max-width: 1540px;
  margin: 0 auto;
  padding: 34px;
}

.mobile-top {
  display: none;
}

.hero-row, .panel-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.hero-row {
  margin-bottom: 26px;
}

.header-actions, .toolbar, .segmented {
  display: flex;
  gap: 10px;
  align-items: center;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric, .panel, .notice {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric {
  min-height: 96px;
  padding: 18px;
  display: flex;
  gap: 13px;
}

.metric-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-weight: 800;
}

.mint { background: #def5ed; color: var(--mint); }
.violet { background: #e8ebff; color: var(--primary); }
.orange { background: #fff1df; color: var(--amber); }
.blue { background: #e2f2ff; color: var(--blue); }

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

.metric strong {
  display: block;
  margin: 5px 0 1px;
  font-size: 23px;
}

.metric small {
  color: #758092;
  font-size: 11px;
}

.notice {
  margin-bottom: 16px;
  padding: 12px 14px;
  color: #1e6f56;
  background: #ecf8f3;
}

.workbench {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.panel {
  padding: 20px;
}

.panel-title {
  margin-bottom: 16px;
}

.panel-title p {
  margin: 5px 0 0;
}

.panel-title.stacked {
  align-items: stretch;
}

.inline-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.inline-form label {
  margin-top: 0;
}

.inline-form button, .inline-form .form-message {
  align-self: end;
}

.icon-button {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: #f2f4f8;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.text-button {
  background: transparent;
  color: var(--primary);
  font-weight: 800;
}

.grid {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.grid.two {
  grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.list {
  display: grid;
  gap: 10px;
}

.item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  border: 1px solid #eef0f5;
  border-radius: 7px;
  padding: 12px;
  background: #fff;
}

.item.compact {
  grid-template-columns: minmax(0, 1fr) auto;
}

.item strong, .item small {
  display: block;
}

.item strong {
  overflow-wrap: anywhere;
  font-size: 14px;
}

.item small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.badge {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: #eef1ff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge.done {
  background: #e2f6ee;
  color: var(--mint);
}

.check {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: #f3f5f9;
  color: var(--muted);
  font-weight: 900;
}

.check.done {
  background: #e2f6ee;
  color: var(--mint);
}

.pipeline-bars {
  display: grid;
  gap: 10px;
}

.bar {
  display: grid;
  gap: 6px;
}

.bar header {
  display: flex;
  justify-content: space-between;
  color: #52596a;
  font-size: 12px;
  font-weight: 800;
}

.bar-track {
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0f5;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--mint));
}

.project-table {
  display: grid;
  gap: 8px;
}

.project-row, .project-head {
  display: grid;
  grid-template-columns: minmax(160px, 1.6fr) minmax(110px, .9fr) minmax(100px, .8fr) minmax(120px, .9fr) minmax(100px, .7fr);
  gap: 12px;
  align-items: center;
}

.project-head {
  padding: 0 12px 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .8px;
}

.project-row {
  min-height: 60px;
  border: 1px solid #eef0f5;
  border-radius: 7px;
  padding: 12px;
  background: #fff;
  font-size: 13px;
}

.progress {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
}

.progress i {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: var(--primary);
}

.toolbar {
  min-width: min(100%, 420px);
}

.toolbar input {
  min-width: 190px;
}

.segmented {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 3px;
  background: #f6f7fa;
}

.segmented button {
  height: 32px;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  font-weight: 800;
}

.segmented button.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(35, 41, 60, .08);
}

.empty {
  border: 1px dashed #d9deea;
  border-radius: 8px;
  padding: 22px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1080px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid.two, .workbench {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .app {
    display: block;
    padding-bottom: 74px;
  }

  .sidebar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 20;
    width: auto;
    height: 64px;
    padding: 6px;
    display: block;
  }

  .sidebar > .brand, .workspace, .sidebar-bottom {
    display: none;
  }

  .nav {
    height: 100%;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
  }

  .nav button {
    height: 52px;
    padding: 0 2px;
    display: grid;
    place-items: center;
    gap: 2px;
    text-align: center;
    font-size: 10px;
  }

  .nav button span {
    width: auto;
    font-size: 17px;
  }

  .content {
    width: 100%;
    padding: max(18px, env(safe-area-inset-top)) 14px 18px;
  }

  .mobile-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
  }

  .mobile-top .brand {
    color: var(--ink);
    font-size: 21px;
  }

  .hero-row {
    display: grid;
  }

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

  .header-actions button {
    width: 100%;
  }

  .metrics {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .metric {
    min-height: 112px;
    padding: 13px;
    display: grid;
  }

  .panel {
    padding: 15px;
  }

  .panel-title.stacked, .toolbar {
    display: grid;
  }

  .toolbar {
    min-width: 0;
  }

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

  .project-head {
    display: none;
  }

  .project-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .project-row span::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .7px;
    margin-bottom: 2px;
  }
}

@media (max-width: 430px) {
  .login-card {
    padding: 23px;
  }

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

  .item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .item .badge {
    grid-column: 2;
    justify-self: start;
  }

  .segmented {
    overflow-x: auto;
  }
}
