:root {
  --page-bg: #e8eaf0;
  --window-bg: #f0f1f5;
  --board-bg: #e8ebf4;
  --panel-bg: #edf0f8;
  --card-bg: #ffffff;
  --line: #e2e6f0;
  --text: #1a1d25;
  --muted: #6b7490;
  --black: #090b10;
  --blue: #7f9de3;
  --red: #d7777c;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  font-family: "Outfit", sans-serif;
  color: var(--text);
  background: var(--page-bg);
  min-height: 100vh;
}

/* ─── APP WRAPPER ──────────────────────────────────────── */
.app-wrapper {
  min-height: 100vh;
  background: linear-gradient(170deg, #f4f5f9 0%, #eef1f8 100%);
  display: flex;
  flex-direction: column;
}

/* ─── HEADER ───────────────────────────────────────────── */
.app-header {
  padding: 14px 28px 12px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  background: transparent;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 19px;
  letter-spacing: -0.04em;
}

.brand strong { font-weight: 700; }
.brand span { font-weight: 300; }

.stack-logo {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
}

.stack-logo span {
  width: 11px;
  height: 3px;
  border-radius: 999px;
  background: #12141b;
}

.nav-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  overflow-x: auto;
  white-space: nowrap;
}

.nav-menu a {
  text-decoration: none;
  color: #434b60;
  font-size: 14px;
  padding: 9px 17px;
  border-radius: 999px;
  transition: background 0.15s;
}

.nav-menu a:hover {
  background: rgba(0,0,0,0.05);
}

.nav-menu a.active {
  background: #090b10;
  color: #fff;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.circle-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid #dde2ef;
  background: #f6f7fb;
  color: #3a4258;
  font-size: 17px;
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
  transition: background 0.15s, border-color 0.15s;
}

.circle-btn:hover {
  background: #eef0f7;
  border-color: #cdd3e4;
}

.notif-btn { position: relative; }

.header-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #e3875a;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 2px solid #f4f5f9;
}

.header-badge.red {
  background: #d7777c;
}

.user-main {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
}

/* ─── CONTENT SHELL ────────────────────────────────────── */
.content-shell {
  display: grid;
  grid-template-columns: 72px 1fr;
  flex: 1;
}

/* ─── SIDEBAR ──────────────────────────────────────────── */
.sidebar {
  padding: 4px 10px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.s-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1.5px solid #dde2ef;
  background: #f2f4f9;
  color: #5d6580;
  font-size: 18px;
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
  transition: background 0.15s;
}

.s-btn:hover {
  background: #eaecf5;
}

.s-btn.active {
  background: #06080f;
  color: #fff;
  border-color: #06080f;
}

.side-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #d7777c;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 2px solid #f2f4f9;
}

