/* ===== VARIABLES ===== */
:root {
  --bsc-bg: #e8e8e8;
  --bsc-sidebar-bg: #141414;
  --bsc-accent: #ffd600;
  --bsc-accent-dark: #c9a000;
  --bsc-accent-hover: #a07800;
  --bsc-card: #ffffff;
  --bsc-text: #1f2937;
  --bsc-muted: #6b7280;
  --bsc-border: #d1d5db;
  --bsc-sidebar-w: 252px;
  --bsc-sidebar-w-collapsed: 76px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

/* Collapsed sidebar (2026-09-15): overriding the custom property here
   means every rule already sized off var(--bsc-sidebar-w) -- .bsc-content's
   margin, the invoice detail modal's full-width sizing, the attachment
   overlay -- follows automatically, with no need to duplicate a second
   "collapsed" value at each of those call sites. */
body.bsc-sidebar-collapsed {
  --bsc-sidebar-w: var(--bsc-sidebar-w-collapsed);
}

/* ===== BASE ===== */
body {
  background: var(--bsc-bg);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  font-size: 0.875rem;
  color: var(--bsc-text);
}

/* ===== LAYOUT ===== */
.bsc-wrap {
  display: flex;
  min-height: 100vh;
}

.bsc-content {
  margin-left: var(--bsc-sidebar-w);
  flex: 1;
  padding: 1.75rem 2rem;
  min-height: 100vh;
  transition: margin-left 0.2s var(--ease-out);
}

/* ===== SIDEBAR ===== */
.bsc-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--bsc-sidebar-w);
  background: var(--bsc-sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: width 0.2s var(--ease-out);
}

.bsc-sidebar-toggle {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  top: 0.65rem;
  right: 0.55rem;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 0.4rem;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  z-index: 6;
  transition: background 0.12s, color 0.12s;
}
.bsc-sidebar-toggle:hover {
  background: rgba(255,255,255,0.14);
  color: #fff;
}
.bsc-sidebar-toggle i {
  font-size: 0.78rem;
  transition: transform 0.2s var(--ease-out);
}
body.bsc-sidebar-collapsed .bsc-sidebar-toggle i {
  transform: rotate(180deg);
}

.bsc-brand {
  padding: 1.1rem 1.25rem 0.9rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  -webkit-user-select: none;
  user-select: none;
}

.bsc-logo-img {
  display: block;
  width: 72px;
  height: auto;
  margin: 0 auto 0.55rem;
}

.bsc-brand-text {
  text-align: center;
  line-height: 1;
}

.bsc-brand-biz {
  display: block;
  color: #ffd600;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.bsc-brand-sub {
  display: block;
  color: #9a9390;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}


.bsc-nav {
  flex: 1;
  padding: 0.5rem 0;
  overflow-y: auto;
}

.bsc-nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 1.25rem;
  color: rgba(255,255,255,0.68);
  text-decoration: none;
  font-size: 0.83rem;
  border-left: 3px solid transparent;
  transition: background 0.12s, color 0.12s;
}

.bsc-nav-link:hover {
  background: rgba(255,255,255,0.09);
  color: #fff;
  text-decoration: none;
}

.bsc-nav-link.active {
  background: rgba(255,214,0,0.12);
  color: var(--bsc-accent);
  border-left-color: var(--bsc-accent);
  font-weight: 600;
}

.bsc-nav-link.soon {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
  font-size: 0.8rem;
}

.bsc-nav-link i {
  font-size: 0.95rem;
  width: 1rem;
  flex-shrink: 0;
}

/* ── Section group buttons (MS Admin Center style) ── */
.bsc-nav-grp-btn {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.65rem 0.85rem 0.65rem 1rem;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  outline: none;
  box-shadow: none;
  color: rgba(255,255,255,0.78);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, color 0.12s;
  letter-spacing: 0;
  margin-top: 0.1rem;
}

.bsc-nav-grp-btn:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.bsc-nav-grp-btn.bsc-nav-grp-open {
  color: #fff;
}

.bsc-nav-grp-btn.bsc-grp-active {
  color: var(--bsc-accent);
  border-left-color: var(--bsc-accent);
}

.bsc-nav-grp-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.bsc-nav-grp-icon {
  font-size: 1rem;
  width: 1rem;
  flex-shrink: 0;
  color: rgba(255,255,255,0.5);
  transition: color 0.12s;
}

.bsc-nav-grp-btn.bsc-nav-grp-open .bsc-nav-grp-icon,
.bsc-nav-grp-btn.bsc-grp-active .bsc-nav-grp-icon {
  color: var(--bsc-accent);
}

.bsc-nav-grp-label {
  font-size: 0.875rem;
  font-weight: 600;
}

.bsc-nav-grp-chevron {
  font-size: 0.72rem;
  flex-shrink: 0;
  color: rgba(255,255,255,0.35);
  transition: transform 0.2s var(--ease-out);
  transform: rotate(-90deg);
}

.bsc-nav-grp-btn.bsc-nav-grp-open .bsc-nav-grp-chevron {
  transform: rotate(0deg);
}

/* Children container */
.bsc-nav-grp-children {
  display: none;
  overflow: hidden;
}

.bsc-nav-grp-children.bsc-nav-grp-open {
  display: block;
}

/* Child links: indented to align with section label */
.bsc-nav-grp-children .bsc-nav-link {
  padding-left: 2.5rem;
  font-size: 0.82rem;
  border-left: 3px solid transparent;
}

.bsc-nav-grp-children .bsc-nav-link i {
  font-size: 0.88rem;
}

/* Deprecated — kept for fallback only */
.bsc-nav-section {
  padding: 0.8rem 1.25rem 0.2rem;
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.3);
  display: none;
}

.bsc-sidebar-footer {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.bsc-user-block {
  flex: 1;
  min-width: 0;
  display: block;
  color: inherit;
  transition: opacity 0.12s;
}
.bsc-user-block:hover { opacity: 0.85; }

.bsc-user-fullname {
  font-size: 0.83rem;
  font-weight: 600;
  line-height: 1.25;
  color: rgba(255,255,255,0.92);
  margin-bottom: 0.06rem;
}

.bsc-user-jobtitle {
  font-size: 0.71rem;
  color: rgba(255,255,255,0.48);
  line-height: 1.3;
  margin-bottom: 0.45rem;
}

.bsc-user-detail-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.bsc-user-sym {
  height: 2.4rem;
  width: auto;
  object-fit: contain;
  opacity: 0.7;
  flex-shrink: 0;
}

.bsc-user-detail-text {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.4;
  flex: 1;
  min-width: 0;
}

.bsc-role-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.1em 0.45em;
  border-radius: 0.2em;
  background: var(--bsc-accent-dark);
  color: #111;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Legacy — no longer used */
.bsc-nav-more-group { display: none !important; }
.bsc-nav-more-btn   { display: none !important; }
.bsc-nav-less-btn   { display: none !important; }

.bsc-logout-btn {
  color: rgba(255,255,255,0.38);
  text-decoration: none;
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.12s;
  padding-top: 0.1rem;
}
.bsc-logout-btn:hover { color: rgba(255,255,255,0.8); }

/* ── Collapsed sidebar (2026-09-15) ──────────────────────────────────────
   Icon-only mode: mini logo, the CURRENT section's own icons (only that
   section -- others stay hidden until expanded again), and just the Si
   mark at the bottom. Toggled via #bscSidebarToggle, see base.html. */
body.bsc-sidebar-collapsed .bsc-brand {
  padding: 2.5rem 0.4rem 0.75rem;
}
body.bsc-sidebar-collapsed .bsc-logo-img {
  width: 34px;
  margin-bottom: 0;
}
body.bsc-sidebar-collapsed .bsc-brand-text {
  display: none;
}

/* Hide every section except the one the current page belongs to. */
body.bsc-sidebar-collapsed .bsc-nav-grp-btn:not(.bsc-grp-active) {
  display: none;
}
body.bsc-sidebar-collapsed .bsc-nav-grp-children {
  display: none !important;
}
body.bsc-sidebar-collapsed .bsc-nav-grp-btn.bsc-grp-active + .bsc-nav-grp-children {
  display: block !important;
}

/* The active section's own header collapses to just its icon (no label,
   no expand/collapse chevron -- it's forced open above, always). */
body.bsc-sidebar-collapsed .bsc-nav-grp-btn {
  justify-content: center;
  padding: 0.65rem 0;
}
body.bsc-sidebar-collapsed .bsc-nav-grp-label,
body.bsc-sidebar-collapsed .bsc-nav-grp-chevron {
  display: none;
}

/* Its children stay real, clickable icons -- centered, no text label. */
body.bsc-sidebar-collapsed .bsc-nav-grp-children .bsc-nav-link {
  justify-content: center;
  padding: 0.6rem 0;
}
body.bsc-sidebar-collapsed .bsc-nav-link span {
  display: none;
}

/* Footer: only the Si mark (+ the already icon-only logout button) --
   name, role badge and job title text all drop out. */
body.bsc-sidebar-collapsed .bsc-sidebar-footer {
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0.4rem;
}
body.bsc-sidebar-collapsed .bsc-user-block {
  flex: 0 0 auto;
}
body.bsc-sidebar-collapsed .bsc-user-detail-row {
  justify-content: center;
}
body.bsc-sidebar-collapsed .bsc-user-detail-text {
  display: none;
}
body.bsc-sidebar-collapsed .bsc-user-sym {
  height: 1.9rem;
}

/* ===== CARDS ===== */
.card {
  border: 1px solid var(--bsc-border);
  border-radius: 0.5rem;
  background: var(--bsc-card);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  overflow: hidden;
}

.card-header {
  background: #fafafa;
  border-bottom: 1px solid var(--bsc-border);
  padding: 0.55rem 1rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--bsc-muted);
  border-radius: calc(0.5rem - 1px) calc(0.5rem - 1px) 0 0 !important;
}

.bsc-card-hdr-subtitle {
  font-size: 0.68rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--bsc-muted);
  opacity: 0.8;
}

/* ===== TABLE ===== */
.table th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
  color: #9ca3af;
  white-space: nowrap;
}

.table td {
  vertical-align: middle;
}

/* ===== BADGES ===== */
.badge {
  font-size: 0.7em;
  font-weight: 500;
  padding: 0.3em 0.65em;
  border-radius: 0.3em;
}

/* ===== BUTTONS ===== */

/* Global: icon alignment for all Bootstrap buttons.
   2026-09-16, real bug found live: `!important` here silently defeated
   `.d-none` on any button that combined both classes (`class="btn ... d-none"`,
   used 17+ times across 14+ templates to conditionally hide a button) --
   Bootstrap's own `.d-none{display:none!important}` has equal specificity,
   so this rule won on source order alone, meaning that button just never
   actually hid. `:not(.d-none)` scopes the override to visible buttons only,
   identical layout for every button that was already showing correctly,
   fixes every already-broken one without touching any template. */
.btn:not(.d-none) {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.32em;
  font-weight: 600;
  transition: transform 160ms var(--ease-out);
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

/* Primary: yellow background, black text */
.btn-bsc {
  background: var(--bsc-accent);
  border-color: var(--bsc-accent);
  color: #111;
  font-weight: 700;
}
.btn-bsc:hover,
.btn-bsc:focus {
  background: #e6c000;
  border-color: #e6c000;
  color: #111;
}
.btn-bsc:active {
  background: #c9a800;
  border-color: #c9a800;
  color: #111;
}
.btn-bsc:disabled,
.btn-bsc[disabled] {
  background: var(--bsc-accent);
  border-color: var(--bsc-accent);
  color: #111;
  opacity: 0.42;
}

/* Accent variant: same yellow/black, kept for semantic use on dark backgrounds */
.btn-bsc-accent {
  background: var(--bsc-accent);
  border-color: var(--bsc-accent);
  color: #111;
  font-weight: 700;
}
.btn-bsc-accent:hover,
.btn-bsc-accent:focus {
  background: #e6c000;
  border-color: #e6c000;
  color: #111;
}
.btn-bsc-accent:active {
  background: #c9a800;
  border-color: #c9a800;
  color: #111;
}

/* Excel export: green background, white text */
.btn-bsc-excel {
  background: #198754;
  border-color: #198754;
  color: #fff;
  font-weight: 700;
}
.btn-bsc-excel:hover,
.btn-bsc-excel:focus {
  background: #146c43;
  border-color: #146c43;
  color: #fff;
}
.btn-bsc-excel:active {
  background: #0f5132;
  border-color: #0f5132;
  color: #fff;
}

/* ZIP bulk-download (Payments library, 2026-09-11): same weight as the
   Excel export next to it, a distinct colour so the two are never
   confused at a glance. */
.btn-bsc-zip {
  background: #6f42c1;
  border-color: #6f42c1;
  color: #fff;
  font-weight: 700;
}
.btn-bsc-zip:hover,
.btn-bsc-zip:focus {
  background: #59339b;
  border-color: #59339b;
  color: #fff;
}
.btn-bsc-zip:active {
  background: #472a7c;
  border-color: #472a7c;
  color: #fff;
}
.btn-bsc-zip:disabled {
  background: #6f42c1;
  border-color: #6f42c1;
  color: #fff;
  opacity: .65;
}

/* Danger/destructive outline */
.btn-bsc-danger {
  background: transparent;
  border-color: #dc3545;
  color: #dc3545;
  font-weight: 600;
}
.btn-bsc-danger:hover,
.btn-bsc-danger:focus {
  background: #dc3545;
  border-color: #dc3545;
  color: #fff;
}
.btn-bsc-danger:active {
  background: #b02a37;
  border-color: #b02a37;
  color: #fff;
}

/* Teams Chat: Microsoft Teams purple */
.btn-bsc-teams {
  background: #6264a7;
  border-color: #6264a7;
  color: #fff;
  font-weight: 600;
}
.btn-bsc-teams:hover,
.btn-bsc-teams:focus {
  background: #4f51a0;
  border-color: #4f51a0;
  color: #fff;
}
.btn-bsc-teams:active {
  background: #3c3e8a;
  border-color: #3c3e8a;
  color: #fff;
}

/* AnyDesk: AnyDesk brand red */
.btn-bsc-anydesk {
  background: #e02b2b;
  border-color: #e02b2b;
  color: #fff;
  font-weight: 600;
}
.btn-bsc-anydesk:hover,
.btn-bsc-anydesk:focus {
  background: #c42020;
  border-color: #c42020;
  color: #fff;
}
.btn-bsc-anydesk:active {
  background: #a81818;
  border-color: #a81818;
  color: #fff;
}

/* Override Bootstrap's btn-outline-secondary → BSC outline style */
.btn.btn-outline-secondary {
  border-color: #9ca3af;
  color: #374151;
  background: transparent;
}
.btn.btn-outline-secondary:hover,
.btn.btn-outline-secondary:focus {
  background: var(--bsc-accent);
  border-color: var(--bsc-accent);
  color: #111;
}
.btn.btn-outline-secondary:active {
  background: #e6c000;
  border-color: #e6c000;
  color: #111;
}
.btn.btn-outline-secondary:disabled,
.btn.btn-outline-secondary[disabled] {
  border-color: #9ca3af;
  color: #9ca3af;
  background: transparent;
  opacity: 0.55;
}

/* Override Bootstrap's btn-outline-primary → same as btn-bsc (yellow/black) */
.btn.btn-outline-primary {
  background: var(--bsc-accent);
  border-color: var(--bsc-accent);
  color: #111;
}
.btn.btn-outline-primary:hover,
.btn.btn-outline-primary:focus {
  background: #e6c000;
  border-color: #e6c000;
  color: #111;
}
.btn.btn-outline-primary:active {
  background: #c9a800;
  border-color: #c9a800;
  color: #111;
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
  font-size: 0.82rem;
  margin-bottom: 1rem;
}

.breadcrumb-item a {
  color: var(--bsc-accent-hover);
  text-decoration: none;
}

.breadcrumb-item a:hover {
  text-decoration: underline;
}

/* ===== PAGE HEADER ===== */
.bsc-page-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--bsc-text);
  margin: 0;
  line-height: 1.3;
}

.appr-person-row {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(0, 0, 0, .05);
}
.appr-person-row:last-child { border-bottom: none; }

#modal-approval .modal-content { overflow: visible; }

.bsc-ticket-no {
  font-family: monospace;
  font-size: 0.78rem;
  color: var(--bsc-muted);
  letter-spacing: 0.03em;
  text-decoration: none;
}

a.bsc-ticket-no:hover {
  color: var(--bsc-accent-dark);
  text-decoration: underline;
}

/* ===== TICKET DETAIL: METADATA PANEL ===== */
.bsc-meta-item {
  padding: 0.55rem 1rem;
  border-bottom: 1px solid #f3f4f6;
}

.bsc-meta-item:last-child {
  border-bottom: none;
}

.bsc-meta-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bsc-muted);
  margin-bottom: 0.2rem;
}

.bsc-meta-value {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--bsc-text);
}

/* ===== PERSON LINKS (ticket detail) ===== */
.bsc-person-link {
  color: var(--bsc-text);
}
.bsc-person-link:hover {
  color: var(--bsc-accent-dark);
  text-decoration: underline !important;
}
.bsc-assoc-user-badge {
  font-size: 0.72rem;
  font-weight: 500;
}

/* ===== TICKET DETAIL: TIMELINE ===== */
.bsc-timeline {
  position: relative;
  padding-left: 1.5rem;
}

.bsc-timeline::before {
  content: '';
  position: absolute;
  left: 0.28rem;
  top: 0.55rem;
  bottom: 1rem;
  width: 2px;
  background: #e5e7eb;
}

.bsc-timeline-item {
  position: relative;
  margin-bottom: 1.1rem;
}

.bsc-timeline-item::before {
  content: '';
  position: absolute;
  left: -1.22rem;
  top: 0.28rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #9ca3af;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #e5e7eb;
}

.bsc-timeline-item.first::before {
  background: var(--bsc-accent-dark);
  box-shadow: 0 0 0 2px rgba(201,160,0,0.25);
}

.bsc-timeline-action {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--bsc-text);
  line-height: 1.3;
}

.bsc-timeline-value {
  font-size: 0.8rem;
  color: var(--bsc-muted);
  margin-top: 0.1rem;
}

.bsc-timeline-meta {
  font-size: 0.72rem;
  color: #9ca3af;
  margin-top: 0.15rem;
}

.bsc-description {
  font-size: 0.875rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.bsc-description p { margin-bottom: 0.4rem; }
.bsc-description p:last-child { margin-bottom: 0; }
.bsc-description img { max-width: 100%; border-radius: 4px; margin-top: 0.25rem; }

.bsc-pre-description {
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  color: inherit;
}

.bsc-arrow-icon {
  font-size: 0.7em;
}

/* Comments — legacy (used by shipments etc.) */
.bsc-comment-divider {
  border-bottom: 1px solid var(--bsc-border);
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
}
.bsc-comment-header {
  font-size: 0.8rem;
  margin-bottom: 0.3rem;
}
.bsc-comment-body {
  font-size: 0.875rem;
  line-height: 1.6;
}
.bsc-comment-body img {
  max-width: 100%;
  border-radius: 4px;
  margin-top: 0.25rem;
}

/* Comments — left/right layout (ticket_detail.html) */
.bsc-cmt-list { padding: .75rem 1rem 1rem; }

.bsc-cmt {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  margin-bottom: .875rem;
}
.bsc-cmt-own {
  flex-direction: row-reverse; /* avatar on right, card fills left */
}

/* Avatar circle */
.bsc-cmt-av {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 700;
  flex-shrink: 0;
  background: #e9ecef; color: #495057;
  text-transform: uppercase;
}
.bsc-cmt-own .bsc-cmt-av {
  background: var(--bsc-accent, #ffd600); color: #333;
}

/* Comment card */
.bsc-cmt-card {
  flex: 1; min-width: 0;
  border: 1px solid var(--bsc-border);
  border-radius: .375rem;
  border-left: 3px solid #adb5bd;
  background: #f8f9fa;
  overflow: hidden;
}
.bsc-cmt-own .bsc-cmt-card {
  background: #fffde7;
  border-left-color: var(--bsc-accent, #ffd600);
}
.bsc-cmt-internal .bsc-cmt-card {
  background: #fff3cd;
  border-left-color: #ffc107;
}

/* Card header row */
.bsc-cmt-hdr {
  padding: .3rem .65rem;
  border-bottom: 1px solid var(--bsc-border);
  font-size: .8rem;
  display: flex; align-items: center; gap: .25rem; flex-wrap: wrap;
  background: rgba(0,0,0,.02);
}
.bsc-cmt-own .bsc-cmt-hdr { background: rgba(255,214,0,.08); }
.bsc-cmt-internal .bsc-cmt-hdr { background: rgba(255,193,7,.12); }

/* Card body */
.bsc-cmt-body { padding: .5rem .65rem; font-size: .875rem; line-height: 1.6; }
.bsc-cmt-body p { margin-bottom: .3rem; }
.bsc-cmt-body p:last-child { margin-bottom: 0; }
.bsc-cmt-body img { max-width: 100%; border-radius: 4px; margin-top: .25rem; }

/* System / activity-log line in the Notes thread (asset-tracker audit trail).
   Deliberately quieter than a human comment: smaller, greyed, no accent. */
.bsc-cmt-sys { margin-bottom: .5rem; }
.bsc-cmt-sys .bsc-cmt-av-sys {
  background: transparent; color: var(--bsc-muted);
  font-size: .95rem; width: 32px; height: 32px;
}
.bsc-cmt-sys .bsc-cmt-card {
  background: transparent;
  border-style: dashed;
  border-left-width: 3px;
  border-left-style: solid;
  border-left-color: #ced4da;
}
.bsc-cmt-sys .bsc-cmt-hdr {
  background: transparent;
  border-bottom-color: transparent;
  padding-bottom: 0;
  font-size: .75rem;
  color: var(--bsc-muted);
}
.bsc-cmt-sys .bsc-cmt-body {
  padding-top: .15rem;
  font-size: .8rem;
  color: var(--bsc-muted);
}
.bsc-cmt-sys-tag {
  font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: #8a94a6; border: 1px solid #d5dae2; border-radius: 999px;
  padding: 0 .35rem; line-height: 1.35;
}

/* Password masking in resolution details */
.bsc-eye-btn, .bsc-copy-btn {
  font-size: .75rem;
  padding: .1rem .35rem;
  line-height: 1.4;
  vertical-align: middle;
  border-radius: .25rem;
}

.bsc-badge-internal {
  font-size: 0.65rem;
}

/* Card header counts */
.bsc-card-count {
  font-size: 0.75rem;
  font-weight: 400;
}

/* Attachments */
.bsc-att-name {
  max-width: 160px;
}

.bsc-upload-hint {
  font-size: 0.72rem;
}

/* Inline create form */
.bsc-create-card {
  border-left: 4px solid var(--bsc-accent);
}

.bsc-cc-hint {
  font-size: 0.78rem;
}

/* Inline chips-in-input field */
.bsc-cc-field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  min-height: 38px;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--bsc-border);
  border-radius: 0.375rem;
  background: #fff;
  cursor: text;
}

.bsc-cc-field:focus-within {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13,110,253,.25);
  outline: 0;
}

