/* Indo Voice Staff Console theme on top of Bootstrap 5.3 (public/vendor/bootstrap.min.css) */

:root,
[data-bs-theme="light"] {
  --idv-gold: #d99a1e;
  --idv-gold-hover: #c4891a;
  --idv-gold-soft: rgba(217, 154, 30, 0.12);
  --idv-brand-soft: rgba(217, 154, 30, 0.12); /* [NEW] Real gold for gold badges / tones, whatever the menu colour */
  --idv-accent-rgb: 217, 154, 30;
  --idv-on-accent: #1a1205;
  --idv-accent-text: #b07a12;
  --idv-sidebar-bg: #0f1420;
  --idv-sidebar-border: rgba(255, 255, 255, 0.06);
  --idv-sidebar-text: #a3acbd;
  --idv-sidebar-active: rgba(217, 154, 30, 0.14);
  --idv-surface: #ffffff;
  --idv-page-bg: #f4f6fa;
  --idv-border: #e5e8ef;
  --idv-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  --bs-body-bg: var(--idv-page-bg);
  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-body-font-size: 0.9rem;
  --bs-border-color: var(--idv-border);
  --bs-primary: #d99a1e;
  --bs-primary-rgb: 217, 154, 30;
  --bs-link-color: #b07a12;
  --bs-link-color-rgb: 176, 122, 18;
  --bs-link-hover-color: #8c600c;
  --bs-link-hover-color-rgb: 140, 96, 12;
  --bs-card-bg: var(--idv-surface);
}

[data-bs-theme="dark"] {
  --idv-gold-soft: rgba(244, 186, 67, 0.14);
  --idv-brand-soft: rgba(244, 186, 67, 0.14);
  --idv-accent-text: #f4ba43;
  --idv-sidebar-bg: #0a0d14;
  --idv-sidebar-border: rgba(255, 255, 255, 0.05);
  --idv-surface: #151a24;
  --idv-page-bg: #0d1118;
  --idv-border: #232a37;
  --idv-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --bs-body-bg: var(--idv-page-bg);
  --bs-border-color: var(--idv-border);
  --bs-link-color: #f4ba43;
  --bs-link-color-rgb: 244, 186, 67;
  --bs-link-hover-color: #f8cd74;
  --bs-link-hover-color-rgb: 248, 205, 116;
  --bs-card-bg: var(--idv-surface);
  --bs-tertiary-bg: #1b2230;
}

body {
  -webkit-font-smoothing: antialiased;
}

/* ----- Buttons: brand gold as primary ----- */
.btn {
  --bs-btn-font-size: 0.875rem;
  --bs-btn-padding-y: 0.45rem;
  --bs-btn-padding-x: 0.9rem;
  --bs-btn-border-radius: 9px;
}

.btn-sm {
  --bs-btn-font-size: 0.8rem;
  --bs-btn-padding-y: 0.3rem;
  --bs-btn-padding-x: 0.65rem;
  --bs-btn-border-radius: 8px;
}

.form-control,
.form-select {
  font-size: 0.875rem;
  border-radius: 9px;
}

.form-check-input {
  border-color: #b4bcc9;
}

[data-bs-theme="dark"] .form-check-input {
  border-color: #4a5466;
}

/* [CHANGED] Every button is a filled pastel pill (no more outline-only buttons): the solid variants use the stronger
   pastel, the outline-* variants the softer one, so a default choice still stands out next to its alternatives.
   Primary follows the section accent (mixed with white), the others have fixed pastel tones. Both tones are
   full-colour fills with dark text in both themes, the soft one only slightly lighter (light) or deeper (dark). */
