:root {
  --forest: #0f241c;
  --canopy: #17352a;
  --moss: #2f6b4f;
  --moss-soft: #3f8a66;
  --lantern: #c7921a;
  --lantern-soft: #e8c56a;
  --paper: #f3f6f4;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-solid: #ffffff;
  --line: rgba(23, 53, 42, 0.1);
  --ink: #1a2a23;
  --slate: #5a6b62;
  --muted: #87968e;
  --danger: #b42318;
  --danger-soft: #f8e4e1;
  --ok: #1f7a4d;
  --ok-soft: #e5f4ec;
  --radius: 18px;
  --radius-sm: 12px;
  --font: "Plus Jakarta Sans", sans-serif;
  --display: "Plus Jakarta Sans", sans-serif;
  --shadow: 0 18px 50px rgba(15, 36, 28, 0.08);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    linear-gradient(160deg, #e8f0eb 0%, #f3f6f4 42%, #eef3f0 100%);
}

.atmosphere__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  animation: drift 14s var(--ease) infinite alternate;
}

.atmosphere__glow--a {
  width: 42vw;
  height: 42vw;
  top: -12%;
  left: -8%;
  background: radial-gradient(circle, rgba(47, 107, 79, 0.22), transparent 68%);
}

.atmosphere__glow--b {
  width: 36vw;
  height: 36vw;
  right: -6%;
  top: 8%;
  background: radial-gradient(circle, rgba(199, 146, 26, 0.16), transparent 70%);
  animation-delay: -4s;
}

.atmosphere__grid {
  position: absolute;
  inset: 0;
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(23, 53, 42, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 53, 42, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 20%, #000 20%, transparent 75%);
}

.app {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
  animation: enter 0.7s var(--ease) both;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

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

.mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 35% 30%, var(--lantern-soft), transparent 42%),
    linear-gradient(145deg, var(--canopy), var(--forest));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  position: relative;
}

.mark::after {
  content: "";
  position: absolute;
  inset: 14px 17px 10px;
  border-radius: 999px 999px 8px 8px;
  background: linear-gradient(180deg, var(--lantern-soft), var(--lantern));
  opacity: 0.95;
}

.brand-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--forest);
  line-height: 1.1;
}

.brand-sub {
  margin: 2px 0 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.masthead__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.conn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--slate);
}

.conn__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 0 rgba(135, 150, 142, 0.4);
  animation: pulse 1.6s ease infinite;
}

.conn[data-kind="ok"] {
  color: var(--ok);
  background: var(--ok-soft);
  border-color: rgba(31, 122, 77, 0.18);
}

.conn[data-kind="ok"] .conn__dot {
  background: var(--ok);
  animation: none;
}

.conn[data-kind="err"] {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(180, 35, 24, 0.16);
}

.conn[data-kind="err"] .conn__dot {
  background: var(--danger);
  animation: none;
}

.project {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--moss);
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(47, 107, 79, 0.08);
  border: 1px solid rgba(47, 107, 79, 0.12);
}

.workspace {
  display: grid;
  gap: 18px;
}

.hero-panel {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 28px 26px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.72)),
    linear-gradient(120deg, rgba(47, 107, 79, 0.08), rgba(199, 146, 26, 0.08));
  box-shadow: var(--shadow);
  animation: enter 0.8s var(--ease) 0.08s both;
}

.hero-panel__copy {
  max-width: 36rem;
}

.hero-panel h1 {
  margin: 0;
  font-size: clamp(1.75rem, 3.5vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--forest);
  line-height: 1.1;
}

.hero-panel p {
  margin: 10px 0 0;
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--slate);
}

.hero-panel__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  border: 0;
  cursor: pointer;
  border-radius: 12px;
  padding: 11px 16px;
  transition:
    transform 0.18s var(--ease),
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    opacity 0.18s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn__icon {
  font-size: 1rem;
  line-height: 1;
}

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

.btn--primary:hover:not(:disabled) {
  background: var(--forest);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.72);
  color: var(--canopy);
  border: 1px solid var(--line);
}

.btn--ghost:hover:not(:disabled) {
  background: #fff;
}

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

.btn--danger:hover:not(:disabled) {
  background: #8f1c13;
}

.btn--soft {
  background: transparent;
  color: var(--canopy);
  border: 1px solid transparent;
  padding: 8px 10px;
}

.btn--soft:hover:not(:disabled) {
  background: rgba(47, 107, 79, 0.08);
  border-color: rgba(47, 107, 79, 0.1);
}

.btn--soft-danger {
  color: var(--danger);
}

.btn--soft-danger:hover:not(:disabled) {
  background: var(--danger-soft);
  border-color: rgba(180, 35, 24, 0.12);
}

.board {
  padding: 18px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  animation: enter 0.85s var(--ease) 0.14s both;
}

.board__bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.metrics {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.metric {
  min-width: 88px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
}

.metric__label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric__value {
  display: block;
  margin-top: 4px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--forest);
  line-height: 1;
}

.metric__value--ok {
  color: var(--ok);
}

.board__controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.search input {
  width: min(260px, 70vw);
  font: inherit;
  font-weight: 500;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
}

.search input:focus {
  outline: 2px solid rgba(47, 107, 79, 0.28);
  border-color: var(--moss);
}

.filters {
  display: inline-flex;
  padding: 4px;
  gap: 2px;
  border-radius: 12px;
  background: rgba(23, 53, 42, 0.05);
  border: 1px solid var(--line);
}

