:root {
  color-scheme: light;
  --bg: #f4f2ed;
  --ink: #17202a;
  --muted: #6c737f;
  --line: rgba(23, 32, 42, 0.1);
  --panel: rgba(255, 255, 255, 0.82);
  --green: #1f9d55;
  --green-soft: #e5f7ec;
  --yellow: #d99b12;
  --yellow-soft: #fff3c4;
  --red: #d92d20;
  --red-soft: #fee4e2;
  --shadow: 0 20px 70px rgba(21, 31, 43, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 214, 102, 0.34), transparent 34rem),
    radial-gradient(circle at 90% 18%, rgba(72, 187, 120, 0.22), transparent 30rem),
    linear-gradient(135deg, #f7f4ee 0%, #eef3f0 48%, #f5f1ea 100%);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 28px;
  gap: 18px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

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

.mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #17202a;
  color: white;
  font-weight: 900;
  box-shadow: var(--shadow);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(28px, 5vw, 56px);
  line-height: 0.96;
  letter-spacing: 0;
}

.subtitle {
  color: var(--muted);
  margin-top: 4px;
}

.userbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
  border-radius: 18px;
}

.avatar {
  width: 42px;
  height: 42px;
  min-width: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 22px rgba(23, 32, 42, 0.16);
  background: rgba(23, 32, 42, 0.08);
}

.avatar img,
.avatar-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  object-fit: cover;
}

.avatar-fallback {
  color: white;
  font-weight: 850;
}

.avatar.small {
  width: 28px;
  height: 28px;
  min-width: 28px;
  font-size: 11px;
}

.avatar.large {
  width: 62px;
  height: 62px;
  min-width: 62px;
}

.avatar-upload,
.person-avatar {
  display: inline-grid;
  place-items: center;
}

.avatar-upload input,
.person-avatar input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.avatar-upload {
  cursor: pointer;
}

.person-avatar {
  cursor: pointer;
  position: relative;
}

.ghost,
.primary,
.icon-button {
  border: 0;
  border-radius: 14px;
  min-height: 42px;
  padding: 0 16px;
  background: #17202a;
  color: white;
  font-weight: 750;
}

.ghost {
  background: rgba(23, 32, 42, 0.08);
  color: var(--ink);
}

.icon-button {
  width: 42px;
  padding: 0;
  border-radius: 50%;
}

.icon-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

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

.login-panel,
.admin-panel {
  width: min(460px, 100%);
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  border-radius: 24px;
  padding: 24px;
}

.login-panel h1 {
  margin-bottom: 18px;
}

.field {
  display: grid;
  gap: 7px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 14px;
}

.field input,
.field select,
.composer textarea,
.composer select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  border-radius: 16px;
  min-height: 48px;
  padding: 0 14px;
  outline: none;
}

.field input:focus,
.field select:focus,
.composer textarea:focus,
.composer select:focus {
  border-color: rgba(23, 32, 42, 0.38);
  box-shadow: 0 0 0 4px rgba(23, 32, 42, 0.08);
}

.field input[type="file"] {
  min-height: auto;
  padding: 10px;
}

.error {
  min-height: 22px;
  color: #b42318;
  font-weight: 700;
}

.board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
}

.task-list {
  display: grid;
  gap: 12px;
  padding-bottom: 90px;
}

.task-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
  border-radius: 20px;
  padding: 14px;
  box-shadow: 0 12px 34px rgba(23, 32, 42, 0.08);
}

.task-card.status-review {
  background: linear-gradient(135deg, var(--yellow-soft), rgba(255, 255, 255, 0.88));
  border-color: rgba(217, 155, 18, 0.35);
}

.task-card.status-approved {
  background: linear-gradient(135deg, var(--green-soft), rgba(255, 255, 255, 0.88));
  border-color: rgba(31, 157, 85, 0.3);
}

.task-card.status-rework {
  background: linear-gradient(135deg, var(--red-soft), rgba(255, 255, 255, 0.88));
  border-color: rgba(217, 45, 32, 0.32);
}

.check {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid rgba(23, 32, 42, 0.14);
  background: white;
  color: transparent;
  font-size: 24px;
  font-weight: 900;
}

.task-card.status-review .check {
  background: var(--yellow);
  color: white;
  border-color: var(--yellow);
}

.task-card.status-approved .check {
  background: var(--green);
  color: white;
  border-color: var(--green);
}

.task-card.status-rework .check {
  background: var(--red);
  color: white;
  border-color: var(--red);
}

.check:disabled {
  cursor: default;
  opacity: 0.42;
}

.task-title {
  font-size: 18px;
  font-weight: 820;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.task-card.status-review .task-title {
  color: #9a6700;
}

.task-card.status-approved .task-title {
  color: var(--green);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.task-card.status-rework .task-title {
  color: var(--red);
}

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

.delete-task {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(180, 35, 24, 0.09);
  color: #b42318;
  font-size: 24px;
  line-height: 1;
  font-weight: 650;
}

.delete-task:hover {
  background: #b42318;
  color: white;
}

.meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.empty {
  min-height: 45vh;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  border: 1px dashed rgba(23, 32, 42, 0.18);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.48);
}

.admin-panel {
  position: sticky;
  top: 20px;
}

.admin-panel h2 {
  font-size: 20px;
  margin-bottom: 10px;
}

.avatar-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(23, 32, 42, 0.05);
}

.people {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.person {
  display: grid;
  grid-template-columns: auto minmax(0, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(23, 32, 42, 0.05);
}

.person strong,
.person span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delete-user {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: rgba(180, 35, 24, 0.09);
  color: #b42318;
  font-size: 22px;
  line-height: 1;
}

.delete-user:hover {
  background: #b42318;
  color: white;
}

.composer {
  position: fixed;
  left: 28px;
  right: 28px;
  bottom: 24px;
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 54px;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow);
}

.composer textarea {
  min-height: 54px;
  max-height: 170px;
  border-radius: 18px;
  font-size: 17px;
  line-height: 1.35;
  padding-top: 14px;
  padding-bottom: 14px;
  resize: none;
}

.composer select {
  min-height: 54px;
}

@media (max-width: 860px) {
  .shell {
    padding: 18px;
  }

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

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

  .admin-panel {
    position: static;
  }

  .composer {
    left: 12px;
    right: 12px;
    bottom: 12px;
    grid-template-columns: 1fr 54px;
    border-radius: 22px;
  }

  .composer select {
    grid-column: 1 / -1;
    order: -1;
  }

  .task-card {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .task-actions {
    grid-column: 2;
    justify-content: flex-start;
  }
}
