:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background:
    radial-gradient(circle at 14% 18%, rgba(83, 164, 255, 0.34), transparent 30%),
    radial-gradient(circle at 82% 12%, rgba(255, 129, 202, 0.38), transparent 32%),
    linear-gradient(135deg, #f8fbff 0%, #dfeeff 42%, #ffe4f5 100%);
  color: #172033;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.14)),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.16) 0,
      rgba(255, 255, 255, 0.16) 1px,
      transparent 1px,
      transparent 84px
    );
}

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

button {
  cursor: pointer;
}

.page-shell {
  width: min(1480px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

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

.eyebrow {
  margin: 0 0 4px;
  color: #4b6f9f;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: #172033;
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 800;
  line-height: 1.05;
}

.glass-panel {
  border: 1px solid rgba(255, 255, 255, 0.62);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.42)),
    linear-gradient(135deg, rgba(82, 149, 255, 0.16), rgba(255, 124, 203, 0.12));
  box-shadow:
    0 24px 70px rgba(64, 101, 154, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(24px) saturate(130%);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 220px 180px 180px;
  gap: 14px;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.tab-bar {
  display: inline-flex;
  gap: 8px;
  padding: 8px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.tab-button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 18px;
  background: rgba(255, 255, 255, 0.42);
  color: #35445d;
  font-weight: 800;
}

.tab-button.active {
  border-color: rgba(50, 121, 255, 0.3);
  background: linear-gradient(135deg, rgba(58, 134, 255, 0.86), rgba(255, 112, 190, 0.78));
  color: #ffffff;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: #4b5c77;
  font-size: 12px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(109, 136, 180, 0.25);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.72);
  color: #172033;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(49, 116, 255, 0.64);
  box-shadow: 0 0 0 3px rgba(71, 141, 255, 0.18);
}

.table-card {
  overflow: hidden;
  border-radius: 8px;
}

.table-scroller {
  overflow-x: auto;
}

.task-table {
  width: var(--table-min-width, 1716px);
  min-width: var(--table-min-width, 1716px);
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

th,
td {
  border-bottom: 1px solid rgba(107, 132, 172, 0.16);
  padding: 10px;
  text-align: left;
  vertical-align: middle;
}

th[data-column="project"],
td[data-column="project"] {
  width: var(--col-project, 134px);
}

th.progress-column,
td.progress-column {
  position: sticky;
  left: 0;
  z-index: 2;
  width: var(--col-progress, 42px);
  min-width: var(--col-progress, 42px);
  padding-inline: 12px 8px;
  background: rgba(248, 251, 255, 0.94);
}

th.progress-column {
  z-index: 4;
}

th[data-column="title"],
td[data-column="title"] {
  width: var(--col-title, 130px);
}

th[data-column="document"],
td[data-column="document"] {
  width: var(--col-document, 122px);
}

th[data-column="test_document"],
td[data-column="test_document"] {
  width: var(--col-test_document, 122px);
}

th[data-column="developer"],
td[data-column="developer"] {
  width: var(--col-developer, 122px);
}

th[data-column="branch"],
td[data-column="branch"] {
  width: var(--col-branch, 122px);
}

th[data-column="summary"],
td[data-column="summary"] {
  width: var(--col-summary, 200px);
}

th[data-column="images"],
td[data-column="images"] {
  width: var(--col-images, 200px);
}

th[data-column="status"],
td[data-column="status"] {
  width: var(--col-status, 110px);
}

th[data-column="quantity"],
td[data-column="quantity"] {
  width: var(--col-quantity, 110px);
}

th[data-column="proposed_date"],
td[data-column="proposed_date"] {
  width: var(--col-proposed_date, 156px);
}

th[data-column="deadline_date"],
td[data-column="deadline_date"] {
  width: var(--col-deadline_date, 156px);
}

th[data-column="modified_date"],
td[data-column="modified_date"] {
  width: var(--col-modified_date, 156px);
}

th[data-column="accepted_date"],
td[data-column="accepted_date"] {
  width: var(--col-accepted_date, 156px);
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(247, 251, 255, 0.86);
  color: #35445d;
  font-size: 13px;
  font-weight: 800;
  user-select: none;
}

th[data-column],
th.actions-column,
th.progress-column {
  overflow: visible;
}

th.sorted {
  color: #245cc7;
}

.header-cell-content {
  display: grid;
  grid-template-columns: 18px minmax(0, max-content) 14px;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  min-height: 20px;
  white-space: nowrap;
}

.action-header-content {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.action-header-content .header-label {
  overflow: visible;
  text-overflow: clip;
}

.header-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.resize-handle {
  position: absolute;
  top: 0;
  right: -4px;
  z-index: 5;
  display: block;
  width: 8px;
  height: 100%;
  background: rgba(255, 255, 255, 0.01);
  cursor: col-resize;
  pointer-events: auto;
  touch-action: none;
}

.resize-handle::after {
  position: absolute;
  top: 20%;
  right: 3px;
  width: 2px;
  height: 60%;
  border-radius: 999px;
  background: rgba(72, 103, 152, 0.24);
  content: "";
}

.resize-handle:hover::after {
  background: rgba(49, 116, 255, 0.62);
}

tbody tr {
  background: rgba(255, 255, 255, 0.38);
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.62);
}

tbody tr.concluded-row {
  background: rgba(226, 232, 240, 0.7);
  color: #718096;
}

tbody tr.concluded-row:hover {
  background: rgba(219, 226, 237, 0.78);
}

tbody tr.concluded-row td:not(.actions-column) {
  opacity: 0.76;
}

tbody tr.concluded-row .status-pill,
tbody tr.concluded-row .progress-dot {
  filter: grayscale(0.72);
  opacity: 0.72;
}

tbody td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editing-row {
  background: rgba(255, 255, 255, 0.74);
}

.actions-column {
  position: sticky;
  right: 0;
  z-index: 2;
  width: var(--col-actions, 84px);
  min-width: var(--col-actions, 84px);
  background: rgba(248, 251, 255, 0.96);
  box-shadow: -10px 0 22px rgba(66, 98, 142, 0.08);
}

tbody td.actions-column {
  overflow: visible;
  text-overflow: clip;
}

th.actions-column {
  z-index: 3;
}

.drag-handle {
  display: inline-flex;
  width: 18px;
  justify-content: center;
  color: #8ba1c4;
  line-height: 1;
}

.sort-indicator {
  display: inline-flex;
  width: 14px;
  justify-content: center;
  color: #245cc7;
  line-height: 1;
}

.icon-button,
.ghost-button,
.solid-button,
.danger-button {
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.58);
  color: #223250;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.icon-button {
  width: 48px;
  height: 48px;
  font-size: 28px;
  line-height: 1;
}

.primary,
.solid-button {
  border-color: rgba(50, 121, 255, 0.3);
  background: linear-gradient(135deg, rgba(58, 134, 255, 0.86), rgba(255, 112, 190, 0.78));
  color: white;
}

.danger-button {
  border-color: rgba(217, 73, 100, 0.2);
  background: rgba(255, 230, 237, 0.82);
  color: #ad2541;
}

.edit-actions {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 4px;
  width: 100%;
  align-items: center;
  min-width: 0;
}

.edit-actions .solid-button,
.edit-actions .ghost-button,
.edit-actions .danger-button {
  width: 100%;
  min-height: 32px;
  padding: 6px 8px;
}

.row-action-menu {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
}

.action-menu-button {
  width: 100%;
  padding-inline: 6px;
}

.edit-field-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  display: grid;
  width: 168px;
  max-height: 260px;
  gap: 4px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 10px;
  padding: 8px;
  background: rgba(249, 252, 255, 0.9);
  box-shadow:
    0 18px 42px rgba(62, 91, 139, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(20px) saturate(1.18);
}

.edit-field-menu button {
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  background: transparent;
  color: #253653;
  font: inherit;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.edit-field-menu button:hover {
  background: linear-gradient(135deg, rgba(58, 134, 255, 0.15), rgba(255, 112, 190, 0.16));
  color: #245cc7;
}

.project-editor,
.document-editor {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.upload-picker {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.upload-picker > .upload-input[type="file"] {
  position: absolute;
  width: 1px;
  min-width: 1px;
  max-width: 1px;
  height: 1px;
  min-height: 1px;
  margin: 0;
  border: 0;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  opacity: 0;
  white-space: nowrap;
}

.upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border: 1px solid rgba(50, 121, 255, 0.26);
  border-radius: 8px;
  padding: 7px 10px;
  background:
    linear-gradient(135deg, rgba(58, 134, 255, 0.86), rgba(255, 112, 190, 0.78)),
    rgba(255, 255, 255, 0.66);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  box-shadow:
    0 8px 18px rgba(68, 106, 169, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.64);
}

.upload-file-name {
  min-width: 0;
  overflow: hidden;
  color: #53637d;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-picker:focus-within .upload-button {
  box-shadow:
    0 0 0 3px rgba(71, 141, 255, 0.2),
    0 8px 18px rgba(68, 106, 169, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.64);
}

.image-strip,
.image-editor-list {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 180px;
  overflow: hidden;
}

.image-thumb {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 48px;
  overflow: hidden;
  border: 1px solid rgba(109, 136, 180, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 20px;
  min-height: 20px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: rgba(173, 37, 65, 0.86);
  color: #ffffff;
  font-size: 12px;
  line-height: 20px;
}

.paste-zone {
  min-height: 54px;
  border: 1px dashed rgba(49, 116, 255, 0.42);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.5);
  color: #52627c;
  font-size: 13px;
}

.paste-zone:focus {
  border-color: rgba(49, 116, 255, 0.72);
  box-shadow: 0 0 0 3px rgba(71, 141, 255, 0.16);
  outline: none;
}

.doc-link {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  color: #245cc7;
  font-weight: 700;
  text-overflow: ellipsis;
  text-decoration: none;
  vertical-align: middle;
}

.doc-link:hover {
  text-decoration: underline;
}

.readonly-date {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  max-width: 100%;
  border: 1px solid rgba(129, 151, 186, 0.18);
  border-radius: 8px;
  padding: 7px 10px;
  overflow: hidden;
  background: rgba(226, 232, 240, 0.5);
  color: #64748b;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-title-button {
  display: inline-block;
  max-width: 100%;
  min-height: 0;
  border: 0;
  padding: 0;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
  color: #245cc7;
  font-weight: 800;
  line-height: 1.4;
  text-align: left;
  text-overflow: ellipsis;
  text-decoration: none;
  vertical-align: middle;
  white-space: nowrap;
}

.task-title-button:hover {
  text-decoration: underline;
}

.progress-cell {
  text-align: center;
}

.progress-dot {
  display: inline-flex;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  box-shadow:
    0 6px 16px rgba(49, 78, 122, 0.22),
    0 0 0 3px rgba(255, 255, 255, 0.46);
}

.progress-confirm {
  background: linear-gradient(135deg, #8ea4c9, #c3d1ea);
}

.progress-dev {
  background: linear-gradient(135deg, #3a86ff, #7eb7ff);
}

.progress-test {
  background: linear-gradient(135deg, #ff70be, #a98bff);
}

.progress-done {
  background: linear-gradient(135deg, #30b27e, #8de3bd);
}

.progress-maintain {
  background: linear-gradient(135deg, #f0a43a, #ffd27a);
}

.status-pill {
  display: inline-flex;
  min-width: 54px;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
}

.status-confirm {
  background: rgba(107, 132, 172, 0.16);
  color: #53647f;
}

.status-dev {
  background: rgba(71, 141, 255, 0.16);
  color: #245cc7;
}

.status-test {
  background: rgba(255, 185, 73, 0.2);
  color: #8a5b00;
}

.status-done {
  background: rgba(48, 178, 126, 0.18);
  color: #11734b;
}

.status-maintain {
  background: rgba(245, 158, 11, 0.18);
  color: #9a5b00;
}

.developer-pending-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  background: rgba(245, 158, 11, 0.2);
  color: #9a5b00;
  font-size: 12px;
  font-weight: 800;
}

.muted {
  color: #71829f;
}

.loading,
.empty-cell {
  padding: 42px 20px;
  color: #5c6b82;
  text-align: center;
}

.comment-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(20, 31, 52, 0.22);
  backdrop-filter: blur(10px);
}

.comment-modal {
  display: flex;
  flex-direction: column;
  width: min(680px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 48px));
  overflow: hidden;
  border-radius: 8px;
}

.comment-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(107, 132, 172, 0.16);
  padding: 18px;
}

.comment-kicker {
  margin: 0 0 4px;
  color: #4b6f9f;
  font-size: 12px;
  font-weight: 800;
}

.comment-modal h2 {
  margin: 0;
  color: #172033;
  font-size: 22px;
  line-height: 1.25;
}

.comment-close {
  flex: 0 0 auto;
}

.comment-list {
  display: grid;
  gap: 10px;
  min-height: 160px;
  overflow-y: auto;
  padding: 16px 18px;
}

.comment-empty {
  display: grid;
  min-height: 130px;
  place-items: center;
  color: #71829f;
  font-weight: 700;
}

.comment-item {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.66);
}

.comment-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #52627c;
  font-size: 12px;
}

.comment-meta strong {
  color: #223250;
  font-size: 14px;
}

.comment-item p {
  margin: 0;
  color: #223250;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: normal;
}

.comment-actions,
.comment-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.comment-form {
  display: grid;
  gap: 10px;
  border-top: 1px solid rgba(107, 132, 172, 0.16);
  padding: 16px 18px 18px;
  background: rgba(255, 255, 255, 0.4);
}

.editing-comment textarea,
.comment-form textarea {
  min-height: 92px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: min(360px, calc(100vw - 48px));
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: #172033;
  box-shadow: 0 18px 50px rgba(49, 78, 122, 0.2);
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  color: #ad2541;
}

@media (max-width: 780px) {
  .page-shell {
    width: min(100vw - 20px, 1480px);
    padding: 20px 0;
  }

  .page-header {
    align-items: flex-start;
  }

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

  th,
  td {
    padding: 10px;
  }
}