.bsc-cc-field input[type="text"] {
  border: none;
  outline: none;
  flex: 1;
  min-width: 160px;
  font-size: 0.875rem;
  background: transparent;
  padding: 0.1rem 0;
  color: var(--bsc-text);
}

.bsc-cc-field input[type="text"]::placeholder {
  color: #9ca3af;
}

.bsc-cc-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #fff8cc;
  border: 1px solid #ffd600;
  color: #7a6200;
  border-radius: 1rem;
  padding: 0.1rem 0.45rem;
  font-size: 0.73rem;
  font-weight: 500;
  white-space: nowrap;
}

.bsc-cc-chip button {
  background: none;
  border: none;
  padding: 0;
  line-height: 1;
  color: #7a6200;
  opacity: 0.55;
  cursor: pointer;
  font-size: 0.9rem;
}

.bsc-cc-chip button:hover {
  opacity: 1;
}

/* Checklist panel */
.bsc-checklist-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.38rem 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 0.875rem;
}

.bsc-checklist-item:last-child {
  border-bottom: none;
}

.bsc-checklist-btn,
.bsc-checklist-btn:hover,
.bsc-checklist-btn:focus,
.bsc-checklist-btn:focus-visible,
.bsc-checklist-btn:active {
  -webkit-appearance: none !important;
  appearance: none !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  padding: 0 !important;
  margin: 0 !important;
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  color: inherit;
}

.bsc-checklist-btn:hover {
  opacity: 0.7;
}

/* Tickets filter + sort */
.bsc-filter-select {
  max-width: 150px;
}

.bsc-sortable {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

/* Dark thead using sidebar color */
.bsc-thead-dark {
  --bs-table-color: #fff;
  --bs-table-bg: var(--bsc-sidebar-bg);
  --bs-table-border-color: #2d2d2d;
}
.bsc-thead-dark > tr > th,
.bsc-thead-dark > tr > td {
  background-color: var(--bsc-sidebar-bg) !important;
  color: #fff !important;
  border-bottom-color: #2d2d2d !important;
}
.bsc-thead-dark > tr > th.bsc-sortable:hover {
  background-color: rgba(255,255,255,0.07) !important;
}

.bsc-suggest-hint {
  font-size: 0.75rem;
  font-weight: 400;
}

/* Quick action buttons in tickets table */
.bsc-actions-col {
  width: 1px;
}

.bsc-qa-group {
  display: flex;
  align-items: center;
  gap: 0.1rem;
}

.bsc-qa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 0.25rem;
  background: transparent;
  color: #cbd5e1;
  cursor: pointer;
  font-size: 0.88rem;
  transition: background 0.12s, color 0.12s;
  text-decoration: none;
  padding: 0;
  flex-shrink: 0;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: none;
  outline: none;
}

.bsc-qa-btn:hover,
.bsc-qa-btn:focus {
  text-decoration: none;
  box-shadow: none;
  outline: none;
}

/* Colour variants — visible at rest, brighter on hover */
.bsc-qa-blue   { color: #93c5fd; }
.bsc-qa-violet { color: #c4b5fd; }
.bsc-qa-amber  { color: #fcd34d; }
.bsc-qa-open   { color: #6ee7b7; }

.bsc-qa-blue:hover,   .bsc-qa-blue:focus   { color: #3b82f6; background: #eff6ff; }
.bsc-qa-violet:hover, .bsc-qa-violet:focus { color: #7c3aed; background: #f5f3ff; }
.bsc-qa-amber:hover,  .bsc-qa-amber:focus  { color: #d97706; background: #fffbeb; }
.bsc-qa-open:hover,   .bsc-qa-open:focus   { color: #059669; background: #d1fae5; }

.bsc-qa-menu {
  min-width: 160px;
  font-size: 0.82rem;
}

.bsc-qa-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

/* Checklist inline edit */
.bsc-cl-text {
  flex: 1;
}

.bsc-cl-edit-form {
  display: none;
  flex: 1;
  align-items: center;
  gap: 0.35rem;
}

.bsc-cl-input {
  flex: 1;
  min-width: 0;
}

.bsc-qa-red { color: #fca5a5; }
.bsc-qa-red:hover, .bsc-qa-red:focus { color: #dc2626; background: #fef2f2; }

/* ===== MY PROFILE ===== */
.bsc-profile-header-card {
  border-left: 4px solid var(--bsc-accent);
}

.bsc-profile-header-inner {
  min-height: 160px;
}

/* Oval/circle avatar header */
.bsc-profile-photo-col {
  width: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1.5rem;
}

.bsc-profile-photo {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 3px solid #e9ecef;
}

.bsc-profile-initials-sq {
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--bsc-accent-dark);
  color: #111;
  letter-spacing: 0.04em;
  border-radius: 50%;
  width: 110px;
  height: 110px;
  flex-shrink: 0;
}

.bsc-profile-photo-fade {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 64px;
  background: linear-gradient(to right, transparent, #fff);
  pointer-events: none;
}

/* Legacy circular avatar (kept for fallback) */
.bsc-profile-avatar-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

.bsc-profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bsc-border);
}

.bsc-profile-initials {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bsc-accent-dark);
  color: #111;
  font-size: 1.6rem;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
  border: 2px solid var(--bsc-border);
}

/* Tenure section */
.bsc-tenure-days {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--bsc-accent-dark);
  line-height: 1;
}

.bsc-tenure-label {
  font-size: 0.75rem;
  color: var(--bsc-muted);
  margin-top: 0.3rem;
}

/* Activities row in Log Presence modal */
.bsc-activity-row .act-name {
  min-width: 120px;
}

/* Reports page */
.bsc-report-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bsc-profile-mgr-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e5e7eb;
  color: var(--bsc-muted);
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bsc-dept-badge {
  font-size: 0.72rem;
  font-weight: 500;
}

.min-width-0 {
  min-width: 0;
}

.bsc-asset-code {
  font-size: 0.7rem;
  font-family: monospace;
  color: var(--bsc-muted);
}

/* ===== DASHBOARD ===== */

.bsc-section-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--bsc-muted);
}

.bsc-section-icon {
  font-size: 0.85rem;
  flex-shrink: 0;
}

.bsc-panel-header-warn {
  background: #fffdf0;
}

/* Date/time card — light background */
.bsc-dash-dt-card {
  border-left: 4px solid var(--bsc-accent);
}

/* Hero strip at top of dashboard — normal spacing all sides */
.bsc-dash-hero-row {
  margin: 0 0 1.5rem;
}

.bsc-dash-greeting {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bsc-muted);
  font-weight: 600;
}

.bsc-dash-username {
  font-size: 1rem;
  font-weight: 700;
  color: var(--bsc-text);
  margin-top: 0.1rem;
}

.bsc-dash-day {
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bsc-accent-dark);
  font-weight: 700;
  margin-bottom: 0.1rem;
}

.bsc-dash-date {
  font-size: 1rem;
  font-weight: 600;
  color: var(--bsc-muted);
  margin-bottom: 0.05rem;
}

.bsc-dash-clock {
  font-size: 2.8rem;
  font-weight: 900;
  color: var(--bsc-accent-dark);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
}

/* Mini calendar */
.bsc-cal {
  -webkit-user-select: none;
  user-select: none;
  min-width: 164px;
}

.bsc-cal-hdr {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--bsc-muted);
  text-align: center;
  margin-bottom: 0.4rem;
}

.bsc-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px 1px;
}

.bsc-cal-dh {
  font-size: 0.58rem;
  font-weight: 700;
  text-align: center;
  color: var(--bsc-muted);
  padding-bottom: 3px;
}

.bsc-cal-day {
  font-size: 0.68rem;
  text-align: center;
  padding: 2px 1px;
  color: var(--bsc-text);
  line-height: 1.5;
  border-radius: 3px;
}

.bsc-cal-today {
  background: var(--bsc-accent);
  color: #111;
  font-weight: 800;
  border-radius: 50%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: auto;
  width: 1.5em;
  height: 1.5em;
}

/* ── 2-section greeting card (left: greeting+weather, right: FX) ──────────── */
.bsc-dash-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.bsc-dash-section-greeting { flex: 0 0 200px; }
.bsc-dash-section-weather  { flex: 0 0 auto; align-items: center; }
.bsc-dash-section-fx       { flex: 1 1 0; min-width: 0; }

/* ── FX currency grid ─────────────────────────────────────────────────────── */
.bsc-fx-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .45rem;
  margin-top: .4rem;
}
.bsc-fx-tile2 {
  background: var(--bsc-card);
  border: 1px solid var(--bsc-border);
  border-radius: .4rem;
  padding: .35rem .45rem .3rem;
}
.bsc-fx-tile2-hdr {
  display: flex;
  align-items: baseline;
  gap: .3rem;
  margin-bottom: .2rem;
}
.bsc-fx-tile2-code {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--bsc-muted);
}
.bsc-fx-tile2-rate {
  font-size: .92rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--bsc-text);
  flex: 1;
}
.bsc-fx-chart-wrap {
  display: flex;
  align-items: stretch;
  gap: 2px;
}
.bsc-fx-sparkline {
  flex: 1;
  height: 44px;
  display: block;
  min-width: 0;
}
.bsc-fx-chart-ylabels {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-left: 2px;
  font-size: .58rem;
  color: var(--bsc-muted);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.bsc-fx-chart-xlabels {
  display: flex;
  justify-content: space-between;
  font-size: .58rem;
  color: var(--bsc-muted);
  margin-top: 1px;
  line-height: 1;
}

/* ── FX refresh label ─────────────────────────────────────────────────────── */
.bsc-fx-refresh-lbl {
  font-size: .62rem;
  color: var(--bsc-muted);
  font-style: italic;
  white-space: nowrap;
}

/* ── FX calculator ────────────────────────────────────────────────────────── */
.bsc-fx-calc-wrap {
  margin-top: .5rem;
  padding-top: .45rem;
  border-top: 1px solid var(--bsc-border);
}
/* bsc-fx-ccy-btn inherits bsc-pvm-tab — just reduce size to match the input */
.bsc-fx-ccy-btn {
  font-size: .72rem;
  padding: .25rem .55rem;
}
.bsc-fx-calc-input {
  width: 90px;
  font-size: .8rem;
  padding: .2rem .4rem;
  font-variant-numeric: tabular-nums;
}
.bsc-fx-calc-results {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .2rem .65rem;
}
.bsc-fx-calc-result-row {
  display: flex;
  align-items: center;
  gap: .25rem;
  font-size: .8rem;
}
.bsc-fx-calc-result-code { font-weight: 700; color: var(--bsc-muted); font-size: .7rem; }
.bsc-fx-calc-result-val  { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--bsc-text); }

/* Weather */
.bsc-wx-icon {
  font-size: 3rem;
  color: var(--bsc-accent-dark);
  flex-shrink: 0;
}

.bsc-wx-temp {
  font-size: 2rem;
  font-weight: 800;
  color: var(--bsc-text);
  line-height: 1;
}

.bsc-wx-label {
  font-size: 0.85rem;
  color: var(--bsc-muted);
  margin-top: 0.15rem;
}

.bsc-wx-city {
  font-size: 0.78rem;
  color: var(--bsc-muted);
  margin-top: 0.3rem;
}

.bsc-wx-details {
  font-size: 0.8rem;
  line-height: 1.8;
}

/* Module tiles */
.bsc-dash-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.25rem 0.75rem;
  background: var(--bsc-card);
  border: 1px solid var(--bsc-border);
  border-radius: 0.5rem;
  text-decoration: none;
  color: var(--bsc-text);
  min-height: 90px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s var(--ease-out);
  cursor: pointer;
  width: 100%;
}

.bsc-dash-tile:hover {
  border-color: var(--bsc-accent);
  box-shadow: 0 0 0 2px rgba(255,214,0,0.2);
  color: var(--bsc-text);
  text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
  .bsc-dash-tile:hover {
    transform: translateY(-1px);
  }
}

.bsc-dash-tile i {
  font-size: 1.5rem;
  color: var(--bsc-accent-dark);
}

.bsc-dash-tile span {
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
}

.bsc-dash-tile-active {
  border-color: var(--bsc-accent);
  background: #fffbe6;
}

.bsc-dash-tile-active i {
  color: var(--bsc-accent-dark);
}

.bsc-dash-tile-soon {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Smaller tile variant for Quick Access in 50%-width column */
.bsc-dash-tile-sm {
  padding: 0.65rem 0.5rem;
  min-height: 64px;
  gap: 0.3rem;
}

.bsc-dash-tile-sm i {
  font-size: 1.1rem;
}

.bsc-dash-tile-sm span {
  font-size: 0.7rem;
}

/* News sections */
.bsc-news-body {
  min-height: 200px;
}

.bsc-news-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 180px;
  color: var(--bsc-muted);
  text-align: center;
}

.bsc-news-empty i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.4;
}

.bsc-news-empty p {
  margin: 0;
  font-size: 0.875rem;
}

.bsc-news-empty small {
  font-size: 0.75rem;
  opacity: 0.7;
}

/* Country tabs in PV news */
.bsc-news-tabs {
  display: flex;
  gap: 0.25rem;
}

.bsc-news-tab {
  background: transparent;
  border: 1px solid var(--bsc-border);
  border-radius: 0.25rem;
  padding: 0.1rem 0.45rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--bsc-muted);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}

.bsc-news-tab:hover {
  background: #f3f4f6;
  color: var(--bsc-text);
}

.bsc-news-tab.active {
  background: var(--bsc-accent);
  border-color: var(--bsc-accent);
  color: #111;
}

/* Calendar weekend days */
.bsc-cal-wknd {
  color: #b45309;
  font-weight: 600;
}

/* News cards */
.bsc-news-card {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--bsc-border);
}

.bsc-news-card:last-child {
  border-bottom: none;
}

.bsc-news-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--bsc-text);
  margin-bottom: 0.15rem;
  line-height: 1.35;
}

.bsc-news-title a {
  color: inherit;
  text-decoration: none;
}

.bsc-news-title a:hover {
  color: var(--bsc-accent-dark);
  text-decoration: underline;
}

.bsc-news-summary {
  font-size: 0.75rem;
  color: var(--bsc-muted);
  line-height: 1.4;
  margin-bottom: 0.2rem;
}

.bsc-news-meta {
  font-size: 0.7rem;
  color: var(--bsc-muted);
  opacity: 0.8;
}

/* Company news scrollable body */
.bsc-company-news-scroll {
  /* no fixed max-height — grows with content */
}

.bsc-news-editor {
  min-height: 180px;
}

/* ── Access Request Module ───────────────────────────────────────────────── */

.bsc-access-steps {
  display: flex;
  align-items: center;
  gap: 0;
}

.bsc-access-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.bsc-access-step-dot {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 2px solid var(--bsc-border);
  background: var(--bsc-card);
  color: var(--bsc-muted);
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}

.bsc-access-step.active .bsc-access-step-dot {
  background: var(--bsc-accent);
  border-color: var(--bsc-accent);
  color: #111;
}

.bsc-access-step.done .bsc-access-step-dot {
  background: var(--bsc-accent-dark);
  border-color: var(--bsc-accent-dark);
  color: #fff;
}

.bsc-access-step-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--bsc-muted);
  white-space: nowrap;
}

.bsc-access-step.active .bsc-access-step-label {
  color: var(--bsc-text);
}

.bsc-access-step-line {
  flex: 1;
  height: 2px;
  background: var(--bsc-border);
  margin: 0 0.5rem;
  margin-bottom: 1rem;
  min-width: 2rem;
}

/* Type selection cards */
.bsc-access-type-card {
  border: 2px solid var(--bsc-border);
  border-radius: 0.5rem;
  background: var(--bsc-card);
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  height: 100%;
}

.bsc-access-type-card:hover {
  border-color: var(--bsc-accent);
  box-shadow: 0 0 0 3px rgba(255,214,0,0.15);
}

/* When used as <a> tag (e.g. parking locations) — inherit text colour */
a.bsc-access-type-card,
a.bsc-access-type-card:hover {
  color: inherit;
}

.bsc-access-type-card.selected {
  border-color: var(--bsc-accent);
  background: #fffbe6;
  box-shadow: 0 0 0 3px rgba(255,214,0,0.2);
}

.bsc-access-type-icon {
  font-size: 2.5rem;
  color: var(--bsc-accent-dark);
}

.bsc-flag-circle {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.12);
  display: inline-block;
  flex-shrink: 0;
}
.bsc-flag-pl { background: linear-gradient(to bottom, #fff 50%, #DC143C 50%); }
.bsc-flag-lt { background: linear-gradient(to bottom, #FDB913 33.33%, #006A44 33.33%, #006A44 66.66%, #C1272D 66.66%); }
.bsc-flag-es { background: linear-gradient(to bottom, #C60B1E 25%, #FFC400 25%, #FFC400 75%, #C60B1E 75%); }
.bsc-flag-de { background: linear-gradient(to bottom, #000 33.33%, #D00 33.33%, #D00 66.66%, #FFCE00 66.66%); }
.bsc-flag-it { background: linear-gradient(to right, #009246 33.33%, #fff 33.33%, #fff 66.66%, #CE2B37 66.66%); }
.bsc-flag-gl { background: radial-gradient(circle at 50% 50%, #60a5fa 40%, #93c5fd 100%); }

/* Permission / option cards */
.bsc-access-perm-card {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border: 1.5px solid var(--bsc-border);
  border-radius: 0.375rem;
  background: var(--bsc-card);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--bsc-muted);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}

.bsc-access-perm-card:hover {
  border-color: var(--bsc-accent);
  color: var(--bsc-text);
}

.bsc-access-perm-card.selected {
  border-color: var(--bsc-accent);
  background: #fffbe6;
  color: #111;
}

.bsc-access-perm-card i {
  font-size: 1rem;
  color: var(--bsc-accent-dark);
}

/* Library chips */
.bsc-access-lib-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  border: 1.5px solid var(--bsc-border);
  border-radius: 1rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--bsc-card);
  color: var(--bsc-muted);
  transition: border-color 0.1s, background 0.1s, color 0.1s;
}

.bsc-access-lib-chip:hover {
  border-color: var(--bsc-accent);
  color: var(--bsc-text);
}

.bsc-access-lib-chip.selected {
  background: var(--bsc-accent);
  border-color: var(--bsc-accent);
  color: #111;
}

/* Email chips */
.bsc-access-chip-box {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  min-height: 1.5rem;
}

.bsc-access-email-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #fffbe6;
  border: 1px solid var(--bsc-accent);
  border-radius: 1rem;
  padding: 0.15rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.bsc-access-chip-remove {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--bsc-muted);
  padding: 0;
  line-height: 1;
}

.bsc-access-chip-remove:hover { color: #dc2626; }

/* Review panel */
.bsc-access-review-section {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--bsc-muted);
  border-bottom: 1px solid var(--bsc-border);
  padding-bottom: 0.25rem;
  margin-bottom: 0.5rem;
}

.bsc-access-review-row {
  display: flex;
  gap: 1rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 0.82rem;
}

.bsc-access-review-label {
  width: 10rem;
  flex-shrink: 0;
  color: var(--bsc-muted);
  font-weight: 600;
}

.bsc-access-review-value {
  flex: 1;
  color: var(--bsc-text);
}

.bsc-access-review-text {
  font-size: 0.82rem;
  color: var(--bsc-text);
  line-height: 1.5;
  background: #f9fafb;
  border-radius: 0.375rem;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.5rem;
}

.bsc-access-checklist {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
}

.bsc-access-checklist li {
  font-size: 0.8rem;
  color: var(--bsc-text);
  padding: 0.2rem 0;
}

/* ── PV Market Intelligence ──────────────────────────────────────────────── */
.bsc-pvm-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.bsc-pvm-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  background: var(--bsc-card);
  border: 1px solid var(--bsc-border);
  border-radius: 0.375rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--bsc-muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.bsc-pvm-tab:hover {
  background: #f9fafb;
  color: var(--bsc-text);
}

.bsc-pvm-tab.active {
  background: var(--bsc-accent);
  border-color: var(--bsc-accent);
  color: #111;
}

.bsc-pvm-flag {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  opacity: 0.7;
}

.bsc-pvm-tab.active .bsc-pvm-flag {
  opacity: 1;
}

/* Card wrapper (reuses .bsc-card defined below) */
.bsc-card {
  background: var(--bsc-card);
  border: 1px solid var(--bsc-border);
  border-radius: 0.5rem;
  overflow: hidden;
}

.bsc-pvm-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--bsc-border);
  background: #fafafa;
}

.bsc-pvm-panel-lbl {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--bsc-muted);
}

/* Plain section divider between multiple card-groups on one dashboard-style
   page (2026-09-16, Admin Panel Access page) -- same typography as
   .bsc-pvm-panel-lbl (a single card's own header label) but standalone,
   no box/border, for grouping several cards under one heading instead. */
.bsc-admin-section-lbl {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--bsc-muted);
  margin-bottom: 0.75rem;
}

.bsc-pvm-ts {
  font-size: 0.7rem;
  color: var(--bsc-muted);
}

.bsc-pvm-section-icon {
  color: var(--bsc-accent-dark);
}

.bsc-pvm-subtitle {
  font-size: 0.8rem;
}

/* News body */
.bsc-pvm-news-body {
  min-height: 200px;
}

.bsc-pvm-loading,
.bsc-pvm-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  color: var(--bsc-muted);
  font-size: 0.82rem;
  gap: 0.4rem;
}

.bsc-pvm-empty i {
  font-size: 1.8rem;
  opacity: 0.35;
}

.bsc-pvm-empty p {
  margin: 0;
  font-size: 0.82rem;
}

.bsc-pvm-empty small {
  font-size: 0.72rem;
  opacity: 0.7;
}

/* News cards */
.bsc-pvm-card {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--bsc-border);
  transition: background 0.1s;
}

.bsc-pvm-card:last-child {
  border-bottom: none;
}

.bsc-pvm-card:hover {
  background: #fafbff;
}

#dash-ann-list .bsc-pvm-card { cursor: pointer; }
.bsc-pvm-card-selected,
.bsc-pvm-card-selected:hover {
  background: #eef2ff;
  border-left: 3px solid var(--bsc-accent);
  padding-left: calc(1rem - 3px);
}

.bsc-pvm-card-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
  flex-wrap: wrap;
}

.bsc-pvm-date {
  font-size: 0.7rem;
  color: var(--bsc-muted);
}

.bsc-pvm-source-badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 0.2rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #fff;
}

