:root {
  --fb-bg: #f3f6fa;
  --fb-panel: #ffffff;
  --fb-panel-soft: #eef4fa;
  --fb-ink: #152131;
  --fb-muted: #637386;
  --fb-line: #d6e0ea;
  --fb-accent: #c92435;
  --fb-accent-strong: #9f1f2b;
  --fb-blue: #176fd3;
  --fb-green: #13835c;
  --fb-amber: #ad6a00;
  --fb-cyan: #087f9b;
  --fb-violet: #6953c7;
  --fb-orange: #c45a14;
  --fb-shadow: 0 16px 48px rgba(28, 42, 60, 0.12);
}

* {
  box-sizing: border-box;
}

body.feedback-app {
  margin: 0;
  min-height: 100vh;
  color: var(--fb-ink);
  background:
    linear-gradient(180deg, #eef4fb 0, var(--fb-bg) 260px),
    var(--fb-bg);
  font-family: "DM Sans", "Segoe UI", sans-serif;
}

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

.feedback-shell {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  min-height: 100vh;
}

.feedback-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 16px;
  border-right: 1px solid #cfdce8;
  background:
    linear-gradient(180deg, #ffffff 0%, #f7fbff 58%, #eef5fb 100%);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 18px;
}

.feedback-brand {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(23, 111, 211, 0.14);
}

.feedback-brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(16, 62, 112, 0.22);
}

.feedback-nav,
.feedback-board-list,
.feedback-list {
  display: grid;
  gap: 8px;
}

.feedback-nav button,
.feedback-board-button {
  width: 100%;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--fb-muted);
  text-align: left;
  padding: 9px 11px 9px 13px;
  cursor: pointer;
  font-weight: 700;
  position: relative;
}

.feedback-nav button:hover,
.feedback-board-button:hover,
.feedback-nav button.is-active,
.feedback-board-button.is-active {
  background: #ffffff;
  border-color: #c9d9e8;
  color: var(--fb-ink);
  box-shadow: 0 8px 24px rgba(24, 61, 102, 0.08);
}

.feedback-nav button.is-active::before,
.feedback-board-button.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 999px;
  background: var(--category-color, var(--fb-blue));
}

.feedback-board-button {
  display: grid;
  gap: 3px;
}

.feedback-board-button--all {
  --category-color: var(--fb-blue);
}

.feedback-board-button span {
  font-size: 12px;
  font-weight: 600;
  color: var(--fb-muted);
}

.feedback-user-card {
  border: 1px solid #cbdbe8;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f2f8fc 100%);
  padding: 12px;
  display: grid;
  gap: 10px;
  box-shadow: 0 10px 28px rgba(27, 58, 92, 0.08);
}

.feedback-user-card strong,
.feedback-user-card span {
  display: block;
}

.feedback-user-card span {
  margin-top: 2px;
  color: var(--fb-muted);
  font-size: 13px;
}

