@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Sora:wght@600;700;800&display=swap");

:root {
  --bg-main: #eef3f8;
  --bg-secondary: #e3ebf5;
  --ink: #192536;
  --ink-muted: #5f6f84;
  --panel: rgba(255, 255, 255, 0.83);
  --panel-strong: #ffffff;
  --line: #d5e0ee;
  --brand: #0e7a71;
  --brand-2: #0d5f88;
  --brand-soft: #d9f2ee;
  --danger-soft: #f8e2dc;
  --danger-ink: #8f2f24;
  --warn-soft: #f4ead0;
  --warn-ink: #946a0d;
  --ok-soft: #d8ebe3;
  --ok-ink: #2f6e4d;
  --shadow-lg: 0 24px 48px -26px rgba(16, 38, 66, 0.35);
  --shadow-md: 0 16px 30px -20px rgba(16, 38, 66, 0.22);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Manrope", "Segoe UI", sans-serif;
  background:
    radial-gradient(1000px 500px at -12% -8%, #d7ecff 0%, transparent 62%),
    radial-gradient(900px 440px at 112% 6%, #f9e6cd 0%, transparent 60%),
    linear-gradient(165deg, var(--bg-main), var(--bg-secondary));
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(28, 42, 61, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28, 42, 61, 0.03) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at center, black 20%, transparent 90%);
}

.bg-shape {
  position: fixed;
  border-radius: 999px;
  filter: blur(52px);
  opacity: 0.45;
  pointer-events: none;
}

.bg-shape-a {
  width: 320px;
  height: 320px;
  background: #f2b47f;
  top: -110px;
  right: -70px;
  animation: float-a 14s ease-in-out infinite;
}

.bg-shape-b {
  width: 360px;
  height: 360px;
  background: #8ab8aa;
  left: -130px;
  bottom: -140px;
  animation: float-b 16s ease-in-out infinite;
}

.app {
  max-width: 1120px;
  margin: 0 auto;
  padding: 34px 18px 46px;
  position: relative;
  z-index: 1;
}

.topbar-main-link {
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  font-family: "Sora", "Manrope", sans-serif;
  font-size: 22px;
  letter-spacing: 0.01em;
  line-height: 1.1;
  color: #fff;
  background: linear-gradient(135deg, #1f8f56, #177846);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  box-shadow: 0 10px 18px -14px rgba(23, 120, 70, 0.9);
  text-decoration: none;
}

.topbar p {
  margin: 10px 0 0;
  max-width: 560px;
  color: var(--ink-muted);
  font-size: 16px;
  line-height: 1.5;
}

.top-menu {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(243, 248, 253, 0.72));
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
}

.top-menu-tabs {
  display: inline-flex;
  gap: 7px;
}

.top-menu-tabs button {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 16px;
  background: transparent;
  color: #41536b;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: all 0.22s ease;
}

.top-menu-tabs button:hover {
  border-color: #ccd9ea;
  background: rgba(255, 255, 255, 0.85);
  color: #243952;
}

.top-menu-tabs button.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 20px -14px rgba(15, 76, 110, 0.88);
}

.top-menu-add-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  padding: 0;
  font-size: 26px;
  line-height: 1;
  font-weight: 600;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 10px 20px -14px rgba(15, 76, 110, 0.88);
}

.top-menu-add-btn:hover {
  filter: brightness(1.07);
}

.page {
  margin-top: 8px;
}

.page[hidden] {
  display: none !important;
}

.panel {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.95), var(--panel));
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 22px;
  padding: 22px;
  margin-top: 18px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(8px);
}

