/* Styles for the in-shell (chat SPA) full "My SNAPs" table. Mirrors
   filesTable.css but scoped under `.snaps-panel` so the generic class names
   (.list-row, .list-head, .bulk-bar, .project-chip-btn, …) can't collide with
   the chat shell or the Files panel. */

.snaps-panel .search-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}
.snaps-panel .search-field { display: grid; gap: 5px; }
.snaps-panel .search-field label {
  font-size: 12px; color: var(--muted); font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.snaps-panel .search-field input {
  width: 100%; box-sizing: border-box;
  border: 1px solid var(--border); border-radius: 9px;
  padding: 9px 10px; font: inherit; background: #fff;
}

/* Bulk-action bar */
.snaps-panel .bulk-bar {
  display: none; align-items: center; gap: 12px;
  margin-bottom: 12px; padding: 10px 14px;
  background: #fff7ed; border: 1px solid #fdba74;
  border-radius: 10px; position: relative;
}
.snaps-panel .bulk-bar.show { display: flex; }
.snaps-panel .bulk-bar[hidden] { display: none; }
.snaps-panel .bulk-bar .bulk-count { font-size: 13px; font-weight: 600; color: #9a3412; }
.snaps-panel .bulk-bar .bulk-spacer { flex: 1; }
.snaps-panel .bulk-bar .btn.danger {
  background: #fff; color: #b91c1c; border: 1px solid #fecaca;
  padding: 6px 12px; border-radius: 8px; font-size: 13px; cursor: pointer;
}
.snaps-panel .bulk-bar .btn.danger:hover { background: #fef2f2; border-color: #fca5a5; }
.snaps-panel .bulk-bar .btn.ghost {
  background: transparent; color: #475569; border: 1px solid transparent;
  padding: 6px 10px; border-radius: 8px; font-size: 13px; cursor: pointer;
}
.snaps-panel .bulk-bar .btn.ghost:hover { color: #0f172a; background: #fff; border-color: var(--border); }
.snaps-panel .bulk-bar #snapsBulkProjectHost { position: relative; }

/* Project assignment chip + inline picker */
.snaps-panel .project-chip-btn {
  border: 1px solid #bae6fd; background: #e0f2fe; color: #0369a1;
  border-radius: 999px; padding: 5px 10px; font: inherit; font-weight: 700;
  cursor: pointer; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.snaps-panel .project-chip-btn.empty { border-color: var(--border); background: #fff; color: var(--muted); font-weight: 600; }
.snaps-panel .project-chip-btn:hover { border-color: #7dd3fc; color: #075985; }
.snaps-panel .project-picker-inline {
  position: absolute; z-index: 1000; top: calc(100% + 6px); left: 0;
  width: min(280px, 80vw); padding: 8px; background: #fff;
  border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .16);
}
.snaps-panel .project-picker-inline input {
  width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 9px; font: inherit; margin-bottom: 6px;
}
.snaps-panel .project-picker-options { display: grid; gap: 4px; max-height: 220px; overflow: auto; }
.snaps-panel .project-picker-options button {
  width: 100%; border: 0; border-radius: 7px; background: transparent;
  padding: 7px 8px; text-align: left; cursor: pointer; font: inherit; font-size: 13px;
}
.snaps-panel .project-picker-options button:hover { background: #f1f5f9; }
.snaps-panel .project-picker-options button.active { background: #e0f2fe; color: #0369a1; font-weight: 700; }

/* List (grid table): check · thumb · name · source · project · updated · actions */
.snaps-panel .snaps-list {
  display: grid;
  grid-template-columns: 36px 60px minmax(200px, 1.8fr) minmax(130px, 1fr) minmax(140px, 1fr) 130px 210px;
  column-gap: 16px;
  background: #fff; border: 1px solid var(--border);
  border-radius: 12px; overflow: visible;
}
.snaps-panel .snaps-list > .empty { grid-column: 1 / -1; padding: 24px; color: var(--muted); text-align: left; margin: 0; }
.snaps-panel .list-cell-project { position: relative; overflow: visible; }
.snaps-panel .list-cell-check { justify-content: center; padding-left: 4px !important; padding-right: 4px !important; }
.snaps-panel .list-cell-check input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: #f97316; }
.snaps-panel .list-row.selected > div { background: #fff7ed; }
.snaps-panel .list-row.selected:hover > div { background: #ffedd5; }
.snaps-panel .list-head, .snaps-panel .list-row { display: contents; }
.snaps-panel .list-head > div {
  padding: 10px 8px; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted);
  background: #fff; border-bottom: 1px solid var(--border);
}
.snaps-panel .list-head .sort-btn {
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
}
.snaps-panel .list-head .sort-btn:hover { color: var(--fg); }
.snaps-panel .list-head .sort-btn .sort-arrow { opacity: .35; font-size: 10px; transition: opacity .15s; }
.snaps-panel .list-head .sort-btn.active { color: var(--fg); }
.snaps-panel .list-head .sort-btn.active .sort-arrow { opacity: 1; }
.snaps-panel .list-row > div {
  padding: 11px 8px; border-bottom: 1px solid #f1f5f9;
  display: flex; align-items: center; min-width: 0; font-size: 15px;
}
.snaps-panel .list-row:last-child > div { border-bottom: none; }
.snaps-panel .list-row:hover > div { background: #f8fafc; }

.snaps-panel .list-thumb {
  width: 52px; height: 40px; border-radius: 6px; overflow: hidden; flex-shrink: 0;
  background: #f1f5f9; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.snaps-panel .list-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.snaps-panel .list-cell-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.snaps-panel .list-name-col { min-width: 0; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.snaps-panel .list-name-pills { display: flex; gap: 4px; flex-wrap: wrap; }
.snaps-panel .name-pill { font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 999px; letter-spacing: .02em; }
.snaps-panel .name-pill-sky { background: #e0f2fe; color: #0369a1; }
.snaps-panel .name-pill-purple { background: #f3e8ff; color: #7c3aed; }
.snaps-panel .name-pill-amber { background: #fef3c7; color: #92400e; }
.snaps-panel .name-pill-green { background: #dcfce7; color: #166534; }
.snaps-panel .list-expand {
  flex-shrink: 0; width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--border); border-radius: 6px;
  cursor: pointer; color: var(--muted); padding: 0;
  transition: background .12s, color .12s, border-color .12s;
}
.snaps-panel .list-expand svg { width: 16px; height: 16px; display: block; }
.snaps-panel .list-expand:hover { color: #2563eb; border-color: #bfdbfe; background: #eff6ff; }
.snaps-panel .list-row.expanded .list-expand { color: #2563eb; border-color: #bfdbfe; background: #eff6ff; }

.snaps-panel .list-name {
  cursor: pointer; background: none; border: none; padding: 0;
  text-align: left; font-size: 15px; color: var(--fg);
  font-weight: 500; font-family: inherit;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.snaps-panel .list-name:hover { color: #2563eb; }
.snaps-panel .list-cell-source { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snaps-panel .list-actions { gap: 6px; justify-content: flex-end; }
.snaps-panel .list-actions .view-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 6px; border: 1px solid var(--border);
  background: #fff; color: var(--fg); font-size: 12px; font-weight: 500; cursor: pointer; text-decoration: none;
}
.snaps-panel .list-actions .view-btn:hover { border-color: #cbd5e1; background: #f8fafc; color: #2563eb; }
.snaps-panel .list-actions .view-btn svg { width: 12px; height: 12px; }
.snaps-panel .list-actions .icon-btn {
  background: none; border: 1px solid var(--border);
  border-radius: 6px; cursor: pointer; padding: 4px 8px; color: var(--muted); font-size: 12px;
}
.snaps-panel .list-actions .icon-btn.share-btn:hover { color: #0369a1; border-color: #7dd3fc; background: #e0f2fe; }
.snaps-panel .list-actions .icon-btn:hover { color: #dc2626; border-color: #fecaca; background: #fef2f2; }

.snaps-panel .list-row-details {
  grid-column: 1 / -1;
  padding: 14px 16px 16px 66px;
  background: #f8fafc; border-bottom: 1px solid #e2e8f0;
  flex-direction: column; gap: 12px; align-items: stretch !important;
}
.snaps-panel .list-row-details[hidden] { display: none !important; }
.snaps-panel .list-row.expanded > div:not(.list-row-details):not(.list-row-idx) { background: #f8fafc; }
.snaps-panel .list-row-idx {
  grid-column: 1 / -1;
  padding: 14px 16px 16px 66px;
  background: #fefce8; border-top: 1px dashed #fde68a; border-bottom: 1px solid #e2e8f0;
  flex-direction: column; gap: 12px; align-items: stretch !important;
}
.snaps-panel .list-row-idx[hidden] { display: none !important; }
.snaps-panel .row-detail-section h4 {
  margin: 0 0 4px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted);
}
.snaps-panel .row-detail-section p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--fg); white-space: pre-wrap; }
.snaps-panel .row-detail-status { margin: 0; font-size: 13px; color: var(--muted); font-style: italic; }
.snaps-panel .row-detail-link { font-size: 13px; color: #2563eb; word-break: break-all; }
.snaps-panel .row-detail-topics { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.snaps-panel .tag-pill { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: #f1f5f9; color: #475569; font-weight: 500; }

/* Inline notes editor */
.snaps-panel .notes-editor { display: flex; flex-direction: column; gap: 6px; }
.snaps-panel .notes-editor textarea {
  width: 100%; min-height: 70px; border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font: inherit; font-size: 13px; resize: vertical; background: #fff;
}
.snaps-panel .notes-editor textarea:focus { outline: 2px solid #bfdbfe; border-color: #2563eb; }
.snaps-panel .notes-row { display: flex; justify-content: flex-end; gap: 6px; align-items: center; }
.snaps-panel .notes-status { font-size: 12px; color: var(--muted); margin-right: auto; }
.snaps-panel .notes-row .btn { font-size: 12px; padding: 4px 12px; }
.snaps-panel .notes-row .btn.primary { background: #2563eb; color: #fff; border: 1px solid #2563eb; border-radius: 8px; cursor: pointer; }
.snaps-panel .notes-row .btn.primary:disabled { opacity: .6; cursor: default; }

@media (max-width: 820px) {
  .snaps-panel .snaps-list { grid-template-columns: 60px minmax(160px, 2fr) minmax(130px, 1fr) 170px; }
  .snaps-panel .list-col-source, .snaps-panel .list-cell-source,
  .snaps-panel .list-col-updated, .snaps-panel .list-cell-updated { display: none; }
  .snaps-panel .list-cell-check { display: none; }
}
@media (max-width: 560px) {
  .snaps-panel .snaps-list { grid-template-columns: 60px 1fr 150px; }
  .snaps-panel .list-col-project, .snaps-panel .list-cell-project { display: none; }
  .snaps-panel .search-row { grid-template-columns: 1fr; }
}
