/* Small page CSS the mockups add on top of stock Bootstrap 5.3.8 — design-tokens.md §4. */

/* One avatar. `.cs-avatar` is the navbar's, on the blue bar; `--page` is the
   same circle on a page, where the ground is light. Sizes are modifiers, not a
   second pattern — design-tokens.md §4. */
.cs-avatar {
  width: 2rem;
  height: 2rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #0d6efd;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.85);
  overflow: hidden;
}
.cs-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cs-avatar-page {
  color: rgba(33, 37, 41, 0.55);
  background: #f8f9fa;
  border-color: #dee2e6;
}
.cs-avatar-lg {
  width: 3.5rem;
  height: 3.5rem;
  font-size: 1rem;
}
#account-menu.dropdown-toggle::after {
  margin-left: 0.15rem;
}
#account-menu:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 2px;
}

/* Greyed, still clickable so the toast can name the permission (X1). */
.navbar .nav-link.cs-gated,
.navbar .dropdown-item.cs-gated,
.cs-gated {
  cursor: not-allowed;
  pointer-events: auto;
}
.navbar .nav-link.cs-gated {
  color: rgba(255, 255, 255, 0.55) !important;
}
.dropdown-item.cs-gated {
  color: #adb5bd !important;
}
button.cs-gated,
.btn.cs-gated {
  opacity: 0.65;
}

.tile {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 20px;
  display: flex;
  flex-direction: column;
}
.t-lab {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(33, 37, 41, 0.75);
}
.t-stamp {
  margin-top: auto;
  padding-top: 20px;
  font-size: 13px;
}

.multi {
  border: 1px solid #dee2e6;
  border-radius: 4px;
  background: #fff;
  padding: 4px 24px 4px 6px;
  min-height: 34px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.tok {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #e9ecef;
  border: 1px solid #dee2e6;
  border-radius: 3px;
  padding: 1px 5px 1px 7px;
  font-size: 13px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #dee2e6;
  border-radius: 999px;
  background: #fff;
  padding: 3px 12px;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}
.chip:hover {
  border-color: #adb5bd;
}
.chip.on {
  background: #0d6efd;
  border-color: #0d6efd;
  color: #fff;
  font-weight: 500;
}
.chip .n {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.chip.on .n {
  color: rgba(255, 255, 255, 0.85);
}
/* One value, nothing to choose — a chip that reads the value, not a dead control. */
.chip.cs-locked {
  background: #f8f9fa;
  color: rgba(33, 37, 41, 0.75);
  cursor: default;
}
.chip.cs-locked:hover {
  border-color: #dee2e6;
}

.rpp .opt {
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 1px 9px;
  font-size: 14px;
  color: #0d6efd;
  background: #fff;
}
.rpp .opt.on {
  background: #0d6efd;
  border-color: #0d6efd;
  color: #fff;
  font-weight: 500;
}

.cs-tabular {
  font-variant-numeric: tabular-nums;
}

/* Filter row grid — design-tokens.md §4. Spans, not flex-grow, and top-aligned:
   labels are one line, so every label and control shares a baseline and a hint
   line hangs below its own field instead of lifting it out of the row. */
.cs-f-row {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 8px 12px;
  align-items: start;
}
.cs-f-1 { grid-column: span 1; }
.cs-f-2 { grid-column: span 2; }
.cs-f-3 { grid-column: span 3; }
.cs-f-4 { grid-column: span 4; }
.cs-f-5 { grid-column: span 5; }
.cs-f-6 { grid-column: span 6; }
.cs-f-7 { grid-column: span 7; }
.cs-f-8 { grid-column: span 8; }
.cs-f-9 { grid-column: span 9; }
.cs-f-10 { grid-column: span 10; }
.cs-f-11 { grid-column: span 11; }
.cs-f-12 { grid-column: span 12; }
@media (max-width: 991.98px) {
  .cs-f-1,
  .cs-f-2,
  .cs-f-3,
  .cs-f-4,
  .cs-f-5,
  .cs-f-6 { grid-column: span 6; }
  .cs-f-7,
  .cs-f-8,
  .cs-f-9,
  .cs-f-10,
  .cs-f-11 { grid-column: 1 / -1; }
}
@media (max-width: 767.98px) {
  [class*="cs-f-"] { grid-column: 1 / -1; }
}

/* The filter card's footer strip — the checkbox filters and the line that says
   what the filter currently covers. */
.cs-filter-foot {
  border-top: 1px solid #e9ecef;
  padding: 10px 16px;
}

/* Adding a value is a token inside the field, not a control below it. */
.tok-add {
  border: 1px dashed #dee2e6;
  border-radius: 3px;
  background: none;
  color: #0d6efd;
  padding: 1px 4px 1px 8px;
  font-size: 13px;
  /* A <select> sizes itself to its widest option; hold it at token width so the
     closed state reads "+ add" and not a stretched control. */
  width: 5rem;
  flex: none;
}
.tok-add:hover {
  border-color: #0d6efd;
}

/* Bulk bar — always in the layout, two appearances. design-tokens.md §4. */
.cs-bulk-bar {
  background: #cfe2ff;
  border: 1px solid #9ec5fe;
  border-radius: 6px;
  padding: 8px 16px;
  color: #052c65;
}
.cs-bulk-bar.idle {
  background: #f8f9fa;
  border-color: #dee2e6;
  color: rgba(33, 37, 41, 0.55);
}
.cs-bulk-bar.idle .btn,
.cs-bulk-bar.idle .form-select {
  opacity: 0.5;
  pointer-events: none;
}

/* The rows-per-page bar is the table card's top bar, not a line above the card. */
.cs-table-bar {
  padding: 10px 14px;
  border-bottom: 1px solid #e9ecef;
}

/* Bootstrap's display utilities are `!important`, so `.d-flex[hidden]` stays
   visible and every `el.hidden = true` on such an element silently does
   nothing. The attribute means hidden; let it win. */
[hidden] {
  display: none !important;
}

/* An uppercase transform is for the value, not for the hint that says what to
   type — "8 OR 11 CHARACTERS" reads as shouting. */
input::placeholder {
  text-transform: none;
}

/* The camera badge that sets a photo — a Bootstrap button positioned on the
   avatar's own corner, the way every product puts it. */
/* A status label beside a page title — the contact's roles, an invoice's status,
   a product's Inactive. `.badge` is `font-size: .75em`, relative to the heading,
   and `fs-6` (1rem) is larger still, so both read as buttons competing with the
   real ones on the right. Pinned small and quiet instead (owner 2026-09-08,
   IA §10 #50). */
.cs-title-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.34em 0.66em;
  vertical-align: middle;
  letter-spacing: 0.01em;
}

.cs-pointer {
  cursor: pointer;
}
.cs-avatar-set {
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