.feedback-login-link,
.feedback-primary,
.feedback-secondary,
.feedback-icon-button {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid var(--fb-line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 800;
}

.feedback-login-link,
.feedback-secondary {
  background: #fff;
  color: var(--fb-ink);
}

.feedback-primary {
  border-color: var(--fb-accent);
  background: var(--fb-accent);
  color: #fff;
}

.feedback-primary:hover {
  border-color: var(--fb-accent-strong);
  background: var(--fb-accent-strong);
}

.feedback-secondary:hover,
.feedback-login-link:hover {
  background: var(--fb-panel-soft);
}

.feedback-actions .feedback-secondary:nth-of-type(2) {
  border-color: #bdd8f6;
  color: #115fae;
  background: #f1f7ff;
}

.feedback-actions .feedback-secondary:nth-of-type(3) {
  border-color: #c7e3db;
  color: #0f7656;
  background: #effaf6;
}

.feedback-actions .feedback-secondary:nth-of-type(4) {
  border-color: #e8d2ae;
  color: #91520a;
  background: #fff7eb;
}

.feedback-main {
  min-width: 0;
  padding: 28px clamp(18px, 4vw, 46px) 42px;
  display: grid;
  align-content: start;
  gap: 18px;
}

.feedback-topbar,
.feedback-section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.feedback-kicker {
  margin: 0 0 4px;
  color: var(--fb-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.feedback-topbar h1,
.feedback-section-head h2 {
  margin: 0;
  line-height: 1.1;
}

.feedback-topbar h1 {
  font-size: clamp(28px, 4vw, 42px);
  color: #101b2b;
}

.feedback-topbar-copy {
  margin: 8px 0 0;
  max-width: 680px;
  color: var(--fb-muted);
  line-height: 1.45;
}

.feedback-actions {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 1080px;
}

.feedback-search {
  display: grid;
  gap: 5px;
  color: var(--fb-muted);
  font-size: 12px;
  font-weight: 800;
}

.feedback-search input {
  width: min(360px, 52vw);
  min-height: 40px;
  border: 1px solid var(--fb-line);
  border-radius: 8px;
  background: #fff;
  color: var(--fb-ink);
  padding: 0 12px;
  box-shadow: 0 1px 0 rgba(18, 41, 67, 0.03);
}

.feedback-view {
  display: none;
}

.feedback-view.is-active {
  display: grid;
  gap: 14px;
}

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

.feedback-filterbar select,
.feedback-form select,
.feedback-form input,
.feedback-form textarea,
.feedback-moderation select {
  min-height: 40px;
  border: 1px solid var(--fb-line);
  border-radius: 8px;
  background: #fff;
  color: var(--fb-ink);
  padding: 0 10px;
  box-shadow: 0 1px 0 rgba(18, 41, 67, 0.03);
}

.feedback-form :is(select, input, textarea):focus,
.feedback-moderation select:focus,
.feedback-comment-form textarea:focus {
  outline: 2px solid rgba(21, 33, 49, 0.16);
  outline-offset: 2px;
  border-color: #aebdcc;
}

.feedback-item,
.roadmap-card {
  border: 1px solid var(--fb-line);
  border-radius: 8px;
  background: var(--fb-panel);
  box-shadow: 0 10px 28px rgba(26, 54, 87, 0.06);
}

.feedback-item {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
  border-left-color: var(--fb-line);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.feedback-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(28, 56, 88, 0.1);
}

.feedback-vote {
  border: none;
  border-right: 1px solid var(--fb-line);
  background: #f5f7fa;
  color: #536274;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  cursor: pointer;
  font-weight: 800;
}

.feedback-vote.is-voted {
  color: #152131;
  background: #eef2f6;
  box-shadow: inset 0 0 0 1px #cbd6e2;
}

.feedback-vote span {
  display: block;
  font-size: 11px;
}

.feedback-item-main {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.feedback-item-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.feedback-item-title button {
  all: unset;
  cursor: pointer;
}

.feedback-item-title button:hover {
  color: var(--fb-accent);
}

.feedback-item p {
  margin: 0;
  color: var(--fb-muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.feedback-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.feedback-pill {
  border: 1px solid var(--fb-line);
  border-radius: 999px;
  background: #fff;
  color: var(--fb-muted);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
}

.feedback-pill-internal-priority {
  color: #39475a;
  background: #eef1f5;
  border-color: #ccd5df;
}

.feedback-pill.status-planned,
.feedback-pill.status-in_progress {
  color: var(--fb-blue);
  background: #eef6ff;
  border-color: #c8ddf6;
}

.feedback-pill.status-published,
.feedback-pill.status-released,
.feedback-pill.status-completed {
  color: var(--fb-green);
  background: #ecfaf4;
  border-color: #bee7d3;
}

.feedback-pill.status-pending,
.feedback-pill.status-under_review,
.feedback-pill.status-in_test {
  color: var(--fb-amber);
  background: #fff7e8;
  border-color: #ead29e;
}

.feedback-pill.status-rejected,
.feedback-pill.status-private,
.feedback-pill.status-archived,
.feedback-pill.priority-critical {
  color: var(--fb-accent);
  background: #fff1f2;
  border-color: #f2c6cc;
}

.feedback-pill.priority-high {
  color: var(--fb-amber);
  background: #fff7e8;
  border-color: #ead29e;
}

.roadmap-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.roadmap-column {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 10px;
}

.roadmap-column-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--fb-line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f5f9fd 100%);
  padding: 12px;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(24, 61, 102, 0.06);
}

.roadmap-card {
  padding: 12px;
  display: grid;
  gap: 8px;
  border-left: 4px solid var(--category-color, var(--fb-blue));
}

.category-bug {
  --category-color: #ca2439;
  --category-soft: #fff1f3;
}

.category-miglioramento {
  --category-color: #176fd3;
  --category-soft: #eef6ff;
}

.category-ui {
  --category-color: #c45a14;
  --category-soft: #fff3e8;
}

.category-dati-co {
  --category-color: #13835c;
  --category-soft: #ecfaf4;
}

.category-altro {
  --category-color: #5f7187;
  --category-soft: #f3f6f9;
}

.roadmap-card strong {
  overflow-wrap: anywhere;
}

.feedback-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 18px;
}

.feedback-modal[hidden] {
  display: none;
}

.feedback-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 30, 45, 0.55);
}

.feedback-modal-panel {
  position: relative;
  width: min(760px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  border: 1px solid var(--fb-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--fb-shadow);
}

.feedback-detail-panel {
  width: min(920px, calc(100vw - 24px));
}

.feedback-modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  border-bottom: 1px solid var(--fb-line);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.feedback-modal-head h2 {
  margin: 0;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.feedback-icon-button {
  width: 40px;
  padding: 0;
}

.feedback-form,
.feedback-detail-body {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.feedback-form label {
  display: grid;
  gap: 6px;
  color: var(--fb-muted);
  font-size: 13px;
  font-weight: 800;
}

.feedback-form textarea {
  padding: 10px;
  resize: vertical;
}

.feedback-privacy-check {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
}

.feedback-privacy-check input {
  margin-top: 3px;
}

.plain-button {
  all: unset;
  cursor: pointer;
}

.plain-button:hover {
  color: var(--fb-accent);
}

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

.feedback-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.feedback-message {
  min-height: 20px;
  margin: 0;
  color: var(--fb-muted);
}

.feedback-message.is-error {
  color: var(--fb-accent);
}

.feedback-detail-copy {
  white-space: pre-wrap;
  line-height: 1.55;
  color: #26384d;
}

.feedback-comments {
  border-top: 1px solid var(--fb-line);
  padding-top: 12px;
  display: grid;
  gap: 10px;
}

.feedback-comment {
  border: 1px solid var(--fb-line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 10px;
  display: grid;
  gap: 6px;
}

.feedback-comment.is-staff-reply {
  background: #fff8e8;
  border-color: #edd69f;
}

.feedback-comment.is-internal-note {
  background: #f1f3f6;
  border-color: #cfd7e1;
  color: #243244;
}

.feedback-internal-label {
  width: fit-content;
  border: 1px solid #c4cdd8;
  border-radius: 999px;
  background: #e7ebf0;
  color: #3e4c5f;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 800;
}

.feedback-comment-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--fb-muted);
  font-size: 12px;
  font-weight: 800;
}

.feedback-comment-form {
  display: grid;
  gap: 8px;
}

.feedback-comment-form textarea {
  min-height: 96px;
  border: 1px solid var(--fb-line);
  border-radius: 8px;
  padding: 10px;
  resize: vertical;
}

.feedback-attachments-field {
  display: grid;
  gap: 6px;
}

.feedback-attachments-field input[type="file"] {
  border: 1px solid var(--fb-line);
  border-radius: 8px;
  background: #fff;
  color: var(--fb-muted);
  min-height: auto;
  padding: 9px 10px;
}

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

.feedback-attachments a {
  display: block;
  width: 112px;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--fb-line);
  border-radius: 8px;
  overflow: hidden;
  background: #eef2f6;
}

.feedback-attachments img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.feedback-moderation {
  border: 1px solid var(--fb-line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 10px;
  display: flex;
  gap: 8px;
  align-items: end;
  flex-wrap: wrap;
}

.feedback-empty {
  border: 1px dashed var(--fb-line);
  border-radius: 8px;
  background: #fff;
  padding: 22px;
  color: var(--fb-muted);
  text-align: center;
}

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

  .feedback-sidebar {
    position: static;
    height: auto;
    grid-template-rows: auto;
  }

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

  .feedback-topbar,
  .feedback-section-head {
    align-items: start;
    flex-direction: column;
  }

  .feedback-actions {
    width: 100%;
    justify-content: stretch;
  }

  .feedback-search,
  .feedback-search input,
  .feedback-actions .feedback-primary {
    width: 100%;
  }

  .roadmap-columns,
  .feedback-form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .feedback-main {
    padding: 18px 12px 28px;
  }

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

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

  .feedback-vote {
    border-right: none;
    border-bottom: 1px solid var(--fb-line);
    min-height: 54px;
    grid-auto-flow: column;
  }
}