/* [CHANGED] Brighter candy pastels: full colour, not washed out. Soft tones are the same hue mixed less with the page */
:root,
[data-bs-theme="light"] {
  --idv-btn-primary: color-mix(in srgb, var(--idv-gold) 82%, #fff);
  --idv-btn-primary-text: color-mix(in srgb, var(--idv-gold) 25%, #0d0d0d);
  --idv-btn-primary-soft: color-mix(in srgb, var(--idv-gold) 52%, #fff);
  --idv-btn-primary-soft-text: color-mix(in srgb, var(--idv-gold) 45%, #111);
  --idv-btn-warning: #ffc94d;
  --idv-btn-warning-text: #3a2700;
  --idv-btn-danger: #ff8a8a;
  --idv-btn-danger-text: #3d0b0b;
  --idv-btn-success: #6edc9a;
  --idv-btn-success-text: #08321a;
  --idv-btn-info: #6cb8ff;
  --idv-btn-info-text: #062947;
  --idv-btn-neutral: #cbd2de;
  --idv-btn-neutral-text: #1a202c;
  --idv-btn-neutral-soft: #e3e7ee;
  --idv-btn-neutral-soft-text: #1f2633;
  --idv-btn-warning-soft: color-mix(in srgb, var(--idv-btn-warning) 62%, #fff);
  --idv-btn-warning-soft-text: #5c3f00;
  --idv-btn-danger-soft: color-mix(in srgb, var(--idv-btn-danger) 62%, #fff);
  --idv-btn-danger-soft-text: #7a1717;
  --idv-btn-success-soft: color-mix(in srgb, var(--idv-btn-success) 62%, #fff);
  --idv-btn-success-soft-text: #0f5a30;
  --idv-btn-info-soft: color-mix(in srgb, var(--idv-btn-info) 62%, #fff);
  --idv-btn-info-soft-text: #0f4475;
}

[data-bs-theme="dark"] {
  --idv-btn-primary: color-mix(in srgb, var(--idv-gold) 85%, #fff);
  --idv-btn-primary-text: color-mix(in srgb, var(--idv-gold) 25%, #0b0b0b);
  --idv-btn-primary-soft: color-mix(in srgb, var(--idv-btn-primary) 84%, var(--idv-surface));
  --idv-btn-primary-soft-text: color-mix(in srgb, var(--idv-gold) 25%, #0b0b0b);
  --idv-btn-neutral: #3e4a60;
  --idv-btn-neutral-text: #eef1f6;
  --idv-btn-neutral-soft: #29324a;
  --idv-btn-neutral-soft-text: #dde3ed;
  --idv-btn-warning-soft: color-mix(in srgb, var(--idv-btn-warning) 84%, var(--idv-surface));
  --idv-btn-warning-soft-text: #3a2700;
  --idv-btn-danger-soft: color-mix(in srgb, var(--idv-btn-danger) 84%, var(--idv-surface));
  --idv-btn-danger-soft-text: #3d0b0b;
  --idv-btn-success-soft: color-mix(in srgb, var(--idv-btn-success) 84%, var(--idv-surface));
  --idv-btn-success-soft-text: #08321a;
  --idv-btn-info-soft: color-mix(in srgb, var(--idv-btn-info) 84%, var(--idv-surface));
  --idv-btn-info-soft-text: #062947;
}

.btn-primary, .btn-warning, .btn-danger, .btn-success, .btn-info, .btn-secondary, .btn-light, .btn-dark,
.btn-outline-primary, .btn-outline-warning, .btn-outline-danger, .btn-outline-success, .btn-outline-info,
.btn-outline-secondary, .btn-outline-light, .btn-outline-dark {
  --bs-btn-bg: var(--idv-fill);
  --bs-btn-border-color: var(--idv-fill);
  --bs-btn-color: var(--idv-fill-text);
  --bs-btn-hover-bg: var(--idv-fill-hover);
  --bs-btn-hover-border-color: var(--idv-fill-hover);
  --bs-btn-hover-color: var(--idv-fill-hover-text);
  --bs-btn-active-bg: var(--idv-fill-active);
  --bs-btn-active-border-color: var(--idv-fill-active);
  --bs-btn-active-color: var(--idv-fill-hover-text);
  --bs-btn-disabled-bg: var(--idv-fill);
  --bs-btn-disabled-border-color: var(--idv-fill);
  --bs-btn-disabled-color: var(--idv-fill-text);
  --bs-btn-focus-shadow-rgb: var(--idv-accent-rgb);
  --idv-fill-active: color-mix(in srgb, var(--idv-fill-hover) 88%, #000);
  font-weight: 600;
}

/* Strong tone: hover darkens it a little */
.btn-primary { --idv-fill: var(--idv-btn-primary); --idv-fill-text: var(--idv-btn-primary-text); --idv-fill-hover: color-mix(in srgb, var(--idv-btn-primary) 90%, #000); --idv-fill-hover-text: var(--idv-btn-primary-text); }
.btn-warning { --idv-fill: var(--idv-btn-warning); --idv-fill-text: var(--idv-btn-warning-text); --idv-fill-hover: color-mix(in srgb, var(--idv-btn-warning) 90%, #000); --idv-fill-hover-text: var(--idv-btn-warning-text); }
.btn-danger { --idv-fill: var(--idv-btn-danger); --idv-fill-text: var(--idv-btn-danger-text); --idv-fill-hover: color-mix(in srgb, var(--idv-btn-danger) 90%, #000); --idv-fill-hover-text: var(--idv-btn-danger-text); }
.btn-success { --idv-fill: var(--idv-btn-success); --idv-fill-text: var(--idv-btn-success-text); --idv-fill-hover: color-mix(in srgb, var(--idv-btn-success) 90%, #000); --idv-fill-hover-text: var(--idv-btn-success-text); }
.btn-info { --idv-fill: var(--idv-btn-info); --idv-fill-text: var(--idv-btn-info-text); --idv-fill-hover: color-mix(in srgb, var(--idv-btn-info) 90%, #000); --idv-fill-hover-text: var(--idv-btn-info-text); }
.btn-secondary, .btn-dark { --idv-fill: var(--idv-btn-neutral); --idv-fill-text: var(--idv-btn-neutral-text); --idv-fill-hover: color-mix(in srgb, var(--idv-btn-neutral) 90%, #000); --idv-fill-hover-text: var(--idv-btn-neutral-text); }
.btn-light { --idv-fill: var(--idv-btn-neutral-soft); --idv-fill-text: var(--idv-btn-neutral-soft-text); --idv-fill-hover: var(--idv-btn-neutral); --idv-fill-hover-text: var(--idv-btn-neutral-text); }

/* Soft tone: hover moves up to the strong tone of the same colour */
.btn-outline-primary { --idv-fill: var(--idv-btn-primary-soft); --idv-fill-text: var(--idv-btn-primary-soft-text); --idv-fill-hover: var(--idv-btn-primary); --idv-fill-hover-text: var(--idv-btn-primary-text); }
.btn-outline-warning { --idv-fill: var(--idv-btn-warning-soft); --idv-fill-text: var(--idv-btn-warning-soft-text); --idv-fill-hover: var(--idv-btn-warning); --idv-fill-hover-text: var(--idv-btn-warning-text); }
.btn-outline-danger { --idv-fill: var(--idv-btn-danger-soft); --idv-fill-text: var(--idv-btn-danger-soft-text); --idv-fill-hover: var(--idv-btn-danger); --idv-fill-hover-text: var(--idv-btn-danger-text); }
.btn-outline-success { --idv-fill: var(--idv-btn-success-soft); --idv-fill-text: var(--idv-btn-success-soft-text); --idv-fill-hover: var(--idv-btn-success); --idv-fill-hover-text: var(--idv-btn-success-text); }
.btn-outline-info { --idv-fill: var(--idv-btn-info-soft); --idv-fill-text: var(--idv-btn-info-soft-text); --idv-fill-hover: var(--idv-btn-info); --idv-fill-hover-text: var(--idv-btn-info-text); }
.btn-outline-secondary, .btn-outline-dark, .btn-outline-light { --idv-fill: var(--idv-btn-neutral-soft); --idv-fill-text: var(--idv-btn-neutral-soft-text); --idv-fill-hover: var(--idv-btn-neutral); --idv-fill-hover-text: var(--idv-btn-neutral-text); }

/* Toggle groups (btn-check): unchecked is the soft fill, checked the strong fill with a ring, so the choice is clear */
.btn-check:checked + .btn,
.btn-check:active + .btn {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--idv-fill-hover) 70%, #000);
}

.btn-check:checked + .btn-outline-secondary {
  --bs-btn-active-bg: var(--idv-btn-primary);
  --bs-btn-active-border-color: var(--idv-btn-primary);
  --bs-btn-active-color: var(--idv-btn-primary-text);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--idv-btn-primary) 70%, #000);
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: var(--idv-gold);
  box-shadow: 0 0 0 0.2rem rgba(var(--idv-accent-rgb), 0.2);
}

.form-check-input:checked {
  background-color: var(--idv-gold);
  border-color: var(--idv-gold);
}

.form-control,
.form-select,
.input-group-text {
  background-color: var(--idv-surface);
}

.dropdown-item.active,
.dropdown-item:active {
  background-color: var(--idv-gold-soft);
  color: var(--bs-body-color);
  font-weight: 600;
}

/* ----- Cards ----- */
.card {
  border-color: var(--idv-border);
  border-radius: 14px;
  box-shadow: var(--idv-shadow);
}

.card > .card-header:first-child {
  border-radius: 14px 14px 0 0;
}

.idv-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  background: transparent;
  border-bottom: 1px solid var(--idv-border);
  padding: 1rem 1.25rem;
}

.idv-card-title {
  font-size: 0.98rem;
  font-weight: 650;
  margin: 0;
  letter-spacing: -0.01em;
}

.idv-card-desc {
  font-size: 0.8rem;
  color: var(--bs-secondary-color);
  margin-top: 0.15rem;
}

.idv-subcard {
  border: 1px solid var(--idv-border);
  border-radius: 10px;
  padding: 0.9rem;
  background: var(--bs-tertiary-bg);
}

/* ----- Shell: sidebar + main ----- */
.idv-shell {
  display: flex;
  min-height: 100vh;
}

.idv-sidebar {
  --bs-offcanvas-width: 264px;
  --bs-offcanvas-bg: var(--idv-sidebar-bg);
  width: 264px;
  flex: 0 0 264px;
  background: var(--idv-sidebar-bg) !important; /* .offcanvas-lg forces transparent on desktop */
  color: var(--idv-sidebar-text);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--idv-sidebar-border);
}

@media (min-width: 992px) {
  .idv-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
  }
}

.idv-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--idv-sidebar-border);
}

.idv-brand .idv-logo {
  filter: invert(1);
}

.idv-brand-name {
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.1;
}

.idv-brand-sub {
  color: var(--idv-gold);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.idv-nav {
  padding: 0.75rem;
  flex: 1;
  overflow-y: auto;
}

.idv-nav-section {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #5d6676;
  padding: 1rem 0.75rem 0.4rem;
}

.idv-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 9px;
  color: var(--idv-sidebar-text);
  text-decoration: none;
  font-weight: 500;
  margin-bottom: 2px;
  transition: background 0.15s, color 0.15s;
}

.idv-nav-link i {
  font-size: 1.05rem;
  width: 1.25rem;
  text-align: center;
}

.idv-nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.idv-nav-link.active {
  background: var(--idv-sidebar-active);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--idv-gold);
}

.idv-nav-link.active i {
  color: var(--idv-gold);
}

.idv-sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--idv-sidebar-border);
}

.idv-avatar-fallback {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #262d3b;
  color: #fff;
  font-weight: 700;
  flex: 0 0 36px;
}

.idv-sidebar-user img {
  background: #262d3b;
  flex: 0 0 36px;
}

.idv-user-name {
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
}

.idv-user-meta {
  font-size: 0.75rem;
  color: var(--idv-sidebar-text);
}

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

.idv-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.idv-topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 60px;
  padding: 0 1.5rem;
  background: color-mix(in srgb, var(--idv-page-bg) 85%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--idv-border);
}

.idv-content {
  flex: 1;
  padding: 1.75rem 1.5rem 2.5rem;
  max-width: 1480px;
  width: 100%;
}

.idv-page-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.idv-page-title {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.idv-page-subtitle {
  margin: 0.3rem 0 0;
  color: var(--bs-secondary-color);
}

.idv-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--idv-border);
  font-size: 0.78rem;
  color: var(--bs-secondary-color);
}

.idv-footer a {
  color: var(--bs-secondary-color);
  text-decoration: none;
}

.idv-footer a:hover {
  color: var(--bs-link-color);
}

/* ----- Logo ----- */
.idv-logo {
  object-fit: contain;
}

[data-bs-theme="dark"] .idv-public .idv-logo {
  filter: invert(1);
}

.idv-logo-fallback {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--idv-gold);
  color: #1a1205;
  font-weight: 800;
  font-size: 0.7rem;
}

.idv-logo-fallback[data-size="64"] {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  font-size: 1rem;
}

/* ----- Stat tiles ----- */
.idv-stat .card-body {
  padding: 1.1rem 1.2rem;
}

.idv-stat-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  font-size: 1.15rem;
  flex: 0 0 42px;
}

.idv-icon-sm {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
  font-size: 1rem;
}

.idv-tone-blue { background: rgba(42, 120, 214, 0.12); color: #2a78d6; }
.idv-tone-gold { background: var(--idv-brand-soft); color: #c4891a; }
.idv-tone-green { background: rgba(27, 175, 122, 0.12); color: #13915f; }
.idv-tone-violet { background: rgba(98, 80, 214, 0.12); color: #6250d6; }
.idv-tone-orange { background: rgba(235, 104, 52, 0.12); color: #d4561f; }
.idv-tone-red { background: rgba(227, 73, 72, 0.12); color: #d33b3a; }
.idv-tone-neutral { background: var(--bs-tertiary-bg); color: var(--bs-secondary-color); }

[data-bs-theme="dark"] .idv-tone-blue { color: #6aa6ef; }
[data-bs-theme="dark"] .idv-tone-gold { color: #f4ba43; }
[data-bs-theme="dark"] .idv-tone-green { color: #3fcf97; }
[data-bs-theme="dark"] .idv-tone-violet { color: #9f95ef; }
[data-bs-theme="dark"] .idv-tone-orange { color: #f08a5d; }
[data-bs-theme="dark"] .idv-tone-red { color: #ef7b7a; }

.idv-stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--bs-secondary-color);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.idv-stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.idv-stat-note {
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
}

/* ----- Badges ----- */
.idv-badge {
  font-weight: 600;
  font-size: 0.74rem;
  padding: 0.35em 0.65em;
  border-radius: 999px;
  border: 1px solid transparent;
}

.idv-badge-success { background: rgba(25, 135, 84, 0.1); color: #157347; border-color: rgba(25, 135, 84, 0.22); }
.idv-badge-danger { background: rgba(220, 53, 69, 0.1); color: #b02a37; border-color: rgba(220, 53, 69, 0.22); }
.idv-badge-warning { background: rgba(255, 193, 7, 0.14); color: #8a6100; border-color: rgba(255, 193, 7, 0.35); }
.idv-badge-neutral { background: var(--bs-tertiary-bg); color: var(--bs-secondary-color); border-color: var(--idv-border); }
.idv-badge-gold { background: var(--idv-brand-soft); color: #9a6a0f; border-color: rgba(217, 154, 30, 0.3); }

[data-bs-theme="dark"] .idv-badge-success { color: #57d39a; }
[data-bs-theme="dark"] .idv-badge-danger { color: #f1868f; }
[data-bs-theme="dark"] .idv-badge-warning { color: #ffd45c; }
[data-bs-theme="dark"] .idv-badge-gold { color: #f4ba43; }

/* ----- Tables ----- */
.idv-table {
  --bs-table-bg: transparent;
  margin: 0;
}

.idv-table thead th {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bs-secondary-color);
  background: var(--bs-tertiary-bg);
  border-bottom: 1px solid var(--idv-border);
  padding: 0.7rem 1rem;
  white-space: nowrap;
}

.idv-table td {
  padding: 0.8rem 1rem;
  border-color: var(--idv-border);
}

.idv-table tbody tr:last-child td {
  border-bottom: 0;
}

.idv-num {
  font-variant-numeric: tabular-nums;
}

.idv-row-click {
  cursor: pointer;
}

.idv-row-chevron {
  transition: transform 0.15s;
  display: inline-block;
}

.idv-row-click.open .idv-row-chevron {
  transform: rotate(90deg);
}

.idv-row-detail td {
  background: var(--bs-tertiary-bg);
}

.idv-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--idv-border);
  background: var(--idv-surface);
  color: var(--bs-body-color);
  font-size: 0.78rem;
  text-decoration: none;
}

.idv-chip:hover {
  border-color: var(--idv-gold);
  color: var(--bs-body-color);
}

.idv-max-w {
  max-width: 420px;
}

.idv-job-list {
  max-height: 140px;
  overflow: auto;
  border: 1px solid var(--idv-border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  background: var(--bs-tertiary-bg);
}

/* ----- Live indicator ----- */
.idv-live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--bs-secondary-color);
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--idv-border);
  border-radius: 999px;
  background: var(--idv-surface);
}

.idv-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1baf7a;
  box-shadow: 0 0 0 0 rgba(27, 175, 122, 0.6);
  animation: idv-pulse 2s infinite;
}

@keyframes idv-pulse {
  0% { box-shadow: 0 0 0 0 rgba(27, 175, 122, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(27, 175, 122, 0); }
  100% { box-shadow: 0 0 0 0 rgba(27, 175, 122, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .idv-live-dot {
    animation: none;
  }
}

/* ----- Charts ----- */
.idv-chart {
  position: relative;
  height: 280px;
}

.idv-chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--bs-secondary-color);
  font-size: 0.85rem;
}

.idv-chart-table {
  max-height: 280px;
  margin-top: 1rem;
}

/* ----- Logs ----- */
.idv-log {
  background: var(--idv-surface);
  border: 1px solid var(--idv-border);
  border-left: 4px solid var(--idv-border);
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
  box-shadow: var(--idv-shadow);
}

.idv-log-body {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--bs-secondary-color);
}

/* ----- Public pages (login, errors, legal) ----- */
.idv-public {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(217, 154, 30, 0.12), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(42, 120, 214, 0.08), transparent 60%),
    var(--idv-page-bg);
}

.idv-public-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
}

.idv-public-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--bs-body-color);
  font-weight: 700;
  text-decoration: none;
}

.idv-public-brand:hover {
  color: var(--bs-body-color);
}

.idv-public-main {
  flex: 1;
  padding: 1.5rem;
}

.idv-login {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 200px);
}

.idv-login-card {
  width: 100%;
  max-width: 420px;
  border-radius: 18px;
}

.idv-error {
  max-width: 520px;
  margin: 10vh auto 0;
}

.idv-error-code {
  font-size: 4.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--idv-gold);
  line-height: 1;
  margin-bottom: 1rem;
}

.idv-legal {
  max-width: 820px;
}

.idv-legal h2 {
  font-size: 1.02rem;
  font-weight: 650;
  margin: 1.75rem 0 0.5rem;
}

.idv-legal p,
.idv-legal li {
  line-height: 1.7;
  color: var(--bs-secondary-color);
}

.idv-legal strong {
  color: var(--bs-body-color);
}

@media (max-width: 991.98px) {
  .idv-topbar,
  .idv-content,
  .idv-footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* ===== Data pages (Report List, Player, Staff Data) ===== */
.idv-bar { height: 8px; border-radius: 4px; background: var(--bs-tertiary-bg); overflow: hidden; min-width: 80px; }
.idv-bar-fill { display: block; height: 100%; width: 0; border-radius: 4px; }
.idv-bar-gold { background: #d99a1e; }
.idv-bar-blue { background: #2a78d6; }
.idv-bar-red { background: #d33b3a; }
.idv-bar-cell { width: 30%; }
.idv-online-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #1baf7a; box-shadow: 0 0 0 3px rgba(27, 175, 122, 0.18); flex-shrink: 0; }
.idv-sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.idv-sortable::after { content: '\2195'; opacity: 0.25; margin-left: 4px; font-size: 0.75em; }
.idv-sortable[data-dir="asc"]::after { content: '\2191'; opacity: 0.8; }
.idv-sortable[data-dir="desc"]::after { content: '\2193'; opacity: 0.8; }
.idv-chip-hit { outline: 2px solid #d99a1e; }
.idv-scroll { max-height: 320px; overflow-y: auto; }
.idv-date { width: 150px; }
.idv-avatar-lg { width: 64px; height: 64px; font-size: 1.6rem; }
.idv-feed-item { padding-bottom: 0.5rem; border-bottom: 1px solid var(--idv-border); }
.idv-feed-item:last-child { border-bottom: 0; padding-bottom: 0; }

.idv-sd-nav { position: sticky; top: 1rem; }
.idv-sd-group { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--bs-secondary-color); padding: 0.5rem 0.75rem 0.25rem; }
.idv-sd-menu .list-group-item { border: 0; border-radius: 6px; padding: 0.4rem 0.75rem; font-size: 0.875rem; background: transparent; }
.idv-sd-menu .list-group-item.active { background: var(--idv-gold-soft); color: inherit; font-weight: 600; }

.idv-mini { display: flex; gap: 0.75rem; align-items: center; padding: 0.75rem; border: 1px solid var(--idv-border); border-radius: 10px; height: 100%; }
.idv-mini-icon { width: 36px; height: 36px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem; flex-shrink: 0; }
.idv-mini-value { font-size: 1.25rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.idv-mini-label { font-size: 0.75rem; color: var(--bs-secondary-color); }

.idv-heatmap { border-collapse: separate; border-spacing: 3px; }
.idv-heatmap td.idv-heat { width: 26px; height: 22px; border-radius: 4px; }
.idv-heat-none { background: var(--bs-tertiary-bg); }
.idv-heat-0 { background: var(--bs-tertiary-bg); }
.idv-heat-1 { background: #fbe9c4; }
.idv-heat-2 { background: #f5d08a; }
.idv-heat-3 { background: #e9b04c; }
.idv-heat-4 { background: #d99a1e; }
.idv-heat-5 { background: #a86f0b; }
[data-bs-theme="dark"] .idv-heat-1 { background: #4a3a1a; }
[data-bs-theme="dark"] .idv-heat-2 { background: #6e5420; }
[data-bs-theme="dark"] .idv-heat-3 { background: #9a7223; }
[data-bs-theme="dark"] .idv-heat-4 { background: #c78d21; }
[data-bs-theme="dark"] .idv-heat-5 { background: #f4ba43; }

/* Sidebar: Data sub-menu (Staff Data pages) */
.idv-nav-toggle { width: 100%; background: transparent; border: 0; text-align: left; }
.idv-nav-toggle .idv-nav-chevron { font-size: 0.8rem; width: auto; transition: transform 0.2s ease; }
.idv-nav-toggle.collapsed .idv-nav-chevron { transform: rotate(-90deg); }
.idv-nav-toggle.active:not(.collapsed) { box-shadow: none; background: rgba(255, 255, 255, 0.04); }
.idv-subnav { margin: 0.25rem 0 0.5rem 1.6rem; padding-left: 0.6rem; border-left: 1px solid var(--idv-sidebar-border); }
.idv-subnav-link { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.5rem; border-radius: 7px; font-size: 0.84rem; color: var(--idv-sidebar-text); text-decoration: none; }
.idv-subnav-link:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.idv-subnav-link.active { background: var(--idv-sidebar-active); color: #fff; box-shadow: inset 3px 0 0 var(--idv-gold); font-weight: 600; }
.idv-subnav-link i { font-size: 0.9rem; opacity: 0.85; }

/* Live Config editor */
.idv-lc-card:hover { border-color: var(--idv-gold); }
.idv-lc-entry { border: 1px solid var(--idv-border); border-radius: 9px; padding: 0.5rem 0.75rem; background: var(--bs-body-bg); }
.idv-lc-entry > summary { cursor: pointer; list-style: none; }
.idv-lc-entry > summary::-webkit-details-marker { display: none; }
.idv-lc-entry[open] > summary { border-bottom: 1px solid var(--idv-border); padding-bottom: 0.5rem; }
.idv-lc-nested { border: 1px solid var(--idv-border); border-radius: 9px; padding: 0.75rem; }
.idv-lc-hints { background: var(--idv-gold-soft); border-radius: 8px; padding: 0.6rem 0.8rem; display: grid; gap: 0.25rem; }
.idv-lc-table td { min-width: 120px; }
.idv-switch-group td { background: var(--bs-tertiary-bg) !important; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--bs-secondary-color); padding-top: 0.5rem; padding-bottom: 0.5rem; }

/* ----- Data page charts (datacharts.js) ----- */
.idv-chart-sm {
  height: 220px;
}

.idv-chart-md {
  height: 280px;
}

/* ----- DataTables inside cards (tables.js, Bootstrap 5 renderer: toolbar rows are .row) ----- */
.card .dt-container > .row {
  margin: 0;
  padding: 0.75rem 1rem;
  row-gap: 0.5rem;
}

.card .dt-container > .row:first-child:not(.dt-layout-table) {
  border-bottom: 1px solid var(--idv-border);
}

.card .dt-container > .row:last-child:not(.dt-layout-table) {
  border-top: 1px solid var(--idv-border);
}

.card .dt-container > .row.dt-layout-table {
  padding: 0;
  margin: 0;
}

.card .dt-container > .row.dt-layout-table > div {
  display: block !important;
  padding: 0;
  overflow-x: auto;
}

.dt-container .dt-layout-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.dt-container .dt-layout-start,
.dt-container .dt-layout-end {
  padding: 0;
}

.dt-container .dt-search input {
  min-width: 220px;
  margin-left: 0 !important;
}

.dt-container .dt-search label:empty {
  display: none;
}

.dt-container .dt-length select {
  width: auto;
  display: inline-block;
  margin-right: 0.4rem;
}

.dt-container .dt-info {
  color: var(--bs-secondary-color);
  font-size: 0.85rem;
  padding: 0 !important;
}

.dt-container .pagination {
  margin: 0;
  --bs-pagination-active-bg: var(--idv-gold);
  --bs-pagination-active-border-color: var(--idv-gold);
  --bs-pagination-active-color: var(--idv-on-accent, #111214); /* [FIXING] Readable current page on the light / neutral accent */
  --bs-pagination-color: var(--bs-body-color);
  --bs-pagination-hover-color: var(--bs-body-color);
  --bs-pagination-focus-color: var(--bs-body-color);
  --bs-pagination-focus-box-shadow: 0 0 0 0.2rem var(--idv-gold-soft);
  --bs-pagination-padding-x: 0.65rem;
  --bs-pagination-padding-y: 0.3rem;
  --bs-pagination-font-size: 0.85rem;
}

.dt-container .dt-buttons .btn {
  --bs-btn-bg: transparent;
  --bs-btn-color: var(--bs-body-color);
  --bs-btn-border-color: var(--bs-border-color);
  --bs-btn-hover-bg: var(--bs-tertiary-bg);
  --bs-btn-hover-color: var(--bs-body-color);
  --bs-btn-hover-border-color: var(--bs-border-color);
  --bs-btn-active-bg: var(--bs-tertiary-bg);
  --bs-btn-active-color: var(--bs-body-color);
}

table.dataTable.idv-table > thead > tr > th {
  white-space: nowrap;
}

/* Alignment comes from the server markup (.text-end / .idv-num), not DataTables' type detection */
table.dataTable th.dt-type-numeric:not(.text-end),
table.dataTable th.dt-type-date:not(.text-end),
table.dataTable td.dt-type-numeric:not(.idv-num):not(.text-end),
table.dataTable td.dt-type-date:not(.idv-num):not(.text-end) {
  text-align: left;
}

table.dataTable th.dt-type-numeric:not(.text-end) div.dt-column-header,
table.dataTable th.dt-type-date:not(.text-end) div.dt-column-header {
  flex-direction: row;
}

@media (max-width: 575.98px) {
  .dt-container .dt-search input {
    min-width: 0;
    width: 100%;
  }
}

/* Sort arrows sit right next to the column title */
table.dataTable thead div.dt-column-header {
  justify-content: flex-start;
  gap: 0.35rem;
}

table.dataTable thead th.text-end div.dt-column-header {
  flex-direction: row;
  justify-content: flex-end;
}

/* Data page tabs */
.idv-tabs {
  gap: 0.4rem;
  flex-wrap: wrap;
  --bs-nav-pills-link-active-bg: var(--idv-gold);
  --bs-nav-pills-link-active-color: #1b1406;
  --bs-nav-link-color: var(--bs-body-color);
  --bs-nav-link-hover-color: var(--bs-body-color);
  --bs-nav-link-padding-y: 0.4rem;
  --bs-nav-link-padding-x: 0.9rem;
  --bs-nav-link-font-size: 0.875rem;
}

.idv-tabs .nav-link {
  border: 1px solid var(--idv-border);
  background: var(--idv-surface);
  font-weight: 500;
}

.idv-tabs .nav-link.active {
  border-color: var(--idv-gold);
  font-weight: 600;
}

.idv-tabs .idv-tab-locked {
  opacity: 0.6;
}

/* ----- Loading placeholders (async.js) ----- */
.idv-skel {
  display: block;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--idv-skel-a) 25%, var(--idv-skel-b) 50%, var(--idv-skel-a) 75%);
  background-size: 200% 100%;
  animation: idv-shimmer 1.3s ease-in-out infinite;
}

.idv-skel-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  flex-shrink: 0;
}

.idv-skel-line {
  height: 0.7rem;
  margin: 0.35rem 0;
}

.idv-skel-title {
  width: 40%;
  height: 0.9rem;
}

.idv-skel-value {
  width: 40%;
  height: 1.6rem;
  margin: 0.45rem 0;
}

.idv-skel-chart {
  border-radius: 8px;
  background: var(--idv-skel-a);
  display: grid;
  place-items: center;
}

.idv-skel-table {
  position: relative;
}

.idv-skel-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--idv-border);
}

.idv-loader {
  color: var(--idv-gold);
}

.idv-loader-inline {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@keyframes idv-shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .idv-skel {
    animation: none;
  }
}

:root {
  --idv-skel-a: #e9ecf2;
  --idv-skel-b: #f5f6f9;
}

[data-bs-theme="dark"] {
  --idv-skel-a: #1f2229;
  --idv-skel-b: #2b2f38;
}

.idv-chart-canvas {
  position: absolute;
  inset: 0;
}

/* ----- Toggles (kill switches, game link, buffs, filters) ----- */
.form-switch .form-check-input.idv-switch {
  width: 2.6em;
  height: 1.4em;
  margin-top: 0.1em;
  cursor: pointer;
}

.form-switch .form-check-input.idv-switch:checked {
  background-color: var(--idv-gold);
  border-color: var(--idv-gold);
}

.form-switch .form-check-input.idv-switch:focus {
  box-shadow: 0 0 0 0.2rem var(--idv-gold-soft);
}

.idv-switch-heading {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bs-secondary-color);
  margin: 0.25rem 0 0.6rem;
}

.idv-switch-card {
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.idv-switch-card .card-body {
  padding: 0.85rem 1rem;
}

.idv-switch-card label {
  cursor: pointer;
}

.idv-switch-card.idv-switch-off {
  border-color: rgba(208, 59, 59, 0.45);
}

.idv-switch-card.idv-switch-mixed {
  border-color: rgba(250, 178, 25, 0.55);
}

.idv-toggle-busy {
  opacity: 0.6;
  pointer-events: none;
}

.idv-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.idv-switch-state {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.idv-switch-state i {
  font-size: 0.6rem;
}

.idv-state-on {
  color: #0a8a0a;
}

.idv-state-off {
  color: #d03b3b;
}

.idv-state-mixed {
  color: #b37a00;
}

.idv-state-unknown {
  color: var(--bs-secondary-color);
}

[data-bs-theme="dark"] .idv-state-on {
  color: #2fc42f;
}

[data-bs-theme="dark"] .idv-state-mixed {
  color: #fab219;
}

[data-bs-theme="dark"] .idv-state-off {
  color: #ef6b6b;
}

/* ----- Phones ----- */
@media (max-width: 575.98px) {
  /* Tabs scroll sideways instead of stacking */
  .idv-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin-left: -1rem;
    margin-right: -1rem;
    padding: 0 1rem 0.25rem;
  }

  .idv-tabs::-webkit-scrollbar {
    display: none;
  }

  .idv-tabs .nav-link {
    white-space: nowrap;
  }

  /* Compact stat tiles: smaller icon, label on one or two lines */
  .idv-stat .card-body {
    padding: 0.75rem;
    gap: 0.6rem !important;
  }

  .idv-stat .idv-stat-icon {
    width: 2rem;
    height: 2rem;
    font-size: 0.95rem;
  }

  .idv-stat .idv-stat-label {
    font-size: 0.66rem;
    letter-spacing: 0.03em;
  }

  .idv-stat .idv-stat-value {
    font-size: 1.35rem;
  }

  .idv-stat .idv-stat-note {
    font-size: 0.72rem;
  }

  .idv-chart-md {
    height: 240px;
  }

  .dt-container .dt-layout-start,
  .dt-container .dt-layout-end {
    width: 100%;
    justify-content: space-between !important;
  }

  .dt-container .pagination {
    flex-wrap: wrap;
  }

  .idv-page-header {
    gap: 0.5rem;
  }
}

/* Comfortable tap targets on touch screens */
@media (pointer: coarse) {
  .idv-subnav-link,
  .idv-nav-link {
    min-height: 40px;
  }

  .form-switch .form-check-input.idv-switch {
    width: 3em;
    height: 1.6em;
  }
}

@media (max-width: 575.98px) {
  .idv-switch-card .card-body {
    padding: 0.65rem 0.7rem;
  }

  .idv-switch-card .fw-semibold {
    font-size: 0.85rem;
  }

  .idv-switch-card .idv-clamp-2 {
    font-size: 0.72rem;
  }
}

.dt-container .page-item.disabled .page-link {
  background: transparent;
  color: var(--bs-secondary-color);
}

/* ----- AI Assist suggestions (Report List) ----- */
.idv-badge-violet { background: rgba(139, 92, 246, 0.13); color: #6d43d9; border-color: rgba(139, 92, 246, 0.35); }
[data-bs-theme="dark"] .idv-badge-violet { color: #b9a0ff; }

.idv-ai {
  min-width: 220px;
  max-width: 320px;
}

.idv-ai-conf {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--bs-secondary-color);
}

.idv-ai-conf-high {
  color: #0a8a0a;
}

.idv-ai-conf-low {
  color: #b37a00;
}

[data-bs-theme="dark"] .idv-ai-conf-high {
  color: #2fc42f;
}

[data-bs-theme="dark"] .idv-ai-conf-low {
  color: #fab219;
}

.idv-ai-flag {
  font-size: 0.68rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--idv-border);
  color: var(--bs-secondary-color);
}

/* ----- Quick review ----- */
.idv-kbd { font-size: 0.7em; padding: 0.05rem 0.3rem; border-radius: 0.25rem; background: var(--bs-tertiary-bg); color: var(--bs-secondary-color); border: 1px solid var(--idv-border); vertical-align: 0.1em; }
.idv-review-text { padding: 0.75rem 0.9rem; border-radius: 0.6rem; background: var(--bs-tertiary-bg); border: 1px solid var(--idv-border); }
.idv-review-detail { white-space: pre-wrap; overflow-wrap: anywhere; }
.idv-review-history li + li { border-top: 1px solid var(--idv-border); }
.idv-review-bar { position: sticky; bottom: 0.75rem; z-index: 5; box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.12); }
.idv-review-done { font-size: 3rem; color: var(--bs-success); }
@media (max-width: 575.98px) {
  .idv-review-bar .btn { flex: 1 1 calc(50% - 0.5rem); }
  .idv-review-bar .ms-auto { margin-left: 0 !important; }
  .idv-kbd { display: none; }
}

/* ----- AI settings & accuracy ----- */
.idv-ai-check { display: flex; gap: 0.5rem; align-items: flex-start; font-size: 0.875rem; }
.idv-ai-check .bi { margin-top: 0.15rem; }
.idv-details > summary { cursor: pointer; color: var(--bs-link-color); }
.idv-details > summary::marker { color: var(--bs-secondary-color); }

/* ----- People: avatar + NameTag / display name + @username ----- */
.idv-person { display: inline-flex; align-items: center; gap: 0.5rem; min-width: 0; max-width: 100%; color: inherit; text-decoration: none; vertical-align: middle; }
a.idv-person:hover .idv-person-main { color: var(--bs-link-hover-color); text-decoration: underline; }
.idv-av { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; overflow: hidden; background: var(--bs-tertiary-bg); border: 1px solid var(--idv-border); color: var(--bs-secondary-color); }
.idv-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.idv-person-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.idv-person-main { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idv-person-sub, .idv-person-handle { font-size: 0.78em; color: var(--bs-secondary-color); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idv-person-xs .idv-av { width: 20px; height: 20px; font-size: 0.7rem; }
.idv-person-md .idv-av { width: 36px; height: 36px; }
.idv-person-lg .idv-av { width: 52px; height: 52px; font-size: 1.3rem; }
.idv-person-lg .idv-person-main { font-size: 1.1rem; }
.idv-person-chip { gap: 0.35rem; padding: 0.15rem 0.55rem 0.15rem 0.2rem; border-radius: 999px; background: var(--bs-tertiary-bg); border: 1px solid var(--idv-border); font-size: 0.82rem; }
.idv-person-chip .idv-person-main { font-weight: 500; max-width: 11rem; }
.idv-person-chip .idv-person-handle { max-width: 8rem; }
.idv-person-chip.idv-chip-hit { border-color: var(--idv-gold, #d99a1e); background: var(--idv-gold-soft); }
@media (max-width: 575.98px) {
  .idv-person-chip .idv-person-handle { display: none; }
  .idv-person-main { max-width: 10rem; }
}

/* ----- Dashboard alerts with advice ----- */
.idv-alert-item { padding: 0.6rem 0.75rem; border-radius: 0.6rem; background: var(--bs-tertiary-bg); border: 1px solid var(--idv-border); }
.idv-alert-danger { border-left: 3px solid var(--bs-danger); }
.idv-alert-warning { border-left: 3px solid var(--bs-warning); }
@media (min-width: 1200px) {
  .idv-security-list { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 2rem; }
}

/* ----- Bigger charts: radar / clock faces, Sankey flows, gauges ----- */
.idv-chart-lg {
  height: 380px;
}

.idv-chart-gauge {
  height: 270px;
}

@media (max-width: 575.98px) {
  .idv-chart-lg {
    height: 320px;
  }
}

/* ----- Logs: Discord markdown rendered ----- */
.idv-log-body { white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; font-size: 0.85rem; }
.idv-log-body strong { color: var(--bs-body-color); font-weight: 600; }
.idv-log-body code { font-size: 0.82em; padding: 0.05rem 0.3rem; border-radius: 0.25rem; background: var(--bs-tertiary-bg); color: var(--bs-body-color); }
.idv-log-code { margin: 0.4rem 0; padding: 0.5rem 0.7rem; border-radius: 0.4rem; background: var(--bs-tertiary-bg); font-size: 0.8rem; white-space: pre-wrap; }
.idv-log-link { text-decoration: none; }
.idv-log-link:hover { text-decoration: underline; }
.idv-log-heading { display: inline-block; font-size: 0.95rem; margin-top: 0.2rem; }
.idv-log-bullet { color: var(--bs-secondary-color); }
.idv-log-quote { display: inline-block; border-left: 3px solid var(--idv-border); padding-left: 0.5rem; }
.idv-details-card > summary { cursor: pointer; list-style: none; }
.idv-details-card > summary::-webkit-details-marker { display: none; }

/* ----- Weekly AI summary above a Data tab ----- */
.idv-summary { border-left: 3px solid #8b5cf6; }
.idv-summary-actions { padding: 0.75rem 0.9rem; border-radius: 0.6rem; background: var(--bs-tertiary-bg); border: 1px solid var(--idv-border); height: 100%; }
.idv-lc-diff { white-space: pre-wrap; overflow-wrap: anywhere; background: rgba(0, 0, 0, 0.05); padding: 0.4rem 0.6rem; border-radius: 0.35rem; }

/* ----- Ticket chat ----- */
.idv-chat { max-height: 520px; overflow-y: auto; }
.idv-chat-msg { padding: 0.55rem 0.75rem; border-radius: 0.6rem; background: var(--bs-tertiary-bg); border: 1px solid var(--idv-border); }
.idv-chat-opener { border-left: 3px solid var(--bs-warning); }

/* [NEW] SweetAlert2 dialogs follow the panel's font and spacing */
.swal2-popup { font-family: inherit; font-size: 0.95rem; }
.swal2-title { font-size: 1.25rem; font-weight: 600; }
.swal2-html-container { font-size: 0.95rem; white-space: pre-line; }
.swal2-input-label { font-size: 0.875rem; }
.swal2-actions .btn { min-width: 6.5rem; }
.idv-chip-link { max-width: 22rem; }
.idv-chip-date { opacity: .75; font-weight: 500; }
.idv-group-done { opacity: 0.7; }
/* [NEW] A row someone just acted on from a modal */
.idv-row-handled { opacity: 0.45; }
.idv-row-handled td:first-child { box-shadow: inset 3px 0 0 var(--bs-success); }


/* ----- [NEW] Each menu has its own colour (buttons, links, active menu item, focus), instead of gold everywhere.
   layout() puts data-section on <body>. The Dashboard keeps the Indo Voice gold; gold badges stay gold. ----- */
body[data-section] {
  --bs-primary: var(--idv-gold);
  --bs-primary-rgb: var(--idv-accent-rgb);
  --bs-link-color: var(--idv-accent-text);
  --bs-link-color-rgb: var(--idv-accent-rgb);
  --bs-link-hover-color: var(--idv-gold-hover);
  --idv-gold-soft: rgba(var(--idv-accent-rgb), 0.12);
  --idv-sidebar-active: rgba(var(--idv-accent-rgb), 0.16);
}
body[data-section="reports"] { --idv-gold: #e5484d; --idv-gold-hover: #c93a3f; --idv-accent-rgb: 229, 72, 77; --idv-on-accent: #fff; --idv-accent-text: #c93a3f; }
body[data-section="players"] { --idv-gold: #3b82f6; --idv-gold-hover: #2f6fd6; --idv-accent-rgb: 59, 130, 246; --idv-on-accent: #fff; --idv-accent-text: #2563eb; }
body[data-section="tickets"] { --idv-gold: #14b8a6; --idv-gold-hover: #0f9c8d; --idv-accent-rgb: 20, 184, 166; --idv-on-accent: #04201c; --idv-accent-text: #0f8f82; }
body[data-section="bugs"] { --idv-gold: #8b5cf6; --idv-gold-hover: #7444e8; --idv-accent-rgb: 139, 92, 246; --idv-on-accent: #fff; --idv-accent-text: #7444e8; }
body[data-section="data"] { --idv-gold: #6366f1; --idv-gold-hover: #4f52dc; --idv-accent-rgb: 99, 102, 241; --idv-on-accent: #fff; --idv-accent-text: #4f52dc; }
body[data-section="commands"] { --idv-gold: #0ea5e9; --idv-gold-hover: #0b8ac4; --idv-accent-rgb: 14, 165, 233; --idv-on-accent: #04161f; --idv-accent-text: #0b7fb5; }
body[data-section="liveconfig"] { --idv-gold: #22c55e; --idv-gold-hover: #1aa64e; --idv-accent-rgb: 34, 197, 94; --idv-on-accent: #04200e; --idv-accent-text: #16924a; }
body[data-section="logs"] { --idv-gold: #64748b; --idv-gold-hover: #536177; --idv-accent-rgb: 100, 116, 139; --idv-on-accent: #fff; --idv-accent-text: #536177; }
body[data-section="notifications"] { --idv-gold: #ec4899; --idv-gold-hover: #d03482; --idv-accent-rgb: 236, 72, 153; --idv-on-accent: #fff; --idv-accent-text: #d03482; }
[data-bs-theme="dark"] body[data-section="reports"] { --idv-accent-text: #ff7a7e; }
[data-bs-theme="dark"] body[data-section="players"] { --idv-accent-text: #7fb0ff; }
[data-bs-theme="dark"] body[data-section="tickets"] { --idv-accent-text: #4fd8c7; }
[data-bs-theme="dark"] body[data-section="bugs"] { --idv-accent-text: #b39bff; }
[data-bs-theme="dark"] body[data-section="data"] { --idv-accent-text: #a2a4ff; }
[data-bs-theme="dark"] body[data-section="commands"] { --idv-accent-text: #5cc8f5; }
[data-bs-theme="dark"] body[data-section="liveconfig"] { --idv-accent-text: #5ee08b; }
[data-bs-theme="dark"] body[data-section="logs"] { --idv-accent-text: #a5b1c4; }
[data-bs-theme="dark"] body[data-section="notifications"] { --idv-accent-text: #ff8ac4; }
.idv-bar-accent { background: var(--idv-gold); }

/* [NEW] Row buttons (warn / ban / claim / reject) stay in view on the right when a wide table scrolls sideways */
table.idv-table td:has(> .idv-row-actions),
table.idv-table:has(td > .idv-row-actions) thead th:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  background-color: var(--bs-card-bg, var(--bs-body-bg));
  box-shadow: -10px 0 12px -12px rgba(0, 0, 0, 0.45);
}
table.idv-table td:has(> .idv-row-actions) .idv-row-actions { flex-wrap: nowrap; }
table.idv-table td:has(> .idv-row-actions.flex-wrap) .idv-row-actions { display: grid !important; grid-template-columns: repeat(2, auto); }

/* [NEW] Count badges follow the menu colour (Tickets cyan, ...) instead of a fixed yellow */
.idv-badge-accent { background: rgba(var(--idv-accent-rgb), 0.14); color: var(--idv-accent-text); border-color: rgba(var(--idv-accent-rgb), 0.35); }
.nav-link.active .idv-badge-accent { background: rgba(0, 0, 0, 0.16); color: var(--idv-on-accent); border-color: transparent; }

/* [NEW] Long AI text: two lines, "Show more" opens all of it */
.idv-more-open .idv-clamp-2 { display: block; -webkit-line-clamp: unset; overflow: visible; }
.idv-more-btn { font-size: 0.78rem; text-decoration: none; color: var(--idv-accent-text); }
.idv-more-btn:hover { text-decoration: underline; }

/* [NEW] Discord embeds in the ticket chat: a colour bar on the left like in Discord (colour set by app.js data-color) */
.idv-embed { border-left: 4px solid var(--bs-border-color); background: var(--bs-tertiary-bg); border-radius: 0.35rem; padding: 0.5rem 0.75rem; font-size: 0.85rem; max-width: 560px; }
.idv-embed-fields { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }
.idv-embed-full { flex: 1 1 100%; }
.idv-embed-inline { flex: 1 1 150px; min-width: 0; }

/* [NEW] Item Performance: money cells never break inside "R$ 33,600", key / value tables fill their column */
.idv-table td.idv-num { white-space: nowrap; }
.idv-kv th, .idv-kv td { padding: 0.45rem 0.25rem; vertical-align: middle; }

/* [NEW] Data tools: amber accent, before -> after preview, result list */
body[data-section="datatools"] { --idv-gold: #f97316; --idv-gold-hover: #ea580c; --idv-accent-rgb: 249, 115, 22; --idv-on-accent: #1f0c02; --idv-accent-text: #c2410c; }
[data-bs-theme="dark"] body[data-section="datatools"] { --idv-accent-text: #fdba74; }
.idv-dt-preview { border: 1px dashed rgba(var(--idv-accent-rgb), 0.5); background: rgba(var(--idv-accent-rgb), 0.06); border-radius: 0.5rem; padding: 0.5rem 0.75rem; }
.idv-dt-log:empty { display: none; }
.idv-dt-log { max-height: 220px; overflow-y: auto; margin-bottom: 1rem; }
.idv-dt-head-tools { max-width: 560px; }
.idv-scroll-lg { max-height: 420px; overflow-y: auto; }

/* ===== [NEW] Live presence (public/presence.js): other staff with the panel open, floating bottom right ===== */
.idv-presence {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 1040;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  pointer-events: none;
}
.idv-presence > * { pointer-events: auto; }
.idv-presence-stack {
  display: flex;
  align-items: center;
  padding: 0.25rem 0.35rem 0.25rem 0.85rem;
  border: 1px solid var(--idv-border);
  border-radius: 999px;
  background: var(--idv-surface);
  box-shadow: 0 6px 20px rgba(15, 20, 30, 0.14);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.idv-presence-stack:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(15, 20, 30, 0.2); }
.idv-presence-stack:focus-visible { outline: 2px solid rgba(var(--idv-accent-rgb), 0.6); outline-offset: 2px; }
.idv-presence-stack.has-here { border-color: rgba(var(--idv-accent-rgb), 0.55); }
.idv-presence-avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #262d3b;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 0 0 2px var(--idv-surface);
}
.idv-presence-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: var(--idv-border); }
.idv-presence-sm { width: 32px; height: 32px; margin-left: -0.5rem; font-size: 0.8rem; }
.idv-presence-md { width: 34px; height: 34px; font-size: 0.85rem; }
.idv-presence-avatar.is-here { box-shadow: 0 0 0 2px var(--idv-surface), 0 0 0 4px rgb(var(--idv-accent-rgb)); }
.idv-presence-sm.is-here { margin-left: -0.35rem; margin-right: 0.15rem; }
.idv-presence-avatar.is-idle img, .idv-presence-avatar.is-idle .idv-presence-initial { opacity: 0.45; filter: grayscale(1); }
.idv-presence-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 2px var(--idv-surface);
}
.idv-presence-avatar.is-idle .idv-presence-dot { background: #f59e0b; }
.idv-presence-more { background: var(--idv-gold-soft, rgba(var(--idv-accent-rgb), 0.12)); color: var(--idv-accent-text); font-size: 0.72rem; }
.idv-presence-avatar.is-new { animation: idv-presence-in 0.35s ease-out; }
@keyframes idv-presence-in { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.idv-presence-card {
  width: min(320px, calc(100vw - 2rem));
  max-height: min(60vh, 440px);
  overflow-y: auto;
  padding: 0.5rem;
  border: 1px solid var(--idv-border);
  border-radius: 14px;
  background: var(--idv-surface);
  box-shadow: 0 12px 32px rgba(15, 20, 30, 0.2);
  animation: idv-presence-in 0.15s ease-out;
}
.idv-presence-head { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.5rem 0.5rem; font-weight: 600; font-size: 0.85rem; }
.idv-presence-live { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2); }
.idv-presence-group { padding: 0.5rem 0.5rem 0.25rem; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--bs-secondary-color); }
.idv-presence-row { display: flex; align-items: center; gap: 0.65rem; padding: 0.45rem 0.5rem; border-radius: 10px; color: inherit; text-decoration: none; }
.idv-presence-row:hover, .idv-presence-row:focus-visible { background: rgba(var(--idv-accent-rgb), 0.1); color: inherit; }
.idv-presence-text { display: flex; flex-direction: column; min-width: 0; }
.idv-presence-name { display: flex; align-items: center; gap: 0.4rem; font-weight: 600; font-size: 0.85rem; }
.idv-presence-role { padding: 0 0.4rem; border-radius: 999px; background: var(--idv-border); font-size: 0.65rem; font-weight: 600; color: var(--bs-secondary-color); }
.idv-presence-where { overflow: hidden; font-size: 0.75rem; color: var(--bs-secondary-color); text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 575.98px) {
  .idv-presence-sm { width: 28px; height: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .idv-presence-avatar.is-new, .idv-presence-card { animation: none; }
  .idv-presence-stack { transition: none; }
}
body.idv-has-presence .idv-footer { padding-bottom: 4.5rem; } /* Room so the floating stack never covers the footer links */

/* ===== [NEW] Collaboration: handling chips, live states, SLA, notes, timeline, team ===== */
body[data-section="team"] { --idv-gold: #65a30d; --idv-gold-hover: #568a0b; --idv-accent-rgb: 101, 163, 13; --idv-on-accent: #fff; --idv-accent-text: #4d7c0f; }
[data-bs-theme="dark"] body[data-section="team"] { --idv-accent-text: #a3e635; }

.idv-presence-xs { width: 20px; height: 20px; font-size: 0.6rem; box-shadow: none; }
.idv-presence-xs .idv-presence-dot { width: 7px; height: 7px; right: -2px; bottom: -2px; }
.idv-live-slot:empty { display: none; }
.idv-live-slot { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.25rem; }
span.idv-live-slot { display: inline-flex; margin-top: 0; }
.idv-live-who {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.1rem 0.5rem 0.1rem 0.15rem;
  border-radius: 999px;
  background: rgba(var(--idv-accent-rgb), 0.12);
  color: var(--idv-accent-text);
  font-size: 0.72rem;
  font-weight: 600;
  animation: idv-presence-in 0.25s ease-out;
}
tr.idv-live-busy > td:first-child { box-shadow: inset 3px 0 0 rgb(var(--idv-accent-rgb)); }

tr[data-sla="warn"] > td:first-child { box-shadow: inset 3px 0 0 #f59e0b; }
tr[data-sla="breach"] > td:first-child { box-shadow: inset 3px 0 0 #e5484d; }
tr[data-sla="breach"] { --bs-table-bg: rgba(229, 72, 77, 0.05); }
.idv-sla-text { font-weight: 600; }
tr[data-sla="warn"] .idv-sla-text { color: #b45309; }
tr[data-sla="breach"] .idv-sla-text { color: #c93a3f; }
[data-bs-theme="dark"] tr[data-sla="warn"] .idv-sla-text { color: #fbbf24; }
[data-bs-theme="dark"] tr[data-sla="breach"] .idv-sla-text { color: #ff7a7e; }

.idv-notes .idv-note { padding: 0.6rem 0.75rem; border: 1px solid var(--idv-border); border-radius: 10px; }
.idv-notes .idv-note.is-pinned { border-color: rgba(var(--idv-accent-rgb), 0.5); background: rgba(var(--idv-accent-rgb), 0.06); }
.idv-note-body { overflow-wrap: anywhere; }
.idv-mention { padding: 0 0.2rem; border-radius: 4px; background: rgba(59, 130, 246, 0.12); color: #2563eb; font-weight: 600; }
[data-bs-theme="dark"] .idv-mention { color: #7fb0ff; }
.idv-mention-menu { position: absolute; top: 100%; left: 0; z-index: 1060; min-width: 12rem; max-height: 14rem; overflow-y: auto; }

.idv-tl { position: relative; }
.idv-tl-day { padding: 0.5rem 0 0.25rem; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--bs-secondary-color); }
.idv-tl-item { position: relative; display: flex; gap: 0.75rem; padding: 0.4rem 0 0.4rem 0; }
.idv-tl-item::before { content: ""; position: absolute; top: 2rem; bottom: -0.4rem; left: 0.85rem; width: 2px; background: var(--idv-border); }
.idv-tl-item:last-child::before { display: none; }
.idv-tl-icon { position: relative; z-index: 1; display: inline-grid; place-items: center; flex: 0 0 1.75rem; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--idv-border); font-size: 0.8rem; }
.idv-tl-danger .idv-tl-icon { background: rgba(229, 72, 77, 0.15); color: #e5484d; }
.idv-tl-warning .idv-tl-icon { background: rgba(245, 158, 11, 0.18); color: #d97706; }
.idv-tl-success .idv-tl-icon { background: rgba(34, 197, 94, 0.15); color: #16a34a; }
.idv-tl-gold .idv-tl-icon { background: rgba(var(--idv-accent-rgb), 0.15); color: var(--idv-accent-text); }
.idv-tl-detail { overflow-wrap: anywhere; }

.idv-heatmap { border-collapse: separate; border-spacing: 2px; width: 100%; min-width: 620px; font-size: 0.68rem; }
.idv-heat-day { width: 2.5rem; padding-right: 0.35rem; text-align: right; font-weight: 600; color: var(--bs-secondary-color); }
.idv-heat-hour { text-align: left; font-weight: 500; color: var(--bs-secondary-color); }
.idv-heat { height: 1.6rem; border-radius: 4px; text-align: center; font-weight: 600; color: #fff; }
.idv-heat-none { background: var(--idv-border); }
.idv-heat-gap { background: #e5484d; }
.idv-heat-low { background: rgba(101, 163, 13, 0.45); }
.idv-heat-mid { background: rgba(101, 163, 13, 0.75); }
.idv-heat-high { background: #4d7c0f; }
.idv-heat.is-now { outline: 2px solid var(--bs-body-color); outline-offset: 1px; }
.idv-heat-key { display: inline-block; width: 0.8rem; height: 0.8rem; margin-right: 0.35rem; border-radius: 3px; vertical-align: -0.1rem; }
.idv-w-day { min-width: 4.5rem; }
.idv-podium-medal { font-size: 1.5rem; line-height: 1; }
.idv-podium-1 { border-color: rgba(234, 179, 8, 0.6); }
.idv-tpl-menu { min-width: 16rem; max-height: 60vh; overflow-y: auto; }

/* ===== [NEW] Global search (public/search.js) ===== */
.idv-search-trigger kbd { padding: 0.05rem 0.35rem; border: 1px solid var(--idv-border); border-radius: 4px; background: transparent; color: var(--bs-secondary-color); font-size: 0.68rem; }
.idv-search { position: fixed; inset: 0; z-index: 1085; display: flex; justify-content: center; align-items: flex-start; padding: 10vh 1rem 1rem; background: rgba(8, 11, 18, 0.45); backdrop-filter: blur(2px); }
.idv-search-box { display: flex; flex-direction: column; width: min(640px, 100%); max-height: 70vh; border: 1px solid var(--idv-border); border-radius: 14px; background: var(--idv-surface); box-shadow: 0 24px 60px rgba(8, 11, 18, 0.35); overflow: hidden; animation: idv-presence-in 0.12s ease-out; }
.idv-search-head { display: flex; align-items: center; gap: 0.75rem; padding: 0.85rem 1rem; border-bottom: 1px solid var(--idv-border); }
.idv-search-head > .bi { color: var(--bs-secondary-color); }
.idv-search-input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--bs-body-color); font-size: 1rem; }
.idv-search-input::-webkit-search-cancel-button { display: none; }
.idv-search-kbd { padding: 0.05rem 0.4rem; border: 1px solid var(--idv-border); border-radius: 4px; background: transparent; color: var(--bs-secondary-color); font-size: 0.68rem; }
.idv-search-list { overflow-y: auto; padding: 0.4rem; }
.idv-search-group { padding: 0.6rem 0.6rem 0.25rem; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--bs-secondary-color); }
.idv-search-item { display: flex; align-items: center; gap: 0.7rem; padding: 0.5rem 0.6rem; border-radius: 9px; color: inherit; text-decoration: none; }
.idv-search-item.active { background: rgba(var(--idv-accent-rgb), 0.12); }
.idv-search-icon { display: inline-grid; place-items: center; flex: 0 0 1.9rem; width: 1.9rem; height: 1.9rem; border-radius: 8px; background: var(--idv-border); font-size: 0.9rem; }
.idv-search-avatar { flex: 0 0 1.9rem; width: 1.9rem; height: 1.9rem; border-radius: 50%; object-fit: cover; background: var(--idv-border); }
.idv-search-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.idv-search-title { overflow: hidden; font-weight: 600; font-size: 0.88rem; text-overflow: ellipsis; white-space: nowrap; }
.idv-search-sub { overflow: hidden; font-size: 0.75rem; color: var(--bs-secondary-color); text-overflow: ellipsis; white-space: nowrap; }
.idv-search-enter { opacity: 0; color: var(--bs-secondary-color); font-size: 0.8rem; }
.idv-search-item.active .idv-search-enter { opacity: 1; }
.idv-search-empty { padding: 1.5rem 1rem; text-align: center; font-size: 0.85rem; color: var(--bs-secondary-color); }
.idv-search-foot { padding: 0.5rem 1rem; border-top: 1px solid var(--idv-border); font-size: 0.72rem; color: var(--bs-secondary-color); }
body.idv-search-open { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .idv-search-box { animation: none; } }

/* ===== [NEW] Access marks (views.js roleMark, data-role on buttons) ===== */
:root { --idv-role-admin: #3b82f6; --idv-role-headAdmin: #8b5cf6; --idv-role-creator: #f59e0b; --idv-role-hm: #ef4444; }
.idv-role { margin-left: 0.35rem; font-size: 0.8em; vertical-align: 0.05em; }
.idv-nav-link .idv-role, .idv-subnav-link .idv-role { margin-left: auto; padding-left: 0.35rem; font-size: 0.75rem; }
.idv-role-admin { color: var(--idv-role-admin); }
.idv-role-headAdmin { color: var(--idv-role-headAdmin); }
.idv-role-creator { color: var(--idv-role-creator); }
.idv-role-hm { color: var(--idv-role-hm); }
[data-role] { position: relative; }
[data-role]::after { content: ""; position: absolute; top: -4px; right: -4px; width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 2px var(--idv-surface); pointer-events: none; }
[data-role="admin"]::after { background: var(--idv-role-admin); }
[data-role="headAdmin"]::after { background: var(--idv-role-headAdmin); }
[data-role="creator"]::after { background: var(--idv-role-creator); }
[data-role="hm"]::after { background: var(--idv-role-hm); }
.idv-role-legend { display: flex; flex-wrap: wrap; gap: 0.35rem 0.75rem; padding: 0.6rem 1.25rem; border-top: 1px solid var(--idv-sidebar-border); font-size: 0.68rem; color: rgba(255, 255, 255, 0.55); }
.idv-role-legend > span { display: inline-flex; align-items: center; gap: 0.25rem; }
.idv-role-legend .idv-role { margin-left: 0; }

/* [NEW] Long choice buttons (review tiers): icon column on the left, title + detail on the right */
.idv-choice-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.idv-choice-icon {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1rem;
  background: color-mix(in srgb, currentColor 14%, transparent);
}

.idv-choice-text {
  flex: 1 1 auto;
  min-width: 0;
}

/* [NEW] Playtime leaf (src/playtimeTier.js): the Roblox achievement icon, or a glyph in the tier colour until it loads */
.idv-leaf {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  object-fit: contain;
}

i.idv-leaf { font-size: 0.95em; }
.idv-leaf-green { color: #5fcf6a; }
.idv-leaf-yellow { color: #f2c94c; }
.idv-leaf-purple { color: #a879ff; }
.idv-leaf-red { color: #ef5b5b; }

/* [NEW] Report List bulk bar: fixed to the bottom of the content while cases are ticked */
.idv-bulkbar {
  position: fixed;
  left: var(--idv-sidebar-width, 264px);
  right: 0;
  bottom: 0;
  z-index: 1030;
  padding: 0 1rem 1rem;
  pointer-events: none;
  animation: idv-bulk-in 0.18s ease-out;
}

.idv-bulkbar[hidden] { display: none; }

.idv-bulkbar-inner {
  pointer-events: auto;
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  gap: 0.6rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: var(--idv-surface);
  border: 1px solid var(--idv-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

.idv-bulkbar-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.idv-bulkbar-names {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.idv-bulk-presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

.idv-bulk-presets .btn { line-height: 1.25; }

body.idv-bulk-open main { padding-bottom: 18rem; }

.idv-pick-col { width: 2.25rem; }
tr.idv-row-picked > td { background: color-mix(in srgb, var(--idv-btn-warning) 14%, transparent); }
[data-bulk-pick] { cursor: pointer; }

@keyframes idv-bulk-in {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@media (max-width: 991.98px) {
  .idv-bulkbar { left: 0; padding: 0 0.5rem 0.5rem; }
  .idv-bulk-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* [NEW] Top 100 badges in the colour of each board's in-game title (ReplicatedStorage.Enum.Title.Color) */
.idv-lb { --idv-lb: #8a93a6; background: color-mix(in srgb, var(--idv-lb) 22%, transparent); color: color-mix(in srgb, var(--idv-lb) 70%, var(--bs-body-color)); border: 1px solid color-mix(in srgb, var(--idv-lb) 45%, transparent); }
.idv-lb-PlayTime { --idv-lb: #4a8cf7; }
.idv-lb-Donation { --idv-lb: #60cc71; }
.idv-lb-Loves { --idv-lb: #cb74ab; }
.idv-lb-Gift { --idv-lb: #d87448; }
.idv-lb-Collector { --idv-lb: #a67cf3; }
.idv-lb-LoyaltyPoint { --idv-lb: #eb5750; }
.idv-lb-Mentor { --idv-lb: #26bac4; }
.idv-lb-Event { --idv-lb: #f4ba43; }

/* [NEW] Folded "Handled" table under Anti-Cheat / Staff Dodge */
.idv-handled > summary { cursor: pointer; color: var(--bs-secondary-color); }
.idv-handled[open] > summary { margin-bottom: 0.25rem; }

/* [FIXING] Switch toggles: more room between the switch and its label text */
.form-switch { padding-left: 3em; min-height: 1.6rem; }
.form-switch .form-check-input { margin-left: -3em; margin-right: 0; }
.form-switch .form-check-label { padding-left: 0.35rem; }

/* [NEW] The recommended choice in Quick Review: a soft glow in its own colour and a light sheen sweeping across */
.btn.idv-recommended {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--idv-fill) 55%, transparent), 0 0 18px 2px color-mix(in srgb, var(--idv-fill) 55%, transparent);
  animation: idv-rec-glow 2.4s ease-in-out infinite;
}

.btn.idv-recommended::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.45) 45%, rgba(255, 255, 255, 0.1) 55%, transparent 70%);
  background-size: 250% 100%;
  animation: idv-rec-sheen 2.8s linear infinite;
  pointer-events: none;
}

.btn.idv-recommended > * { position: relative; }

@keyframes idv-rec-sheen {
  from { background-position: 150% 0; }
  to { background-position: -100% 0; }
}

@keyframes idv-rec-glow {
  0%, 100% { box-shadow: 0 0 0 2px color-mix(in srgb, var(--idv-fill) 45%, transparent), 0 0 10px 0 color-mix(in srgb, var(--idv-fill) 40%, transparent); }
  50% { box-shadow: 0 0 0 2px color-mix(in srgb, var(--idv-fill) 70%, transparent), 0 0 22px 4px color-mix(in srgb, var(--idv-fill) 60%, transparent); }
}

@media (prefers-reduced-motion: reduce) {
  .btn.idv-recommended,
  .btn.idv-recommended::before { animation: none; }
}

/* ===== [CHANGED] Clean gray theme, in the style of the Roblox Creator Hub =====================================
   Grays carry the interface: one neutral accent instead of a colour per menu, gray buttons with light text, and a
   single high-contrast primary button. Colour is kept for meaning only: the red of destructive actions, the small
   tier / status marks, badges and the game's own colours (Gold, titles, leaves). This block comes last on purpose,
   it overrides the per-menu accents and the pastel button system above. */
:root,
[data-bs-theme="light"] {
  --idv-page-bg: #f2f3f5;
  --idv-surface: #ffffff;
  --idv-border: #e1e2e5;
  --idv-sidebar-bg: #121315;
  --idv-sidebar-border: rgba(255, 255, 255, 0.06);
  --idv-sidebar-text: #b4b6ba;
  --idv-gray-1: #f6f7f8;
  --idv-gray-2: #ebecee;
  --idv-gray-3: #dfe0e3;
  --idv-gray-text: #1f2023;
  --idv-primary-bg: #1f2023;
  --idv-primary-bg-hover: #35373b;
  --idv-primary-text: #ffffff;
  --idv-danger-text: #c73636;
  --idv-check: #3d6bff;
}

[data-bs-theme="dark"] {
  --idv-page-bg: #111214;
  --idv-surface: #191a1d;
  --idv-border: #2a2c30;
  --idv-sidebar-bg: #0c0d0f;
  --idv-sidebar-border: rgba(255, 255, 255, 0.06);
  --idv-sidebar-text: #a9abb0;
  --idv-gray-1: #232427;
  --idv-gray-2: #2c2e32;
  --idv-gray-3: #393b40;
  --idv-gray-text: #e8e9eb;
  --idv-primary-bg: #f1f2f3;
  --idv-primary-bg-hover: #ffffff;
  --idv-primary-text: #111214;
  --idv-danger-text: #ff7676;
  --idv-check: #5b84ff;
  --bs-tertiary-bg: #202124;
  --bs-secondary-bg: #202124;
}

/* One neutral accent for every menu (beats body[data-section="..."] and its dark variants) */
html body.idv-app[data-section],
html body.idv-app {
  --idv-gold: #1f2023;
  --idv-gold-hover: #000000;
  --idv-accent-rgb: 31, 32, 35;
  --idv-on-accent: #ffffff;
  --idv-accent-text: #1f2023;
  --bs-primary: #1f2023;
  --bs-primary-rgb: 31, 32, 35;
  --bs-link-color: #1f2023;
  --bs-link-color-rgb: 31, 32, 35;
  --bs-link-hover-color: #000000;
  --idv-gold-soft: rgba(31, 32, 35, 0.06);
  --idv-sidebar-active: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] body.idv-app[data-section],
[data-bs-theme="dark"] body.idv-app {
  --idv-gold: #e8e9eb;
  --idv-gold-hover: #ffffff;
  --idv-accent-rgb: 232, 233, 235;
  --idv-on-accent: #111214;
  --idv-accent-text: #e8e9eb;
  --bs-primary: #e8e9eb;
  --bs-primary-rgb: 232, 233, 235;
  --bs-link-color: #e8e9eb;
  --bs-link-color-rgb: 232, 233, 235;
  --bs-link-hover-color: #ffffff;
  --idv-gold-soft: rgba(255, 255, 255, 0.06);
  --idv-sidebar-active: rgba(255, 255, 255, 0.08);
}

body.idv-app a:not(.btn):not(.nav-link):not(.idv-nav-link):not(.badge):not(.dropdown-item) {
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
}

/* Buttons: gray fills with light text; .btn-primary is the one high-contrast action */
body.idv-app .btn-secondary, body.idv-app .btn-dark, body.idv-app .btn-light,
body.idv-app .btn-success, body.idv-app .btn-info, body.idv-app .btn-warning,
body.idv-app .btn-outline-primary, body.idv-app .btn-outline-secondary, body.idv-app .btn-outline-dark, body.idv-app .btn-outline-light,
body.idv-app .btn-outline-success, body.idv-app .btn-outline-info, body.idv-app .btn-outline-warning {
  --idv-fill: var(--idv-gray-2);
  --idv-fill-text: var(--idv-gray-text);
  --idv-fill-hover: var(--idv-gray-3);
  --idv-fill-hover-text: var(--idv-gray-text);
  --idv-fill-active: var(--idv-gray-3);
}

body.idv-app .btn-outline-primary, body.idv-app .btn-outline-secondary, body.idv-app .btn-outline-dark, body.idv-app .btn-outline-light,
body.idv-app .btn-outline-success, body.idv-app .btn-outline-info, body.idv-app .btn-outline-warning {
  --idv-fill: var(--idv-gray-1);
  --bs-btn-border-color: var(--idv-border);
}

body.idv-app .btn-primary {
  --idv-fill: var(--idv-primary-bg);
  --idv-fill-text: var(--idv-primary-text);
  --idv-fill-hover: var(--idv-primary-bg-hover);
  --idv-fill-hover-text: var(--idv-primary-text);
  --idv-fill-active: var(--idv-primary-bg-hover);
}

/* Destructive: gray until it matters, red text; the solid one (final confirm) is a real red */
body.idv-app .btn-outline-danger {
  --idv-fill: var(--idv-gray-1);
  --idv-fill-text: var(--idv-danger-text);
  --idv-fill-hover: color-mix(in srgb, var(--idv-danger-text) 16%, var(--idv-gray-1));
  --idv-fill-hover-text: var(--idv-danger-text);
  --idv-fill-active: color-mix(in srgb, var(--idv-danger-text) 22%, var(--idv-gray-1));
  --bs-btn-border-color: var(--idv-border);
}

body.idv-app .btn-danger {
  --idv-fill: #d64545;
  --idv-fill-text: #ffffff;
  --idv-fill-hover: #c23a3a;
  --idv-fill-hover-text: #ffffff;
  --idv-fill-active: #b03333;
}

body.idv-app .btn { font-weight: 600; box-shadow: none; }
body.idv-app .btn:focus-visible { box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--idv-gray-text) 25%, transparent); }

/* Chosen option of a toggle group: the high-contrast fill */
body.idv-app .btn-check:checked + .btn,
body.idv-app .btn-check:active + .btn,
body.idv-app .btn-check:checked + .btn-outline-secondary {
  --bs-btn-active-bg: var(--idv-primary-bg);
  --bs-btn-active-border-color: var(--idv-primary-bg);
  --bs-btn-active-color: var(--idv-primary-text);
  box-shadow: none;
}

/* Inputs: neutral focus, one calm blue for ticks and switches (gray-on-gray would not read as on) */
body.idv-app .form-control:focus,
body.idv-app .form-select:focus,
body.idv-app .form-check-input:focus {
  border-color: color-mix(in srgb, var(--idv-gray-text) 45%, transparent);
  box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--idv-gray-text) 14%, transparent);
}

body.idv-app .form-check-input:checked {
  background-color: var(--idv-check);
  border-color: var(--idv-check);
}

/* Menu: white text and a light gray band for the open page, no coloured bar */
body.idv-app .idv-nav-link.active,
body.idv-app .idv-subnav-link.active {
  background: var(--idv-sidebar-active);
  color: #ffffff;
  box-shadow: none;
}

body.idv-app .idv-nav-link.active i { color: #ffffff; }

/* Page tabs: gray pills, the open one in the high-contrast fill */
body.idv-app .idv-tabs {
  --bs-nav-pills-link-active-bg: var(--idv-primary-bg);
  --bs-nav-pills-link-active-color: var(--idv-primary-text);
}

body.idv-app .idv-tabs .nav-link { background: var(--idv-gray-1); border-color: var(--idv-border); }
body.idv-app .idv-tabs .nav-link.active { background: var(--idv-primary-bg); border-color: var(--idv-primary-bg); color: var(--idv-primary-text); }

/* Cards: flat, a thin border, no glow */
body.idv-app .card { border-color: var(--idv-border); box-shadow: none; }

/* Quick Review tiers: the buttons are gray, the tier shows in the round icon only */
body.idv-app .idv-choice-success .idv-choice-icon { color: #3fbf7f; }
body.idv-app .idv-choice-warning .idv-choice-icon { color: #e0a93a; }
body.idv-app .idv-choice-danger .idv-choice-icon { color: var(--idv-danger-text); }
body.idv-app .btn-primary.idv-choice-success .idv-choice-icon { color: #5fe0a0; }
body.idv-app .btn-primary.idv-choice-warning .idv-choice-icon { color: #f5c25a; }
body.idv-app .btn-primary.idv-choice-danger .idv-choice-icon { color: #ff8a8a; }
[data-bs-theme="dark"] body.idv-app .btn-primary.idv-choice-success .idv-choice-icon { color: #1f9d60; }
[data-bs-theme="dark"] body.idv-app .btn-primary.idv-choice-warning .idv-choice-icon { color: #b07d12; }
[data-bs-theme="dark"] body.idv-app .btn-primary.idv-choice-danger .idv-choice-icon { color: #c73636; }
body.idv-app .btn-primary .idv-choice-icon { background: color-mix(in srgb, currentColor 16%, transparent); }

/* Recommended choice: a quiet white ring instead of a coloured glow; the sheen stays subtle */
body.idv-app .btn.idv-recommended {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--idv-gray-text) 55%, transparent);
  animation: none;
}

body.idv-app .btn.idv-recommended::before {
  background: linear-gradient(110deg, transparent 35%, color-mix(in srgb, var(--idv-gray-text) 14%, transparent) 50%, transparent 65%);
  background-size: 250% 100%;
}

body.idv-app tr.idv-row-picked > td { background: color-mix(in srgb, var(--idv-gray-text) 7%, transparent); }
.idv-budget-bar { height: 4px; } /* [NEW] AI month budget (Control Center) */
/* [CHANGED] Denser menu, like the Creator Hub: more items fit without scrolling now that every Data page has its own */
body.idv-app .idv-nav-link { padding: 0.45rem 0.75rem; font-size: 0.875rem; margin-bottom: 1px; }
body.idv-app .idv-nav-section { padding: 0.85rem 0.75rem 0.3rem; color: #6b6e74; }

/* [CHANGED] Layout tidy-up for the gray theme ------------------------------------------------------------------
   Info notes are neutral (the cyan box was the last bright block on many pages); warnings / errors keep their colour */
body.idv-app .alert-info {
  --bs-alert-bg: var(--idv-gray-1);
  --bs-alert-border-color: var(--idv-border);
  --bs-alert-color: var(--bs-body-color);
  --bs-alert-link-color: var(--bs-body-color);
}

/* Page head: a slightly tighter title */
body.idv-app .idv-page-title { letter-spacing: -0.01em; }

/* Cards: one radius, one header rhythm, quieter section titles inside tables */
body.idv-app .card { border-radius: 12px; }
body.idv-app .card > .card-header { padding-top: 0.9rem; padding-bottom: 0.9rem; }
body.idv-app .table > thead th {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--bs-secondary-color);
  white-space: nowrap;
}

/* Wide tables scroll inside their card and say so with a soft edge, instead of cutting the last columns */
body.idv-app .table-responsive {
  scrollbar-width: thin;
  background:
    linear-gradient(to right, var(--idv-surface) 30%, transparent) left / 24px 100% no-repeat local,
    linear-gradient(to left, var(--idv-surface) 30%, transparent) right / 24px 100% no-repeat local,
    linear-gradient(to right, rgba(0, 0, 0, 0.25), transparent) left / 10px 100% no-repeat scroll,
    linear-gradient(to left, rgba(0, 0, 0, 0.25), transparent) right / 10px 100% no-repeat scroll;
}

/* [NEW] Player facts (src/playerInfo.js): one quiet line of small gray pills under a name */
.idv-facts { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.35rem; }
.idv-fact {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: var(--idv-gray-1, rgba(127, 127, 127, 0.12));
  border: 1px solid var(--idv-border);
  color: var(--bs-secondary-color);
  font-size: 0.72rem;
  line-height: 1.35;
  white-space: nowrap;
}
.idv-fact i { font-size: 0.75rem; }
.idv-fact-title { color: var(--bs-body-color); font-weight: 600; }
.idv-fact-muted { opacity: 0.7; }
.idv-fact-warning { color: #e0a93a; border-color: color-mix(in srgb, #e0a93a 40%, var(--idv-border)); }
.idv-fact-danger { color: var(--idv-danger-text, #ef5b5b); border-color: color-mix(in srgb, var(--idv-danger-text, #ef5b5b) 40%, var(--idv-border)); }
.idv-fact-when { background: transparent; border-color: transparent; padding-left: 0.1rem; }
.idv-fact-online { color: #3fbf7f; font-size: 0.45rem !important; }

/* [NEW] Live Servers: one small card per player instead of a row of chips */
.idv-player-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.5rem; }
.idv-player-card { padding: 0.5rem 0.6rem; border: 1px solid var(--idv-border); border-radius: 10px; background: var(--idv-surface); min-width: 0; }
.idv-player-card.idv-chip-hit { border-color: color-mix(in srgb, var(--bs-body-color) 45%, transparent); }
.idv-player-card .idv-person-chip { max-width: 100%; }
/* [CHANGED] Quick Review: Ban reads like the other choices (normal text); only its icon carries the red */
body.idv-app .idv-choice .btn-outline-danger { --idv-fill-text: var(--idv-gray-text); --idv-fill-hover-text: var(--idv-gray-text); }

/* [NEW] Ticket chat images: thumbnails that open full size */
.idv-chat-thumbs { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.idv-chat-thumb { display: block; width: 140px; height: 105px; border-radius: 8px; overflow: hidden; border: 1px solid var(--idv-border); background: var(--idv-gray-1, transparent); }
.idv-chat-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.15s; }
.idv-chat-thumb:hover img { transform: scale(1.04); }
.idv-dt-tx { max-height: 480px; } /* [NEW] Data Tools transactions */

/* [NEW] Quick Review: NameTag and Display Name side by side */
.idv-names { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin-bottom: 0.25rem; }
.idv-name-item { display: inline-flex; align-items: center; gap: 0.3rem; min-width: 0; }
.idv-name-item .bi { color: var(--bs-secondary-color); }

/* [NEW] Quick Review auto mode (hold Enter, Creator+) */
.idv-auto-pill { position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); z-index: 1080; display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.5rem 0.45rem 0.9rem; border-radius: 999px; background: var(--bs-emphasis-color); color: var(--bs-body-bg); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25); font-size: 0.875rem; max-width: calc(100vw - 32px); }
.idv-auto-pill .btn { border-radius: 999px; padding: 0.15rem 0.75rem; }

/* [NEW] Tickets > Panel names & rules */
.idv-pnl-card > summary { list-style: none; cursor: pointer; }
.idv-pnl-card > summary::-webkit-details-marker { display: none; }
.idv-pnl-sub { margin-top: -0.15rem; }
.idv-pnl-steps { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; list-style: none; padding: 0; margin: 0 0 0.75rem; }
.idv-pnl-step { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.85rem; }
.idv-pnl-num { display: inline-flex; align-items: center; justify-content: center; width: 1.35rem; height: 1.35rem; border-radius: 50%; background: var(--idv-brand-soft); color: var(--idv-gold, #d99a1e); font-weight: 700; font-size: 0.75rem; flex: 0 0 auto; }
.idv-pnl { border: 1px solid var(--idv-border); border-radius: 0.6rem; margin-bottom: 0.5rem; background: var(--idv-surface); }
.idv-pnl[open] { border-color: color-mix(in srgb, var(--idv-gold, #d99a1e) 45%, var(--idv-border)); }
.idv-pnl-head { list-style: none; display: flex; align-items: center; gap: 0.75rem; padding: 0.65rem 0.85rem; cursor: pointer; }
.idv-pnl-head::-webkit-details-marker { display: none; }
.idv-pnl-head:hover { background: var(--bs-tertiary-bg); border-radius: 0.6rem; }
.idv-pnl-caret { transition: transform 0.15s ease; color: var(--bs-secondary-color); }
.idv-pnl[open] .idv-pnl-caret { transform: rotate(90deg); }
.idv-pnl-body { padding: 0.25rem 0.85rem 0.85rem 2.35rem; }
.idv-pnl-filter { max-width: 18rem; }
.idv-pnl-chip { --bs-btn-padding-y: 0.15rem; --bs-btn-padding-x: 0.65rem; --bs-btn-font-size: 0.78rem; }
.idv-pnl-save { position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; gap: 0.75rem; margin: 0.75rem -1rem -1rem; padding: 0.65rem 1rem; background: var(--bs-body-bg); border-top: 1px solid var(--idv-border); border-radius: 0 0 var(--bs-card-border-radius, 0.5rem) var(--bs-card-border-radius, 0.5rem); }
.min-w-0 { min-width: 0; }
@media (max-width: 576px) { .idv-pnl-body { padding-left: 0.85rem; } }

/* [NEW] UX kit (Creator Hub style): empty states, "on this page" chips, section heads, phone-friendly card headers.
   Helpers in src/views.js (emptyState, jumpNav, sectionHead); empty tables in public/tables.js */
.idv-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.35rem; padding: 2.5rem 1.25rem; color: var(--bs-secondary-color); }
.idv-empty-sm { padding: 1.5rem 1rem; }
.idv-empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; background: var(--idv-gray-1, var(--bs-tertiary-bg)); border: 1px solid var(--idv-border); color: var(--bs-secondary-color); font-size: 1.2rem; margin-bottom: 0.25rem; }
.idv-empty-sm .idv-empty-icon { width: 2.25rem; height: 2.25rem; font-size: 1rem; }
.idv-empty-title { font-weight: 600; color: var(--bs-body-color); font-size: 0.92rem; }
.idv-empty-text { font-size: 0.84rem; max-width: 34rem; }
.idv-empty-action { margin-top: 0.5rem; }
.card > .idv-empty-table { border-top: 1px solid var(--idv-border); }
.card-header + .idv-empty-table, .idv-card-header + .idv-empty-table { border-top: 0; }

.idv-jump { position: sticky; top: 60px; z-index: 1010; display: flex; align-items: center; gap: 0.4rem; overflow-x: auto; scrollbar-width: none; margin: -0.5rem 0 1.25rem; padding: 0.5rem 0; background: color-mix(in srgb, var(--idv-page-bg) 90%, transparent); backdrop-filter: blur(8px); }
.idv-jump::-webkit-scrollbar { display: none; }
.idv-jump-label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--bs-secondary-color); white-space: nowrap; margin-right: 0.25rem; }
.idv-jump-link { display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap; padding: 0.3rem 0.75rem; border-radius: 999px; border: 1px solid var(--idv-border); background: var(--idv-surface); color: var(--bs-body-color); font-size: 0.82rem; font-weight: 500; text-decoration: none; }
.idv-jump-link:hover { background: var(--idv-gray-1, var(--bs-tertiary-bg)); color: var(--bs-body-color); }
.idv-jump-link.active { background: var(--idv-primary-bg, #1f2023); border-color: var(--idv-primary-bg, #1f2023); color: var(--idv-primary-text, #fff); }
.idv-jump-badge { font-size: 0.7rem; padding: 0 0.4rem; border-radius: 999px; background: var(--idv-gray-2, var(--bs-secondary-bg)); color: var(--bs-body-color); }
.idv-jump-link.active .idv-jump-badge { background: rgba(127, 127, 127, 0.35); color: inherit; }
[id^="cc-"], [id^="pl-"], .idv-section-head, .card[id] { scroll-margin-top: 120px; }

.idv-section-head { margin: 2rem 0 0.85rem; padding-top: 0.25rem; }
.idv-section-head:first-of-type { margin-top: 0.25rem; }
.idv-jump + .idv-section-head { margin-top: 0; }
.idv-section-title { display: flex; align-items: center; gap: 0.5rem; font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; margin: 0; }
.idv-section-title i { color: var(--bs-secondary-color); font-size: 0.95rem; }
.idv-section-desc { margin: 0.2rem 0 0; font-size: 0.85rem; color: var(--bs-secondary-color); max-width: 60rem; }
.idv-section-danger .idv-section-title i { color: var(--idv-danger-text, #c73636); }
.idv-section-head + .card, .idv-section-head + .card.mt-4 { margin-top: 0 !important; }
.idv-section-head + .row { margin-top: calc(-1 * var(--bs-gutter-y)) !important; }

/* Search above a list of cards (Live Config keys) */
.idv-list-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.idv-list-tools .input-group { max-width: 22rem; }

/* Phones: card header actions drop under the title instead of squeezing it to one word per line */
@media (max-width: 575.98px) {
  .idv-card-header { flex-wrap: wrap; gap: 0.6rem; padding: 0.85rem 1rem; }
  .idv-card-header > :first-child { flex: 1 1 14rem; min-width: 0; }
  .idv-card-header .btn { white-space: nowrap; }
  .idv-tabs { -webkit-mask-image: linear-gradient(to right, #000 88%, transparent); mask-image: linear-gradient(to right, #000 88%, transparent); }
  .idv-jump { margin-left: -1rem; margin-right: -1rem; padding-left: 1rem; padding-right: 1rem; }
  .idv-jump-label { display: none; }
  .idv-section-head { margin-top: 1.5rem; }
}
.idv-anchor { display: block; height: 0; }

/* [NEW] Ticket page: the player's form answers as question / answer pairs, technical fields folded away */
.idv-answer + .idv-answer { margin-top: 0.85rem; padding-top: 0.85rem; border-top: 1px dashed var(--idv-border); }
.idv-answer-q { font-size: 0.78rem; font-weight: 600; color: var(--bs-secondary-color); margin-bottom: 0.2rem; }
.idv-answer-a { font-size: 0.92rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.idv-tech > summary { list-style: none; cursor: pointer; align-items: center; }
.idv-tech > summary::-webkit-details-marker { display: none; }
.idv-tech:not([open]) > summary { border-bottom: 0; }
.idv-tech[open] .idv-pnl-caret { transform: rotate(90deg); }

/* [NEW] Sticky save bar for long editors (Live Config): stays at the bottom of the screen while scrolling */
.idv-savebar { position: sticky; bottom: 0.75rem; z-index: 5; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12) !important; }
[data-bs-theme="dark"] .idv-savebar { box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5) !important; }
/* [NEW] Sidebar menu that scrolls: a soft fade at the bottom says there is more below */
@media (min-width: 992px) { .idv-nav { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); padding-bottom: 1.5rem; } }
/* [NEW] Avatars never shrink into an oval next to long names */
.idv-avatar-fallback, .idv-avatar-lg, .card-body > img.rounded-circle { flex-shrink: 0; }

/* [NEW] Team leaderboard: where the points come from (cases / play time / ratings / panel) */
.idv-lb-bar { display: flex; height: 6px; border-radius: 999px; overflow: hidden; background: var(--bs-tertiary-bg); }
.idv-lb-part { display: block; height: 100%; }
.idv-lb-part-gold { background: #d99a1e; }
.idv-lb-part-blue { background: #3b82f6; }
.idv-lb-part-green { background: #22c55e; }
.idv-lb-part-violet { background: #8b5cf6; }
.idv-lb-legend { display: flex; flex-wrap: wrap; gap: 0.15rem 0.7rem; font-size: 0.72rem; color: var(--bs-secondary-color); }
.idv-lb-key { display: inline-flex; align-items: center; gap: 0.3rem; }
.idv-lb-dot { display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%; }

/* [NEW] Staff Coverage: 24-hour strip */
.idv-cov-strip { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 4px; }
.idv-cov-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 0.45rem 0; border-radius: 6px; border: 1px solid transparent; min-width: 0; }
.idv-cov-staff { font-weight: 700; font-size: 0.85rem; line-height: 1; }
.idv-cov-hour { font-size: 0.65rem; opacity: 0.75; line-height: 1; }
.idv-cov-gap { background: rgba(229, 72, 77, 0.2); border-color: rgba(229, 72, 77, 0.55); color: #ff8a8e; }
.idv-cov-thin { background: rgba(245, 158, 11, 0.18); border-color: rgba(245, 158, 11, 0.5); color: #f6b94a; }
.idv-cov-ok { background: rgba(34, 197, 94, 0.14); border-color: rgba(34, 197, 94, 0.4); color: #4ed27f; }
.idv-cov-quiet { background: var(--bs-tertiary-bg); color: var(--bs-secondary-color); }
[data-bs-theme="light"] .idv-cov-gap { color: #b42328; }
[data-bs-theme="light"] .idv-cov-thin { color: #8a5a00; }
[data-bs-theme="light"] .idv-cov-ok { color: #15803d; }
.idv-cov-legend { display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; font-size: 0.78rem; color: var(--bs-secondary-color); }
.idv-cov-key { display: inline-flex; align-items: center; gap: 0.35rem; }
.idv-cov-dot { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 3px; border: 1px solid transparent; }
.idv-cov-table > summary { list-style: none; cursor: pointer; }
.idv-cov-table > summary::-webkit-details-marker { display: none; }
@media (max-width: 767.98px) {
  .idv-cov-strip { grid-template-columns: repeat(12, minmax(0, 1fr)); }
}
.idv-cov-dot.idv-cov-gap { background: #e5484d; }
.idv-cov-dot.idv-cov-thin { background: #f59e0b; }
.idv-cov-dot.idv-cov-ok { background: #22c55e; }
.idv-cov-dot.idv-cov-quiet { background: var(--bs-secondary-bg); border-color: var(--idv-border); }
.idv-lb-cases { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.25rem; max-width: 16rem; }

/* [NEW] Public recap image preview (Team > Weekly report) */
.idv-recap-preview img { display: block; width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--idv-border); }

/* [NEW] Notification Center (the bell, top right) */
.idv-inbox { position: relative; }
.idv-inbox-bell { position: relative; }
.idv-inbox-bell.idv-inbox-has i { color: var(--bs-body-color); }
.idv-inbox-count { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #e5484d; color: #fff; font-size: 0.68rem; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--bs-body-bg); }
.idv-inbox-panel { position: absolute; right: 0; top: calc(100% + 8px); width: 400px; max-width: calc(100vw - 24px); max-height: min(640px, calc(100vh - 90px)); display: flex; flex-direction: column; background: var(--bs-body-bg); border: 1px solid var(--idv-border); border-radius: 14px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35); z-index: 1060; overflow: hidden; }
.idv-inbox-head { display: flex; align-items: center; gap: 0.25rem; padding: 0.75rem 0.75rem 0.5rem 1rem; }
.idv-inbox-head .btn-link { text-decoration: none; color: var(--bs-secondary-color); }
.idv-inbox-filters { display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0 1rem 0.65rem; border-bottom: 1px solid var(--idv-border); }
.idv-inbox-filters .btn { --bs-btn-padding-y: 0.1rem; --bs-btn-padding-x: 0.6rem; --bs-btn-font-size: 0.76rem; }
.idv-inbox-list { overflow-y: auto; flex: 1 1 auto; }
.idv-inbox-item { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.7rem 1rem; text-decoration: none; color: var(--bs-body-color); border-bottom: 1px solid var(--idv-border); position: relative; }
.idv-inbox-item:hover { background: var(--bs-tertiary-bg); color: var(--bs-body-color); }
.idv-inbox-unread { background: color-mix(in srgb, var(--idv-gold, #d99a1e) 7%, transparent); }
.idv-inbox-icon { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 0.95rem; }
.idv-inbox-text { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; flex: 1 1 auto; }
.idv-inbox-title { font-weight: 600; font-size: 0.86rem; line-height: 1.3; }
.idv-inbox-body { font-size: 0.8rem; color: var(--bs-secondary-color); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.idv-inbox-meta { font-size: 0.72rem; color: var(--bs-secondary-color); }
.idv-inbox-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: #3b82f6; margin-top: 0.35rem; }
.idv-inbox-empty { padding: 2.5rem 1rem; text-align: center; color: var(--bs-secondary-color); font-size: 0.86rem; }
.idv-inbox-empty .bi { font-size: 1.6rem; }
@media (max-width: 575.98px) {
  .idv-inbox-panel { position: fixed; top: 58px; right: 8px; left: 8px; width: auto; max-width: none; }
}

/* [NEW] Name Scanner + name history */
.idv-ns-kind { min-width: 6.5rem; }
.idv-ns-person { width: 16rem; }
.idv-refund-amount { width: 9rem; }
@media (max-width: 575.98px) { .idv-ns-person { width: auto; } }
