:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --panel: #ffffff;
  --panel-2: #eef3f0;
  --text: #202522;
  --muted: #66716b;
  --line: #dbe2dd;
  --brand: #1e6f5c;
  --brand-2: #d54732;
  --warn: #bd6b12;
  --danger: #b3261e;
  --ok: #287d3c;
  --shadow: 0 18px 48px rgba(39, 48, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

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

button {
  border: 0;
  cursor: pointer;
}

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

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

.login-panel h1,
.view-head h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}

.login-panel p,
.muted {
  color: var(--muted);
}

.field {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

textarea {
  min-height: 90px;
  resize: vertical;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 248px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px;
  background: #17231f;
  color: #f6faf7;
}

.brand {
  display: grid;
  gap: 4px;
  padding: 8px 10px 18px;
}

.brand strong {
  font-size: 20px;
}

.brand span {
  color: #b9c8c0;
  font-size: 13px;
}

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

.nav button {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 6px;
  background: transparent;
  color: #dce7e1;
  text-align: left;
}

.nav button.active,
.nav button:hover {
  background: #263832;
  color: #fff;
}

.main {
  min-width: 0;
  padding: 24px;
}

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

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  white-space: nowrap;
}

.btn.secondary {
  background: var(--panel-2);
  color: var(--text);
}

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

.btn.small {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 13px;
}

.grid {
  display: grid;
  gap: 14px;
}

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

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric {
  min-height: 112px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 26px;
  line-height: 1.1;
}

.panel {
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  background: #f0f4f1;
  color: #46504a;
  font-size: 12px;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--panel-2);
  color: #2b3530;
  font-size: 12px;
}

.badge.ok {
  background: #e3f2e7;
  color: var(--ok);
}

.badge.warn {
  background: #fff1dc;
  color: var(--warn);
}

.badge.danger {
  background: #fde8e6;
  color: var(--danger);
}