.filter {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  border: 0;
  background: transparent;
  color: var(--slate);
  padding: 8px 12px;
  border-radius: 9px;
  cursor: pointer;
}

.filter.is-on {
  background: #fff;
  color: var(--forest);
  box-shadow: 0 1px 2px rgba(15, 36, 28, 0.06);
}

.table-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 280px;
  gap: 12px;
  padding: 0 14px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.rows {
  display: grid;
  gap: 8px;
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 280px;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 16px;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  transition:
    border-color 0.2s ease,
    transform 0.2s var(--ease),
    background 0.2s ease;
  animation: rise 0.45s var(--ease) both;
}

.row:hover {
  border-color: rgba(47, 107, 79, 0.28);
  transform: translateY(-1px);
}

.row.is-off {
  opacity: 0.78;
}

.row__identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.avatar {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.82rem;
  color: var(--forest);
  background: linear-gradient(145deg, #e8f2ec, #f7faf8);
  border: 1px solid var(--line);
}

.row h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--forest);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta {
  margin: 3px 0 0;
  font-size: 0.78rem;
  color: var(--slate);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--ok-soft);
  color: var(--ok);
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge.is-off {
  background: rgba(23, 53, 42, 0.06);
  color: var(--muted);
}

.row__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.btn--action {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f7faf8;
  color: var(--canopy);
}

.btn--action:hover:not(:disabled) {
  background: #eef5f1;
  border-color: rgba(47, 107, 79, 0.22);
}

.btn--action-mute {
  color: var(--slate);
}

.btn--action-danger {
  color: var(--danger);
  background: #fff;
  border-color: rgba(180, 35, 24, 0.18);
}

.code-row {
  display: flex;
  gap: 8px;
}

.code-row input {
  flex: 1;
}

.row__code {
  margin-top: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--moss);
  font-variant-numeric: tabular-nums;
}

.btn--copy {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 10px;
  border: 1px dashed rgba(47, 107, 79, 0.35);
  background: rgba(47, 107, 79, 0.06);
  color: var(--moss);
}

.btn--copy:hover:not(:disabled) {
  background: rgba(47, 107, 79, 0.12);
}

.empty {
  margin-top: 8px;
  padding: 42px 20px;
  text-align: center;
  border: 1px dashed rgba(23, 53, 42, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.55);
}

.empty__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--forest);
}

.empty__copy {
  margin: 8px auto 18px;
  max-width: 28rem;
  color: var(--slate);
  font-size: 0.92rem;
}

.skeleton {
  display: grid;
  gap: 8px;
}

.skeleton[hidden] {
  display: none;
}

.skeleton__row {
  height: 72px;
  border-radius: 16px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.35),
    rgba(255, 255, 255, 0.85),
    rgba(255, 255, 255, 0.35)
  );
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
  border: 1px solid var(--line);
}

.hint {
  margin: 14px 0 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
}

.hint code {
  font-size: 0.75rem;
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(23, 53, 42, 0.06);
}

.hint a {
  color: var(--moss);
  font-weight: 700;
}

.foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding: 0 6px;
  font-size: 0.75rem;
  color: var(--muted);
}

.foot a {
  color: var(--moss);
  text-decoration: none;
  font-weight: 700;
}

.sheet {
  width: min(440px, calc(100% - 24px));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 0;
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 36, 28, 0.22);
}

.sheet::backdrop {
  background: rgba(15, 36, 28, 0.42);
  backdrop-filter: blur(4px);
}

.sheet[open] {
  animation: sheet-in 0.28s var(--ease);
}

.sheet__form {
  display: grid;
  gap: 14px;
  padding: 24px;
}

.sheet__head h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--forest);
}

.sheet__lede {
  margin: 6px 0 0;
  font-size: 0.88rem;
  color: var(--slate);
  line-height: 1.45;
}

.field {
  display: grid;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--canopy);
}

.field input {
  font: inherit;
  font-weight: 500;
  padding: 12px 13px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f7faf8;
  color: var(--ink);
}

.field input:focus {
  outline: 2px solid rgba(47, 107, 79, 0.28);
  border-color: var(--moss);
  background: #fff;
}

.switch {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch__ui {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: rgba(23, 53, 42, 0.15);
  position: relative;
  transition: background 0.2s ease;
}

.switch__ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s var(--ease);
  box-shadow: 0 1px 3px rgba(15, 36, 28, 0.2);
}

.switch input:checked + .switch__ui {
  background: var(--moss);
}

.switch input:checked + .switch__ui::after {
  transform: translateX(18px);
}

.switch__label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
}

.sheet__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(8px);
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--forest);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 16px 40px rgba(15, 36, 28, 0.28);
  z-index: 40;
  opacity: 0;
  transition:
    opacity 0.25s ease,
    transform 0.25s var(--ease);
}

.toast.is-on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(135, 150, 142, 0.35);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(135, 150, 142, 0);
  }
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(18px, 12px, 0);
  }
}

@media (max-width: 820px) {
  .table-head {
    display: none;
  }

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

  .row__actions {
    justify-content: flex-start;
  }

  .hero-panel {
    flex-direction: column;
    align-items: stretch;
    padding: 22px;
  }

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

@media (max-width: 560px) {
  .app {
    width: calc(100% - 20px);
    padding-top: 16px;
  }

  .board {
    padding: 12px;
  }

  .board__controls {
    width: 100%;
  }

  .search input {
    width: 100%;
  }

  .filters {
    width: 100%;
  }

  .filter {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