.bsc-pvm-card-title {
  display: block;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--bsc-text);
  text-decoration: none;
  line-height: 1.4;
  margin-bottom: 0.25rem;
}

.bsc-pvm-card-title:hover {
  color: var(--bsc-accent-dark);
  text-decoration: underline;
}

.bsc-pvm-card-summary {
  font-size: 0.76rem;
  color: var(--bsc-muted);
  line-height: 1.45;
  margin-bottom: 0.3rem;
}

.bsc-pvm-read-more {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--bsc-accent-dark);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.bsc-pvm-read-more:hover {
  color: var(--bsc-accent-hover);
}

/* ── Dashboard Announcements split panel ────────────────────────────────── */
.bsc-dash-ann-latest      { padding: 1rem; }
.bsc-dash-ann-title       { font-size: .88rem; font-weight: 700; margin-bottom: .5rem; line-height: 1.4; }
.bsc-dash-ann-content     { font-size: .82rem; line-height: 1.65; color: var(--bsc-text); }
.bsc-dash-ann-content p:last-child  { margin-bottom: 0; }
.bsc-dash-ann-content ul,
.bsc-dash-ann-content ol  { padding-left: 1.25rem; }
.bsc-dash-ann-content img { max-width: 100%; height: auto; border-radius: .25rem; }

/* Key sources panel */
.bsc-pvm-sources {
  display: flex;
  flex-direction: column;
}

.bsc-pvm-source-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--bsc-border);
  text-decoration: none;
  color: var(--bsc-text);
  transition: background 0.1s;
}

.bsc-pvm-source-item:last-child {
  border-bottom: none;
}

.bsc-pvm-source-item:hover {
  background: #fffbe6;
  text-decoration: none;
}

.bsc-pvm-source-icon {
  font-size: 0.85rem;
  color: var(--bsc-accent-dark);
  margin-top: 0.12rem;
  flex-shrink: 0;
}

.bsc-pvm-source-name {
  font-size: 0.77rem;
  font-weight: 600;
  line-height: 1.3;
}

.bsc-pvm-source-desc {
  font-size: 0.7rem;
  color: var(--bsc-muted);
  line-height: 1.3;
}

.bsc-pvm-source-ext {
  font-size: 0.65rem;
  color: var(--bsc-muted);
  opacity: 0.5;
  align-self: center;
}

.bsc-pvm-source-item:hover .bsc-pvm-source-ext {
  opacity: 1;
  color: var(--bsc-accent-dark);
}

/* Spinning loader animation */
@keyframes bsc-spin {
  to { transform: rotate(360deg); }
}

.bsc-spin {
  display: inline-block;
  will-change: transform;
  animation: bsc-spin 0.8s linear infinite;
}

/* Quill editor overrides */
.bsc-quill-editor {
  min-height: 120px;
}

.bsc-quill-modal {
  min-height: 140px;
}

.bsc-desc-editor {
  min-height: 90px;
}

.ql-toolbar.ql-snow {
  border-radius: 0.375rem 0.375rem 0 0;
  border-color: var(--bsc-border);
  font-family: inherit;
}

.ql-container.ql-snow {
  border-radius: 0 0 0.375rem 0.375rem;
  border-color: var(--bsc-border);
  font-family: inherit;
  font-size: 0.875rem;
}

/* ── Access Request — additional classes ────────────────────────────────── */

.bsc-access-lib-loading { font-size: 0.72rem; }
.bsc-access-lib-desc { font-size: 0.78rem; }
.bsc-access-form-hint { font-size: 0.75rem; }
.bsc-alert-sm { font-size: 0.8rem; }
.bsc-alert-sm-x { font-size: 0.82rem; }
.bsc-access-date-input { max-width: 220px; }

/* File browser */
.bsc-access-browser-body {
  max-height: 320px;
  overflow-y: auto;
  border-top: 1px solid var(--bsc-border);
}

.bsc-access-browser-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 1rem;
  border-bottom: 1px solid var(--bsc-border);
  transition: background 0.08s;
}

.bsc-access-browser-item:last-child { border-bottom: none; }
.bsc-access-browser-item:hover { background: #fafafa; }
.bsc-access-browser-item.selected-item { background: #fffbe6; }

.bsc-access-browser-icon {
  width: 1.2rem;
  flex-shrink: 0;
  text-align: center;
  font-size: 1rem;
}

.bsc-access-browser-name {
  flex: 1;
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.bsc-access-browser-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.bsc-browser-btn {
  background: none;
  border: 1px solid transparent;
  padding: 0.1rem 0.45rem;
  font-size: 0.73rem;
  font-weight: 600;
  border-radius: 0.25rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
}

.bsc-browser-btn-select { color: #16a34a; }
.bsc-browser-btn-select:hover {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}

.bsc-browser-btn-open { color: var(--bsc-accent-dark); }
.bsc-browser-btn-open:hover {
  background: #fffbe6;
  border-color: var(--bsc-accent);
  color: var(--bsc-accent-hover);
}

.bsc-access-browser-crumb { font-size: 0.78rem; }

.bsc-access-browser-crumb-item {
  color: var(--bsc-muted);
  cursor: pointer;
  transition: color 0.1s;
}

.bsc-access-browser-crumb-item:hover { color: var(--bsc-accent-dark); text-decoration: underline; }

.bsc-access-browser-crumb-item.active {
  color: var(--bsc-text);
  font-weight: 600;
  cursor: default;
}

.bsc-access-browser-crumb-item.active:hover { text-decoration: none; }

.bsc-access-browser-crumb-sep {
  font-size: 0.6rem;
  color: var(--bsc-muted);
}

.bsc-access-browser-selected {
  font-size: 0.82rem;
  background: #f0fdf4;
  color: var(--bsc-text);
}

.bsc-browser-folder-icon { color: #f59e0b; }

.bsc-browser-state-msg {
  padding: 0.75rem 1rem;
  color: var(--bsc-muted);
  font-size: 0.82rem;
}

/* ── Hardware Module ──────────────────────────────────────────────────────── */

.bsc-hw-item-card {
  background: var(--bsc-card);
  border: 1.5px solid var(--bsc-border);
  border-left: 4px solid var(--bsc-accent-dark);
  border-radius: 0.5rem;
  overflow: hidden;
}

.bsc-hw-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 1rem;
  background: #fafafa;
  border-bottom: 1px solid var(--bsc-border);
}

.bsc-hw-item-num {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--bsc-muted);
}

.bsc-hw-item-remove {
  background: none;
  border: none;
  padding: 0.15rem 0.35rem;
  color: var(--bsc-muted);
  cursor: pointer;
  border-radius: 0.25rem;
  line-height: 1;
  font-size: 0.78rem;
  transition: background 0.1s, color 0.1s;
}

.bsc-hw-item-remove:hover {
  background: #fee2e2;
  color: #dc2626;
}

/* Hardware type chip selector */
.bsc-hw-type-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.bsc-hw-type-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border: 1.5px solid var(--bsc-border);
  border-radius: 1rem;
  background: var(--bsc-card);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--bsc-muted);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
  -webkit-user-select: none;
  user-select: none;
}

.bsc-hw-type-chip i {
  font-size: 0.88rem;
}

.bsc-hw-type-chip:hover {
  border-color: var(--bsc-accent);
  color: var(--bsc-text);
}

.bsc-hw-type-chip.selected {
  border-color: var(--bsc-accent);
  background: #fffbe6;
  color: #111;
}

/* Card count badge in card headers */
.bsc-card-count {
  font-size: 0.72rem;
  font-weight: 700;
}

/* Asset serial / cpu text */
.bsc-asset-serial {
  font-family: monospace;
  font-size: 0.78rem;
}

.bsc-asset-cpu {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Profile page ─────────────────────────────────────────────────────────── */

/* Accent-coloured icon (replaces inline style) */
.bsc-accent-icon {
  color: var(--bsc-accent-dark);
}

/* Direct-report avatar (smaller variant) */
.bsc-profile-dr-avatar {
  width: 32px;
  height: 32px;
  font-size: 0.75rem;
}

/* ── Attendance calendar ─────────────────────────────────────────────────── */

.bsc-att-calendar {
  -webkit-user-select: none;
  user-select: none;
}

.bsc-att-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.bsc-att-header {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--bsc-muted);
  padding: 4px 0;
}

.bsc-att-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: default;
}

.bsc-att-empty {
  background: transparent;
}

.bsc-att-cell.bsc-att-present {
  background: #d1fae5;
  color: #065f46;
}

.bsc-att-cell.bsc-att-absent {
  background: #f3f4f6;
  color: #6b7280;
}

.bsc-att-cell.bsc-att-weekend {
  background: #f9fafb;
  color: #9ca3af;
  font-weight: 400;
}

.bsc-att-cell.bsc-att-future {
  background: transparent;
  color: #d1d5db;
}

.bsc-att-legend {
  font-size: 0.75rem;
  color: var(--bsc-muted);
}

.bsc-att-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.bsc-att-dot.bsc-att-present { background: #d1fae5; border: 1px solid #a7f3d0; }
.bsc-att-dot.bsc-att-absent  { background: #f3f4f6; border: 1px solid #e5e7eb; }
.bsc-att-dot.bsc-att-weekend { background: #f9fafb; border: 1px solid #e5e7eb; }

.bsc-cal-nav {
  width: 32px;
  height: 28px;
  padding: 0;
  flex-shrink: 0;
}

/* Segment switcher (PV / BESS) */
.bsc-segment-switcher {
  border-bottom: 1px solid var(--bsc-border);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.bsc-segment-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  border: 1px solid var(--bsc-border);
  background: transparent;
  color: var(--bsc-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.bsc-segment-btn:hover {
  background: #f9fafb;
  color: var(--bsc-text);
}

.bsc-segment-btn.active {
  background: var(--bsc-accent-dark);
  color: #fff;
  border-color: var(--bsc-accent-dark);
}

/* ── Profile: Org chart ──────────────────────────────────────────────────── */

.bsc-org-tree {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem 0.75rem 1rem;
  gap: 0;
}

.bsc-org-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.bsc-org-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #e5e7eb;
  color: var(--bsc-muted);
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: 0.35rem;
  border: 2px solid var(--bsc-border);
}

.bsc-org-avatar-me {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--bsc-accent-dark);
  color: #111;
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: 0.35rem;
  border: 3px solid var(--bsc-accent);
}

.bsc-org-name {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  max-width: 120px;
  word-break: break-word;
  color: var(--bsc-text);
}

.bsc-org-title {
  font-size: 0.68rem;
  color: var(--bsc-muted);
  line-height: 1.3;
  max-width: 120px;
  word-break: break-word;
}

.bsc-org-you-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  background: var(--bsc-accent-dark);
  color: #111;
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  margin-top: 0.2rem;
}

.bsc-org-connector {
  width: 2px;
  background: var(--bsc-border);
  height: 18px;
  align-self: center;
}

.bsc-org-reports-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 0.75rem;
  padding-top: 0.25rem;
  width: 100%;
}

.bsc-org-section-lbl {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--bsc-muted);
  margin-bottom: 0.25rem;
  align-self: center;
}

/* ── Employees: list avatar ──────────────────────────────────────────────── */

.bsc-emp-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e5e7eb;
  color: var(--bsc-muted);
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  object-fit: cover;  /* only relevant when used on a real <img>, e.g. Projects' PM photo */
}

/* Smaller variant for inline table cells (2026-09-22, Projects PM column
   -- also applied to the real <img> photo, not just the initials-only
   fallback span, so both are the exact same size/shape) */
.bsc-emp-avatar-xs {
  width: 22px;
  height: 22px;
  font-size: 0.65rem;
  object-fit: cover;
}

/* Clickable badge/link -> opens a detail modal without leaving the page
   (2026-09-22, Projects SPV/PM columns) */
.bsc-badge-link {
  cursor: pointer;
}
.bsc-badge-link:hover {
  opacity: 0.75;
}

/* ── Employees: org chart ────────────────────────────────────────────────── */

/* One root (or multiple roots) stacked vertically */
.bsc-oc-tree {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2rem;
  overflow-x: auto;
  padding: 0.25rem 0.25rem 1rem;
}

/* Node = card + optional children block below */
.bsc-oc-node {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
}

/* Card: avatar LEFT, info RIGHT — horizontal compact layout */
.bsc-oc-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  text-align: left;
  background: var(--bsc-card-bg);
  border: 1px solid var(--bsc-border);
  border-radius: 8px;
  padding: 0.4rem 0.85rem 0.4rem 0.5rem;
  min-width: 175px;
  max-width: 290px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  transition: box-shadow 0.15s, border-color 0.15s;
}
.bsc-oc-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
  border-color: #9ca3af;
}

.bsc-oc-root > .bsc-oc-card {
  border-color: var(--bsc-accent);
  border-width: 2px;
}

/* Smaller avatar — fits the compact row card */
.bsc-oc-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: #e5e7eb;
  color: var(--bsc-muted);
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bsc-oc-root > .bsc-oc-card .bsc-oc-avatar {
  background: var(--bsc-accent-dark);
  color: #111;
}

/* Info block to the right of the avatar */
.bsc-oc-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.bsc-oc-name {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  word-break: break-word;
  color: var(--bsc-text);
}

.bsc-oc-title {
  font-size: 0.68rem;
  color: var(--bsc-muted);
  line-height: 1.2;
  margin-top: 0.1rem;
}

.bsc-oc-dept {
  font-size: 0.63rem;
  color: var(--bsc-accent-dark);
  font-weight: 600;
  margin-top: 0.05rem;
}

.bsc-oc-country {
  font-size: 0.68rem;
  color: var(--bsc-muted);
  margin-top: 0.05rem;
}

/*
 * Children: stacked vertically below the parent.
 * border-left = the vertical connector line running alongside all children.
 */
.bsc-oc-children {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-left: 1.1rem;      /* horizontal offset — positions line under the card */
  padding-left: 1.4rem;     /* space between the vertical line and the child card */
  border-left: 2px solid #d1d5db;
  padding-top: 0.35rem;
  padding-bottom: 0.1rem;
  margin-top: 0.25rem;
}

/* Horizontal branch from the vertical bar to each child card */
.bsc-oc-children > .bsc-oc-node {
  position: relative;
}
.bsc-oc-children > .bsc-oc-node::before {
  content: '';
  position: absolute;
  left: -1.4rem;   /* matches padding-left above */
  top: 20px;       /* ~half the card height (32px avatar + 2×6.4px padding ≈ 45px → 22px) */
  width: 1.4rem;
  height: 2px;
  background: #d1d5db;
}

.bsc-oc-highlight > .bsc-oc-card {
  outline: 2px solid var(--bsc-accent);
  box-shadow: 0 0 0 4px var(--bsc-accent-light, #fef9c3);
}

/*
 * ── Classic Tree style ──────────────────────────────────────────────────────
 * Applied when #org-chart-body has .bsc-oc-style-classic.
 * Restores the old "card stacked vertically, children spread horizontally" layout.
 */

/* Org chart body: horizontal scroll instead of clipping */
#org-chart-body {
  overflow-x: auto;
  overflow-y: visible;
}

/* Roots centered horizontally */
.bsc-oc-style-classic .bsc-oc-tree {
  align-items: flex-start;
  width: max-content;
  min-width: 100%;
}

/* Each node: column, centered */
.bsc-oc-style-classic .bsc-oc-node {
  align-items: center;
}

/* Card: vertical layout — avatar top, info below */
.bsc-oc-style-classic .bsc-oc-card {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
  min-width: 130px;
  max-width: 170px;
  padding: 0.75rem 1rem;
  border-radius: 10px;
}

.bsc-oc-style-classic .bsc-oc-avatar {
  width: 44px;
  height: 44px;
  min-width: 44px;
  margin-bottom: 0.4rem;
  font-size: 1rem;
}

.bsc-oc-style-classic .bsc-oc-root > .bsc-oc-card .bsc-oc-avatar {
  width: 52px;
  height: 52px;
  min-width: 52px;
}

/* Info: center-aligned text */
.bsc-oc-style-classic .bsc-oc-info {
  align-items: center;
}

/* Children: horizontal row with a border-top connector bar */
.bsc-oc-style-classic .bsc-oc-children {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  align-items: flex-start;

  /* Reset vertical-style properties */
  border-left: none;
  margin-left: 0;
  padding-left: 0;
  padding-bottom: 0;

  /* Classic connector */
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 2px solid var(--bsc-border);
  position: relative;
}

/* Vertical stem: from parent card down to the horizontal bar */
.bsc-oc-style-classic .bsc-oc-children::before {
  content: '';
  position: absolute;
  top: -1rem;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 1rem;
  background: var(--bsc-border);
}

/* Hide vertical-style's horizontal branches to child cards */
.bsc-oc-style-classic .bsc-oc-children > .bsc-oc-node::before {
  display: none;
}

/*
 * ── Depth 3+ nodes: switch to compact vertical column ─────────────────────
 * CEO (depth 0) → VP (depth 1, row) → Dir (depth 2, row) → Mgr+ (depth 3+, COLUMN)
 * Selector: a .bsc-oc-children that is direct child of a node
 *           which itself is inside at least 2 ancestor nodes.
 */