.kanban {
  display: grid;
  grid-template-columns: repeat(6, minmax(220px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.column {
  min-height: 360px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #edf2ef;
}

.column.drop-target {
  border-color: var(--brand);
  background: #e6f2ee;
}

.column h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.task-card {
  position: relative;
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--season-soft, transparent);
}

.task-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 6px 0 0 6px;
  background: var(--season-accent, var(--brand));
}

.task-card.dragging {
  opacity: 0.55;
  transform: rotate(1deg);
}

.task-card strong {
  line-height: 1.25;
}

.task-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.task-season-dot {
  flex: none;
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 999px;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.column-empty {
  margin: 0;
  padding: 8px 2px;
}

.season-list {
  display: grid;
  gap: 6px;
  min-width: 180px;
}

.season-list-item {
  display: grid;
  gap: 4px;
}

.season-list-item strong {
  line-height: 1.25;
}

.season-list-item span {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 30;
  padding: 18px;
  background: rgba(16, 24, 20, 0.45);
}

.modal {
  width: min(860px, 100%);
  max-height: 92vh;
  overflow: auto;
  padding: 18px;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.task-modal {
  display: grid;
  gap: 14px;
}

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

.task-modal-head h2 {
  margin: 0 0 8px;
}

.task-modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 14px;
}

.task-modal-side {
  min-width: 0;
}

.task-modal-comments {
  display: grid;
  align-content: start;
}

.task-block {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.task-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.task-block-head h3 {
  margin: 0;
  font-size: 15px;
}

.checklist-list,
.comment-thread {
  display: grid;
  gap: 8px;
}

.checklist-item {
  display: grid;
  grid-template-columns: 18px 1fr 26px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.checklist-item.done span {
  color: var(--muted);
  text-decoration: line-through;
}

.checklist-item input {
  width: 16px;
  min-height: 16px;
  padding: 0;
}

.checklist-add {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.icon-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: #edf2ef;
  color: var(--muted);
}

.comment-item {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.comment-meta {
  color: var(--muted);
  font-size: 12px;
}

.modal h2 {
  margin: 0 0 12px;
}

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

.span-2 {
  grid-column: span 2;
}

.error {
  margin-top: 10px;
  color: var(--danger);
}

.analysis-box {
  max-height: 420px;
  overflow: auto;
  padding: 14px;
  border: 1px solid #d9e4df;
  border-radius: 8px;
  background: #fbfdfb;
  white-space: pre-wrap;
  line-height: 1.5;
}

.feedback-hero {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.feedback-score,
.feedback-insight {
  min-height: 170px;
  padding: 18px;
  border: 1px solid #d8e4de;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbf9 100%);
  box-shadow: 0 10px 28px rgba(39, 48, 42, 0.07);
}

.feedback-score span,
.feedback-insight span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.feedback-score strong {
  display: block;
  margin-top: 12px;
  color: #17231f;
  font-size: 44px;
  line-height: 1;
}

.feedback-score small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.nps-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.feedback-insight {
  display: grid;
  align-content: space-between;
  background: #f7fbf8;
}

.feedback-insight strong {
  font-size: 18px;
  line-height: 1.35;
}

.feedback-insight.risk {
  background: #fff8ef;
}

.score-track,
.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5ece8;
}

.score-track {
  margin-top: 16px;
  box-shadow: inset 0 0 0 1px rgba(23, 35, 31, 0.04);
}

.score-track i,
.bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

.score-track.accent i {
  background: var(--brand-2);
}

.analytics-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}

.aspect-chart {
  display: grid;
  gap: 10px;
}

.aspect-bar {
  display: grid;
  gap: 8px;
  padding: 11px 12px;
  border: 1px solid #e1e8e4;
  border-radius: 8px;
  background: #fbfdfb;
}

.aspect-bar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

.aspect-bar-head span {
  color: var(--muted);
  font-weight: 700;
}

.bar-track i.good {
  background: var(--ok);
}

.bar-track i.risk {
  background: var(--danger);
}

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

.feedback-bucket {
  min-height: 210px;
  padding: 16px;
  border: 1px solid #dce7e1;
  border-radius: 8px;
  background: #fbfdfb;
}

.feedback-bucket-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.feedback-bucket-head h3 {
  margin: 0;
  font-size: 17px;
}

.feedback-bucket-head span {
  display: inline-grid;
  min-width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.quote-list {
  display: grid;
  gap: 8px;
}

.quote-list p {
  margin: 0;
  padding: 11px 12px;
  border-left: 3px solid var(--brand);
  border-radius: 6px;
  background: #fff;
  line-height: 1.45;
}

.compact-stats {
  margin-top: 0;
}

.price-verdict {
  margin: 12px 0 0;
  padding: 13px 14px;
  border: 1px solid #d7e5df;
  border-radius: 8px;
  background: #f7fbf8;
  line-height: 1.45;
}

.distribution-list,
.theme-list,
.recommendation-list {
  display: grid;
  gap: 12px;
}

.distribution-row {
  display: grid;
  grid-template-columns: minmax(220px, 0.64fr) minmax(0, 1.36fr);
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid #dce7e1;
  border-radius: 8px;
  background: #fbfdfb;
}

.distribution-row.warn {
  border-color: #efc27a;
  background: #fffaf1;
}

.distribution-row.danger {
  border-color: #e4a19b;
  background: #fff6f5;
}

.distribution-main {
  display: grid;
  gap: 5px;
}

.distribution-main strong {
  font-size: 15px;
}

.distribution-main span,
.theme-item span {
  color: var(--muted);
  font-size: 13px;
}

.distribution-bars {
  display: grid;
  gap: 8px;
}

.score-bucket {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}

.score-bucket span,
.score-bucket b {
  color: var(--muted);
  font-weight: 700;
}

.mini-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eee9;
}

.mini-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

.score-bucket.excellent .mini-track i {
  background: #1b7f4f;
}

.score-bucket.good .mini-track i {
  background: #57a66a;
}

.score-bucket.ok .mini-track i {
  background: #8bb66f;
}

.score-bucket.warn .mini-track i {
  background: var(--warn);
}

.score-bucket.risk .mini-track i {
  background: var(--danger);
}

.theme-item {
  display: grid;
  gap: 9px;
  padding: 13px;
  border: 1px solid #dce7e1;
  border-radius: 8px;
  background: #fbfdfb;
}

.theme-item div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.theme-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.quote-highlights {
  display: grid;
  gap: 14px;
}

.quote-highlights article {
  display: grid;
  gap: 8px;
}

.quote-highlights h3 {
  margin: 0;
  font-size: 15px;
  color: #35443d;
}

.quote-highlights p {
  margin: 0;
  padding: 11px 12px;
  border-left: 3px solid var(--brand-2);
  border-radius: 6px;
  background: #fff;
  line-height: 1.45;
}

.recommendation-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  counter-reset: recommendations;
}

.recommendation-list li {
  position: relative;
  padding: 13px 14px 13px 48px;
  border: 1px solid #dce7e1;
  border-radius: 8px;
  background: #fbfdfb;
  line-height: 1.45;
  counter-increment: recommendations;
}

.recommendation-list li::before {
  content: counter(recommendations);
  position: absolute;
  left: 14px;
  top: 13px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: #17231f;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4,
  .feedback-hero,
  .analytics-layout,
  .feedback-buckets,
  .distribution-row,
  .filters,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }

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

@media (max-width: 620px) {
  .main {
    padding: 16px;
  }

  .topbar,
  .view-head {
    display: grid;
  }

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