/* Empty-state text */
.cl-empty, .kb-empty { color: var(--muted); font-family: var(--read); padding: var(--sp-2) 0; }

/* Scroll region with page gutters — reused by every list/detail page. */
.cl-scroll { flex: 1; overflow-y: auto; padding: 0 var(--sp-8) var(--sp-7); position: relative; z-index: 1; }

/* Card grid + card — PILOT for the design-token migration (type + spacing
   scales). Raw px here now reference --fs-* / --sp-* tokens. */
.cl-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-6); padding: var(--sp-4) 0 var(--sp-7); align-content: start; }
.cl-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: var(--sp-6); position: relative; display: flex; flex-direction: column; min-width: 0;
  text-decoration: none; color: inherit;
}
.cl-card:hover { box-shadow: 0 14px 30px -22px rgba(0, 0, 0, .4); }
.cl-card__hit { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.cl-card__star { position: absolute; top: var(--sp-5); right: var(--sp-5); z-index: 2; margin: 0; }
.cl-card .star {
  display: flex; padding: var(--sp-2); color: var(--faint);
  background: none; border: 0; cursor: pointer; line-height: 0;
}
.cl-card .star:hover, .cl-card .star.on { color: var(--gold); }
.cl-card .star.on svg { fill: var(--gold); }
.cl-card__top { display: flex; align-items: center; gap: var(--sp-5); padding-right: var(--sp-7); margin-bottom: var(--sp-6); }
.cl-card__id { min-width: 0; }
.cl-card .av { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: var(--white); font-weight: 700; font-size: var(--fs-6); }
.cl-card h3 { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }  /* size/weight via .t-title */
.cl-card .co { font-family: var(--read); font-size: var(--fs-3); color: var(--muted); margin-top: var(--sp-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-card .meta2 { display: flex; justify-content: space-between; margin-top: auto; padding-top: var(--sp-5); border-top: 1px solid var(--line); color: var(--muted); }  /* size via .t-meta */
.cl-card .meta2 b { font-weight: 600; color: var(--ink-2); }

/* Reusable pill filter bar (customers A–Z index, calls status filter). Active
   pill = accent; an inert/empty pill is `.off`. Use plain text labels for word
   pills (e.g. "Missed") or single letters for an A–Z index. */
.pill-filter { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1); padding: 10px 0 var(--sp-2); }
.pill-filter .pill {
  min-width: 24px; height: 24px; padding: 0 9px; gap: var(--sp-3);
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: none; border-radius: 6px; font-size: var(--fs-3); font-weight: 600;
  color: var(--muted); cursor: pointer; user-select: none;
  text-decoration: none;
}
.pill-filter .pill:hover { background: rgba(0, 0, 0, .05); color: var(--ink); }
.pill-filter .pill.on { background: var(--accent); color: var(--white); }
.pill-filter .pill.off { color: var(--line-2); cursor: default; }
.pill-filter .pill.off:hover { background: none; color: var(--line-2); }
/* Optional per-item count (e.g. Tasks label filter): override the global italic
   serif <em> so the count reads as plain pill text — same font, just bolder. */
.pill-filter .pill em { font-family: inherit; font-style: normal; font-weight: 700; color: var(--muted); }
.pill-filter .pill.on em { color: rgba(255, 255, 255, .8); }

/* Special toggles (favorites, open tasks) alongside the A–Z index. Set off from
   the letters with a little space and tinted to their own accent when active. */
.pill-filter .pill--flag { margin-left: var(--sp-4); }
.pill-filter .pill--flag svg { color: var(--muted); }
.pill-filter .pill--flag.on svg { color: var(--white); }
.pill-filter .pill--favorite.on { background: var(--accent); }
.pill-filter .pill--tasks.on { background: var(--amber); color: var(--white); }
.pill-filter .pill--route.on { background: var(--blue); color: var(--white); }

/* Shared filter sub-nav: a pinned row hosting a .pill-filter directly under the
   page header (.cl-head) on Calls, Customers and Tasks, so the filter lines up
   identically on all three. Left padding matches the header's. */
.cl-subnav { padding: var(--sp-5) var(--sp-8) var(--sp-3); padding-top: 16px; position: relative; z-index: 3; margin-bottom: 10px; }
.cl-subnav .pill-filter { padding: 0; }

/* Pages index — folder cards, each listing the pages it contains. */
.pg-folders {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px; padding: 7px 0 var(--sp-7); align-content: start;
}
.pg-fcard {
  position: relative;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: var(--sp-6); height: max-content;
}
.pg-fcard__add { position: absolute; top: 12px; right: 12px; z-index: 2; margin: 0; }
.pg-fcard .add {
  display: inline-flex; padding: var(--sp-3); background: none; border: 0; border-radius: var(--sp-4);
  color: var(--faint); cursor: pointer; line-height: 0;
}
.pg-fcard .add:hover { background: var(--accent-soft); color: var(--accent); }

.pg-fcard__star, .pg-fcard__vis-form { display: inline-flex; margin: 0; }
/* A little breathing room between the visibility icon and the star. */
.pg-fcard__vis-form { margin-right: var(--sp-2); }
.pg-fcard .star, .pg-fcard__vis {
  display: inline-flex; padding: 0; background: none; border: 0;
  color: var(--faint); cursor: pointer; line-height: 0;
}
.pg-fcard .star:hover, .pg-fcard .star.on { color: var(--gold); }
.pg-fcard .star.on svg { fill: var(--gold); }

/* Visibility toggle sits just left of the star. Amber while personal (matching
   the eye-off marker on personal pages), muted when public. */
.pg-fcard__vis:hover { color: var(--accent); }
.pg-fcard__vis.on { color: var(--amber); }
.pg-fcard .fhead { display: flex; align-items: center; gap: 11px; margin-bottom: var(--sp-5); padding-right: 26px; }
.pg-fcard__titlerow { display: flex; align-items: center; gap: var(--sp-2); }
.pg-fcard .ficon {
  flex: none; width: 38px; height: 38px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center;
}
.pg-fcard .ftitle { min-width: 0; }
.pg-fcard .ftitle h3 { margin: 0; font-size: var(--fs-6); font-weight: 700; letter-spacing: -.01em; }
.pg-fcard__name {
  display: block; width: fit-content; max-width: 100%;
  cursor: text; border-radius: 4px; outline: none;
  padding: 1px 5px; margin: -1px -5px;
}
.pg-fcard__name:hover { box-shadow: inset 0 0 0 1px var(--line-2); }
.pg-fcard__name:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.pg-fcard .ftitle .cnt { font-family: var(--read); font-size: var(--fs-3); color: var(--muted); padding-left: 5px; }

.pg-flist { display: flex; flex-direction: column; gap: var(--sp-1); padding-top: 10px; border-top: 1px solid var(--line); }
.pg-flist:empty { padding-top: 0; border-top: 0; }
.pg-fitem {
  display: flex; align-items: center; gap: 9px; padding: var(--sp-4);
  border-radius: 7px; font-family: var(--read); font-size: var(--fs-4);
  color: var(--ink-2); text-decoration: none; cursor: grab;
}
.pg-fitem--dragging { opacity: .4; }

/* Highlighted folder a page is being dragged onto. */
.pg-fcard--over {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.pg-fitem:hover { background: rgba(0, 0, 0, .04); }
.pg-fitem svg { flex: none; color: var(--faint); }
.pg-fitem .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-fitem svg.pg-fitem__vis { color: var(--amber); }
.pg-fitem:hover svg:last-child { color: var(--ink-2); }

/* Delete prompt shown in an empty folder's body; hidden while it holds pages
   (so a drag in/out toggles it live, no reload). Click deletes, no confirm. */
.pg-fcard__empty { margin: 0; }
.pg-flist:has(.pg-fitem) .pg-fcard__empty { display: none; }
.pg-fcard__empty-btn {
  width: 100%; padding: var(--sp-4); border: 0; border-radius: 7px; background: transparent;
  font-family: var(--read); font-size: var(--fs-4); color: var(--faint);
  text-align: left; cursor: pointer;
}
.pg-fcard__empty-btn:hover { background: rgba(220, 38, 38, .08); color: var(--red); }