.side-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ─── MAIN ─────────────────────────────────────────────── */
.main {
  background: linear-gradient(170deg, #e4e8f4 0%, #dce4f5 100%);
  border-radius: 26px 0 0 0;
  padding: 22px 18px 18px;
  position: relative;
}

/* ─── JOURNEY PANEL ────────────────────────────────────── */
.journey-panel {
  background: linear-gradient(160deg, #e2e7f3 0%, #dae2f4 100%);
  border-radius: 28px;
  border: 1px solid #d2d9ea;
  padding: 14px;
  padding-top: 52px;
  position: relative;
  overflow: visible;
}

h1 {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
  color: #12151f;
}

/* The avatar-rail sits inside the panel, centered at the top.
   A pseudo-element behind it covers the panel border line. */
.avatars-cutout {
  position: absolute;
  top: -31px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 10;
  pointer-events: none;
  margin-bottom: 0;
}

.avatars-cutout .avatar-rail {
  height: 62px;
  border-radius: 22px;
  border: 1.5px solid #cdd5e5;
  background: linear-gradient(170deg, #e4e8f4 0%, #dce4f5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  white-space: nowrap;
  pointer-events: all;
  /* Thick shadow in the main bg color covers the panel border behind the pill */
  box-shadow: 0 0 0 7px #e6eaf4;
}

.journey-topline {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.journey-title {
  flex: 1;
  height: 66px;
  border-radius: 22px;
  border: 1.5px solid #d5dcea;
  background: #edf0f8;
  display: flex;
  align-items: center;
  padding: 0 22px;
  font-size: 18px;
  font-weight: 500;
  color: #1e2234;
}

.journey-title-box {
  height: 66px;
  border-radius: 22px;
  border: 1.5px solid #d5dcea;
  background: #edf0f8;
  display: flex;
  align-items: center;
  padding: 0 22px;
  font-size: 18px;
  font-weight: 500;
  color: #1e2234;
}

/* avatar rail lives inside .avatars-cutout */

.member {
  position: relative;
  flex: 0 0 auto;
}

.member img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2.5px solid #eef1f8;
  display: block;
}

.badge {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -7px;
  min-width: 17px;
  height: 17px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  display: grid;
  place-items: center;
  padding: 0 4px;
}

.badge.blue  { background: #7d9add; }
.badge.red   { background: #dd666f; }
.badge.gray  { background: #edf0f7; color: #727b95; border: 1px solid #ccd2e1; }

.float-actions {
  display: inline-flex;
  gap: 7px;
  flex-shrink: 0;
}

/* ─── FLOW GRID ────────────────────────────────────────── */
.flow-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 0.95fr;
  gap: 10px;
}

.flow-col { min-width: 0; }

.flow-card {
  background: #ffffff;
  border: 1px solid #e4e9f4;
  border-radius: 26px;
  padding: 10px;
  min-height: 380px;
  position: relative;
  box-shadow: 0 2px 12px rgba(100, 120, 180, 0.07);
}

.flow-col.first .flow-card {
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  gap: 10px;
}

.divider {
  border-top: 1.5px solid #e8ecf5;
}

.flow-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 8px;
  align-items: center;
  min-height: 60px;
  padding: 4px 2px;
}

.flow-item img,
.plus {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #e0e6f2;
  background: #f5f7fc;
  flex-shrink: 0;
}

.plus {
  display: grid;
  place-items: center;
  color: #8590a8;
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
}

.flow-item strong {
  font-size: 13px;
  line-height: 1.25;
  font-weight: 500;
  color: #1e2438;
}

.mini-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid #dde3f0;
  background: #f4f6fb;
  color: #606882;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.mini-icon.dots { color: #8590a8; }

/* ─── CONNECTOR LINES ──────────────────────────────────── */
.has-connectors .flow-card::before,
.has-connectors .flow-card::after {
  content: "";
  position: absolute;
  top: 40px;
  bottom: 40px;
  width: 2px;
  border-radius: 99px;
  opacity: 0.55;
}

.has-connectors .flow-card::before {
  left: -6px;
  background: linear-gradient(180deg, #98b8f0 0%, #98b8f0 50%, #df98a2 50%, #df98a2 100%);
}

.has-connectors .flow-card::after {
  right: -6px;
  background: linear-gradient(180deg, #98b8f0 0%, #98b8f0 50%, #df98a2 50%, #df98a2 100%);
}

.has-connectors.alt .flow-card::before,
.has-connectors.alt .flow-card::after {
  opacity: 0.65;
}

.flow-col p {
  text-align: center;
  margin: 10px 0 2px;
  font-size: 13px;
  color: #3a4055;
  font-weight: 400;
}

/* ─── TASK BOX ─────────────────────────────────────────── */
.task-box {
  background: #ffffff;
  border: 1px solid #e4e9f4;
  border-radius: 26px;
  min-height: 380px;
  padding: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  box-shadow: 0 2px 12px rgba(100, 120, 180, 0.07);
}

.task {
  border: 1.5px solid #e2e8f3;
  border-radius: 18px;
  background: #f6f8fd;
  color: #2a3348;
  text-align: left;
  padding: 14px 13px;
  font-size: 13px;
  line-height: 1.25;
  font-family: inherit;
  font-weight: 400;
  cursor: pointer;
  transition: background 0.15s;
}

.task:hover {
  background: #eef1f9;
}

.task.active {
  background: #07090f;
  color: #fff;
  border-color: #07090f;
}

/* ─── BOTTOM PANELS ────────────────────────────────────── */
.bottom-panels {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.panel {
  border-radius: 26px;
  background: linear-gradient(160deg, #dce4f4 0%, #d6dff2 100%);
  border: 1px solid #cdd5e6;
  padding: 16px 16px 12px;
  min-height: 240px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.panel h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
}

th, td {
  border-bottom: 1px solid #c8d1e3;
  text-align: left;
  padding: 9px 6px;
  font-size: 13px;
}

th {
  color: #7880a0;
  font-weight: 400;
}

.star-col { width: 28px; }

.row-icon {
  color: #9aa3b8;
  padding-right: 4px;
}

.tag {
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 11.5px;
  font-weight: 500;
}

.tag.blue { background: #7f9de3; color: #fff; }
.tag.red  { background: #d7777c; color: #fff; }

/* ─── DONUT CHARTS ─────────────────────────────────────── */
.chart-row {
  margin-top: 10px;
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  gap: 14px;
}

.ring {
  width: min(44%, 220px);
  aspect-ratio: 1;
  border-radius: 50%;
  position: relative;
  display: grid;
  place-items: center;
}

.ring::before {
  content: "";
  position: absolute;
  width: 60%;
  height: 60%;
  border-radius: 50%;
  background: #d5dcee;
}

.ring > div {
  position: absolute;
  text-align: center;
  z-index: 1;
}

.ring strong {
  display: block;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 2px;
}

.ring span {
  font-size: 13px;
  color: #fff;
}

.ring.blue {
  background: conic-gradient(#7f9de3 0 78%, #c0cfe9 78% 100%);
}

.ring.red {
  background: conic-gradient(#d7777c 0 76%, #e8bdc0 76% 100%);
}

/* ─── RESPONSIVE ───────────────────────────────────────── */
@media (max-width: 1400px) {
  .flow-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 1100px) {
  .bottom-panels {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .journey-topline {
    grid-template-columns: 1fr auto;
    flex-wrap: wrap;
  }

  .avatars-inline {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .app-header {
    grid-template-columns: 1fr;
    padding: 10px 14px;
    gap: 8px;
  }

  .header-actions {
    justify-content: flex-end;
  }

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

  .sidebar {
    flex-direction: row;
    overflow-x: auto;
    padding: 8px 10px;
    border-top: 1px solid #d4daea;
    border-bottom: 1px solid #d4daea;
  }

  .side-bottom {
    margin-top: 0;
    margin-left: auto;
    flex-direction: row;
  }

  .main {
    border-radius: 0;
    padding: 14px 12px 12px;
  }

  h1 { font-size: 28px; }

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

  .flow-card, .task-box {
    min-height: 200px;
  }

  .task-box {
    grid-template-columns: 1fr;
  }

  .chart-row {
    flex-direction: column;
  }

  .ring {
    width: min(80vw, 220px);
  }
}

/* ─── TIMER WIDGET ─────────────────────────────────────── */
.flow-card--timer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 18px 14px 16px;
  min-height: 380px;
  background: #ffffff;
}

/* Header row */
.t-header {
  display: flex;
  align-items: center;
  gap: 7px;
  align-self: flex-start;
  width: 100%;
  margin-bottom: 4px;
}

.t-header__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #98b8f0;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(152,184,240,0.22);
  transition: background 0.3s;
}

.t-header__title {
  font-size: 12px;
  font-weight: 600;
  color: #3a4258;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Ring */
.t-ring-wrap {
  position: relative;
  width: 170px;
  height: 170px;
  flex-shrink: 0;
}

.t-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.t-ring__bg {
  fill: none;
  stroke: #e8ecf5;
  stroke-width: 8;
}

.t-ring__track {
  fill: none;
  stroke: url(#timerGrad);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.85s cubic-bezier(0.4, 0, 0.2, 1);
}

.t-ring__inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.t-time {
  font-size: 28px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
  color: #1a1d25;
  line-height: 1;
}

.t-status {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #98b8f0;
  transition: color 0.3s;
}

/* Note input */
.t-note-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  background: #f5f7fc;
  border: 1.5px solid #e4e9f4;
  border-radius: 14px;
  padding: 8px 12px;
}

.t-note-icon {
  color: #9aa3b8;
  flex-shrink: 0;
}

.t-note {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 12.5px;
  color: #1e2438;
  outline: none;
}

.t-note::placeholder { color: #b0b8cc; }

/* Controls */
.t-controls {
  display: flex;
  gap: 10px;
}

.t-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1.5px solid #dde3f0;
  background: #f4f6fb;
  color: #3a4258;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(100,120,180,0.08);
  transition: background 0.15s, transform 0.12s, box-shadow 0.15s;
}
.t-btn:hover {
  background: #eaecf5;
  transform: scale(1.07);
  box-shadow: 0 4px 14px rgba(100,120,180,0.14);
}
.t-btn:disabled {
  opacity: 0.28;
  cursor: default;
  transform: none;
  pointer-events: none;
}
.t-btn--stop:hover {
  background: #fde8e8;
  color: #d7777c;
  border-color: #f0c0c0;
}
