/* /programs — ported from web/app/styles/04-programs.css plus the
   `.settings-view` / `.settings-topbar` / `.settings-body` /
   `.settings-content` shell rules from 03-settings.css that this page
   reuses for layout. CSS Modules keep names scoped per component. */

.view {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  height: 64px;
  box-sizing: border-box;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-bright);
  flex-shrink: 0;
}

.body {
  flex: 1;
  display: grid;
  /* sidebar inner content = 288 − 1px border = 287; match here. */
  grid-template-columns: calc(var(--sidebar-width) - 1px) 1fr;
  /* No padding — nav and content extend the full body height.
     Inner breathing room is owned by .content / .foldersNav themselves. */
  padding: 0;
  min-height: 0;
  overflow: hidden;
}

.content {
  min-width: 0;
  overflow-y: auto;
  /* Body no longer has horizontal/top padding; .content owns its own
     breathing room. 16 top so cards sit clear of the title border;
     24 horizontal for viewport-edge gap. */
  padding: 16px 24px 0;
}

/* Inline toolbar next to title */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  padding-bottom: 2px;
}

.search {
  flex: 1;
  max-width: 320px;
  height: var(--ui-button-h);
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--ui-button-radius);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}
.search:focus {
  border-color: var(--accent-blue);
}
.search::placeholder {
  color: var(--text-muted);
}

/* `.toolbarBtn` — the grid/list toggle is the shadcn <Button> now. */

/* Folders nav. The folder rows match the left sidebar's nav rows
   (`components/sidebar/nav-classes.ts::sidebarNavItemClass`) — same
   32px height, 6px corner, `--nav-color` text + `--nav-color-hover`
   on hover/active, 150ms transition. `gap: 1px` between rows so
   they read as a stacked group with subtle separation. */
.foldersNav {
  width: 100%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  /* Fill the column height so the right divider spans the full body. */
  align-self: stretch;
  position: sticky;
  top: 0;
  padding: 8px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
}
.folderSep {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}
.folderItem {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px;
  height: 32px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  color: var(--nav-color);
  border-radius: var(--ui-list-radius);
  transition: background 150ms ease-out, color 150ms ease-out;
  white-space: nowrap;
}
.folderItem:hover {
  background: var(--bg-hover);
  color: var(--nav-color-hover);
}
.folderItem.active {
  background: var(--bg-hover);
  color: var(--nav-color-hover);
}
.folderItem.dragOver {
  background: rgba(24, 169, 107, 0.08);
  color: var(--accent-green);
}
.folderNew {
  color: var(--text-muted);
  font-style: italic;
  margin-top: 4px;
}
.folderNew:hover {
  color: var(--text-primary);
  font-style: normal;
}
.folderNew .folderIcon {
  font-weight: 600;
  font-size: 16px;
  line-height: 1;
}
.folderIcon {
  font-size: 14px;
  line-height: 1;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.folderName {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.folderCount {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 1px 6px;
  border-radius: 10px;
  flex-shrink: 0;
}
.renameInput {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--accent-blue);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 14px;
  padding: 2px 6px;
  outline: none;
}

/* Empty state */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.emptyIcon {
  font-size: 40px;
  margin-bottom: 12px;
}
.emptyText {
  font-size: 14px;
}
.emptyHint {
  margin-top: 8px;
  font-size: 14px;
}


/* ── Built-in (regular) tools — fixed, display-only ───────────────── */
/* Cards reuse function-card.module.css wholesale; only the section
   divider + header live here, on the same design-system variables the
   rest of the page uses. */
.toolsSection {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.toolsHeader {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.toolsHint {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
}
