/* Project list as a compact table: name, assignee, due date, priority, tags.
   Loaded after list-concept.css; the extra .list-table class wins over the older list rules. */
.list-view .list-table {
  --list-cols: minmax(320px, 1fr) 170px 140px 120px 150px;
  --list-line: #eeebf2;
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: auto;
  border: 1px solid #e8e4ef !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-shadow: none !important;
}
.list-view .list-table > * { min-width: 840px; }

.list-view .list-table .list-head { display: grid !important; grid-template-columns: var(--list-cols) !important; gap: 0 !important; min-height: 36px; margin: 0 !important; padding: 0 !important; border-bottom: 1px solid #e8e4ef !important; background: #fff !important; }
.list-view .list-table .list-head span { display: flex; align-items: center; height: 36px; padding: 0 12px; border-left: 1px solid var(--list-line); color: #6f6780 !important; font-size: 12px !important; font-weight: 500 !important; text-transform: none !important; letter-spacing: 0 !important; }
.list-view .list-table .list-head span:first-child { padding-left: 44px; border-left: 0; }

/* Sections */
.list-view .list-table .list-section { display: flex !important; align-items: center; gap: 4px; margin: 0 !important; padding: 18px 12px 6px !important; border: 0 !important; border-bottom: 1px solid #e8e4ef !important; border-radius: 0 !important; background: #fff !important; }
.list-view .list-table .list-section button[data-section-toggle] { display: flex !important; align-items: center; gap: 8px; min-height: 30px; padding: 0 6px !important; border: 0 !important; border-radius: 6px !important; background: transparent !important; box-shadow: none !important; color: #1f1b26 !important; font-size: 15px !important; font-weight: 600 !important; }
.list-view .list-table .list-section button[data-section-toggle]:hover { background: #f5f3f8 !important; }
.list-view .list-table .list-section .section-dot { display: none !important; }
.list-view .list-table .list-section small { color: #8a8299 !important; font-size: 13px !important; font-weight: 400 !important; }
.list-view .list-table .list-section-add { display: grid; place-items: center; width: 28px; height: 28px; padding: 0 !important; border: 0 !important; border-radius: 6px !important; background: transparent !important; color: #6f6780 !important; font-size: 18px !important; cursor: pointer; opacity: 0; }
.list-view .list-table .list-section:hover .list-section-add, .list-view .list-table .list-section-add:focus-visible { opacity: 1; }
.list-view .list-table .list-section-add:hover { background: #f3effc !important; color: #6a45cc !important; }

/* Rows */
.list-view .list-table .list-row { display: grid !important; grid-template-columns: var(--list-cols) !important; gap: 0 !important; column-gap: 0 !important; row-gap: 0 !important; align-items: stretch !important; min-height: 38px !important; margin: 0 !important; padding: 0 !important; border: 0 !important; border-bottom: 1px solid var(--list-line) !important; border-radius: 0 !important; background: #fff !important; box-shadow: none !important; cursor: pointer; }
.list-view .list-table .list-row:hover { background: #faf9fc !important; }
.list-view .list-table .list-row.active { background: #f4f0fc !important; }
.list-view .list-table .list-row > .list-cell { display: flex !important; align-items: center !important; gap: 8px; min-width: 0 !important; min-height: 38px; margin: 0 !important; padding: 0 12px !important; border-left: 1px solid var(--list-line); font-size: 13px !important; grid-column: auto !important; grid-row: auto !important; }
.list-view .list-table .list-row > .list-name-cell { position: relative; gap: 10px; padding-left: 14px !important; border-left: 0; }
.list-view .list-table .list-row { font-weight: 400 !important; }
.list-view .list-table .list-row .complete-circle { flex: none; margin: 0 !important; }
.list-view .list-table .list-name { min-width: 0; margin-left: -4px; padding: 2px 4px; overflow: hidden; border-radius: 4px; color: #1f1b26; font-size: 14px; font-weight: 400; white-space: nowrap; text-overflow: ellipsis; cursor: text; }
.list-view .list-table .list-name[data-list-name]:hover { box-shadow: inset 0 0 0 1px #ddd6ea; }
.list-view .list-table .list-name.editing { overflow: visible; background: #fff; box-shadow: inset 0 0 0 2px #7954d6 !important; white-space: normal; outline: 0; }
.list-view .list-table .list-row.done .list-name { color: #8c839a; }
.list-view .list-table .list-meta { display: flex; flex: none; gap: 10px; color: #8a8299; font-size: 12px; font-weight: 500; }
.list-view .list-table .list-meta span { display: inline-flex; align-items: center; gap: 3px; }
.list-view .list-table .list-meta img { opacity: .55; }
.list-view .list-table .list-details { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); pointer-events: none; box-shadow: -16px 0 12px -4px #faf9fc; padding: 3px 8px; border-radius: 6px; background: #f3effc; color: #6a45cc; font-size: 12px; font-weight: 500; white-space: nowrap; opacity: 0; }
.list-view .list-table .list-row:hover .list-details { opacity: 1; }

.list-view .list-table .list-edit-cell { cursor: pointer; }
.list-view .list-table .list-edit-cell:hover { box-shadow: inset 0 0 0 1px #ddd6ea; }
.list-view .list-table .list-edit-cell:focus-visible { outline: 2px solid #7954d6; outline-offset: -2px; }
.list-view .list-table .list-cell > span:not(.avatar):not(.task-priority-pill):not(.due-badge):not(.tag) { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.list-view .list-table .list-cell .avatar { width: 22px !important; min-width: 22px !important; height: 22px !important; flex-basis: 22px !important; font-size: 10px !important; }
.list-view .list-table .list-placeholder { color: #a29bb0; opacity: 0; }
.list-view .list-table .list-row:hover .list-placeholder, .list-view .list-table .list-edit-cell:focus-visible .list-placeholder { opacity: 1; }
.list-view .list-table .list-empty-person { flex: none; width: 22px; height: 22px; border: 1px dashed #c9c1d6; border-radius: 50%; background: url("/icons/lucide/user.svg") center / 12px no-repeat; opacity: .45; }
.list-view .list-table .list-row:hover .list-empty-person { opacity: .8; }
.list-view .list-table .list-tags-cell { gap: 4px !important; overflow: hidden; }

/* Adding tasks and columns */
.list-view .list-table .quick-task-row { display: flex !important; min-height: 36px; margin: 0 !important; padding: 0 12px 0 44px !important; border: 0 !important; border-bottom: 1px solid var(--list-line) !important; border-radius: 0 !important; background: #fff !important; box-shadow: none !important; }
.list-view .list-table .quick-task-row input { flex: 1; min-height: 36px; padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; font-size: 14px !important; }
.list-view .list-table .quick-task-row input::placeholder { color: #8a8299; }
.list-view .list-table .quick-task-row button { display: none !important; }
.list-view .list-table .list-add-section { display: block; margin: 10px 12px 14px; padding: 6px 8px; border: 0; border-radius: 6px; background: transparent; color: #6f6780; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; min-width: 0; width: max-content; }
.list-view .list-table .list-add-section:hover { background: #f3effc; color: #6a45cc; }

/* Pop-up choices for a cell */
.list-popover { position: fixed; z-index: 80; display: grid; min-width: 210px; max-width: 280px; max-height: 320px; overflow-y: auto; padding: 6px; border: 1px solid #e8e4ef; border-radius: 10px; background: #fff; box-shadow: 0 12px 32px #1d172926; }
.list-popover button { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 34px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: #24202c; font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.list-popover button:hover, .list-popover button:focus-visible { background: #f3effc; outline: 0; }
.list-popover button.current { color: #6a45cc; font-weight: 600; }
.list-popover .avatar { width: 20px !important; min-width: 20px !important; height: 20px !important; font-size: 9px !important; }
.list-popover-date { display: grid; gap: 4px; margin-top: 4px; padding: 8px 10px 4px; border-top: 1px solid #f0edf5; color: #857d92; font-size: 12px; }
.list-popover-date input { min-height: 34px; }

/* Phones: each task is a short card — name on top, assignee / due date / priority below */
@media (max-width: 760px) {
  .list-view .list-table { overflow-x: visible; }
  .list-view .list-table .list-row > .list-cell:nth-child(4) { justify-content: flex-start; }
  .list-view .list-table > * { min-width: 0 !important; }
  .list-view .list-table .list-head { display: none !important; }
  .list-view .list-table .list-row { grid-template-columns: auto auto minmax(0, 1fr) !important; grid-template-areas: "name name name" "who due pri" "tags tags tags"; padding: 6px 0 8px !important; }
  .list-view .list-table .list-row > .list-tags-cell:empty { display: none !important; }
  .list-view .list-table .list-row > .list-tags-cell { padding-left: 40px !important; flex-wrap: wrap; }
  .list-view .list-table .list-row > .list-cell { min-height: 30px; padding: 0 8px !important; border-left: 0; }
  .list-view .list-table .list-row > .list-name-cell { grid-area: name !important; min-height: 34px; padding-left: 12px !important; }
  .list-view .list-table .list-row > .list-cell:nth-child(2) { grid-area: who !important; padding-left: 40px !important; }
  .list-view .list-table .list-row > .list-cell:nth-child(3) { grid-area: due !important; }
  .list-view .list-table .list-row > .list-cell:nth-child(4) { grid-area: pri !important; }
  .list-view .list-table .list-row > .list-cell:nth-child(5) { grid-area: tags !important; }
  .list-view .list-table .list-row > .list-cell:nth-child(2) > span:not(.avatar):not(.list-empty-person) { display: none; }
  .list-view .list-table .list-name { white-space: normal; overflow-wrap: anywhere; }
  .list-view .list-table .list-details { display: none; }
  .list-view .list-table .quick-task-row { padding-left: 40px !important; }
}
@media (hover: none) {
  .list-view .list-table .list-placeholder { opacity: .8; }
  .list-view .list-table .list-section-add { opacity: 1; }
}

/* Dark theme */
html[data-theme="dark"] .list-view .list-table { --list-line: var(--d-border); border-color: var(--d-border) !important; background: var(--d-surface) !important; }
html[data-theme="dark"] .list-view .list-table :is(.list-head, .list-section, .list-row, .quick-task-row) { border-color: var(--d-border) !important; background: var(--d-surface) !important; }
html[data-theme="dark"] .list-view .list-table .list-row:hover { background: var(--d-hover) !important; }
html[data-theme="dark"] .list-view .list-table :is(.list-name, .list-section button[data-section-toggle]) { color: var(--d-text) !important; }
html[data-theme="dark"] .list-view .list-table .list-name.editing { background: var(--d-surface-2); }
html[data-theme="dark"] .list-view .list-table .list-details { background: var(--d-surface-2); color: #c9b8ff; }
html[data-theme="dark"] .list-view .list-table .list-meta img, html[data-theme="dark"] .list-view .list-table .list-empty-person { filter: invert(.85); }
html[data-theme="dark"] .list-popover { border-color: var(--d-border); background: var(--d-surface-2); }
html[data-theme="dark"] .list-popover button { color: var(--d-text); }
html[data-theme="dark"] .list-popover button:hover { background: var(--d-hover); }
.list-popover button { justify-content: flex-start !important; }
.list-view .list-table .list-cell > span:not(.avatar):not(.task-priority-pill):not(.tag) { font-weight: 400 !important; }

/* «Мои задачи»: the project column links to the project */
.workspace > .my-tasks-table { margin: 0 24px 24px !important; }
.list-view .list-table .list-project-link { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; padding: 2px 6px; margin-left: -6px; border: 0; border-radius: 6px; background: transparent; color: #2f3033; font: inherit; font-size: 13px; cursor: pointer; }
.list-view .list-table .list-project-link:hover { background: #f3effc; color: #6a45cc; }
.list-view .list-table .list-project-link > span:last-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.list-view .list-table .list-project-dot { flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--project-color, #7954d6); }
@media (max-width: 760px) {
  .workspace > .my-tasks-table { margin: 0 14px 90px !important; }
  .list-view .list-table .list-row > .list-project-cell { padding-left: 40px !important; }
}
html[data-theme="dark"] .list-view .list-table .list-project-link { color: var(--d-text-2); }
html[data-theme="dark"] .list-view .list-table .list-project-link:hover { background: var(--d-hover); }
.list-view .list-table .list-project-link, .list-view .list-table .list-project-link span { font-weight: 400 !important; }
@media (max-width: 760px) {
  /* Cells wrap to the next line instead of squeezing each other */
  .my-tasks-table.list-view .list-table .list-row { display: flex !important; flex-wrap: wrap; align-items: center !important; }
  .my-tasks-table.list-view .list-table .list-row > .list-name-cell { flex: 1 0 100%; }
  .my-tasks-table.list-view .list-table .list-row > .list-cell:not(.list-name-cell) { flex: 0 0 auto; min-height: 28px; }
  .my-tasks-table.list-view .list-table .list-row > .list-project-cell { max-width: 60%; }
  .my-tasks-table.list-view .list-table .list-row > .list-tags-cell { padding-left: 8px !important; }
}