.panel h2 {
  margin: 0;
  font-family: "Sora", "Manrope", sans-serif;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.page.is-active .panel {
  animation: panel-in 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.page.is-active .panel:nth-child(2) {
  animation-delay: 0.08s;
}

.page.is-active .panel:nth-child(3) {
  animation-delay: 0.14s;
}

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

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #40526a;
}

.full {
  grid-column: 1 / -1;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfdced;
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--panel-strong);
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

input::placeholder,
textarea::placeholder {
  color: #8999af;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #7dbdb7;
  box-shadow: 0 0 0 4px rgba(14, 122, 113, 0.13);
}

button {
  border: 0;
  border-radius: 11px;
  padding: 10px 15px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

#taskForm button[type="submit"],
.edit-actions button[type="submit"],
.user-form button[type="submit"] {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 12px 22px -14px rgba(13, 95, 136, 0.75);
}

.list-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.user-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.user-list {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.user-item {
  border: 1px solid #d7e3f0;
  border-radius: 14px;
  padding: 12px;
  background: #fff;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  box-shadow: 0 10px 16px -16px rgba(20, 43, 70, 0.6);
  animation: item-in 0.35s ease both;
}

.user-item-main {
  min-width: 0;
}

.user-item-name {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.user-item-meta {
  margin: 6px 0 0;
  color: var(--ink-muted);
  font-size: 13px;
}

.user-item-actions {
  display: flex;
  gap: 6px;
}

.user-action-btn {
  border: 1px solid #cfdae8;
  border-radius: 999px;
  padding: 6px 11px;
  background: #fff;
  font-size: 12px;
}

.edit-user-btn {
  color: #194f7f;
  background: #d9eafc;
}

.delete-user-btn {
  color: #7f3124;
  background: #f6dfd9;
}

.list-tools {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.filters {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.filters button {
  background: #eaf0f8;
  color: #3c4d64;
  border: 1px solid #d2dfed;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 13px;
}

.filters button.active {
  background: linear-gradient(145deg, #ea8d4d, #d7702f);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 18px -14px rgba(160, 87, 39, 0.95);
}

.task-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.task-item {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #d8e4f0;
  border-radius: 16px;
  padding: 13px 14px;
  background: #fff;
  box-shadow: 0 15px 22px -18px rgba(19, 44, 72, 0.58);
  overflow: hidden;
  animation: item-in 0.36s ease both;
}

.task-item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, #53aaa1, #3471a0);
}

.task-item:has(.priority.high)::before {
  background: linear-gradient(180deg, #cf5f44, #97351f);
}

.task-item:has(.priority.medium)::before {
  background: linear-gradient(180deg, #dcab3d, #b17c17);
}

.task-item:has(.priority.low)::before {
  background: linear-gradient(180deg, #64ad83, #3f7e5e);
}

.task-item:hover {
  border-color: #c4d5e8;
  transform: translateY(-1px);
}

.task-item.deadline-soon {
  background: #fde8e8;
  border-color: #f5c6cb;
}

.task-item.deadline-soon:hover {
  border-color: #e8a0a8;
}

.task-item.overdue {
  background: rgba(183, 28, 28, 0.08);
  border-color: #b71c1c;
}

.task-item.overdue:hover {
  border-color: #b71c1c;
}

.meta-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.priority {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: 999px;
  background: #ebf2fb;
  color: #335172;
  text-transform: uppercase;
}

.priority.high {
  background: var(--danger-soft);
  color: var(--danger-ink);
}

.priority.medium {
  background: var(--warn-soft);
  color: var(--warn-ink);
}

.priority.low {
  background: var(--ok-soft);
  color: var(--ok-ink);
}

.assignee {
  font-size: 13px;
  color: var(--ink-muted);
}

.dates {
  font-size: 12px;
  color: #6f7f93;
}

.comments-meta {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  color: #4f637b;
  background: #e9f0fb;
  border: 1px solid #d1dfef;
  border-radius: 999px;
  padding: 2px 8px;
}

.comments-meta.unread {
  color: #fff;
  background: linear-gradient(145deg, #e47f37, #cc6227);
  border-color: transparent;
  box-shadow: 0 8px 14px -10px rgba(172, 83, 30, 0.95);
}

.task-item.has-unread-comments {
  border-color: #e8b78a;
  box-shadow: 0 18px 26px -18px rgba(172, 83, 30, 0.48);
}

.title {
  margin: 9px 0 6px;
  font-family: "Sora", "Manrope", sans-serif;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.description {
  margin: 0;
  color: #4d5f76;
  line-height: 1.45;
}

.task-actions {
  min-width: 188px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 8px;
}

.status-select {
  border-radius: 10px;
  border-color: #cfdcee;
  background: #f8fbff;
  font-weight: 600;
}

.edit-btn {
  background: #deebf9;
  color: #1b4873;
}

.delete-btn {
  background: #f6ddd7;
  color: #822f22;
}

.empty {
  color: var(--ink-muted);
  border: 1px dashed #bfd0e4;
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  background: rgba(255, 255, 255, 0.7);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.metric-card {
  border: 1px solid #d7e3f0;
  border-radius: 14px;
  background: linear-gradient(160deg, #ffffff, #f6faff);
  padding: 12px;
  box-shadow: 0 10px 16px -15px rgba(15, 40, 67, 0.62);
  animation: item-in 0.35s ease both;
}

.metric-name {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.metric-stats {
  margin-top: 6px;
  color: var(--ink-muted);
  font-size: 13px;
}

.edit-dialog {
  border: 1px solid #cad8e9;
  border-radius: 16px;
  width: min(600px, calc(100vw - 24px));
  padding: 0;
  background: #fdfefe;
  box-shadow: var(--shadow-lg);
}

.create-task-dialog {
  width: min(680px, calc(100vw - 24px));
}

.edit-dialog::backdrop {
  background: rgba(15, 26, 40, 0.46);
  backdrop-filter: blur(2px);
}

.edit-form {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.edit-form h3 {
  margin: 0 0 4px;
  font-family: "Sora", "Manrope", sans-serif;
  letter-spacing: -0.02em;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-close-btn {
  border: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
  background: #e8eef6;
  color: #30455d;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.modal-close-btn:hover {
  background: #d9e4f2;
  color: #1e334b;
}

.comments-dialog {
  width: min(720px, calc(100vw - 24px));
}

.comments-list {
  max-height: 300px;
  overflow: auto;
  display: grid;
  gap: 8px;
}

.comment-item {
  border: 1px solid #d8e4f0;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}

.comment-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  color: #5f6f84;
  font-size: 12px;
}

.comment-item p {
  margin: 0;
  color: #2a4059;
  line-height: 1.45;
  white-space: pre-wrap;
}

.table-wrap,
.feeds-table-wrap,
.shopping-table-wrap {
  margin-top: 16px;
  border: 1px solid #cfddee;
  border-radius: 16px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(244, 250, 255, 0.88));
  box-shadow: 0 14px 22px -18px rgba(23, 53, 84, 0.72);
  overflow-x: auto;
}

.app-table,
.feeds-table,
.shopping-table {
  width: 100%;
  min-width: 620px;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.app-table thead th,
.feeds-table thead th,
.shopping-table thead th {
  text-align: left;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #3b5572;
  padding: 0 14px 6px;
}

.app-table tbody td,
.feeds-table tbody td,
.shopping-table tbody td {
  padding: 12px 14px;
  border-top: 1px solid #d9e6f4;
  border-bottom: 1px solid #d9e6f4;
  background: #ffffff;
  color: #2b4058;
  font-weight: 600;
}

.app-table tbody tr:nth-child(even) td,
.feeds-table tbody tr:nth-child(even) td,
.shopping-table tbody tr:nth-child(even) td {
  background: #f4f9ff;
}

.app-table tbody tr td:first-child,
.feeds-table tbody tr td:first-child,
.shopping-table tbody tr td:first-child {
  border-left: 1px solid #d9e6f4;
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}

.app-table tbody tr td:last-child,
.feeds-table tbody tr td:last-child,
.shopping-table tbody tr td:last-child {
  border-right: 1px solid #d9e6f4;
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
  white-space: nowrap;
}

.app-table tbody tr:hover td,
.feeds-table tbody tr:hover td,
.shopping-table tbody tr:hover td {
  background: #ebf4ff;
  border-color: #c8dbef;
}

.js-row-edit {
  cursor: pointer;
}

.app-table td.empty,
.feeds-table td.empty,
.shopping-table td.empty {
  background: transparent;
  border: 0;
  padding: 18px 14px;
}

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

.ghost-btn {
  background: #e8eef6;
  color: #35495f;
}

.danger-btn {
  background: linear-gradient(145deg, #c04834, #9a3323);
  color: #fff;
}

.danger-text {
  margin: 0;
  font-weight: 700;
}

.danger-note {
  margin: 0;
  color: var(--ink-muted);
}

.strategy-group {
  margin: 0;
  border: 1px solid #d6e2f0;
  border-radius: 12px;
  padding: 11px;
  display: grid;
  gap: 8px;
  background: #f9fcff;
}

.strategy-group legend {
  padding: 0 4px;
  font-weight: 700;
  font-size: 14px;
  color: #2a4059;
}

.strategy-option {
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: flex-start;
  font-size: 14px;
  font-weight: 600;
}

.strategy-option input {
  margin-top: 2px;
}

.task-list .task-item:nth-child(1),
.task-list .task-item:nth-child(2),
.task-list .task-item:nth-child(3),
.task-list .task-item:nth-child(4),
.task-list .task-item:nth-child(5),
.user-list .user-item:nth-child(1),
.user-list .user-item:nth-child(2),
.user-list .user-item:nth-child(3),
.user-list .user-item:nth-child(4),
.metrics-grid .metric-card:nth-child(1),
.metrics-grid .metric-card:nth-child(2),
.metrics-grid .metric-card:nth-child(3),
.metrics-grid .metric-card:nth-child(4) {
  animation-duration: 0.45s;
}

.task-list .task-item:nth-child(2),
.user-list .user-item:nth-child(2),
.metrics-grid .metric-card:nth-child(2) {
  animation-delay: 0.04s;
}

.task-list .task-item:nth-child(3),
.user-list .user-item:nth-child(3),
.metrics-grid .metric-card:nth-child(3) {
  animation-delay: 0.08s;
}

.task-list .task-item:nth-child(4),
.user-list .user-item:nth-child(4),
.metrics-grid .metric-card:nth-child(4) {
  animation-delay: 0.12s;
}

.topbar-links {
  display: contents;
}

.topbar-title-row {
  position: sticky;
  top: 10px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  width: fit-content;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.85), rgba(243, 248, 253, 0.72));
  backdrop-filter: blur(8px);
}

.topbar-burger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 22px;
  color: var(--ink);
  padding: 6px;
  border-radius: 10px;
  line-height: 1;
}
.topbar-burger:hover { background: rgba(0,0,0,0.06); }

.topbar-utm-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-family: "Sora", "Manrope", sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 13px;
  color: #fff;
  background: linear-gradient(135deg, #1f8f56, #177846);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  padding: 6px 12px;
  box-shadow: 0 10px 18px -14px rgba(23, 120, 70, 0.9);
}

.topbar-utm-link:hover {
  filter: brightness(1.06);
}

@media (max-width: 920px) {
  .list-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .list-tools {
    grid-template-columns: 1fr;
  }

  .task-item {
    flex-direction: column;
  }

  .task-actions {
    min-width: 188px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 8px;
  }
}

@media (max-width: 780px) {
  .topbar-burger {
    display: inline-flex;
  }

  .topbar-links {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(243, 248, 253, 0.92));
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-lg);
    z-index: 100;
  }

  .topbar-links.is-open {
    display: flex;
  }

  .topbar-links a {
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 14px;
    white-space: nowrap;
  }

  .topbar-title-row {
    width: 100%;
    position: relative;
    justify-content: flex-end;
  }

  .top-menu {
    display: flex;
    width: 100%;
    justify-content: space-between;
  }

  .top-menu-tabs {
    display: flex;
    flex: 1;
  }

  .top-menu-tabs button {
    flex: 1;
    text-align: center;
  }

  .top-menu-add-btn {
    flex: 0 0 auto;
  }

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

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

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

  .table-wrap,
  .feeds-table-wrap,
  .shopping-table-wrap {
    padding: 8px;
  }

  .app-table,
  .feeds-table,
  .shopping-table {
    min-width: 560px;
    border-spacing: 0 6px;
  }

  .app-table thead th,
  .feeds-table thead th,
  .shopping-table thead th {
    padding: 0 10px 4px;
  }

  .app-table tbody td,
  .feeds-table tbody td,
  .shopping-table tbody td {
    padding: 10px;
    font-size: 14px;
  }
}

@keyframes panel-in {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes item-in {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes float-a {
  0% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(22px, 10px, 0);
  }
  100% {
    transform: translate3d(0, 0, 0);
  }
}

@keyframes float-b {
  0% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(-24px, -12px, 0);
  }
  100% {
    transform: translate3d(0, 0, 0);
  }
}


.icon-btn { width: 40px; height: 40px; padding: 0; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn i { font-size: 18px; line-height: 1; }
.edit-btn.icon-btn { background: #deebf9; color: #1b4873; }
.delete-btn.icon-btn { background: #f6ddd7; color: #822f22; }