.bsc-oc-style-classic .bsc-oc-node .bsc-oc-node .bsc-oc-node > .bsc-oc-children {
  flex-direction: column;
  align-items: flex-start;
  flex-wrap: nowrap;
  justify-content: flex-start;

  /* Replace horizontal bar connector with left-side vertical bar */
  border-top: none;
  padding-top: 0;
  border-left: 2px solid var(--bsc-border, #dee2e6);
  margin-left: 1rem;
  margin-top: 0.35rem;
  padding-left: 0.75rem;
  gap: 0.35rem;
}

/* Remove the vertical stem (::before) — not needed in column mode */
.bsc-oc-style-classic .bsc-oc-node .bsc-oc-node .bsc-oc-node > .bsc-oc-children::before {
  display: none;
}

/* Node alignment in column: left-aligned, not centered */
.bsc-oc-style-classic .bsc-oc-node .bsc-oc-node .bsc-oc-node {
  align-items: flex-start;
}

/* Compact horizontal card for depth 3+ nodes */
.bsc-oc-style-classic .bsc-oc-node .bsc-oc-node .bsc-oc-node .bsc-oc-card {
  flex-direction: row;
  align-items: center;
  text-align: left;
  gap: 0.45rem;
  padding: 0.35rem 0.6rem;
  min-width: 160px;
  max-width: 240px;
  border-radius: 8px;
}

.bsc-oc-style-classic .bsc-oc-node .bsc-oc-node .bsc-oc-node .bsc-oc-avatar {
  width: 28px;
  height: 28px;
  min-width: 28px;
  font-size: 0.72rem;
  margin-bottom: 0;
}

.bsc-oc-style-classic .bsc-oc-node .bsc-oc-node .bsc-oc-node .bsc-oc-info {
  align-items: flex-start;
}

.bsc-oc-style-classic .bsc-oc-node .bsc-oc-node .bsc-oc-node .bsc-oc-name {
  font-size: 0.77rem;
}

/* Small horizontal tick connector from left bar to each child card */
.bsc-oc-style-classic .bsc-oc-node .bsc-oc-node .bsc-oc-node > .bsc-oc-children > .bsc-oc-node {
  position: relative;
  padding-left: 0.6rem;
}
.bsc-oc-style-classic .bsc-oc-node .bsc-oc-node .bsc-oc-node > .bsc-oc-children > .bsc-oc-node::before {
  content: '';
  display: block;
  position: absolute;
  left: -0.75rem;
  top: 0.62rem;
  width: 0.75rem;
  height: 2px;
  background: var(--bsc-border, #dee2e6);
}

/* ── Multi-select dropdown (bscMSel) ─────────────────────────────────────── */

.bsc-ms-host { position: relative; }
.bsc-ms-btn {
  display: block;
  width: 100%;
  padding: 0.375rem 2.25rem 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
  color: #212529 !important;
  background-color: #fff !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  border: 1px solid #dee2e6 !important;
  border-radius: 0.375rem;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-user-select: none;
  user-select: none;
}
.bsc-ms-btn:hover { background-color: #f8f9fa !important; }
.bsc-ms-drop {
  background: #fff;
  border: 1px solid #dee2e6 !important;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12) !important;
}
.bsc-ms-item {
  cursor: pointer;
  font-size: 0.84rem;
  white-space: nowrap;
}
.bsc-ms-item:hover { background: #f0f0f0; }
.bsc-ms-item label { cursor: pointer; overflow: hidden; text-overflow: ellipsis; }
:root[data-theme="dark"] .bsc-ms-btn  {
  background-color: #1f2937 !important; border-color: #374151 !important; color: #f9fafb !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23adb5bd' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] .bsc-ms-btn:hover { background-color: #374151 !important; }
:root[data-theme="dark"] .bsc-ms-drop { background: #1f2937 !important; border-color: #374151 !important; }
:root[data-theme="dark"] .bsc-ms-item:hover { background: #374151; }

/* ── Employees: dept chip + chart search ─────────────────────────────────── */

.bsc-dept-chip {
  display: inline-block;
  font-size: 0.65rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-weight: 600;
}

.bsc-chart-search {
  width: 180px;
}
#chart-search        { width: auto; min-width: 180px; max-width: 240px; }
#chart-filter-country{ width: 140px; }
#chart-filter-dept   { width: 160px; }

.bsc-emp-row:hover td {
  background: #f9fafb;
}

/* ── Attendance calendar: smaller variant ────────────────────────────────── */

.bsc-att-sm .bsc-att-grid {
  gap: 2px;
}

.bsc-att-sm .bsc-att-cell,
.bsc-att-sm .bsc-att-empty {
  font-size: 0.65rem;
  border-radius: 3px;
}

.bsc-att-sm .bsc-att-header {
  font-size: 0.6rem;
  padding: 1px 0;
}

/* ── Attendance: work presence types ─────────────────────────────────────── */

.bsc-att-cell.bsc-att-wfo  { background: #d1fae5; color: #065f46; }
.bsc-att-cell.bsc-att-wfh  { background: #dbeafe; color: #1e40af; }
.bsc-att-cell.bsc-att-field{ background: #ffedd5; color: #9a3412; }
.bsc-att-cell.bsc-att-ooo  { background: #fce7f3; color: #9d174d; }
.bsc-att-cell.bsc-att-leave{ background: #f3f4f6; color: #6b7280; }
.bsc-att-dot.bsc-att-wfo   { background: #10b981; border: none; }
.bsc-att-dot.bsc-att-wfh   { background: #3b82f6; border: none; }
.bsc-att-dot.bsc-att-field  { background: #f97316; border: none; }
.bsc-att-dot.bsc-att-ooo   { background: #ec4899; border: none; }
.bsc-att-dot.bsc-att-leave  { background: #9ca3af; border: none; }

/* ── Work Presence module ────────────────────────────────────────────────── */

.bsc-wp-month-label {
  min-width: 130px;
  text-align: center;
}

.bsc-wp-scroll-wrap {
  overflow-x: auto;
}

.bsc-wp-bulk-toggle-wrap {
  padding-top: 1.6rem;
}

.bsc-wp-legend {
  font-size: 0.8rem;
  color: var(--bsc-muted);
}

.bsc-wp-legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.bsc-wp-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  letter-spacing: 0.03em;
}

.bsc-wp-wfo   { background: #d1fae5; color: #065f46; }
.bsc-wp-wfh   { background: #dbeafe; color: #1e40af; }
.bsc-wp-field { background: #ffedd5; color: #9a3412; }
.bsc-wp-btrip { background: #ede9fe; color: #5b21b6; }
.bsc-wp-ooo   { background: #fce7f3; color: #9d174d; }
.bsc-wp-leave { background: #f3f4f6; color: #6b7280; }
.bsc-wp-bh    { background: #fde8e8; color: #dc3545; }

/* Checkbox column — always centred horizontally and vertically */
.bsc-wp-cb-col {
  width: 38px;
  min-width: 38px;
  max-width: 38px;
  padding: 0 !important;
  text-align: center;
  vertical-align: middle !important;
}
.bsc-wp-table .bsc-wp-cb-col .form-check-input {
  display: block;
  margin: 0 auto;
  float: none;
}

/* Entry detail modal summary strip */
.bsc-wp-entry-summary {
  background: var(--bsc-bg, #f9fafb);
}

/* Activity time inputs in detail modal */
.bsc-wp-act-time {
  width: 110px;
}

/* "needs approval" micro-badge on Leave type button */
.bsc-wp-needs-approval {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: #fee2e2;
  color: #991b1b;
  border-radius: 4px;
  padding: 1px 4px;
  vertical-align: middle;
  line-height: 1.4;
}

/* Team calendar table */
.bsc-wp-table {
  border-collapse: collapse;
  min-width: 100%;
  font-size: 0.78rem;
}

.bsc-wp-table th,
.bsc-wp-table td {
  padding: 0;
  border: 1px solid var(--bsc-border);
}

.bsc-wp-name-col {
  min-width: 180px;
  max-width: 220px;
  position: sticky;
  left: 0;
  background: var(--bsc-card-bg);
  z-index: 2;
  padding: 0.4rem 0.75rem !important;
}

.bsc-wp-day-hdr {
  min-width: 36px;
  max-width: 48px;
  text-align: center;
  padding: 0.2rem 0.15rem !important;
  font-weight: 600;
  font-size: 0.72rem;
  background: var(--bsc-card-bg);
  position: sticky;
  top: 0;
}

.bsc-wp-day-hdr .bsc-wp-dow {
  font-size: 0.6rem;
  font-weight: 400;
  color: var(--bsc-muted);
}

.bsc-wp-cell {
  text-align: center;
  vertical-align: middle;
  padding: 0.15rem !important;
  min-width: 36px;
  height: 32px;
  position: relative;
}

.bsc-wp-weekend {
  background: #f9fafb;
}

.bsc-wp-holiday-cell {
  background: #fff5f5;
}

.bsc-wp-today-hdr {
  background: var(--bsc-accent-dark) !important;
  color: #111;
  border-radius: 4px;
}

.bsc-wp-today-cell {
  outline: 1px solid var(--bsc-accent);
  outline-offset: -1px;
}

.bsc-wp-clickable {
  cursor: pointer;
}

.bsc-wp-clickable:hover {
  background: #f0fdf4;
}

.bsc-wp-add-hint {
  font-size: 0.75rem;
  color: #d1d5db;
  font-weight: 700;
}

.bsc-wp-del-btn {
  position: absolute;
  top: 0;
  right: 0;
  background: none;
  border: none;
  padding: 0;
  font-size: 0.6rem;
  color: var(--bsc-muted);
  cursor: pointer;
  display: none;
}

.bsc-wp-cell:hover .bsc-wp-del-btn {
  display: block;
}

.bsc-wp-started-dot {
  display: block;
  font-size: 0.55rem;
  color: #16a34a;
  line-height: 1;
  margin-top: 2px;
}

.bsc-wp-status-dot {
  display: block;
  font-size: 0.55rem;
  line-height: 1;
  margin-top: 1px;
}
.bsc-wp-status-dot.bsc-wp-status-approved { color: #16a34a; }
.bsc-wp-status-dot.bsc-wp-status-rejected { color: #dc3545; }
.bsc-wp-status-dot.bsc-wp-status-pending  { color: #f97316; }

/* ── Work Presence: All Events Modal (full content-area, mirrors invoice detail modal) ─── */
/* All Events table — timestamp line below status badge */
.bsc-ae-ts-line {
  font-size: 0.68rem;
  margin-top: 0.18rem;
  line-height: 1.3;
  white-space: nowrap;
}

.bsc-wp-act-total {
  color: #16a34a;
}

.bsc-wp-act-dur-input {
  max-width: 68px;
}

.bsc-wp-my-row > td {
  background: #fffbeb;
}

.bsc-wp-my-row > .bsc-wp-name-col {
  background: #fffbeb;
  border-left: 3px solid var(--bsc-accent);
}

.bsc-wp-person-name {
  font-size: 0.78rem;
  font-weight: 600;
}

.bsc-wp-person-dept {
  font-size: 0.68rem;
}

.bsc-wp-you-chip {
  font-size: 0.58rem;
  background: var(--bsc-accent-dark);
  color: #111;
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
  font-weight: 700;
  vertical-align: middle;
}

/* Type picker buttons in log modal */
.bsc-wp-type-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  border: 2px solid transparent;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, border-color 0.15s;
  opacity: 0.6;
}

.bsc-wp-type-btn:hover {
  opacity: 0.85;
}

.bsc-wp-type-btn.active {
  opacity: 1;
  border-color: currentColor;
}

/* ── Ticket structured fields (Access / Hardware detail view) ────────────── */

.bsc-field-lbl {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--bsc-muted);
  margin-bottom: 0.15rem;
}

.bsc-field-val {
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.bsc-field-row {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  margin-bottom: 0.2rem;
}

.bsc-field-row .bsc-field-lbl {
  flex: 0 0 90px;
  margin-bottom: 0;
}

.bsc-field-row .bsc-field-val {
  margin-bottom: 0;
}

.bsc-struct-item {
  background: #f9fafb;
  border: 1px solid var(--bsc-border);
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
}

.bsc-struct-item-header {
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}

/* ── Add to Calendar — weekly grid ──────────────────────────────────────── */

.bsc-cg-wrap {
  overflow-x: auto;
}

.bsc-cg-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 260px;
  font-size: 0.7rem;
  table-layout: fixed;
}

.bsc-cg-lbl-col {
  width: 30px;
}

.bsc-cg-day-hdr {
  text-align: center;
  padding: 2px 1px 4px;
  font-weight: normal;
  border-bottom: 1px solid var(--bsc-border);
}

.bsc-cg-dn {
  font-size: 0.58rem;
  text-transform: uppercase;
  color: var(--bsc-muted);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.bsc-cg-dd {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
  margin-top: 1px;
}

.bsc-cg-today-num {
  background: var(--bsc-accent);
  color: #111;
  border-radius: 50%;
  width: 1.5em;
  height: 1.5em;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1px auto 0;
  font-weight: 800;
}

.bsc-cg-lbl {
  color: var(--bsc-muted);
  font-size: 0.6rem;
  text-align: right;
  padding-right: 3px;
  vertical-align: top;
  white-space: nowrap;
  width: 30px;
}

.bsc-cg-cell {
  border: 1px solid rgba(0, 0, 0, .05);
  height: 15px;
  cursor: pointer;
  transition: background 0.07s;
}

.bsc-cg-hr .bsc-cg-cell {
  border-top-color: rgba(0, 0, 0, .13);
}

.bsc-cg-cell:hover {
  background: rgba(255, 214, 0, .35) !important;
}

.bsc-cg-cell.bsc-cg-busy {
  background: rgba(220, 53, 69, .15);
  cursor: not-allowed;
}

.bsc-cg-cell.bsc-cg-sel {
  background: var(--bsc-accent) !important;
  box-shadow: inset 0 0 0 1px var(--bsc-accent-dark);
}

/* Today column */
.bsc-cg-cell.bsc-cg-tc {
  background: rgba(255, 214, 0, .10);
}

.bsc-cg-day-hdr.bsc-cg-tc {
  background: rgba(255, 214, 0, .22);
  border-bottom: 2px solid var(--bsc-accent-dark);
}

/* Weekend columns */
.bsc-cg-day-hdr.bsc-cg-weekend {
  opacity: .4;
}

.bsc-cg-cell.bsc-cg-weekend {
  background: rgba(0, 0, 0, .04);
  cursor: not-allowed;
}

.bsc-cg-cell.bsc-cg-weekend:hover {
  background: rgba(0, 0, 0, .04) !important;
}

/* ── Module ticket tables (Access / Hardware pages) ─────────────────────── */

.bsc-module-tickets-table th,
.bsc-module-tickets-table td {
  font-size: 0.8rem;
}

/* ── Checkbox column, truly centered (originally Payments-library-only,
   narrower checkbox column, its checkbox truly centered on every side --
   top/bottom AND left/right, in the header and every row, regardless of
   row height (e.g. a company name that wraps to 2 lines + "and N more…"
   pushing that row taller than standard).
   text-align:center + vertical-align:middle alone turned out NOT to be
   enough -- confirmed live: Bootstrap's .form-check-input carries its own
   `vertical-align: top`, so even with the *cell's* vertical-align set to
   middle, the checkbox aligns to the top of its own line box inside that
   already-centered cell, landing a few px above true center. Its size
   also comes out different in the header vs. a row (11px vs 14px) since
   `.form-check-input`'s width/height are `1em`-relative and the header's
   font-size is smaller than the body's.
   ⚠️ First attempt fixed this with `display: flex` directly on the
   `<th>`/`<td>` -- looked correct in a Playwright screenshot at one
   viewport width, but broke live in a real browser: a flex-display table
   cell stops participating in the table's own column-width algorithm the
   normal way, and the browser handed the whole first column a huge width
   instead of the intended 34px, leaving a big empty gap before "Document
   type" (live-reported, screenshot). Fixed properly instead: the `<th>`/
   `<td>` stay plain table cells (untouched display, correct width/
   colspan math) and the checkbox is wrapped in an inner `<span
   class="bsc-cb-wrap">` that alone is the flex container -- centers its
   one child by real box geometry, not font metrics, without ever
   touching how the table itself lays out columns. */
/* 2026-09-23: generalized from #inv-card-only to every table with a
   checkbox column (explicit request while redesigning Internal Companies/
   Vendors/Projects: "pamietaj o zasadzie checkboxów, taka sama jak w
   payments library") -- .bsc-cb-cell is the reusable name going forward;
   .inv-cb-cell (Payments Library's own original name) is kept as an alias
   so its existing markup/JS needed no changes. */
.bsc-cb-col {
  width: 34px;
}
.bsc-cb-col,
.bsc-cb-cell,
.inv-cb-cell {
  vertical-align: middle !important;
}

.bsc-cb-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.bsc-cb-col input[type="checkbox"],
.bsc-cb-cell input[type="checkbox"],
.inv-cb-cell input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  flex-shrink: 0;
}

/* ── Grid Edit view (SharePoint "Edit in grid view" equivalent) ─────────── */

.gv-cell { min-width: 8.5rem; }
.gv-cell .gv-edit { min-width: 8rem; }
@keyframes gv-flash-ok  { 0% { background: #d1fae5; } 100% { background: transparent; } }
@keyframes gv-flash-err { 0% { background: #fee2e2; } 100% { background: transparent; } }
.gv-flash-ok  { animation: gv-flash-ok 1.1s ease-out; }
.gv-flash-err { animation: gv-flash-err 1.6s ease-out; }

/* ── Bulk Import preview grid: manually resizable columns ────────────────── */

#bi-preview-table {
  table-layout: fixed;
}
#bi-preview-table th {
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 60px;
}
#bi-preview-table td {
  overflow: hidden;
}
#bi-preview-table td .form-control,
#bi-preview-table td .form-select {
  min-width: 0; /* let the cell's own width win, not the input's intrinsic content width */
}
.bi-col-resize-handle {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 6px;
  cursor: col-resize;
  user-select: none;
}
.bi-col-resize-handle:hover,
.bi-col-resize-handle.bi-resizing {
  background: var(--bsc-accent, #6366f1);
  opacity: .5;
}

/* ── Bulk action floating bar ────────────────────────────────────────────── */

.bsc-bulk-bar {
  position: fixed;
  bottom: 1.75rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1050;
  background: #1f2937;
  color: #fff;
  border-radius: 0.5rem;
  padding: 0.65rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, .35);
  min-width: 280px;
  white-space: nowrap;
  transition: transform 300ms var(--ease-out), opacity 300ms var(--ease-out);

  @starting-style {
    transform: translateX(-50%) translateY(0.75rem);
    opacity: 0;
  }
}

.bsc-bulk-count {
  font-size: 0.875rem;
  font-weight: 600;
  flex: 1;
}

/* Payments library's own bulk bar layout (2026-09-09) -- "N selected" and
   the per-currency total now read as one cohesive block (were two visually
   disconnected pieces of UI before: this bar's count, and a separate total
   that lived up in the card header). Purely additive wrapper classes
   (.bsc-bulk-summary/.bsc-bulk-totals/.bsc-bulk-actions) scoped to
   invoices.html's own markup -- .bsc-bulk-bar/.bsc-bulk-count themselves
   are shared app-wide (Asset Tracker, Tickets, Employees, ...) and stay
   exactly as they were for every other page. */
.bsc-bulk-summary {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex: 1;
}
.bsc-bulk-summary .bsc-bulk-count { flex: 0 0 auto; }
.bsc-bulk-totals {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: nowrap;
  max-width: 40vw;
  overflow-x: auto;
  scrollbar-width: none;
}
.bsc-bulk-totals::-webkit-scrollbar { display: none; }
.bsc-bulk-total-pill {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: .35rem;
  padding: .15rem .5rem;
  font-size: .78rem;
  font-weight: 600;
  font-family: var(--bsc-font-mono, monospace);
  white-space: nowrap;
}
.bsc-bulk-actions { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }

/* ===== DASHBOARD — Bank Holiday Calendar ===== */
.bsc-hcal-body { overflow: auto; }

.bsc-hcal-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.bsc-hcal { padding: 0.5rem 0.6rem 0.6rem; }

.bsc-hcal-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.2rem 0.2rem 0.55rem;
}
.bsc-hcal-title {
  font-size: .9rem;
  font-weight: 600;
  color: #1f2937;
}
.bsc-hcal-nav {
  background: none;
  border: none;
  padding: 0.15rem 0.45rem;
  border-radius: 0.25rem;
  cursor: pointer;
  color: #6b7280;
  line-height: 1;
  transition: background .15s, color .15s;
}
.bsc-hcal-nav:hover { background: rgba(0, 0, 0, .07); color: #1f2937; }

.bsc-hcal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.bsc-hcal-dh {
  text-align: center;
  font-size: .7rem;
  font-weight: 700;
  color: #6b7280;
  padding: 0.15rem 0 0.35rem;
}
.bsc-hcal-wknd-hdr { color: #dc3545; }

.bsc-hcal-cell {
  min-height: 74px;
  border-radius: 4px;
  padding: 4px 4px 3px;
  background: #f9fafb;
  border: 1px solid rgba(0, 0, 0, .04);
  overflow: hidden;
}
.bsc-hcal-cell.bsc-hcal-empty {
  background: transparent;
  border-color: transparent;
}
.bsc-hcal-cell.bsc-hcal-red {
  background: rgba(220, 53, 69, .08);
}
.bsc-hcal-cell.bsc-hcal-today {
  border: 2px solid #ffd600;
  background: rgba(255, 214, 0, .15);
}
.bsc-hcal-cell.bsc-hcal-red.bsc-hcal-today {
  background: rgba(220, 53, 69, .12);
  border: 2px solid #ffd600;
}

.bsc-hcal-num {
  display: block;
  font-size: .8rem;
  font-weight: 700;
  color: #1f2937;
  line-height: 1;
  margin-bottom: 3px;
}
.bsc-hcal-red .bsc-hcal-num { color: #dc3545; }

.bsc-hcal-hol {
  display: flex;
  align-items: flex-start;
  gap: 2px;
  margin-bottom: 2px;
}
.bsc-hcal-hbadge {
  flex-shrink: 0;
  font-size: .52rem;
  padding: .15em .3em;
  border-radius: .2rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
  margin-top: 1px;
}
.bsc-hcal-hname {
  font-size: .58rem;
  color: #4b5563;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

/* Dashboard card-header action badges (same height as country pill-badges) */
.bsc-dash-hdr-btn {
  font-size: .72rem;
  font-weight: 500;
  padding: .3em .6em;
  border-radius: 50rem;
  background: #e9ecef;
  color: #495057;
  text-decoration: none;
  cursor: pointer;
  letter-spacing: 0;
}
.bsc-dash-hdr-btn:hover { background: #dee2e6; color: #212529; }
.bsc-dash-hdr-btn-primary { background: var(--bsc-accent); color: #000; }
.bsc-dash-hdr-btn-primary:hover { background: #e6b800; color: #000; }
/* Reset default button border when bsc-dash-hdr-btn is used on <button> */
button.bsc-dash-hdr-btn { border: none; }
.bsc-inv-filter-hdr { cursor: pointer; }
/* Override card-header uppercase/spacing inside count/badge elements */
.bsc-card-hdr-badge { letter-spacing: 0; text-transform: none; font-size: .65rem; }

/* Segmented toggle (2026-09-09) -- Payments library's "Filters / Filter
   presets" switch; a small, reusable two-(or-more)-state pill group, same
   visual family as .bsc-dash-hdr-btn (flat pill buttons) rather than a new
   look. */
.bsc-seg {
  display: inline-flex;
  background: #e9ecef;
  border-radius: 50rem;
  padding: .15rem;
  gap: .15rem;
}
.bsc-seg-btn {
  border: none;
  background: transparent;
  color: #495057;
  font-size: .8rem;
  font-weight: 600;
  padding: .3em .75em;
  border-radius: 50rem;
  cursor: pointer;
  white-space: nowrap;
}
.bsc-seg-btn:hover { color: #212529; }
.bsc-seg-btn.active { background: var(--bsc-accent); color: #000; }

/* "Show my presets" list (2026-09-09) */
.bsc-fp-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .65rem .9rem;
  border-bottom: 1px solid var(--bsc-border);
}
.bsc-fp-list-item:last-child { border-bottom: none; }
.bsc-fp-list-main { min-width: 0; }
.bsc-fp-list-actions { display: flex; align-items: center; gap: .35rem; flex-shrink: 0; }

/* Country badge colours (used in calendar cells and card header) */
.bsc-hol-badge-pl { background: #dc3545; }
.bsc-hol-badge-lt { background: #198754; }
.bsc-hol-badge-es { background: #fd7e14; }
.bsc-hol-badge-it { background: #0d6efd; }

/* ===== DASHBOARD — Add News modal helpers ===== */
.bsc-modal-section {
  background: var(--bs-light, #f8f9fa);
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: var(--bs-border-radius, .375rem);
  padding: 0.75rem;
}
.bsc-modal-hint {
  font-size: .75rem;
  margin-top: .3rem;
}
.bsc-img-input  { max-width: 220px; }
.bsc-file-input { max-width: 300px; }
.bsc-file-list  { font-size: .8rem; }
.bsc-rm-btn { line-height: 1; }

/* ===================================================================
   ANNOUNCEMENTS MODULE
   =================================================================== */

/* ── Feed page ──────────────────────────────────────────────────────── */
.bsc-ann-search-wrap { max-width: 260px; }
.bsc-ann-filter-sel  { max-width: 160px; }

.bsc-ann-section-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--bsc-muted);
}

.bsc-ann-empty {
  text-align: center;
  padding: 3.5rem 1rem;
  color: var(--bsc-muted);
}
.bsc-ann-empty i { font-size: 2.5rem; display: block; margin-bottom: .75rem; opacity: .4; }

/* ── Announcement card ──────────────────────────────────────────────── */
.bsc-ann-card {
  background: #fff;
  border-radius: .5rem;
  border: 1px solid #e5e7eb;
  padding: 1.1rem 1.25rem;
  margin-bottom: .75rem;
  transition: box-shadow .15s, border-color .15s;
  cursor: pointer;
  position: relative;
}
.bsc-ann-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.09);
  border-color: #d1d5db;
}
.bsc-ann-card-pinned { border-left: 3px solid var(--bsc-accent); }
.bsc-ann-card-draft  { opacity: .75; }

.bsc-ann-title-link       { text-decoration: none; color: inherit; }
.bsc-ann-title-link:hover { text-decoration: none; color: inherit; }

.bsc-ann-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--bsc-text);
  margin-bottom: .3rem;
  line-height: 1.35;
}
.bsc-ann-card:hover .bsc-ann-title { color: #111; }

.bsc-ann-summary {
  font-size: .84rem;
  color: var(--bsc-muted);
  line-height: 1.5;
  margin-bottom: .6rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bsc-ann-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  font-size: .78rem;
  color: var(--bsc-muted);
  margin-top: .55rem;
  padding-top: .55rem;
  border-top: 1px solid #f3f4f6;
}
.bsc-ann-author { font-weight: 500; color: #4b5563; }
.bsc-ann-sep    { color: #d1d5db; }
.bsc-ann-count  { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; color: #6b7280; }
.bsc-ann-edit-btn { padding: .2rem .45rem; }

/* ── Priority badges ────────────────────────────────────────────────── */
.bsc-ann-pri {
  display: inline-flex; align-items: center;
  font-size: .65rem; font-weight: 700;
  padding: .2em .6em; border-radius: .2rem;
  text-transform: uppercase; letter-spacing: .04em;
  color: #fff;
}

/* ── Country badge ──────────────────────────────────────────────────── */
.bsc-ann-country {
  display: inline-flex; align-items: center;
  font-size: .65rem; font-weight: 600;
  padding: .2em .55em; border-radius: .25rem;
  background: #e9ecef; color: #495057;
  text-transform: uppercase; letter-spacing: .04em;
}

/* ── Image resize overlay ────────────────────────────────────────────── */
.bsc-img-overlay {
  position: absolute; pointer-events: none; z-index: 20;
  border: 2px solid var(--bsc-accent);
  box-sizing: border-box;
}
.bsc-img-handle {
  position: absolute; width: 10px; height: 10px;
  background: var(--bsc-accent); border: 1px solid #fff;
  border-radius: 2px; pointer-events: all; z-index: 21;
}
.bsc-img-handle-nw { top:-5px;  left:-5px;  cursor:nw-resize; }
.bsc-img-handle-ne { top:-5px;  right:-5px; cursor:ne-resize; }
.bsc-img-handle-sw { bottom:-5px; left:-5px;  cursor:sw-resize; }
.bsc-img-handle-se { bottom:-5px; right:-5px; cursor:se-resize; }

.bsc-img-toolbar {
  position: fixed; z-index: 1060;
  display: flex; align-items: center; gap: 3px;
  background: #1e2432; color: #fff;
  padding: 4px 8px; border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  white-space: nowrap; pointer-events: all;
}
.bsc-img-toolbar button {
  border: 1px solid rgba(255,255,255,.3); background: transparent; color: #fff;
  border-radius: 3px; padding: 1px 7px; font-size: .75rem; cursor: pointer; line-height: 1.6;
}
.bsc-img-toolbar button:hover { background: rgba(255,255,255,.2); }
.bsc-img-tb-sep { width: 1px; height: 16px; background: rgba(255,255,255,.3); margin: 0 3px; flex-shrink: 0; }
.ql-editor img.bsc-img-sel { outline: 2px solid var(--bsc-accent); cursor: pointer; }

/* ── Single-line truncated text (dashboard announcements) ────────────── */
.bsc-ann-oneline {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  display: block;
  margin-bottom: 0.3rem;
}

/* ── Cover image editor preview ─────────────────────────────────────── */
.bsc-cover-preview-img  { object-fit: cover; max-height: 130px; }
.bsc-cover-clear-btn    { border-radius: .25rem; }

/* ── Dashboard announcement cover image ─────────────────────────────── */
.bsc-ann-dash-cover {
  width: 160px; height: 160px;
  object-fit: cover; border-radius: .5rem;
  flex-shrink: 0; align-self: flex-start;
}

/* ── Quill table button ─────────────────────────────────────────────── */
button.ql-table-btn { display: inline-flex !important; align-items: center; padding: 2px 4px !important; }
button.ql-table-btn i { font-size: 14px; pointer-events: none; }
.bsc-ann-pri-low    { background: #6c757d; }
.bsc-ann-pri-normal { background: #0d6efd; }
.bsc-ann-pri-high   { background: #fd7e14; }
.bsc-ann-pri-urgent { background: #dc3545; }

/* ── Category badges ────────────────────────────────────────────────── */
.bsc-ann-cat {
  display: inline-flex; align-items: center;
  font-size: .65rem; font-weight: 600;
  padding: .2em .55em; border-radius: .25rem;
  color: #fff;
}
.bsc-ann-cat-general    { background: #6c757d; }
.bsc-ann-cat-it         { background: #0d6efd; }
.bsc-ann-cat-hr         { background: #6610f2; }
.bsc-ann-cat-finance    { background: #198754; }
.bsc-ann-cat-operations { background: #fd7e14; }
.bsc-ann-cat-management { background: #343a40; }
.bsc-ann-cat-legal      { background: #20c997; }

/* ── Status badges ──────────────────────────────────────────────────── */
.bsc-ann-status {
  display: inline-flex; align-items: center;
  font-size: .65rem; font-weight: 600;
  padding: .2em .55em; border-radius: .25rem;
}
.bsc-ann-status-draft     { background: #e9ecef; color: #495057; }
.bsc-ann-status-published { background: #d1fae5; color: #065f46; }
.bsc-ann-status-archived  { background: #e5e7eb; color: #6b7280; }

/* ── Pinned indicator ───────────────────────────────────────────────── */
.bsc-ann-pin {
  display: inline-flex; align-items: center; gap: .25rem;
  font-size: .68rem; font-weight: 600;
  color: #92400e; background: #fef3c7;
  padding: .2em .55em; border-radius: .25rem;
}

/* ── Detail page ────────────────────────────────────────────────────── */
.bsc-ann-detail-card { border: 1px solid #e5e7eb; }

.bsc-ann-detail-title {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--bsc-text);
  margin-bottom: .5rem;
}

.bsc-ann-detail-summary {
  font-size: 1.05rem;
  color: #4b5563;
  margin-bottom: 1rem;
  line-height: 1.6;
  font-style: italic;
}

.bsc-ann-detail-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  font-size: .82rem;
  color: #6b7280;
}

.bsc-ann-body {
  font-size: .9375rem;
  line-height: 1.75;
  color: #1f2937;
}
.bsc-ann-body h1, .bsc-ann-body h2, .bsc-ann-body h3 {
  margin-top: 1.5em;
  margin-bottom: .5em;
  font-weight: 700;
}
.bsc-ann-body h1 { font-size: 1.4rem; }
.bsc-ann-body h2 { font-size: 1.2rem; }
.bsc-ann-body h3 { font-size: 1rem; }
.bsc-ann-body p  { margin-bottom: .85em; }
.bsc-ann-body ul, .bsc-ann-body ol { padding-left: 1.5rem; margin-bottom: .85em; }
.bsc-ann-body blockquote {
  border-left: 3px solid var(--bsc-accent);
  padding: .5rem 1rem;
  color: #4b5563;
  background: #fafafa;
  border-radius: 0 .25rem .25rem 0;
  margin: 1rem 0;
}
.bsc-ann-body img { max-width: 100%; border-radius: .375rem; }
.bsc-ann-body a   { color: #0d6efd; }

/* ── Related links / attachments section ───────────────────────────── */
.bsc-ann-links-section {
  background: #f9fafb;
  border-radius: .375rem;
  border: 1px solid #e5e7eb;
  padding: .75rem 1rem;
}
.bsc-ann-links-title {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #6b7280;
  margin-bottom: .5rem;
}
.bsc-ann-link-item {
  display: flex;
  align-items: center;
  padding: .25rem 0;
  font-size: .875rem;
  border-bottom: 1px solid #e5e7eb;
}
.bsc-ann-link-item:last-child { border-bottom: none; }

/* ── Read confirmation bar ──────────────────────────────────────────── */
.bsc-ann-read-bar  { border-radius: .375rem; overflow: hidden; }
.bsc-ann-read-prompt {
  display: flex; align-items: center; flex-wrap: wrap; gap: .5rem;
  background: #eff6ff; border: 1px solid #bfdbfe;
  color: #1d4ed8; border-radius: .375rem;
  padding: .65rem 1rem; font-size: .875rem;
}
.bsc-ann-read-done {
  display: flex; align-items: center;
  background: #d1fae5; border: 1px solid #6ee7b7;
  color: #065f46; border-radius: .375rem;
  padding: .65rem 1rem; font-size: .875rem;
}

/* ── Sidebar details table ──────────────────────────────────────────── */
.bsc-ann-detail-sidebar { border: 1px solid #e5e7eb; }
.bsc-ann-detail-table { width: 100%; border-collapse: collapse; }
.bsc-ann-detail-table tr { border-bottom: 1px solid #f3f4f6; }
.bsc-ann-detail-table tr:last-child { border-bottom: none; }
.bsc-ann-detail-table td { padding: .5rem .75rem; font-size: .8rem; vertical-align: middle; }
.bsc-ann-detail-label {
  color: #6b7280; font-weight: 600; font-size: .73rem;
  text-transform: uppercase; letter-spacing: .04em;
  white-space: nowrap; width: 90px;
}

/* ── Comments ───────────────────────────────────────────────────────── */
.bsc-cmt-form {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
}
.bsc-cmt-avatar {
  width: 2rem; height: 2rem;
  background: var(--bsc-accent);
  color: #1f2937; font-weight: 700; font-size: .8rem;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.bsc-cmt-avatar-me { background: var(--bsc-accent); }
.bsc-readers-avatar { width: 1.75rem; height: 1.75rem; font-size: .7rem; }

.bsc-cmt-input { resize: none; }

.bsc-cmt-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .75rem 0;
  border-bottom: 1px solid #f3f4f6;
}
.bsc-cmt-item:last-child { border-bottom: none; }
.bsc-cmt-author { font-weight: 600; font-size: .85rem; color: #1f2937; }
.bsc-cmt-date   { font-size: .75rem; color: #9ca3af; }
.bsc-cmt-body   { font-size: .875rem; color: #374151; margin-top: .2rem; white-space: pre-wrap; word-break: break-word; }
.bsc-cmt-del    { margin-left: auto; flex-shrink: 0; opacity: .4; }
.bsc-cmt-del:hover { opacity: 1; }
.bsc-cmt-empty  { font-size: .875rem; color: #9ca3af; text-align: center; padding: 1.5rem 0; }

/* ── Editor ─────────────────────────────────────────────────────────── */
.bsc-editor-title-input {
  font-size: 1.2rem;
  font-weight: 700;
  border: none;
  border-bottom: 2px solid #e5e7eb;
  border-radius: 0;
  padding-left: 0;
  box-shadow: none;
}
.bsc-editor-title-input:focus {
  border-bottom-color: var(--bsc-accent);
  box-shadow: none;
}

.bsc-ann-quill-editor { min-height: 260px; }
.bsc-ann-editor-quill { min-height: 400px; }

/* ── Custom Rich Text Editor ─────────────────────────────────────────── */
.bsc-rte-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 5px 8px;
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  align-items: center;
}
.bsc-rte-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 2px 7px;
  cursor: pointer;
  font-size: 13px;
  color: #495057;
  line-height: 1.4;
}
.bsc-rte-btn:hover  { background: #e9ecef; border-color: #ced4da; }
.bsc-rte-btn.active { background: rgba(13,110,253,.12); border-color: #0d6efd; color: #0d6efd; }
.bsc-rte-sep { width: 1px; height: 20px; background: #dee2e6; margin: 0 3px; flex-shrink: 0; }
.bsc-rte-sel {
  font-size: 12px;
  border: 1px solid #ced4da;
  border-radius: 3px;
  padding: 1px 4px;
  background: #fff;
  cursor: pointer;
  height: 24px;
}
.bsc-rte-clr {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 5px;
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: pointer;
  font-size: 13px;
  color: #495057;
}
.bsc-rte-clr:hover { background: #e9ecef; border-color: #ced4da; }
.bsc-rte-clr input[type=color] { width: 18px; height: 14px; padding: 0; border: none; cursor: pointer; background: none; }
.bsc-rte-editor {
  min-height: max(480px, calc(100vh - 460px));
  padding: 16px 20px;
  outline: none;
  line-height: 1.65;
  font-size: 14px;
  overflow-y: auto;
}
.bsc-rte-editor:focus { outline: none; }
.bsc-rte-editor img { max-width: 100%; cursor: move; }
.bsc-rte-src {
  display: none;
  width: 100%;
  min-height: max(480px, calc(100vh - 460px));
  padding: 14px 16px;
  border: none;
  outline: none;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  resize: none;
  background: #1e1e1e;
  color: #d4d4d4;
}

/* + button inside card-header — stays same height as header */
.bsc-card-hdr-btn {
  padding: 0 .35rem;
  line-height: 1.3;
  font-size: .75rem;
}

.bsc-editor-publish-card { border: 2px solid #e5e7eb; }
.bsc-editor-publish-card .card-header { background: #f9fafb; }

.bsc-editor-link-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .5rem;
}
.bsc-editor-link-row .link-label { max-width: 130px; }

.bsc-editor-att-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem 0;
  font-size: .85rem;
  border-bottom: 1px solid #f3f4f6;
}
.bsc-editor-att-row:last-child { border-bottom: none; }

/* ── Dashboard preview card ─────────────────────────────────────────── */
/* ── Dashboard latest announcement card ─────────────────────────────── */
.bsc-ann-dash-title {
  font-size: 1.15rem; font-weight: 700; color: #1f2937; line-height: 1.35;
}
.bsc-ann-dash-summary {
  font-size: .875rem; line-height: 1.55; color: #6b7280;
}

.bsc-ann-preview-item {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .6rem .75rem;
  border-bottom: 1px solid #f3f4f6;
  text-decoration: none;
  color: inherit;
  transition: background .1s;
}
.bsc-ann-preview-item:hover { background: #f9fafb; color: inherit; text-decoration: none; }
.bsc-ann-preview-item:last-child { border-bottom: none; }
.bsc-ann-preview-title { font-size: .83rem; font-weight: 600; color: #1f2937; line-height: 1.3; }
.bsc-ann-preview-meta  { font-size: .72rem; color: #9ca3af; margin-top: .15rem; }
.bsc-ann-preview-pin   { color: #d97706; font-size: .7rem; }

/* ── Onboarding / Offboarding module ─────────────────────────────────────── */

.bsc-ob-status-mgr    { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.bsc-ob-status-it     { background: #fef9c3; color: #854d0e; border: 1px solid #fde047; }
.bsc-ob-status-wip    { background: #ffedd5; color: #9a3412; border: 1px solid #fed7aa; }
.bsc-ob-status-done   { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.bsc-ob-status-cancel { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

.bsc-ob-status-badge {
  display: inline-flex;
  align-items: center;
  font-size: .65rem;
  font-weight: 700;
  padding: .25em .6em;
  border-radius: .25rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}

.bsc-ob-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 1.75rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.bsc-ob-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.bsc-ob-step-dot {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 2px solid var(--bsc-border);
  background: var(--bsc-card);
  color: var(--bsc-muted);
  font-size: .78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}

.bsc-ob-step.active .bsc-ob-step-dot {
  background: var(--bsc-accent);
  border-color: var(--bsc-accent);
  color: #111;
}

.bsc-ob-step.done .bsc-ob-step-dot {
  background: var(--bsc-accent-dark);
  border-color: var(--bsc-accent-dark);
  color: #fff;
}

.bsc-ob-step-label {
  font-size: .62rem;
  font-weight: 600;
  color: var(--bsc-muted);
  white-space: nowrap;
  text-align: center;
}

.bsc-ob-step.active .bsc-ob-step-label { color: var(--bsc-text); }

.bsc-ob-step-line {
  flex: 1;
  height: 2px;
  background: var(--bsc-border);
  margin: 0 0.35rem;
  margin-bottom: 1.1rem;
  min-width: 1.5rem;
}

.bsc-ob-step-line.done-line { background: var(--bsc-accent-dark); }

.bsc-ob-landing-card {
  border: 1.5px solid var(--bsc-border);
  border-radius: 0.75rem;
  background: var(--bsc-card);
  padding: 2rem 1.75rem;
  text-decoration: none;
  color: var(--bsc-text);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s var(--ease-out);
  cursor: pointer;
  height: 100%;
}

@media (hover: hover) and (pointer: fine) {
  .bsc-ob-landing-card:hover {
    border-color: var(--bsc-accent);
    box-shadow: 0 0 0 3px rgba(255,214,0,0.15);
    transform: translateY(-2px);
    color: var(--bsc-text);
  }
}

.bsc-ob-landing-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.bsc-ob-landing-icon-green  { background: #dcfce7; color: #16a34a; }
.bsc-ob-landing-icon-orange { background: #ffedd5; color: #ea580c; }

.bsc-ob-landing-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--bsc-text);
}

.bsc-ob-landing-desc {
  font-size: .83rem;
  color: var(--bsc-muted);
  line-height: 1.5;
}

/* Hardware / license toggles */
.bsc-ob-hw-toggle {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--bsc-border);
  border-radius: 0.5rem;
  background: var(--bsc-card);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  -webkit-user-select: none;
  user-select: none;
}

.bsc-ob-hw-toggle.selected {
  border-color: var(--bsc-accent);
  background: #fffbe6;
}

.bsc-ob-hw-toggle input[type=checkbox] {
  accent-color: var(--bsc-accent-dark);
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.bsc-ob-hw-toggle-label {
  font-size: .83rem;
  font-weight: 600;
  color: var(--bsc-text);
}

/* SharePoint access list */
.bsc-ob-sp-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: #f9fafb;
  border: 1px solid var(--bsc-border);
  border-radius: 0.375rem;
  font-size: .82rem;
  margin-bottom: 0.35rem;
}

.bsc-ob-sp-row-label { flex: 1; font-weight: 500; }
.bsc-ob-sp-rm { background: none; border: none; color: var(--bsc-muted); cursor: pointer; padding: 0; line-height: 1; }
.bsc-ob-sp-rm:hover { color: #dc2626; }

/* Mailbox / Teams item */
.bsc-ob-chip-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.55rem;
  background: #fffbe6;
  border: 1px solid var(--bsc-accent);
  border-radius: 1rem;
  font-size: .78rem;
  font-weight: 600;
  color: #7a6200;
  margin-bottom: 0.25rem;
  display: inline-flex;
}

.bsc-ob-chip-rm {
  background: none;
  border: none;
  cursor: pointer;
  color: #7a6200;
  opacity: 0.55;
  font-size: .9rem;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

.bsc-ob-chip-rm:hover { opacity: 1; }

/* Mandatory chip (global defaults) */
.bsc-ob-chip-row.bsc-ob-chip-locked { background: #f3f4f6; border-color: #d1d5db; color: #374151; }

/* Start-date highlight */
.bsc-ob-startdate-highlight {
  background: #fffbe6;
  border: 2px solid var(--bsc-accent);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
}

/* chip-row = flex container; override the old single-chip definition */
.bsc-ob-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  background: none;
  border: none;
  padding: 0;
}

/* Individual chip */
.bsc-ob-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.6rem;
  background: #fffbe6;
  border: 1px solid var(--bsc-accent);
  border-radius: 1rem;
  font-size: .78rem;
  font-weight: 600;
  color: #7a6200;
  white-space: nowrap;
}

.bsc-ob-chip-yes {
  background: #dcfce7;
  border-color: #bbf7d0;
  color: #166534;
}

.bsc-ob-chip-link {
  cursor: pointer;
  text-decoration: none;
}
.bsc-ob-chip-link:hover {
  background: #fffacc;
  border-color: var(--bsc-accent-dark);
  color: var(--bsc-accent-dark);
}

.bsc-ob-chip-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.55;
  font-size: .88rem;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}
.bsc-ob-chip-remove:hover { opacity: 1; }

/* Hardware toggle: class-based active state */
.bsc-ob-hw-toggle-on {
  border-color: var(--bsc-accent);
  background: #fffbe6;
}

.bsc-ob-hw-toggle-icon {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  color: var(--bsc-muted);
  flex-shrink: 0;
}
.bsc-ob-hw-toggle-on .bsc-ob-hw-toggle-icon { color: var(--bsc-accent-dark); }

.bsc-ob-hw-toggle-sub {
  font-size: .73rem;
  color: var(--bsc-muted);
  margin-top: .1rem;
}

/* Stepper: BEM-style class variants (match Jinja2 output) */
.bsc-ob-step-active .bsc-ob-step-dot {
  background: var(--bsc-accent);
  border-color: var(--bsc-accent);
  color: #111;
}
.bsc-ob-step-active .bsc-ob-step-label { color: var(--bsc-text); }

.bsc-ob-step-done .bsc-ob-step-dot {
  background: var(--bsc-accent-dark);
  border-color: var(--bsc-accent-dark);
  color: #fff;
}
.bsc-ob-step-done .bsc-ob-step-label { color: var(--bsc-text); }

/* Manager / user search typeahead dropdown */
.bsc-ob-mgr-dropdown {
  position: fixed;
  background: var(--bsc-card);
  border: 1px solid var(--bsc-border);
  border-radius: 0.5rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  z-index: 1055;
  max-height: 220px;
  overflow-y: auto;
}

.bsc-ob-mgr-item {
  padding: .45rem .75rem;
  cursor: pointer;
  font-size: .86rem;
  transition: background .1s;
}
.bsc-ob-mgr-item:hover { background: #f3f4f6; }

/* Comment / notes read-only box */
.bsc-ob-comment-box {
  background: #f9fafb;
  border: 1px solid var(--bsc-border);
  border-radius: 0.375rem;
  padding: .5rem .75rem;
  font-size: .84rem;
  color: var(--bsc-text);
  white-space: pre-wrap;
}

/* Start date card highlight */
.bsc-ob-start-date-card {
  border: 2px solid var(--bsc-accent) !important;
  background: #fffbe6 !important;
}

/* SP row remove button (new name) */
.bsc-ob-sp-remove {
  background: none;
  border: none;
  color: var(--bsc-muted);
  cursor: pointer;
  padding: 0 .15rem;
  line-height: 1;
  flex-shrink: 0;
}
.bsc-ob-sp-remove:hover { color: #dc2626; }

/* Breadcrumb */
.bsc-breadcrumb { font-size: .8rem; }
.bsc-breadcrumb .breadcrumb-item a { color: var(--bsc-muted); text-decoration: none; }
.bsc-breadcrumb .breadcrumb-item a:hover { color: var(--bsc-text); }
.bsc-breadcrumb .breadcrumb-item.active { color: var(--bsc-text); font-weight: 500; }
.bsc-breadcrumb .breadcrumb-item + .breadcrumb-item::before { color: var(--bsc-border); }

/* Status filter button active state (ob list pages) */
.ob-filter-btn.active {
  background: var(--bsc-accent);
  border-color: var(--bsc-accent);
  color: #111;
}

/* ===== ASSET TRACKER ===== */

.bsc-at-stat {
  background: var(--bsc-card);
  border-radius: .5rem;
  border: 1px solid var(--bsc-border);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: box-shadow .2s var(--ease-out);
  text-decoration: none !important;
  color: inherit !important;
}
.bsc-at-stat:hover { box-shadow: 0 2px 12px rgba(0,0,0,.08); }

.bsc-at-stat-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: .5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.bsc-at-stat-icon-devices   { background: #e8f4fd; color: #1d6fa5; }
.bsc-at-stat-icon-sims      { background: #e8fdf2; color: #1d8a5a; }
.bsc-at-stat-icon-licenses  { background: #fdf5e8; color: #a06b00; }
.bsc-at-stat-icon-equipment { background: #f5e8fd; color: #6b1da8; }

.bsc-at-stat-count { font-size: 2rem; font-weight: 700; line-height: 1; }
.bsc-at-stat-label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--bsc-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-top: .15rem;
}
.bsc-at-stat-sub { font-size: .78rem; color: var(--bsc-muted); margin-top: .4rem; }

/* ── Ticket status stat tiles (reuse at-stat layout, button-reset) ─────── */
.bsc-tkt-tile {
  background: var(--bsc-card);
  border-radius: .5rem;
  border: 1.5px solid var(--bsc-border);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: box-shadow .2s var(--ease-out), border-color .15s;
  text-decoration: none;
  color: inherit;
}
.bsc-tkt-tile:hover { box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.bsc-tkt-tile.active {
  border-color: var(--bsc-accent);
  box-shadow: 0 0 0 3px rgba(255,214,0,.18);
}
.bsc-tkt-icon-new        { background: #dbeafe; color: #1d4ed8; }
.bsc-tkt-icon-inprogress { background: #fef3c7; color: #92400e; }
.bsc-tkt-icon-resolved   { background: #d1fae5; color: #065f46; }
.bsc-tkt-icon-cancelled  { background: #f3f4f6; color: #6b7280; }
.bsc-tkt-icon-sent       { background: #cffafe; color: #0e7490; }

/* Empty-state icon */
.bsc-empty-icon { font-size: 2rem; opacity: .3; }

/* Status badges */
.bsc-badge-assigned  { background: #d1fae5; color: #065f46; border: none; }
.bsc-badge-inventory { background: #f3f4f6; color: #374151; border: none; }
.bsc-badge-repair    { background: #fef3c7; color: #92400e; border: none; }
.bsc-badge-inactive  { background: #fee2e2; color: #991b1b; border: none; }
.bsc-badge-unknown   { background: #f3f4f6; color: #6b7280; border: none; }

/* Clickable table row */
.bsc-tr-link { cursor: pointer; }
.bsc-tr-link:hover { background: #fafafa !important; }
.bsc-tr-link td:first-child { border-left: 3px solid transparent; }
.bsc-tr-link:hover td:first-child { border-left-color: var(--bsc-accent); }

/* Valuation bar */
.bsc-val-bar-wrap {
  height: .35rem;
  background: #e5e7eb;
  border-radius: .2rem;
  overflow: hidden;
  margin-top: .25rem;
}
.bsc-val-bar {
  height: 100%;
  background: var(--bsc-accent-dark);
  border-radius: .2rem;
}

/* Assignment typeahead (2026-09-11: position: fixed, not absolute --
   absolute got clipped by the app-wide `.card { overflow: hidden }` on
   every Asset Tracker detail page's "Assigned To" card. Now matches
   .bsc-user-drop / .bsc-ob-mgr-dropdown, the app's other two typeahead
   dropdowns, which were already fixed-positioned for this exact reason.
   Every caller positions it from the input's getBoundingClientRect() --
   see positionAssignDropdown() in the *_detail.html templates and
   positionDropdown() in users.html.) */
.bsc-assign-dropdown {
  position: fixed;
  background: #fff;
  border: 1px solid var(--bsc-border);
  border-radius: .375rem;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
  z-index: 1060;
  max-height: 200px;
  overflow-y: auto;
}
.bsc-assign-item {
  padding: .4rem .75rem;
  cursor: pointer;
  font-size: .84rem;
}
.bsc-assign-item:hover { background: #fffbe6; }
.bsc-assign-item .small { color: var(--bsc-muted); }

/* Spec grid in device detail */
/* Every cell keeps its own border-bottom -- deliberately NOT trying to hide
   it on "the last row" via :nth-last-child(-n+2) anymore. That selector
   counts DOM children, not visual grid rows, so it silently broke whenever
   a card had an odd cell count (a lone last cell, e.g. Budget & Ownership's
   5 fields) or mixed in a .bsc-grid-full cell (e.g. Hardware Specs'
   Processor spanning both columns) -- both throw the child-index/row
   correspondence off, which is exactly what was making the separator line
   vanish from the wrong (non-last) row instead of the actual last one.
   A harmless hairline under the true last row is a fair trade for this
   never breaking again regardless of how many optional fields render. */
.bsc-spec-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; }
.bsc-spec-cell { padding: .5rem .75rem; border-bottom: 1px solid var(--bsc-border); }
.bsc-spec-label { font-size: .72rem; color: var(--bsc-muted); text-transform: uppercase; letter-spacing: .03em; font-family: inherit; }
.bsc-spec-value { font-size: .84rem; font-weight: 500; margin-top: .1rem; font-family: inherit; }

/* Print: form_print.html */
@media print {
  .bsc-print-hide { display: none !important; }
  body { background: #fff !important; }
}

/* ── bsc-bulk-info (count label inside floating bulk bar) ────────────────── */
.bsc-bulk-info {
  font-size: 0.875rem;
  font-weight: 600;
  flex: 1;
}

/* ── Row selection checkbox column ───────────────────────────────────────── */
.bsc-select-col {
  width: 36px !important;
  padding-left: 0.75rem !important;
  padding-right: 0 !important;
}
.bsc-select-col input[type="checkbox"] {
  cursor: pointer;
}

/* ── Edit modal for assets / onboarding ─────────────────────────────────── */
.bsc-edit-modal .modal-header {
  background: #fafafa;
  border-bottom: 1px solid var(--bsc-border);
}
.bsc-edit-modal .modal-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bsc-muted);
}

/* ── Assign user typeahead (shared across asset list pages) ──────────────── */
.bsc-user-drop {
  position: fixed;
  background: #fff;
  border: 1px solid var(--bsc-border);
  border-radius: .375rem;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
  z-index: 1055;
  max-height: 200px;
  overflow-y: auto;
}
.bsc-user-drop-item {
  padding: .4rem .75rem;
  cursor: pointer;
  font-size: .84rem;
}
.bsc-user-drop-item:hover { background: #fffbe6; }
.bsc-user-drop-item .text-muted { font-size: .75rem; }

/* ── Onboarding / Asset table search bar ─────────────────────────────────── */
.bsc-list-search { max-width: 220px; }
.bsc-list-filter-select { width: auto; max-width: 160px; }

/* ── Sortable table columns (Asset Tracker) ──────────────────────────────── */
.bsc-th-sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.bsc-th-sortable:hover { color: #111827; }
.bsc-th-sortable::after { content: '\2195'; opacity: .35; margin-left: .3em; font-size: .8em; }
.bsc-th-sort-asc::after  { content: '\2191'; opacity: 1; }
.bsc-th-sort-desc::after { content: '\2193'; opacity: 1; }

/* ── Asset thumbnail (list + detail) ─────────────────────────────────────── */
.bsc-asset-thumb { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; background: #f3f4f6; }
.bsc-asset-thumb-placeholder {
  width: 40px; height: 40px; border-radius: 6px; background: #f3f4f6; color: #9ca3af;
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
}
.bsc-asset-thumb-lg { width: 96px; height: 96px; border-radius: 10px; object-fit: cover; background: #f3f4f6; }
.bsc-asset-thumb-lg-placeholder {
  width: 96px; height: 96px; border-radius: 10px; background: #f3f4f6; color: #9ca3af;
  display: flex; align-items: center; justify-content: center; font-size: 2.4rem;
}
.bsc-mono-sm { font-size: .78rem; font-family: monospace; }
.bsc-edit-panel { background: #fafafa; }
.bsc-form-sm { font-size: .88rem; }
.bsc-form-label-xs { font-size: .74rem; margin-bottom: .2rem; }
.bsc-detail-meta { font-size: .84rem; }

/* ── General utility classes (replace inline styles) ─────────────────────── */
.bsc-tr-clickable   { cursor: pointer; }
.bsc-text-sm        { font-size: .8rem; }
.bsc-hint-sm        { font-size: .82rem; }
.bsc-text-xs        { font-size: .78rem; }
.bsc-text-xxs       { font-size: .75rem; }
.bsc-badge-xs       { font-size: .72rem; }
.bsc-subsec-hdr     { font-size: .84rem; }       /* h6 subsection labels in detail/form views */
.bsc-btn-xs         { font-size: .72rem; padding: .1rem .4rem; }  /* tiny link-style buttons */

/* Onboarding — start date card */
.bsc-start-date-icon { font-size: 1.6rem; color: var(--bsc-accent-dark); }
.bsc-start-date-val  { font-size: 1.2rem; font-weight: 600; }

/* Onboarding — calendar icon in new starter/leaver forms */
.bsc-ob-date-icon    { font-size: 1.8rem; color: var(--bsc-accent-dark); }

/* Onboarding — manager selection preview box */
.bsc-mgr-sel-box {
  background: var(--bsc-bg-alt);
  border: 1px solid var(--bsc-border);
  border-radius: .25rem;
}

/* Onboarding — SharePoint access pickers */
.bsc-sp-site-sel     { max-width: 260px; }
.bsc-sp-perm-sel     { max-width: 140px; }

/* Onboarding — steps ordered list */
.bsc-steps-list      { font-size: .82rem; line-height: 1.8; }

/* Asset forms */
.bsc-form-panel      { max-width: 760px; }        /* form wrapper max-width */
.bsc-input-id        { max-width: 200px; }         /* small ID input */
.bsc-card-sm         { max-width: 560px; }         /* narrow card */
.bsc-grid-full       { grid-column: 1 / -1; }      /* full-width grid cell */
.bsc-bar-wrap        { min-width: 50px; }          /* progress bar wrapper */
.bsc-pct-col         { min-width: 35px; }          /* percentage label column in valuation bars */
.bsc-td-truncate     { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bsc-list-filter-bar {
  background: var(--bsc-card);
  border: 1px solid var(--bsc-border);
  border-radius: .5rem;
  padding: .5rem .75rem;
  margin-bottom: .75rem;
}
.bsc-list-filter-bar .row { align-items: center; }

@media (prefers-reduced-motion: reduce) {
  .btn,
  .bsc-nav-link,
  .bsc-dash-tile,
  .bsc-ann-card,
  .bsc-access-type-card,
  .bsc-bulk-bar,
  .bsc-parking-loc-card,
  .bsc-pg-available,
  .bsc-sidebar,
  .bsc-content,
  .bsc-sidebar-toggle i {
    transition: none !important;
    animation: none !important;
  }
}

/* ── Parking ─────────────────────────────────────────────────────────────── */

/* Location selector cards */
.bsc-parking-loc-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem 1.75rem;
  background: var(--bsc-card);
  border: 1.5px solid var(--bsc-border);
  border-radius: .875rem;
  color: var(--bsc-text);
  text-align: center;
  min-height: 210px;
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
.bsc-parking-loc-card:hover {
  border-color: var(--bsc-accent);
  box-shadow: 0 6px 24px rgba(255, 214, 0, .25);
  transform: translateY(-4px);
  color: var(--bsc-text);
}
.bsc-parking-loc-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 62px; height: 62px;
  border-radius: 50%;
  background: var(--bsc-accent);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -.5px;
  color: var(--bsc-text);
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(255, 214, 0, .4);
}
.bsc-parking-loc-name    { font-size: 1.3rem; font-weight: 700; margin-bottom: .3rem; }
.bsc-parking-loc-address { font-size: .78rem; color: var(--bsc-muted); margin-bottom: .85rem; line-height: 1.4; }
.bsc-parking-loc-meta {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .78rem;
  font-weight: 600;
  color: var(--bsc-text);
  background: #fff8cc;
  border: 1px solid #ffe066;
  border-radius: 999px;
  padding: .2rem .7rem;
}

/* Parking grid scroll wrapper */
.bsc-pg-scroll-wrap {
  overflow-x: auto;
}

/* Spot header column — auto-fit to content */
.bsc-pg-spot-hdr {
  width: 1%;
  white-space: nowrap;
  text-align: center;
  font-size: .75rem;
  font-weight: 600;
  padding: .4rem .75rem !important;
  background: var(--bsc-card);
}

/* Spot name cell (sticky left) */
.bsc-pg-spot-name {
  white-space: nowrap;
  text-align: center;
  background: #fffdf0;
  font-weight: 600;
}

/* Spot header — same tint */
.bsc-pg-spot-hdr {
  background: #fffdf0 !important;
}

/* Parking cells: taller, weekday tint */
.bsc-pg-scroll-wrap .bsc-wp-cell {
  height: 52px;
  vertical-align: middle;
  background: #f0f7ff;
}

/* Day header — wider than WP to fit "27 May" */
.bsc-pg-day-hdr {
  min-width: 62px;
  max-width: 72px;
  text-align: center;
  padding: .25rem .2rem !important;
  font-weight: 600;
  font-size: .72rem;
  background: var(--bsc-card);
  position: sticky;
  top: 0;
  white-space: nowrap;
}

/* Weekend column header — light red */
.bsc-pg-wknd-hdr {
  background: #fee2e2 !important;
  color: #991b1b !important;
}
.bsc-pg-wknd-hdr .bsc-wp-dow { color: #b91c1c !important; }

/* Weekend cells — light red tint */
.bsc-pg-wknd-cell { background: #fff5f5 !important; }

/* My booking cell — td stays display:table-cell, flex lives in the wrapper */
.bsc-pg-mine-cell {
  background: #fffbeb !important;
  padding: 0 !important;
  overflow: hidden;
}
.bsc-pg-mine-cell:hover { background: #fef3c7 !important; }

.bsc-pg-mine-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 100%;
  min-height: 52px;
}

/* Initials badges */
.bsc-pg-init-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  font-size: .65rem;
  font-weight: 700;
}
.bsc-pg-init-mine  { background: var(--bsc-accent); color: #111; }
.bsc-pg-init-taken { background: #e5e7eb; color: #6b7280; }

/* Cancel pill — space is always reserved (no layout jump), visible only on hover */
.bsc-pg-cancel-pill {
  visibility: hidden;
  font-size: .55rem;
  line-height: 1;
  padding: 2px 7px;
  border-radius: 999px;
  background: #fecaca;
  color: #991b1b;
  border: 1px solid #fca5a5;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.bsc-pg-mine-cell:hover .bsc-pg-cancel-pill {
  visibility: visible;
}
.bsc-pg-cancel-pill:hover {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}

/* Reservation chips (My Upcoming section) */
.bsc-pg-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .25rem .65rem;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 999px;
  font-size: .78rem;
  color: var(--bsc-text);
}
.bsc-pg-chip-cancel {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--bsc-muted);
  line-height: 1;
  font-size: .75rem;
}
.bsc-pg-chip-cancel:hover { color: #dc2626; }

/* ===== PROCEDURES ===== */
.bsc-pdf-viewer-wrap {
  width: 100%;
  height: 75vh;
  min-height: 400px;
  border-radius: 8px;
  overflow: hidden;
  background: #f8f9fa;
}
.bsc-pdf-embed {
  width: 100%;
  height: 100%;
  border: none;
}
.bsc-proc-card {
  cursor: pointer;
  transition: box-shadow .15s;
}
.bsc-proc-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); }



/* Procedures: department subfolder pills */
.bsc-dept-pill {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .35rem .85rem;
  border: 1px solid var(--bsc-border);
  border-radius: 20px;
  background: #fff;
  font-size: .82rem;
  font-weight: 500;
  color: var(--bsc-text);
  transition: border-color .12s, background .12s;
}
.bsc-dept-pill:hover {
  border-color: var(--bsc-accent);
  background: #fffbf0;
  color: var(--bsc-text);
}
.bsc-dept-pill-count {
  background: var(--bsc-bg);
  border-radius: 10px;
  padding: .05rem .45rem;
  font-size: .7rem;
  color: #666;
}

/* Procedure card badges */
.bsc-proc-badge {
  display: inline-block;
  padding: .18em .55em;
  font-size: .7rem;
  font-weight: 600;
  border-radius: 4px;
  line-height: 1.4;
  white-space: nowrap;
}
.bsc-proc-badge-country { background: #495057; color: #fff; }
.bsc-proc-badge-dept    { background: #e0f4ff; color: #0369a1; border: 1px solid #bae6fd; }
.bsc-proc-badge-draft   { background: #fef9c3; color: #854d0e; border: 1px solid #fde68a; }
.bsc-tag-btn {
  padding: .2rem .65rem;
  font-size: .78rem;
  border: 1px solid var(--bsc-border);
  background: #fff;
  color: var(--bsc-text);
  border-radius: 999px;
  line-height: 1.4;
}
.bsc-tag-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}
.bsc-tag-btn.active {
  background: var(--bsc-accent);
  border-color: var(--bsc-accent-dark);
  color: #111;
  font-weight: 600;
}

/* ── Custom scrollbar ────────────────────────────────────────────────────── */
/* Global (light content areas) — Webkit */
::-webkit-scrollbar               { width: 8px; height: 8px; }
::-webkit-scrollbar-track         { background: #f1f1f1; border-radius: 4px; }
::-webkit-scrollbar-thumb         { background: #c0c4cc; border-radius: 4px; border: 2px solid #f1f1f1; }
::-webkit-scrollbar-thumb:hover   { background: #9ca3af; }
::-webkit-scrollbar-corner        { background: #f1f1f1; }
/* Global — Firefox */
* { scrollbar-width: thin; scrollbar-color: #c0c4cc #f1f1f1; }

/* Sidebar nav (dark background #141414) — override global */
.bsc-nav                           { scrollbar-color: #383838 #141414; }
.bsc-nav::-webkit-scrollbar        { width: 4px; }
.bsc-nav::-webkit-scrollbar-track  { background: #141414; border-radius: 0; }
.bsc-nav::-webkit-scrollbar-thumb  { background: #383838; border-radius: 4px; border: none; }
.bsc-nav::-webkit-scrollbar-thumb:hover { background: var(--bsc-accent); }


/* ── Notifications ───────────────────────────────────────────────────────── */
.bsc-notif-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bsc-card);
  border: 1px solid var(--bsc-border);
  border-radius: 8px;
  padding: 14px 16px;
  transition: box-shadow .15s;
}
.bsc-notif-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.bsc-notif-unread {
  border-left: 3px solid var(--bsc-accent);
  background: #fffef5;
}
.bsc-notif-left {
  padding-top: 4px;
  flex-shrink: 0;
}
.bsc-notif-status-col { width: 20px; }
.bsc-notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bsc-border);
  transition: background .2s;
}
.bsc-notif-dot.active {
  background: var(--bsc-accent);
}
.bsc-notif-title {
  font-size: .93rem;
  color: var(--bsc-text);
}
.bsc-notif-msg {
  font-size: .83rem;
  line-height: 1.45;
}
.bsc-notif-source {
  font-size: .78rem;
}
.bsc-notif-meta {
  font-size: .78rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.bsc-notif-actions {
  min-width: 90px;
}
.bsc-notif-admin-unread {
  font-weight: 500;
}

/* filter pills */
.bsc-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: .3rem .85rem;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--bsc-text-muted, #6b7280);
  background: var(--bsc-card);
  border: 1px solid var(--bsc-border);
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
.bsc-filter-pill:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
  color: var(--bsc-text);
  text-decoration: none;
}
.bsc-filter-pill.active {
  background: var(--bsc-accent);
  border-color: var(--bsc-accent-dark, #ca8a04);
  color: #111;
}
.bsc-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
  background: rgba(0,0,0,.12);
  line-height: 1;
}

/* accent badge */
.bsc-badge-accent {
  background: var(--bsc-accent);
  color: #111;
  font-weight: 700;
}

/* stat cards */
.bsc-stat-card {
  background: var(--bsc-card);
  border: 1px solid var(--bsc-border);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}
.bsc-stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--bsc-text);
}
.bsc-stat-label {
  font-size: .78rem;
  color: #6b7280;
  margin-top: 2px;
}

/* ── Invoices module ─────────────────────────────────────────────────────── */

/* Column header = one click target (2026-09-11 rework). No ⋮ button, no
   persistent sort arrows -- clicking a <th> opens #col-menu-popover with
   Sort asc/desc + a text filter for that column. */
.bsc-inv-th-sort { white-space: nowrap; }   /* legacy alias, kept harmless */
.bsc-inv-th-menu {
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.bsc-inv-th-menu:hover { background: rgba(0, 0, 0, .05); }
.bsc-inv-th-menu:focus-visible { outline: 2px solid var(--bsc-accent); outline-offset: -2px; }
.bsc-inv-th-inner {
  display: flex;
  align-items: center;
  gap: .3rem;
}
.bsc-inv-th-label { white-space: nowrap; }
/* the sorted column: label goes bold + accent (no arrow) */
.bsc-inv-th-menu.bsc-inv-th-sorted .bsc-inv-th-label {
  font-weight: 700;
  color: var(--bsc-accent-dark);
}
/* the filtered column: a small filled funnel after the label */
.bsc-inv-th-filt-ico {
  font-size: .62rem;
  color: var(--bsc-accent-dark);
  display: none;
}
.bsc-inv-th-menu.bsc-inv-th-filtered .bsc-inv-th-filt-ico { display: inline-block; }
.bsc-inv-th-menu.bsc-inv-th-filtered .bsc-inv-th-label { color: var(--bsc-accent-dark); }

.bsc-col-menu {
  position: fixed;
  width: 240px;
  background: var(--bsc-card, #fff);
  border: 1px solid var(--bsc-border);
  border-radius: .5rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.16);
  z-index: 1060;
  overflow: hidden;
}
.bsc-col-menu-hdr {
  padding: .5rem .75rem;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--bsc-muted);
  border-bottom: 1px solid var(--bsc-border);
  background: rgba(0,0,0,.02);
}
.bsc-col-menu-sort { padding: .35rem .35rem 0; }
.bsc-col-menu-sort-btn {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
  border: none;
  background: transparent;
  padding: .4rem .55rem;
  border-radius: .35rem;
  font-size: .82rem;
  color: var(--bsc-text);
  text-align: left;
}
.bsc-col-menu-sort-btn:hover { background: rgba(0, 0, 0, .06); }
.bsc-col-menu-sort-btn.active {
  background: var(--bsc-accent);
  color: #1a1300;
  font-weight: 600;
}
.bsc-col-menu-sort-btn .bi { font-size: .8rem; }
.bsc-col-menu-body { padding: .35rem .75rem .6rem; }
.bsc-col-menu-sublabel {
  display: block;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--bsc-muted);
  margin: .3rem 0 .25rem;
}
.bsc-col-menu-footer {
  padding: .4rem .75rem .6rem;
  border-top: 1px solid var(--bsc-border);
}
.bsc-col-menu-footer .btn-link { font-size: .78rem; text-decoration: none; }
.bsc-col-menu-footer .btn-link:hover { text-decoration: underline; }

.bsc-inv-row { cursor: pointer; }

/* Column striping (2026-09-11, Payments Library; made a reusable app-wide
   class 2026-09-23, explicit request: "sprawdź każdą taką tabelke w
   aplikacji i zrób tak żeby wszędzie była zasada: co druga kolumna inny
   odcień szarości, jak w payments library") -- every other column gets a
   subtle darker tint so columns stay easy to tell apart at a glance across
   a wide table. Add class="bsc-col-striped" to any <table class="table
   table-hover ...">  to opt in. Deliberately body-only (not the header --
   .table-light already gives the header its own distinct look). Lower
   precedence than a selected-row highlight (use !important there, it'll
   always win) and than :hover (the second rule here re-asserts a
   slightly-darker-still tint specifically on the striped columns while
   hovering, so table-hover's own row feedback doesn't go missing on
   exactly the striped cells). */
.bsc-col-striped > tbody > tr > td:nth-child(even) {
  background-color: rgba(0, 0, 0, .03);
}
.bsc-col-striped.table-hover > tbody > tr:hover > td:nth-child(even) {
  background-color: rgba(0, 0, 0, .075);
}

#inv-tbody tr.bsc-inv-row:has(.inv-cb:checked) td {
  background-color: rgba(255, 214, 0, .15) !important;
  box-shadow: none !important;
}
#inv-tbody tr.bsc-inv-row:has(.inv-cb:checked):hover td {
  background-color: rgba(255, 214, 0, .22) !important;
}

.bsc-inv-td-name { max-width: 160px; }

/* Status badges */
.bsc-inv-badge {
  font-size: .65rem;
  font-weight: 700;
  padding: .25em .65em;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.bsc-inv-badge-success  { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.bsc-inv-badge-primary  { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.bsc-inv-badge-warning  { background: #fef9c3; color: #854d0e; border: 1px solid #fde047; }
.bsc-inv-badge-danger   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.bsc-inv-badge-secondary{ background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; }
.bsc-inv-badge-info     { background: #e0f2fe; color: #075985; border: 1px solid #bae6fd; }
/* Extra colour slots (2026-09-09), added for the Department column's
   deterministic name→colour hash (deptColorClass() in invoices.html) --
   departments are open-ended, not a small fixed enum like payment/approval
   status, so the original 6 status-badge colours weren't enough slots to
   keep collisions rare. */
.bsc-inv-badge-purple   { background: #f3e8ff; color: #6b21a8; border: 1px solid #e9d5ff; }
.bsc-inv-badge-teal     { background: #ccfbf1; color: #115e59; border: 1px solid #99f6e4; }
.bsc-inv-badge-orange   { background: #ffedd5; color: #9a3412; border: 1px solid #fed7aa; }
.bsc-inv-badge-pink     { background: #fce7f3; color: #9d174d; border: 1px solid #fbcfe8; }
.bsc-inv-badge-indigo   { background: #e0e7ff; color: #3730a3; border: 1px solid #c7d2fe; }
.bsc-inv-badge-lime     { background: #ecfccb; color: #3f6212; border: 1px solid #d9f99d; }
.bsc-inv-badge-slate    { background: #e2e8f0; color: #334155; border: 1px solid #cbd5e1; }
.bsc-inv-badge-brown    { background: #efe4dc; color: #7c4a2d; border: 1px solid #e0cbb9; }
.bsc-inv-badge-sm { font-size: .6rem; padding: .2em .5em; }

/* SPV cell fill (2026-09-23, explicit request, Projects list) -- the SPV
   column stopped being a small badge-in-a-cell and became a full-cell
   colour fill instead (same colour hash / same 13 hues as the badges
   above, just filling the whole <td>, normal table font size, not bold,
   acts as a link to open the company detail modal). !important because
   .bsc-col-striped's own even-column tint (ID-less but still a background-
   color on the same element) must never wash this out if SPV happens to
   land on an even column. */
.bsc-spv-cell {
  cursor: pointer;
  font-weight: 400;
}
.bsc-spv-cell:hover { text-decoration: underline; }
.bsc-spv-success  { background: #dcfce7 !important; color: #166534; }
.bsc-spv-primary  { background: #dbeafe !important; color: #1e40af; }
.bsc-spv-warning  { background: #fef9c3 !important; color: #854d0e; }
.bsc-spv-danger   { background: #fee2e2 !important; color: #991b1b; }
.bsc-spv-info     { background: #e0f2fe !important; color: #075985; }
.bsc-spv-purple   { background: #f3e8ff !important; color: #6b21a8; }
.bsc-spv-teal     { background: #ccfbf1 !important; color: #115e59; }
.bsc-spv-orange   { background: #ffedd5 !important; color: #9a3412; }
.bsc-spv-pink     { background: #fce7f3 !important; color: #9d174d; }
.bsc-spv-indigo   { background: #e0e7ff !important; color: #3730a3; }
.bsc-spv-lime     { background: #ecfccb !important; color: #3f6212; }
.bsc-spv-slate    { background: #e2e8f0 !important; color: #334155; }
.bsc-spv-brown    { background: #efe4dc !important; color: #7c4a2d; }

/* Approval labels — fill column width */
.bsc-inv-app-badge {
  display: block;
  width: 100%;
  text-align: center;
}

/* Approval column, 2026-09-09 (explicit request): 4 small labels side by
   side (1st/2nd/3rd/4th, colour-coded same as before) instead of a
   vertically-stacked "1st: Approved" list -- much more compact, the full
   "status (approver)" detail moves to a tooltip instead of being printed
   inline. */
.bsc-inv-approval-row {
  display: flex;
  gap: .25rem;
  justify-content: center;
  flex-wrap: nowrap;
}
.bsc-inv-approval-pill {
  min-width: 1.9rem;
  text-align: center;
  padding: .2em .35em;
}

/* Payments library data-card header, 2026-09-09: the count badge / "Clear
   filters" pill / Refresh button all stay on one line -- flex-wrap: nowrap
   on the whole right-hand group (explicit "keep the header height"
   request), overflow-x: auto as the fallback rather than wrapping to a
   second line. (The per-currency totals that used to live here moved into
   the floating bulk bar itself, next to "N selected" -- see
   .bsc-bulk-summary below -- so selection count and total read as one
   cohesive place instead of two disconnected ones.) */
.bsc-inv-data-hdr { flex-wrap: nowrap; }
.bsc-inv-hdr-right {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
}
.bsc-inv-hdr-right::-webkit-scrollbar { display: none; }

/* Document number, plain text now (2026-09-09, was a mono badge/pill) --
   same font style/size as Amount (mono, semibold, .82rem, see renderRow())
   but a distinct colour so the two never read as the same kind of value. */
.bsc-inv-docnum-text { color: #4338ca; }

/* Compact columns (dates, payment) */
.bsc-inv-th-compact {
  width: 78px;
  white-space: normal;
  font-size: .75rem;
  line-height: 1.25;
  vertical-align: middle;
}

/* Standard-width columns: doc number, dept, approval, uploaded by */
.bsc-inv-col-std { width: 105px; }

/* Amount column — same width as department */
.bsc-inv-col-amount { width: 120px; }

/* Company / Vendor / Department column widths */
.bsc-inv-col-company { width: 180px; }
.bsc-inv-col-vendor  { width: 180px; }
.bsc-inv-col-dept    { width: 120px; }

/* Filter card label style */
.form-label-sm { font-size: .72rem; letter-spacing: .02em; }

/* ── SearchSelect (bsc-ss) ─────────────────────────────────────────────── */
.bsc-ss { position: relative; }
.bsc-ss-wrap { position: relative; display: flex; align-items: center; }
.bsc-ss-search { padding-right: 1.6rem !important; cursor: pointer; }
.bsc-ss-search:read-only { background-color: #fff; }
.bsc-ss-clear {
  position: absolute; right: .35rem; top: 50%; transform: translateY(-50%);
  border: none; background: none; color: #9ca3af; cursor: pointer;
  font-size: .85rem; line-height: 1; padding: 0 .1rem;
}
.bsc-ss-clear:hover { color: #374151; }
.bsc-ss-drop {
  position: fixed; z-index: 1060;
  background: #fff; border: 1px solid #dee2e6; border-radius: .375rem;
  box-shadow: 0 .5rem 1rem rgba(0,0,0,.12);
  max-height: 220px; overflow-y: auto;
  padding: .2rem 0;
}
.bsc-ss-opt {
  padding: .3rem .75rem; cursor: pointer; font-size: .82rem; white-space: nowrap;
}
.bsc-ss-opt:hover { background: #f3f4f6; }

/* Uploaded-by badge — full column width, centered, hover highlight */
.bsc-inv-uploader-badge {
  display: block;
  width: 100%;
  text-align: center;
  transition: filter .15s;
}
a:hover .bsc-inv-uploader-badge,
.bsc-inv-uploader-badge:hover {
  filter: brightness(.88);
  cursor: pointer;
}
/* Infinite scroll sentinel */
.bsc-inv-sentinel { height: 1px; }

/* ── Filter grid: every field exactly as wide as its column ──────────────
   Bootstrap's grid columns are already equal-width by construction, but
   Tom Select's own wrapper <div> doesn't reliably stretch to fill its
   parent on its own (it can size to content instead) -- forced to 100%
   here so a long option's text can never make one filter visually wider
   than its neighbours. Also has to beat the pre-existing ".bsc-filter-select
   { max-width: 150px }" rule above (sized for Tickets'/Work Presence's/
   Shipments' own narrow horizontal filter bars) -- Tom Select copies the
   wrapped <select>'s classes onto its wrapper div, so that old unqualified
   rule was clamping every select-based filter here to 150px regardless of
   how wide its actual grid column was; overridden with max-width here,
   scoped to these filter panels only so those other pages are untouched. */
[id$="-filter-body"] .row > [class*="col-"] {
  min-width: 0; /* the grid column's width wins, not a child's intrinsic content width */
}
[id$="-filter-body"] input.form-control,
[id$="-filter-body"] select.form-select,
[id$="-filter-body"] .ts-wrapper {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

/* Active filter highlight — yellow glow on filled controls */
.bsc-filter-active.form-control {
  background: #fffbe6 !important;
  border-color: var(--bsc-accent) !important;
  box-shadow: 0 0 0 2px rgba(255,214,0,.25) !important;
}
.bsc-ss.bsc-filter-active .bsc-ss-search {
  background: #fffbe6;
  border-color: var(--bsc-accent) !important;
  box-shadow: 0 0 0 2px rgba(255,214,0,.25);
}
.bsc-filter-active.form-select,
select.bsc-filter-active + .ts-wrapper .ts-control {
  background: #fffbe6 !important;
  border-color: var(--bsc-accent) !important;
  box-shadow: 0 0 0 2px rgba(255,214,0,.25) !important;
}


/* MultiSelect option row — checkbox + label inline */
.bsc-ms-opt { display: flex; align-items: center; gap: .45rem; }
.bsc-ms-opt .bsc-ms-cb { flex-shrink: 0; pointer-events: none; }

/* ── FX Rates inline section ──────────────────────────────────────────────── */
.bsc-fx-hdr {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--bsc-muted);
}
.bsc-fx-date { font-size: .68rem; color: var(--bsc-muted); }

.bsc-fx-row {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .2rem 0;
  border-bottom: 1px solid var(--bsc-border);
}
.bsc-fx-row:last-child { border-bottom: none; }

.bsc-fx-row-flag { font-size: 1rem; line-height: 1; width: 1.25rem; text-align: center; }
.bsc-fx-row-code {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--bsc-muted);
  width: 26px;
}
.bsc-fx-row-val {
  font-size: .92rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--bsc-text);
  flex: 1;
}
.bsc-fx-up   { font-size: .65rem; font-weight: 700; color: #16a34a; white-space: nowrap; }
.bsc-fx-down { font-size: .65rem; font-weight: 700; color: #dc2626; white-space: nowrap; }
@media (prefers-color-scheme: dark) {
  .bsc-fx-up   { color: #4ade80; }
  .bsc-fx-down { color: #f87171; }
}
:root[data-theme="dark"] .bsc-fx-up   { color: #4ade80; }
:root[data-theme="dark"] .bsc-fx-down { color: #f87171; }

/* ── Invoice Detail Modal ───────────────────────────────────────────────────── */

/* Full content-area sizing (mirrors .bsc-content margin-left) */
@media (min-width: 992px) {
  .bsc-inv-detail-modal .modal-dialog {
    max-width: none;
    width: calc(100vw - var(--bsc-sidebar-w) - 40px);
    margin-left: calc(var(--bsc-sidebar-w) + 20px);
    margin-right: 20px;
    margin-top: 20px;
    margin-bottom: 20px;
    height: calc(100vh - 40px);
  }
  .bsc-inv-detail-modal .modal-content { height: 100%; }
}
@media (max-width: 991px) {
  .bsc-inv-detail-modal .modal-dialog {
    max-width: calc(100vw - 32px);
    margin: 16px auto;
  }
}

.bsc-inv-detail-docnum {
  font-size: 1.05rem;
  font-weight: 700;
  font-family: var(--bsc-font-mono, monospace);
  letter-spacing: .03em;
}
/* Detail modal header's 4 icon actions -- download / copy link / delete /
   close -- one shared style, one shared gap between all of them (explicit
   request, 2026-09-11; previously copy-link and delete sat edge to edge
   with 0 gap and close used a visually different native .btn-close). */
.bsc-inv-detail-actions {
  gap: 5px;
}
.bsc-inv-detail-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--bsc-muted);
  margin-bottom: .15rem;
}
.bsc-inv-detail-val {
  font-size: .88rem;
  color: var(--bsc-text);
}
.bsc-inv-detail-section {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--bsc-muted);
  border-bottom: 1px solid var(--bsc-border);
  padding-bottom: .25rem;
  margin-bottom: .75rem;
  margin-top: 1.1rem;
}

/* Approval stepper */
.bsc-inv-stepper {
  display: flex;
  align-items: flex-start;
  overflow-x: auto;
  padding: .5rem 0 .75rem;
}
.bsc-inv-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 72px;
  flex: 1;
}
.bsc-inv-step-icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  border: 2px solid #d1d5db;
  background: #f9fafb;
  color: #9ca3af;
}
.bsc-inv-step.approved    .bsc-inv-step-icon { background: #d1fae5; color: #16a34a; border-color: #16a34a; }
.bsc-inv-step.rejected    .bsc-inv-step-icon { background: #fee2e2; color: #dc2626; border-color: #dc2626; }
.bsc-inv-step.in-progress .bsc-inv-step-icon { background: #fef3c7; color: #d97706; border-color: #f59e0b; }
.bsc-inv-step-tier  { font-size: .65rem; font-weight: 700; text-transform: uppercase; color: var(--bsc-muted); margin-top: .3rem; }
.bsc-inv-step-status{ font-size: .68rem; margin-top: .15rem; font-weight: 600; }
.bsc-inv-step.approved    .bsc-inv-step-status { color: #16a34a; }
.bsc-inv-step.rejected    .bsc-inv-step-status { color: #dc2626; }
.bsc-inv-step.in-progress .bsc-inv-step-status { color: #d97706; }
.bsc-inv-step-person { font-size: .66rem; color: var(--bsc-muted); margin-top: .1rem; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bsc-inv-connector {
  height: 2px;
  flex: 1;
  background: #d1d5db;
  margin-top: 18px;
  min-width: 16px;
}
.bsc-inv-connector.approved { background: #16a34a; }
.bsc-inv-connector.rejected { background: #dc2626; }

/* Attachment row */
.bsc-att-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .5rem;
  border-radius: .4rem;
  font-size: .83rem;
}
.bsc-att-row:hover { background: var(--bsc-card-inner, #f3f4f6); }
.bsc-att-link {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--bsc-accent);
  text-decoration: none;
}
.bsc-att-link:hover { text-decoration: underline; }
.bsc-att-row-active { background: rgba(255,214,0,.12) !important; }

/* Add Attachment inline overlay — fixed over the content area (right of sidebar) */
.bsc-att-overlay {
  position: fixed;
  top: 0;
  left: var(--bsc-sidebar-w);
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: none; /* shown via JS: style.display = 'flex' */
  align-items: center;
  justify-content: center;
}
@media (max-width: 991px) {
  .bsc-att-overlay { left: 0; }
}
.bsc-att-overlay-back {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .5);
}
.bsc-att-overlay-box {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: .5rem;
  width: min(440px, 90%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .25);
  overflow: hidden;
}

/* Attachment type selector cards (add attachment overlay) */
.bsc-att-type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  padding: .75rem .5rem;
  border: 2px solid var(--bsc-border, #e5e7eb);
  border-radius: .5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  -webkit-user-select: none;
  user-select: none;
}
.bsc-att-type-card:hover { border-color: var(--bsc-accent, #f59e0b); }
.bsc-att-type-card.active {
  border-color: var(--bsc-accent, #f59e0b);
  background: rgba(245,158,11,.08);
}
.bsc-att-type-label { font-size: .82rem; }

/* ===== Tom Select vertical-centering fix (2026-09-08, app-wide) =====
   The vendored tom-select.bootstrap5.min.css zeroes out .ts-control's
   bottom padding once a compact (.form-select-sm) single-select has a
   value chosen, while keeping the top padding -- pushes the selected
   value's text down toward the bottom edge instead of centering it.
   Affects every form-select-sm Tom-Select dropdown in the app (most
   noticeable on Documentless Payment's dense multi-column form, where it
   was reported), not just one page, so this is a global override, not
   page-scoped.
   ⚠️ First attempt at this fix (same day) used the wrong selector and
   silently never applied -- verified only via Jinja/HTML-text checks,
   which can't catch a losing CSS specificity battle. The real vendored
   selector is the 4-class compound ".ts-wrapper.form-select-sm.has-items
   .ts-control" (confirmed by grepping the actual vendored file, not a
   truncated view of it), not the 3-class ".form-select-sm.has-items
   .ts-control" this rule originally used -- one specificity level lower,
   so it always lost regardless of source order. Fixed by matching the
   real selector exactly (plus !important, belt-and-braces, matching the
   vendored file's own convention on the adjacent multi-select rule) and
   confirmed this time with a real Playwright browser measuring the
   computed style, not just source-text presence. */
.ts-wrapper.form-select-sm.has-items .ts-control {
  padding-top: calc(.375rem - 1px) !important;
  padding-bottom: calc(.375rem - 1px) !important;
}

/* ===== Required-field validity colour on Tom-Select-wrapped <select>s =====
   classList.toggle('is-invalid'/'is-valid', ...) on the underlying <select>
   has no visible effect once Tom Select has wrapped it -- the real select
   is display:none and Tom Select's own visible ".ts-wrapper" sibling only
   ever copies classes from it once, at construction time, so a class added
   later never reaches the visible control. Same adjacent-sibling-selector
   fix already used for the filter-panel "active" glow above
   (select.bsc-filter-active + .ts-wrapper .ts-control) -- targets the
   *visible* .ts-control via the hidden select's own live class instead.
   Generic on `select`, not scoped to one page's field class (`.dp-f` /
   `.ap-f` / any future one) -- Documentless Payment and regular Add
   Payment both hit this exact bug, and any future page doing the same
   required-field validation pattern should get it for free. */
select.is-invalid + .ts-wrapper .ts-control,
select.is-invalid + .ts-wrapper.form-select-sm .ts-control,
select.is-invalid + .ts-wrapper.form-select.single.input-active .ts-control,
select.is-invalid + .ts-wrapper.form-control.single.input-active .ts-control {
  border-color: var(--bs-danger, #dc3545) !important;
}
select.is-valid + .ts-wrapper .ts-control,
select.is-valid + .ts-wrapper.form-select-sm .ts-control,
select.is-valid + .ts-wrapper.form-select.single.input-active .ts-control,
select.is-valid + .ts-wrapper.form-control.single.input-active .ts-control {
  border-color: var(--bs-success, #198754) !important;
}
/* ⚠️ Second real bug found and fixed live, 2026-09-09, in this exact same
   problem space: the two 4-class rules above (kept, still correct and
   needed for the non-focused state) silently lose to the vendored
   ".ts-wrapper.form-select.single.input-active .ts-control,
   .ts-wrapper.form-control.single.input-active .ts-control
   {border-color:currentcolor!important}" rule -- 5 compound classes vs.
   this file's 4 -- for as long as the control is actually focused
   (clicked into/being typed in). Confirmed live: right after picking a
   value via a real click, the border read a neutral currentcolor gray
   (RGB 52,58,64), not red or green, until the control lost focus, at
   which point it correctly showed green -- a real, reproducible "looks
   wrong while you're still looking at it" bug, not a Playwright
   testing-API artifact like the similar-sounding report investigated and
   dismissed earlier the same day. The two rules just above add the exact
   focused-state selector shape (6 compound classes, still beating
   vendored's 5) so validity colour now wins in every state, not just
   once blurred. */

/* ===== Real bug found and fixed, 2026-09-09: narrow Tom Select controls
   visibly grow taller the instant they're opened =====
   The vendored tom-select.bootstrap5.min.css hardcodes
   `.ts-control > input { min-width: 7rem }` (112px) on the live search
   input a single-select control switches to showing once opened/focused.
   Any field narrower than that (this app's dense field grids commonly run
   ~100-160px wide -- Payments' col-md-2 fields nested inside col-lg-8 are
   a clear example, confirmed live: a 103px-wide control grew from 31px to
   52px tall the moment it was clicked, because the too-wide-to-fit input
   forced the control's own flex-wrap layout onto a second line) hits
   this. Reported as "dropdowns aren't allowed to change size" -- fixed at
   the actual cause (the input's own min-width) rather than by disabling
   the dropdown, which would break the ability to type a search term.
   App-wide, not Payments-scoped, since any narrow Tom Select field
   anywhere could hit the same layout bug. */
.ts-control > input {
  min-width: 0 !important;
}
.ts-wrapper.single .ts-control {
  flex-wrap: nowrap !important;
}
/* The actual root cause, found by measuring the real box model live (the
   two rules above are still correct/worth keeping, just weren't
   sufficient alone): opening a narrow single-select control shrinks the
   shared space between the still-visible selected-item label and the new
   live search input, and the vendored CSS never gives that label
   `white-space: nowrap` -- once its own width drops below what "No need"
   (or any other value) needs on one line, the text wraps inside the
   label itself (measured live: 21px -> 42px, i.e. 1 line -> 2), which is
   what actually grows the parent control's height. Ellipsis-truncate
   instead of wrapping -- the field is still fully legible via its full
   value once selected/closed at its normal width; only the transient
   open state on a very narrow field would ever truncate at all. */
.ts-control .item {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* ===== Dropdown search legibility (2026-09-10, app-wide, explicit request) =====
   Two real, reproducible issues found live (measured via a real Playwright
   browser, not just reading the vendored CSS):
   1. A single-select's previously-picked item stays visibly rendered
      alongside the live search input the whole time you're typing to
      filter (confirmed: .ts-control's own text still read the full old
      selection's name while "a" was being typed into the search box) --
      the vendored CSS never hides `.item` during the "actively searching"
      state, only ever removes/replaces it on an actual new pick.
      ⚠️ 2026-09-11 regression fix: this was originally scoped to Tom
      Select's `.input-active` class ("the live search input is focused"),
      which is ALSO true for a few ticks right after you click an option --
      Tom Select's own addItem()→inputState() runs before the control
      loses focus, so `.input-active` doesn't clear until blur. Net result,
      confirmed live: pick a value, the control renders blank until you
      click something else. Rescoped to `.dropdown-active` (Tom Select's
      class for "the options panel is actually open") instead: true for
      the entire time you're searching (open on focus, before AND while
      typing), and — critically — already false by the time addItem() closes
      a single-select's dropdown on pick, so the chosen value shows
      immediately, no blur needed. Still reverts the instant the dropdown
      closes for any reason (Escape, click-away), matching the original intent.
   2. The dropdown panel itself was measured narrower than its own control
      (78px vs. an 88px control) when using `dropdownParent: 'body'` (this
      app's own default, see base.html/every explicit TomSelect(...) call --
      avoids .card{overflow:hidden} clipping) -- Tom Select sizes a
      body-parented dropdown to exactly the control's width, which reads
      fine for a short value but truncates/wraps real option text badly on
      this app's narrow field grids (col-md-2 columns, long vendor/company
      names). Given a real floor width instead, so there's room to actually
      read what's being searched, regardless of how narrow the field itself
      is -- still anchored to the control's left edge (Tom Select's own
      positioning, untouched), just allowed to extend further right. */
.ts-wrapper.single.dropdown-active .ts-control > .item {
  display: none;
}
.ts-dropdown {
  min-width: 260px;
}

/* ===== Real bug found and fixed live, 2026-09-11: a Tom Select dropdown
   inside a Bootstrap modal rendered completely invisible/unclickable =====
   Reported as "the SIM Card Edit dropdown does nothing when clicked" but
   confirmed live (Playwright) to be a general, app-wide problem, not a
   SIM-Card-only one: every dropdown in this app uses `dropdownParent:
   'body'` (base.html), so its `.ts-dropdown` panel is appended straight
   to <body> -- a *sibling* of an open `.modal`, not a descendant, so
   Bootstrap's own modal stacking gives it no help. The vendored
   tom-select.bootstrap5.min.css hardcodes `.ts-dropdown { z-index: 1000 }`,
   which loses to Bootstrap 5's own `.modal-backdrop` (1050) AND `.modal`
   (1055) -- confirmed live via getComputedStyle + elementFromPoint: the
   dropdown WAS open (display:block, options present, clickable in the
   DOM) but rendered entirely *underneath* the modal, so every real click
   landed on the modal's own content behind it instead. Any `<select>`
   inside ANY Bootstrap modal in the app had this problem (Device/SIM
   Card/Equipment/License Edit modals, any other modal with a dropdown
   field) -- it was only reported against SIM Card's Operator/Location
   because those two were still a native `<input list>` (unaffected,
   browser-native) until 2026-09-10's dropdown-consistency pass converted
   them to Tom Select, making the pre-existing latent bug visible there
   first. Fix: give `.ts-dropdown` a z-index clearly above Bootstrap's own
   modal stack (backdrop 1050 / modal 1055 / this app's own "must beat a
   modal" popovers at 1060) with headroom to spare. */
.ts-dropdown {
  z-index: 1100 !important;
}

/* (The old .bsc-payments-field-grid .form-label rule that lived here is
   gone -- superseded by the app-wide form-label unification at the very
   end of this file, 2026-09-11.) */

/* Payments "add a payment" field grid (2026-09-11, explicit requests):
   - exactly 4 equal-width fields per row on desktop (was col-md-2, ~6/row
     inside the col-lg-8 field area), 2/row on small screens -- overriding
     the Bootstrap col widths here instead of editing every field's class;
   - tighter padding on every control so there's more room to read/type
     the value. Both scoped to .bsc-payments-field-grid so the rest of the
     app's forms are untouched. */
@media (min-width: 576px) {
  .bsc-payments-field-grid > [class*="col-"]:not(.col-12) { flex: 0 0 50%; max-width: 50%; }
}
@media (min-width: 992px) {
  .bsc-payments-field-grid > [class*="col-"]:not(.col-12) { flex: 0 0 25%; max-width: 25%; }
}
/* Payment title (2026-09-22, explicit request: "cała szerokość" -- full
   row width): real bug found -- the two rules just above match ANY
   [class*="col-"] child, including this field's own col-md-8, and pin it
   to a fixed 25%/50% regardless of that class -- every earlier width
   change to this field (col-md-6 on 2026-09-17, col-md-8 today) was
   silently overridden by this same rule the whole time and never
   actually rendered wider. !important because the two rules above are
   otherwise equal-or-higher specificity ([class*="col-"] + :not(.col-12)
   ~= two classes) and would still win on source order/specificity alone. */
.bsc-payments-field-grid > .ap-title-row,
.bsc-payments-field-grid > .dp-title-row {
  flex: 0 0 100% !important;
  max-width: 100% !important;
}
/* Payments field-grid controls: only the *vertical* padding is tightened
   for the dense 4-per-row layout. Horizontal padding — and, crucially,
   Tom Select's own 2.25rem right-side caret reserve — is left at the
   default so the dropdown chevron shows, exactly like the Asset Tracker
   Edit-modal dropdowns (2026-09-11, "wszystkie dropdowny w /payments mają
   być takie same jak w /assets/devices details"; supersedes the earlier
   tight-all-sides override that hid the caret). */
.bsc-payments-field-grid .form-control.form-control-sm,
.bsc-payments-field-grid .form-select.form-select-sm {
  padding-top: .2rem;
  padding-bottom: .2rem;
}
.bsc-payments-field-grid .ts-wrapper .ts-control {
  padding-top: .2rem !important;
  padding-bottom: .2rem !important;
  min-height: auto !important;
}
.bsc-payments-field-grid .ts-control > input { margin: 0 !important; }

/* ===== Documentless Payment row header (2026-09-08) =====
   The remove button used a full Bootstrap .btn.btn-sm, which is visibly
   taller than the flat pill-badge buttons used in every other card header
   in the app (e.g. Payments library's Refresh button) -- made the whole
   row header taller as a result. Reuses the existing flat pill-badge
   convention (.bsc-dash-hdr-btn) instead of introducing a new style. */
.bsc-dash-hdr-btn-danger { background: #f8d7da; color: #842029; }
.bsc-dash-hdr-btn-danger:hover { background: #f1aeb5; color: #58151c; }

/* ===== Payments forms: keep the valid/invalid border colour, drop the
   checkmark/exclamation icon (2026-09-08, explicit request) =====
   Bootstrap's own .is-valid/.is-invalid styling adds a background-image
   icon plus extra right-padding to make room for it -- undone here, kept
   scoped to .ap-f/.dp-f (Payments' own field-marker classes) rather than
   applied globally, since is-valid/is-invalid is also used unmodified
   elsewhere in the app (Announcements, Onboarding new-starter/leaver
   forms) and shouldn't change there. Safe for Tom-Select-wrapped <select>
   elements too -- they're always display:none in this app (Tom Select's
   own .ts-control carries its own separate caret, untouched by this). */
.ap-f.is-valid, .ap-f.is-invalid,
.dp-f.is-valid, .dp-f.is-invalid {
  background-image: none !important;
  padding-right: .5rem !important;
}

/* ===== Document preview widget (BscDocPreview, doc-preview.js) — 2026-09-09
   Every Payments "add a payment" form now shows its source/preview
   document in a 1/3-width column next to the 2/3-width field grid,
   replacing the previous plain <iframe> -- explicit request for
   guaranteed zoom in/out controls, copyable text, and a view that always
   starts at the document's own top-left corner at full (non-shrunk)
   resolution, none of which a bare browser-embedded PDF plugin can be
   relied on to provide consistently across browsers. */
.bsc-doc-preview {
  width: 100%;
  height: 640px;
  border: 1px solid var(--bsc-border);
  border-radius: .5rem;
  background: #eceff3;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* Add Payment / Documentless Payment cards only (2026-09-18, explicit
   request) -- Document preview stretches to end exactly where the last
   field section (Document approval, or Document notes when approval is
   hidden) ends, not the fixed 640px above (still used as-is by Payments
   library's own detail modal, which has a different layout). .col-lg-8/
   .col-lg-4 are flex-item siblings in the same .row, so Bootstrap's own
   default align-items:stretch already makes the preview column exactly
   as tall as the fields column next to it -- but a plain height:100% on
   .ap-pdf-wrap ignores the "Document preview" header sitting above it in
   the same column, overflowing past the column's real bottom edge by the
   header's own height (found live 2026-09-18). Fixed by making the
   column itself a flex column (.ap-preview-col/.dp-preview-col, set in
   the template) and letting .ap-pdf-wrap grow to fill only the space
   actually left after the header, via flex:1 instead of height:100%. */
.ap-preview-col, .dp-preview-col {
  display: flex;
  flex-direction: column;
}
.ap-pdf-wrap, .dp-pdf-wrap {
  flex: 1 1 auto;
  min-height: 0;
}
/* Documentless Payment's disabled Document number input (2026-09-22,
   explicit request) -- plain Bootstrap .form-control:disabled only dims
   the background, no opacity change, while the disabled Document type
   <select> right next to it goes through Tom Select, which applies its
   own .disabled .ts-control { opacity: .5 } -- the two ended up two
   visibly different shades of "locked" side by side. Matches Tom
   Select's own value so both read as the same "locked" state. */
.dp-docnum:disabled {
  opacity: .5;
}
/* Same fix, other flow (2026-09-22, follow-up -- the first pass only
   touched the standalone Documentless page; this is the INLINE "Add
   documentless payment" card on /payments/add itself, a different
   template with its own Document number field). Scoped by attribute
   selector, not a class, since this exact input (data-f="invoice_ref_no")
   is only ever disabled in the documentless-mode clone -- the regular
   queue card's own copy of this field is never disabled, so this rule
   can't accidentally dim it. */
input[data-f="invoice_ref_no"]:disabled {
  opacity: .5;
}
.bdp-toolbar {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .5rem;
  background: var(--bsc-card);
  border-bottom: 1px solid var(--bsc-border);
  flex-shrink: 0;
}
.bdp-toolbar button {
  border: 1px solid var(--bsc-border);
  background: var(--bsc-card);
  border-radius: .35rem;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  color: var(--bsc-muted);
  cursor: pointer;
  padding: 0;
}
.bdp-toolbar button:hover:not(:disabled) { background: #f3f4f6; color: var(--bsc-accent-dark); }
.bdp-toolbar button:disabled { opacity: .4; cursor: default; }
.bdp-zoom-pct { font-size: .76rem; font-weight: 600; color: var(--bsc-muted); min-width: 38px; text-align: center; }
.bdp-scroll {
  flex: 1;
  overflow: auto;
  background: #6b7280;
  padding: .6rem;
  /* Belt-and-braces alongside the explicit wheel handler in doc-preview.js
     -- never let scrolling this box leak into scrolling its container
     (the modal / the page) once it's maxed out. */
  overscroll-behavior: contain;
}
/* No auto-centering on purpose -- pages sit flush at the scroll
   container's top-left, so scrollTop/scrollLeft = 0 (set on every
   render/zoom in doc-preview.js) really does show the document's own
   top-left corner, at any zoom level, not just whenever it happens to
   fit inside the visible box. */
.bdp-page {
  position: relative;
  margin: 0 0 10px 0;
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
  background: #fff;
}
.bdp-page canvas { display: block; }
.bdp-text-layer {
  position: absolute;
  top: 0; left: 0;
  overflow: hidden;
  line-height: 1;
  opacity: 1;
}
.bdp-text-layer span, .bdp-text-layer br {
  color: transparent;
  position: absolute;
  white-space: pre;
  cursor: text;
  transform-origin: 0% 0%;
}
.bdp-text-layer ::selection { background: rgba(37, 99, 235, .35); }
.bdp-image { display: block; transform-origin: top left; }

/* Nesting the field grid inside col-lg-8 (see above) narrowed every
   col-md-2 field -- the Vendor/Project fields' "select + Add-new button"
   combo (.d-flex.gap-1) then hit a classic flexbox gotcha: a <select> (or
   a Tom-Select-wrapped .ts-wrapper) defaults to refusing to shrink below
   its own intrinsic content width inside a flex container, so the Add
   button got pushed out and visually spilled into the Document preview
   column next to it. Standard fix -- min-width: 0 lets the control
   actually shrink to fit its column, flex: 1 lets it claim the leftover
   space instead of the fixed-size button. */
.ap-doc-card .d-flex.gap-1 > select,
.ap-doc-card .d-flex.gap-1 > .ts-wrapper,
.dp-row .d-flex.gap-1 > select,
.dp-row .d-flex.gap-1 > .ts-wrapper {
  min-width: 0;
  flex: 1 1 auto;
}

/* AI read (2026-09-15, manual trigger, explicit request): icon-only header
   buttons -- .bsc-dash-hdr-btn already covers the "pill badge with just an
   icon" look (Assign To reuses the same class, just without a text label
   now), this just fixes the icon's own vertical centering inside the pill
   since there's no text baseline to align against anymore. */
.bsc-dash-hdr-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9em;
  height: 1.9em;
  padding: 0;
}

/* Dims the card body and shows a spinner while its document is being read
   -- covers the whole card-body (not just the field grid) since Notes/
   Approval preview below are equally stale until the read finishes.
   Card-body needs position:relative for this to anchor to it, not the
   page. */
.ap-doc-card .card-body,
.dp-row .card-body {
  position: relative;
}
.bsc-ai-read-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, .82);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--bsc-text);
  z-index: 20;
}
.bdp-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--bsc-muted);
  font-size: .85rem;
  gap: .5rem;
  text-align: center;
  padding: 1rem;
}

/* =======================================================================
   FORM DESIGN SYSTEM — one label style + one dropdown style, app-wide
   (2026-09-11, explicit request: "przeskanuj całą apkę i doprowadź do
   tego, że WSZYSTKIE labele w formularzach oraz WSZYSTKIE dropdowny w
   formularzach będą stylistycznie i designersko takie same").
   Reference = the Asset Tracker detail-page spec grid (.bsc-spec-label)
   and its Edit-modal dropdowns.
   ======================================================================= */

/* ── 1. Every field label: .72rem, regular weight, muted, UPPERCASE,
      .03em tracking. !important because assorted labels across the app
      carry fw-semibold / small / fw-medium utilities that would otherwise
      win the cascade. .form-check-label (the inline text beside a
      checkbox/radio) is deliberately excluded — it isn't a field label. */
.form-label,
.form-label-sm,
.bsc-inv-detail-label,
.bsc-payments-field-grid label:not(.form-check-label),
.modal-body label:not(.form-check-label),
.bsc-proto-doc-card label:not(.form-check-label) {
  font-size: .72rem !important;
  font-weight: 400 !important;
  color: var(--bsc-muted) !important;
  text-transform: uppercase !important;
  letter-spacing: .03em !important;
  margin-bottom: .3rem;
}
.bsc-spec-label { font-weight: 400; letter-spacing: .03em; }

/* ── 2. Payments form controls render like the default (= Asset Tracker):
      the native dropdown chevron (Bootstrap's .form-select background,
      right-padded by Tom Select's own --ts-pr-caret:2.25rem) must be
      visible on every single-select, and clicking behaves identically. */
.bsc-payments-field-grid .ts-wrapper.single .ts-control {
  padding-right: 2.1rem !important;
}
.bsc-payments-field-grid .ts-wrapper.form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right .7rem center;
  background-size: 14px 11px;
}

/* ── 3. Persistent validity "glow" on every Payments control ───────────
      red  = required & empty      (.is-invalid)
      green = filled               (.is-valid)
      nothing = optional & empty   (no class)
      validate()/validateRow() (payments_add.html / payments_documentless.html)
      toggle is-invalid/is-valid on the control itself AND on
      el.tomselect.wrapper for the Tom-Select-wrapped ones. This makes the
      box-shadow constant instead of focus-only, and its 4-class selectors
      beat the vendored blue focus ring. Applies to <select>/<input>/
      <textarea>/date pickers alike. */
.bsc-payments-field-grid .form-control.is-invalid,
.bsc-payments-field-grid .form-select.is-invalid,
.bsc-payments-field-grid select.is-invalid + .ts-wrapper .ts-control,
.bsc-payments-field-grid .ts-wrapper.is-invalid .ts-control {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 .2rem rgba(220, 53, 69, .3) !important;
}
.bsc-payments-field-grid .form-control.is-valid,
.bsc-payments-field-grid .form-select.is-valid,
.bsc-payments-field-grid select.is-valid + .ts-wrapper .ts-control,
.bsc-payments-field-grid .ts-wrapper.is-valid .ts-control {
  border-color: #198754 !important;
  box-shadow: 0 0 0 .2rem rgba(25, 135, 84, .3) !important;
}
/* keep the same red/green glow (not the neutral blue one) while the
   control is actually focused/open, too */
.bsc-payments-field-grid .ts-wrapper.is-invalid.focus .ts-control {
  box-shadow: 0 0 0 .25rem rgba(220, 53, 69, .35) !important;
}
.bsc-payments-field-grid .ts-wrapper.is-valid.focus .ts-control {
  box-shadow: 0 0 0 .25rem rgba(25, 135, 84, .35) !important;
}


/* ═══════════════════════════════════════════════════════════════════════
   Payments library — Filter Presets redesign (2026-09-11)
   Natural-language "sentences" (Payment due date / Processing status) +
   a "Create your own" [Field] [Operator] [Value] rule builder, replacing
   the previous technical filter-form layout. See invoices.html for the
   markup/logic this styles.
   ═══════════════════════════════════════════════════════════════════════ */

.bsc-fp-cards {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

/* ── Sentence cards (Preset 1 / Preset 2) ─────────────────────────────── */
.bsc-fp-card {
  display: flex;
  align-items: center;
  gap: .65rem;
  background: #fafbfc;
  border: 1px solid var(--bsc-border);
  border-radius: .6rem;
  padding: .65rem .85rem;
}
.bsc-fp-card-icon {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 214, 0, .18);
  color: var(--bsc-accent-dark);
  font-size: .85rem;
}
.bsc-fp-sentence {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem .45rem;
  font-size: .875rem;
}
.bsc-fp-text {
  color: #374151;
  white-space: nowrap;
}

/* Chip-style <select> — a plain native select, styled as a compact rounded
   pill so it reads as part of the sentence instead of a form field. Native
   <select> chosen deliberately over a custom dropdown widget here: full
   keyboard/touch support for free, and these lists are short (≤7 options). */
.bsc-fp-chip {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--bsc-accent-dark);
  background: #fff8db url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23c9a000' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E") no-repeat right .55rem center/12px 9px;
  color: #7a5d00;
  font-weight: 600;
  font-size: .82rem;
  border-radius: 999px;
  padding: .3rem 1.6rem .3rem .75rem;
  max-width: 220px;
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.bsc-fp-chip:hover   { background-color: #fff2b8; }
.bsc-fp-chip:focus   { outline: none; box-shadow: 0 0 0 .2rem rgba(255, 214, 0, .3); }
.bsc-fp-chip-wide    { max-width: 280px; }

/* The two Company/Vendor chips are SearchSelects (.bsc-ss, see fp_chip_ss()
   macro) — override their normal full-width block layout to match the
   .bsc-fp-chip pill above instead. */
.bsc-fp-chip-ss {
  display: inline-flex;
  width: auto;
  max-width: 180px;
}
.bsc-fp-chip-ss .bsc-ss-wrap {
  border: 1px solid var(--bsc-border);
  border-radius: 999px;
  background: #fff;
  padding: 0 .25rem 0 .1rem;
}
.bsc-fp-chip-ss .bsc-ss-search {
  border: none !important;
  background: transparent !important;
  border-radius: 999px !important;
  font-size: .82rem;
  font-weight: 600;
  color: #1f2937;
  padding: .28rem .3rem .28rem .6rem !important;
  box-shadow: none !important;
  min-width: 90px;
}
.bsc-fp-chip-ss:focus-within .bsc-ss-wrap {
  border-color: var(--bsc-accent-dark);
  box-shadow: 0 0 0 .2rem rgba(255, 214, 0, .3);
}
.bsc-fp-chip-ss .bsc-ss-clear { right: .5rem; }

/* Round "run this sentence" icon button at the end of each sentence */
.bsc-fp-go-btn {
  flex-shrink: 0;
  margin-left: auto;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--bsc-accent);
  color: #1a1300;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem;
  cursor: pointer;
  transition: background-color .15s, transform .1s;
}
.bsc-fp-go-btn:hover  { background: var(--bsc-accent-dark); color: #fff; }
.bsc-fp-go-btn:active { transform: scale(.94); }

/* ── "Create your own" card ───────────────────────────────────────────── */
.bsc-fp-custom-card {
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
}
.bsc-fp-custom-toggle {
  display: flex;
  align-items: center;
  width: 100%;
  border: none;
  background: transparent;
  padding: .65rem .85rem;
  font-size: .875rem;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  transition: background-color .15s;
}
.bsc-fp-custom-toggle:hover { background: #f3f4f6; }
.bsc-fp-custom-toggle.active { color: #1f2937; }
.bsc-fp-custom-chevron { transition: transform .2s; font-size: .8rem; color: var(--bsc-muted); }
.bsc-fp-custom-toggle.active .bsc-fp-custom-chevron { transform: rotate(180deg); }
.bsc-fp-custom-body {
  padding: 0 .85rem .85rem;
  border-top: 1px solid var(--bsc-border);
  padding-top: .75rem;
}

/* One rule row: [AND/OR] [Field] [Operator] [Value] [remove] */
#fp-rules { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .6rem; }
.bsc-fp-rule {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem;
  background: #fff;
  border: 1px solid var(--bsc-border);
  border-radius: .5rem;
  padding: .4rem .5rem;
}
.bsc-fp-logic-spacer { flex: 0 0 52px; }
.bsc-fp-logic-chip {
  flex: 0 0 52px;
  text-align: center;
  border: 1px solid var(--bsc-border);
  background: #f3f4f6;
  color: #4b5563;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .03em;
  border-radius: 999px;
  padding: .25rem 0;
  cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}
.bsc-fp-logic-chip:hover { border-color: #9ca3af; }
.bsc-fp-logic-chip.bsc-fp-logic-and { background: #e0e7ff; color: #3730a3; border-color: #c7d2fe; }
.bsc-fp-logic-chip.bsc-fp-logic-or  { background: #ffedd5; color: #9a3412; border-color: #fed7aa; }
.bsc-fp-rule-field, .bsc-fp-rule-op {
  flex: 1 1 150px;
  min-width: 120px;
  font-size: .82rem;
}
.bsc-fp-rule-value {
  flex: 1 1 170px;
  min-width: 140px;
}
.bsc-fp-rule-value select, .bsc-fp-rule-value input {
  width: 100%;
  font-size: .82rem;
}
.bsc-fp-rule-novalue { white-space: nowrap; padding: 0 .25rem; }
.bsc-fp-rule-remove {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #9ca3af;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem;
  cursor: pointer;
  transition: background-color .15s, color .15s;
}
.bsc-fp-rule-remove:hover { background: #fee2e2; color: #b91c1c; }

.bsc-fp-add-rule {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border: 1px dashed #b7bdc6;
  background: transparent;
  color: #4b5563;
  font-size: .8rem;
  font-weight: 600;
  border-radius: .5rem;
  padding: .35rem .7rem;
  cursor: pointer;
  transition: border-color .15s, color .15s, background-color .15s;
}
.bsc-fp-add-rule:hover { border-color: var(--bsc-accent-dark); color: #7a5d00; background: #fffbe6; }

.bsc-fp-custom-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .75rem;
  padding-top: .65rem;
  border-top: 1px dashed var(--bsc-border);
}
.bsc-fp-custom-footer #fp-custom-name { flex: 1 1 220px; min-width: 160px; }

@media (max-width: 767.98px) {
  .bsc-fp-card { flex-wrap: wrap; }
  .bsc-fp-go-btn { margin-left: 0; }
  .bsc-fp-sentence { gap: .5rem; }
}
