/* Employee Survey Analytics — Android Auto inspired palette.
   Bright theme = Android Auto day mode, dark theme = exact app.css values
   from D:\AI-APP\Androidauto versi browser (colors.xml based). */
:root {
  /* bright / day surfaces */
  --bg: #f1f3f4;
  --card: #ffffff;
  --card-press: #f8f9fa;
  --stroke: #dadce0;
  --text: #202124;
  --dim: #5f6368;
  --heading: #1e2a3a;

  /* accents */
  --blue: #1a73e8;
  --cyan: #0097a7;
  --violet: #8430ce;
  --lime: #689f38;
  --gold: #b26a00;
  --green: #188038;
  --orange: #e8710a;
  --red: #d93025;
  --sky: #0277bd;
  --pink: #c2185b;

  --navy: #1e2a3a;
  --sidebar-w: 240px;
  --topbar-h: 52px;
  --cat-engaged: #188038;
  --cat-stable: #1a73e8;
  --cat-atrisk: #e8710a;
  --cat-disengaged: #d93025;
  --cat-unknown: #5f6368;
}

html[data-bs-theme='dark'] {
  /* Android Auto dark palette (public/css/app.css) */
  --bg: #141414;
  --card: #272727;
  --card-press: #333333;
  --stroke: #3a3a3a;
  --text: #ffffff;
  --dim: #9e9e9e;
  --heading: #ffffff;

  --blue: #4285f4;
  --cyan: #2be8ff;
  --violet: #9b6bff;
  --lime: #c6ff3d;
  --gold: #ffd700;
  --green: #9ee6b8;
  --orange: #ffb86b;
  --red: #ea4335;
  --sky: #8cc8eb;
  --pink: #f28b82;

  --cat-engaged: #2e7d4f;
  --cat-stable: #4285f4;
  --cat-atrisk: #b26a00;
  --cat-disengaged: #c5221f;
  --cat-unknown: #9e9e9e;
}

body { background: var(--bg); color: var(--text); font-size: 0.925rem; }

/* Layout */
.app-wrapper { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); min-width: var(--sidebar-w);
  background: var(--navy); color: #cdd5df;
  position: fixed; inset: 0 auto 0 0; z-index: 1040;
  display: flex; flex-direction: column;
  transition: transform .2s ease;
}
.sidebar-brand { display: flex; gap: .6rem; align-items: center; padding: 1rem 1.1rem; border-bottom: 1px solid rgba(255,255,255,.08); color: #fff; }
.sidebar-brand i { font-size: 1.6rem; color: #4dabf7; }
.brand-title { font-weight: 700; font-size: .95rem; }
.brand-sub { font-size: .72rem; color: #8fa3b8; }
.sidebar-nav { padding: .6rem .5rem; overflow-y: auto; flex: 1; }
.sidebar-nav a {
  display: flex; align-items: center; gap: .6rem; color: #c3cdd9;
  padding: .5rem .7rem; border-radius: .4rem; text-decoration: none; font-size: .875rem; margin-bottom: 2px;
}
.sidebar-nav a i { width: 1.1rem; text-align: center; }
.sidebar-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar-nav a.active { background: var(--blue); color: #fff; font-weight: 600; }
.sidebar-nav a.sub { padding-left: 1.4rem; font-size: .84rem; }
.nav-group {
  font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: #7d8fa3;
  padding: .8rem .7rem .25rem; display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; user-select: none; border-radius: 6px;
}
.nav-group:hover { color: #aab8c8; }
.nav-group .chevron { font-size: .6rem; transition: transform .18s ease; }
.nav-group.collapsed .chevron { transform: rotate(-90deg); }
.nav-group-items { overflow: hidden; }
.nav-group-items.collapsed { display: none; }

.app-main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }
.topbar {
  background: var(--card); border-bottom: 1px solid var(--stroke);
  padding: .65rem 1.2rem; display: flex; align-items: center; gap: 1rem;
  position: sticky; top: 0; z-index: 1030;
}
.topbar-company { flex: 1; min-width: 0; display: flex; align-items: center; gap: .5rem; font-weight: 600; color: var(--heading); }
/* Ikon aksi user selalu satu baris — tidak boleh menyusut/wrap oleh flex. */
.topbar-user { flex: 0 0 auto; display: flex; align-items: center; gap: .5rem; white-space: nowrap; }
/* Logo client aktif mengisi slot ikon gedung — bentuk rounded seperti Initial. */
.topbar-company-logo {
  width: 28px; height: 28px; flex: 0 0 auto; object-fit: cover;
  border-radius: .5rem; display: block;
}
.topbar-company .company-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-company .text-truncate { display: inline-block; max-width: 100%; min-width: 0; }
@media (max-width: 575.98px) {
  .topbar { gap: .5rem; padding: .55rem .75rem; }
  .topbar-company { gap: .4rem; }
}
.app-content { padding: 1.2rem; }

/* Desktop collapse via the topbar hamburger (state persisted in
   localStorage and applied pre-paint in header.ejs). Mobile keeps the
   old overlay behaviour — .sidebar.show is untouched. */
.app-main { transition: margin-left .2s ease; }
@media (min-width: 992px) {
  html.sidebar-collapsed .sidebar { transform: translateX(-100%); }
  html.sidebar-collapsed .app-main { margin-left: 0; }
}

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: none; }
  .app-main { margin-left: 0; }
}

/* Cards / KPI */
.kpi-card {
  background: var(--card); border: 1px solid var(--stroke); border-radius: .6rem;
  padding: 1rem 1.1rem; height: 100%;
}
.kpi-card .kpi-label { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--dim); font-weight: 600; }
.kpi-card .kpi-value { font-size: 1.45rem; font-weight: 700; color: var(--heading); line-height: 1.2; }
.kpi-card .kpi-icon { font-size: 1.15rem; width: 2.4rem; height: 2.4rem; display: flex; align-items: center; justify-content: center; border-radius: .55rem; }
.kpi-card .kpi-sub { font-size: .75rem; color: var(--dim); }
.chart-card { background: var(--card); border: 1px solid var(--stroke); border-radius: .6rem; padding: 1rem; height: 100%; }
.chart-card h6 { font-weight: 700; color: var(--heading); margin-bottom: .8rem; }
.chart-box { position: relative; height: 260px; }
.chart-box-sm { position: relative; height: 220px; }
/* EEI vs ESI by Status Pekerja: chart + frame 60% taller (220 -> 352). */
.chart-box-sm.cmp-tall { height: 352px; }
.chart-box-scale { position: relative; height: 320px; }
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .8rem; }
.chart-head h6 { margin: 0; }
.chart-sort { width: auto; max-width: 170px; font-size: .75rem; }
@media (max-width: 575.98px) {
  .chart-head { flex-wrap: wrap; }
  .chart-sort { max-width: 100%; }
}

/* Overall index gauges (Dashboard Section 2) */
.gauge-card { background: var(--card); border: 1px solid var(--stroke); border-radius: .6rem; overflow: hidden; height: 100%; }
.gauge-title {
  background: #1e2a3a; color: #fff; display: flex; align-items: baseline; justify-content: space-between;
  gap: .5rem; flex-wrap: wrap; padding: .55rem .9rem;
}
.gauge-title span:first-child { font-size: .82rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.gauge-title .gauge-title-sub { font-size: .68rem; color: rgba(255, 255, 255, .72); letter-spacing: .02em; }
.gauge-body { padding: .35rem .6rem .55rem; }
.gauge-svg { display: block; width: 100%; height: auto; }

/* Dimensi x Level matrix (Dashboard Section 4) */
table.level-matrix { font-size: .78rem; }
table.level-matrix thead th {
  background: #e8eef7; color: var(--heading); text-align: center; vertical-align: middle;
  white-space: nowrap; font-weight: 600; border-color: var(--stroke);
}
table.level-matrix td { border-color: var(--stroke); }
/* Section 4 matrix: uniform cell height (height acts as min-height, so a
   wrapped dimension label settles at the same row height) and values
   anchored mid-center instead of top. */
table.level-matrix thead th,
table.level-matrix tbody td { height: 3rem; vertical-align: middle; }
table.level-matrix .lm-dim {
  text-align: left; white-space: nowrap; font-weight: 600;
  background: var(--card-press); color: var(--heading);
}
table.level-matrix tbody .lm-dim { white-space: normal; min-width: 220px; max-width: 300px; }
table.level-matrix .lm-cell { color: #202124; font-weight: 600; }
/* Drill-down affordance: matrix cells and heat map answer cells are clickable. */
table.level-matrix td.lm-cell, table.level-matrix td.lm-empty { cursor: pointer; }
table.level-matrix td.lm-cell:hover, table.level-matrix td.lm-empty:hover { outline: 2px solid var(--blue); outline-offset: -2px; }
.drill-table td { vertical-align: middle; }
.heat-cell, .heat-fav, .heat-nonfav, .heat-blank { cursor: pointer; }
#heatmapTable td.heat-cell:hover, #heatmapTable td.heat-fav:hover,
#heatmapTable td.heat-nonfav:hover, #heatmapTable td.heat-blank:hover { outline: 2px solid var(--blue); outline-offset: -2px; }
table.level-matrix .lm-empty { background: transparent; color: var(--dim); }
html[data-bs-theme='dark'] table.level-matrix thead th { background: rgba(66, 133, 244, .16); color: #fff; }

/* Classification legend (Dashboard Section 3) */
table.classification-legend { font-size: .82rem; }
table.classification-legend thead th {
  background: var(--blue); color: #fff; text-align: center; font-size: .76rem;
  letter-spacing: .02em; border-color: rgba(255, 255, 255, .25);
}
table.classification-legend td { text-align: center; vertical-align: middle; }
table.classification-legend .cl-range { background: #e8eef7; color: var(--heading); font-weight: 600; }
table.classification-legend .cl-level { font-weight: 600; }
html[data-bs-theme='dark'] table.classification-legend .cl-range { background: rgba(66, 133, 244, .16); }
html[data-bs-theme='dark'] table.classification-legend thead th { color: #fff; }

/* Category badges */
.badge.cat-engaged { background: var(--cat-engaged); color: #fff; }
.badge.cat-stable { background: var(--cat-stable); color: #fff; }
.badge.cat-atrisk { background: var(--cat-atrisk); color: #fff; }
.badge.cat-disengaged { background: var(--cat-disengaged); color: #fff; }
.badge.cat-unknown { background: var(--cat-unknown); color: #fff; }

/* Filter panel */
.filter-panel .card-body { padding: .9rem 1rem; }
.filter-head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .8rem; }
.filter-title { display: inline-flex; align-items: center; gap: .45rem; font-weight: 700; color: var(--heading); }
.filter-count { display: inline-flex; align-items: baseline; gap: .35rem; margin-right: auto; color: var(--dim); font-size: .8rem; }
.filter-count .badge { font-size: .78rem; font-variant-numeric: tabular-nums; }
.filter-items {
  display: grid; gap: .75rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.filter-item {
  min-width: 0; padding: .5rem .55rem;
  border: 1px solid var(--stroke); border-radius: .65rem; background: var(--card-press);
}
.filter-item-head { display: flex; align-items: center; justify-content: space-between; gap: .35rem; margin-bottom: .35rem; }
.filter-label {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: .72rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--dim);
}
.filter-clear {
  flex: 0 0 auto; border: 0; background: transparent; padding: 0;
  font-size: .68rem; color: var(--dim); text-decoration: underline;
  visibility: hidden;
}
.filter-item.has-selection .filter-clear { visibility: visible; }
.filter-clear:hover { color: var(--blue); }
/* Checkmark master di atas kartu filter — penanda nilai untuk title kedua
   laporan PDF (Dashboard). Kartu menyala tipis saat checkmark aktif. */
.filter-master {
  display: inline-flex; align-items: center; flex: 0 0 auto;
  margin-right: .15rem; cursor: pointer;
}
.filter-master .form-check-input { width: 1rem; height: 1rem; margin: 0; cursor: pointer; }
.filter-item:has(.filter-master-check:checked) {
  border-color: rgba(26, 115, 232, .55);
  box-shadow: 0 0 0 1px rgba(26, 115, 232, .25);
}
/* Whole-panel hide/unhide: the eye toggle in the panel header collapses the
   entire card into its slim header bar; the state persists per page. */
.filter-toggle {
  border: 0; background: transparent; padding: .15rem .35rem;
  font-size: .88rem; line-height: 1; color: var(--dim);
}
.filter-toggle:hover { color: var(--blue); }
.filter-panel.filter-panel-collapsed .filter-items { display: none; }
.filter-panel.filter-panel-collapsed #fltReset { display: none; }
.filter-panel.filter-panel-collapsed .filter-head { margin-bottom: 0; }

/* Global quick search (Ctrl+K) command palette */
.qs-dialog { max-width: 560px; }
.qs-list { max-height: 320px; overflow-y: auto; }
.qs-item {
  display: flex; align-items: center; gap: .6rem;
  padding: .45rem .65rem; border-radius: .5rem; cursor: pointer;
  font-size: .86rem; color: var(--text);
}
.qs-item i { width: 1.1rem; text-align: center; color: var(--dim); }
.qs-item.active, .qs-item:hover { background: rgba(26, 115, 232, .1); }
.qs-item.active i, .qs-item:hover i { color: var(--blue); }
.qs-hint { font-size: .7rem; color: var(--dim); }
.qs-empty { padding: .6rem; font-size: .85rem; color: var(--dim); text-align: center; }
html[data-bs-theme='dark'] .qs-item.active, html[data-bs-theme='dark'] .qs-item:hover { background: rgba(66, 133, 244, .16); }
/* Every option list has the same height so the grid stays aligned. */
.filter-options {
  height: 150px; overflow-y: auto; display: flex; flex-direction: column;
  gap: .05rem; padding-right: .2rem;
}
.filter-check {
  display: flex; align-items: center; gap: .45rem; margin: 0;
  padding: .18rem .25rem; border-radius: .4rem;
  font-size: .8rem; color: var(--text); cursor: pointer;
}
.filter-check:hover { background: rgba(26, 115, 232, .07); }
.filter-check .form-check-input { flex: 0 0 auto; margin: 0; cursor: pointer; }
.filter-check-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html[data-bs-theme='dark'] .filter-check:hover { background: rgba(66, 133, 244, .12); }

@media (max-width: 575.98px) {
  .filter-panel .card-body { padding: .8rem; }
  .filter-items { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .filter-options { height: 132px; }
  .filter-item { padding: .45rem; }
  .filter-head { gap: .5rem; }
  .filter-title { font-size: .9rem; }
  .filter-count { margin-right: 0; gap: .25rem; font-size: .72rem; }
  .filter-count-label { white-space: nowrap; }
  #fltReset { margin-left: auto; font-size: .72rem; padding: .22rem .4rem; }
  .filter-reset-text { display: none; }
}

/* Category multi-select filter used above tables */
.cat-filter .btn { font-size: .75rem; }
.cat-filter-menu { min-width: 220px; padding: .5rem; }
.cat-filter-list {
  max-height: 220px; overflow-y: auto;
  display: flex; flex-direction: column; gap: .05rem;
}
.cat-filter .dropdown-menu .filter-check { font-size: .8rem; }
.cat-filter .dropdown-menu .filter-check-label { white-space: normal; }
.cat-filter-foot {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  margin-top: .4rem; padding-top: .4rem; border-top: 1px solid var(--stroke);
}
.cat-filter-clear { font-size: .75rem; text-decoration: underline; }

/* Search box + category selector on one toolbar row. */
.emp-toolbar {
  display: flex; align-items: center; justify-content: flex-end;
  flex-wrap: wrap; gap: .5rem;
}
.emp-toolbar > label {
  display: flex; align-items: center; gap: .5rem;
  margin: 0; font-weight: 400; white-space: nowrap;
}
.emp-toolbar .cat-filter { margin: 0; }
@media (max-width: 575.98px) {
  .emp-toolbar { justify-content: flex-start; }
  .emp-toolbar > label { flex: 1 1 100%; }
  .emp-toolbar > label input { flex: 1 1 auto; min-width: 0; }
}

/* Sticky table headers.
   1) Tables inside a height-limited wrapper scroll internally: the header
      sticks to the top of that wrapper.
   2) DataTables (scrollX) keep the header in a separate container: make that
      container stick below the fixed topbar while the page scrolls. */
.table-responsive[style*="max-height"] > .table > thead > tr > th,
.table-responsive[style*="max-height"] > .table > thead > tr > td {
  position: sticky; top: 0; z-index: 3;
  background: var(--card);
  box-shadow: inset 0 -1px 0 var(--stroke);
}
.dataTables_scrollHead {
  position: sticky !important;
  top: var(--topbar-h);
  z-index: 20;
  background: var(--card);
}
.dataTables_scrollHead table { margin-bottom: 0; }
.dataTables_scrollHead thead th { background: var(--card); }

/* Login */
.login-page {
  position: relative;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vh, 2.5rem) clamp(1rem, 4vw, 3rem);
  background:
    radial-gradient(circle at 12% 12%, rgba(26, 115, 232, .10), transparent 42%),
    radial-gradient(circle at 88% 88%, rgba(0, 151, 167, .10), transparent 42%),
    var(--bg);
}
.login-theme-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 5;
  --md-icon-button-icon-size: 18px;
  --md-icon-button-state-layer-height: 38px;
  --md-icon-button-state-layer-width: 38px;
  color: var(--dim);
  background: var(--card);
  border-radius: 50%;
}
.login-theme-btn:hover { color: var(--blue); }

.login-shell {
  width: 100%;
  max-width: 1080px;
  height: 100%;
  max-height: 760px;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: 0 28px 70px rgba(16, 24, 40, .18), 0 4px 14px rgba(16, 24, 40, .06);
}

.login-visual {
  position: relative;
  min-height: 0;
  display: flex;
  background: url('/images/login-survey.jpg') center / cover no-repeat;
  color: #fff;
}
.login-visual-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 18, 30, .12) 0%, rgba(10, 18, 30, .58) 52%, rgba(10, 18, 30, .94) 100%),
    linear-gradient(115deg, rgba(26, 115, 232, .55) 0%, rgba(10, 18, 30, .10) 68%);
}
.login-visual-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  width: 100%;
  padding: 2.4rem 2.4rem 1.8rem;
}
.login-visual-brand { display: flex; align-items: center; gap: .75rem; }
.login-visual-logo {
  width: 2.9rem;
  height: 2.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: .8rem;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .22);
  backdrop-filter: blur(6px);
  font-size: 1.3rem;
}
.login-visual-name { font-weight: 700; font-size: 1rem; letter-spacing: .01em; }
.login-visual-tag { font-size: .74rem; color: rgba(255, 255, 255, .72); }

.login-visual-copy { max-width: 30rem; }
.login-visual-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #dce9ff;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  padding: .3rem .7rem;
  margin-bottom: 1rem;
}
.login-visual-copy h1 {
  font-size: clamp(1.45rem, 2.4vw, 1.9rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: .75rem;
  text-wrap: balance;
}
.login-visual-copy p {
  font-size: .9rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, .78);
  margin-bottom: 1.4rem;
}
.login-visual-features { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.login-visual-features li {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .86rem;
  color: rgba(255, 255, 255, .92);
}
.login-visual-features i { color: #c6ff3d; font-size: .82rem; }
.login-visual-credit { font-size: .68rem; color: rgba(255, 255, 255, .45); }

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.75rem clamp(1.5rem, 3.5vw, 3rem);
  background: var(--card);
  overflow: hidden;
}
.login-panel-inner { width: 100%; max-width: 360px; min-height: 0; }
.login-panel-head { text-align: center; margin-bottom: 1.5rem; }
.login-logo {
  width: 3.6rem;
  height: 3.6rem;
  margin: 0 auto .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  font-size: 1.55rem;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 10px 24px rgba(26, 115, 232, .30);
}
.login-title { font-size: 1.4rem; font-weight: 700; color: var(--heading); margin-bottom: .3rem; }
.login-subtitle { font-size: .85rem; color: var(--dim); margin: 0; }

/* Login form — Material Web Components (md-outlined-text-field + md-filled-button). */
.login-field { margin-bottom: 14px; }
.login-form md-outlined-text-field { width: 100%; }
.login-form md-filled-button.login-submit {
  width: 100%;
  margin-top: 4px;
  --md-filled-button-container-height: 46px;
  font-weight: 600;
  letter-spacing: .01em;
}
.login-form md-icon-button[slot='trailing-icon'] { color: var(--dim); }

.login-panel-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin-top: 2rem;
  font-size: .72rem;
  color: var(--dim);
}
.login-panel-foot-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--stroke); }

html[data-bs-theme='dark'] .login-page {
  background:
    radial-gradient(circle at 12% 12%, rgba(66, 133, 244, .14), transparent 42%),
    radial-gradient(circle at 88% 88%, rgba(43, 232, 255, .08), transparent 42%),
    var(--bg);
}
html[data-bs-theme='dark'] .login-shell {
  box-shadow: 0 28px 70px rgba(0, 0, 0, .55), 0 4px 14px rgba(0, 0, 0, .35);
}
html[data-bs-theme='dark'] .login-visual-overlay {
  background:
    linear-gradient(180deg, rgba(5, 9, 16, .35) 0%, rgba(5, 9, 16, .72) 52%, rgba(5, 9, 16, .96) 100%),
    linear-gradient(115deg, rgba(66, 133, 244, .38) 0%, rgba(5, 9, 16, .20) 68%);
}

@media (max-width: 991.98px) {
  .login-shell { grid-template-columns: 1fr; max-width: 470px; }
  .login-visual { display: none; }
  .login-panel { padding: 2.5rem 1.75rem; }
}
@media (max-width: 575.98px) {
  .login-page { padding: 4.25rem .85rem .85rem; align-items: flex-start; }
  .login-theme-btn { top: .9rem; right: .9rem; }
  .login-shell { border-radius: 1rem; }
  .login-panel { padding: 1.9rem 1.25rem; }
}

/* Short viewports: scale the login down so it always fits without scrolling. */
@media (max-height: 820px) {
  .login-visual-content { padding: 1.9rem 2rem 1.4rem; gap: 1.2rem; }
  .login-visual-copy h1 { font-size: 1.5rem; }
  .login-visual-copy p { font-size: .85rem; margin-bottom: 1rem; }
  .login-visual-features { gap: .4rem; }
  .login-panel { padding: 1.7rem 2.25rem; }
  .login-panel-head { margin-bottom: 1.1rem; }
  .login-logo { width: 3.1rem; height: 3.1rem; font-size: 1.35rem; margin-bottom: .65rem; }
  .login-title { font-size: 1.28rem; }
  .login-panel-foot { margin-top: 1.1rem; }
}
@media (max-height: 700px) {
  .login-visual-content { padding: 1.4rem 1.6rem 1rem; gap: .9rem; }
  .login-visual-copy h1 { font-size: 1.3rem; margin-bottom: .5rem; }
  .login-visual-copy p { display: none; }
  .login-visual-features li { font-size: .8rem; }
  .login-panel { padding: 1.25rem 1.9rem; }
  .login-panel-head { margin-bottom: .8rem; }
  .login-logo { width: 2.7rem; height: 2.7rem; font-size: 1.15rem; margin-bottom: .5rem; }
  .login-title { font-size: 1.15rem; }
  .login-subtitle { font-size: .8rem; }
  .login-form md-filled-button.login-submit { --md-filled-button-container-height: 40px; }
  .login-field { margin-bottom: 10px; }
  .login-panel-foot { display: none; }
}
@media (max-height: 560px) {
  .login-visual-features,
  .login-visual-credit { display: none; }
  .login-visual-copy h1 { font-size: 1.15rem; }
  .login-visual-eyebrow { margin-bottom: .5rem; padding: .2rem .55rem; font-size: .65rem; }
  .login-panel { padding: .9rem 1.4rem; }
  .login-logo { display: none; }
  .login-panel-head { margin-bottom: .6rem; }
  .login-field { margin-bottom: 8px; }
  .login-form md-filled-button.login-submit { --md-filled-button-container-height: 36px; }
}
@media (max-height: 440px) {
  .login-page { padding: .75rem; }
  .login-shell { grid-template-columns: 1fr; max-width: 420px; max-height: none; }
  .login-visual { display: none; }
  .login-panel { padding: .75rem 1.1rem; }
  .login-panel-head { margin-bottom: .5rem; }
  .login-title { font-size: 1.05rem; }
  .login-subtitle { display: none; }
  .login-form .form-label { margin-bottom: .2rem; }
}

/* Heat map */
.heatmap-wrap { overflow: auto; max-height: 70vh; border: 1px solid var(--stroke); border-radius: .4rem; background: var(--card); }
table.heatmap { border-collapse: separate; border-spacing: 0; font-size: .72rem; }
table.heatmap th, table.heatmap td { padding: .18rem .3rem; text-align: center; white-space: nowrap; }
table.heatmap thead th {
  position: sticky; top: 0; z-index: 3; background: var(--navy); color: #fff;
  font-size: .68rem; font-weight: 600;
}
table.heatmap .id-col { position: sticky; left: 0; z-index: 2; background: var(--card); font-weight: 600; text-align: left; min-width: 90px; }
table.heatmap thead .id-col { z-index: 4; background: var(--navy); }
table.heatmap td.heat-cell { font-weight: 600; }
table.heatmap td.heat-fav { background: #2e7d4f; color: #fff; }
table.heatmap td.heat-nonfav { background: var(--card-press); color: var(--dim); }
table.heatmap td.heat-blank { background: var(--stroke); color: var(--dim); }
.hm-legend span { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: middle; margin-right: 4px; }
/* Heatmap column selector reuses the DataTables colvis markup, so the check
   mark comes from the buttons stylesheet. The Employee Data version inherits
   position:relative from the div.dt-buttons wrapper, which the heatmap
   dropdown does not have — provide it here so the check anchors to the item. */
#hmColMenu .dt-button { position: relative; }
#hmColMenu a.dt-button.dt-button-active::after { color: var(--dim, #8a8f98); }

/* Misc */
.section-title { font-weight: 700; color: var(--heading); border-left: 4px solid var(--blue); padding-left: .6rem; margin: 1.4rem 0 .9rem; }
/* Report title block: only rendered in the PDF export (eei-esi.js and
   dashboard.js make it visible and size it against the print zoom). */
#printReportTitle { display: none; }

/* PDF footnote: logo + client name at the bottom-left of every sheet of
   the exported PDF. Hidden on screen; position:fixed repeats it on each
   printed page in Chrome. Lives outside .app-wrapper so no transformed
   print sizer can shift it. The reserved bottom @page margin (18mm on
   dashboard/eei-esi) keeps it clear of page content. */
.pdf-footnote { display: none; }
.table-sm td, .table-sm th { font-size: .8rem; }
.card { border: 1px solid var(--stroke); background: var(--card); }

/* Client Management — page head + portfolio summary */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}
.page-head-copy { min-width: 0; }
.page-head .section-title { margin: 0; }
.page-eyebrow {
  font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--dim); margin-bottom: .3rem;
}
.page-head-cta { border-radius: .65rem; font-weight: 600; }

.portfolio-summary {
  display: flex; flex-wrap: wrap; gap: .5rem;
  margin: .9rem 0 1.1rem;
}
.portfolio-summary[hidden] { display: none; }
.portfolio-stat {
  flex: 0 1 auto; min-width: 132px; padding: .55rem .9rem;
  border: 1px solid var(--stroke); border-radius: .8rem; background: var(--card);
  display: flex; flex-direction: column; gap: .1rem;
}
.portfolio-stat-label {
  font-size: .68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--dim);
}
.portfolio-stat-value {
  font-size: 1.05rem; font-weight: 700; color: var(--heading);
  font-variant-numeric: tabular-nums; line-height: 1.25;
}
.portfolio-stat-value.is-accent { color: var(--blue); font-size: .95rem; }
.portfolio-stat-value.is-empty { color: var(--dim); font-size: .9rem; font-weight: 600; }

/* Client Management cards */
.company-card {
  border: 1px solid var(--stroke);
  border-radius: 1rem;
  background: var(--card);
  overflow: hidden;
  position: relative;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 28px -22px rgba(16, 24, 40, .45);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.company-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(16, 24, 40, .05), 0 18px 36px -24px rgba(16, 24, 40, .55);
}
.company-card.is-active {
  border-color: rgba(26, 115, 232, .55);
  box-shadow: 0 0 0 1px rgba(26, 115, 232, .18), 0 14px 32px -24px rgba(16, 24, 40, .5);
}
.company-card.is-active::before {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--blue);
}
html[data-bs-theme='dark'] .company-card.is-active { border-color: rgba(66, 133, 244, .6); box-shadow: 0 0 0 1px rgba(66, 133, 244, .22), 0 14px 32px -24px rgba(0, 0, 0, .7); }

.company-card-head { display: flex; align-items: flex-start; gap: .8rem; padding: 1.05rem 1.1rem .8rem; }
.company-avatar {
  flex: 0 0 auto; width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: .8rem; background: rgba(26, 115, 232, .1); color: var(--blue);
  font-size: .95rem; font-weight: 700; letter-spacing: .02em;
}
html[data-bs-theme='dark'] .company-avatar { background: rgba(66, 133, 244, .16); }
/* Logo mengisi slot Initial persis — bentuk & ukuran mengikuti kondisi Initial. */
.company-avatar { position: relative; overflow: visible; cursor: pointer; }
.company-avatar img {
  width: 100%; height: 100%; object-fit: cover; border-radius: .8rem; display: block;
}
.company-avatar-edit {
  position: absolute; inset: 0; display: grid; place-items: center; border-radius: .8rem;
  background: rgba(15, 23, 42, .55); color: #fff; font-size: .8rem;
  opacity: 0; transition: opacity .15s ease; pointer-events: none;
}
.company-avatar:hover .company-avatar-edit,
.company-avatar:focus-visible .company-avatar-edit { opacity: 1; }
.company-avatar:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
/* Viewers (non-admin): the avatar is a plain logo/monogram, not an upload
   trigger — no pointer cursor, no focus ring. */
.company-avatar-static { cursor: default; }
.modal .logo-preview { width: 64px; height: 64px; font-size: 1.4rem; cursor: default; }
.modal .logo-preview:hover .company-avatar-edit { opacity: 0; }
.modal .logo-preview img { border-radius: .8rem; }
.company-head-text { min-width: 0; }
.company-name { font-weight: 700; font-size: 1rem; line-height: 1.3; color: var(--heading); overflow-wrap: anywhere; }
.company-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }
.company-code-badge {
  display: inline-flex; align-items: center; padding: .15rem .5rem; border-radius: 999px;
  border: 1px solid var(--stroke); background: var(--card-press); color: var(--dim);
  font-size: .7rem; font-weight: 700; letter-spacing: .04em;
}
.company-active-badge {
  display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .5rem; border-radius: 999px;
  background: rgba(24, 128, 56, .12); color: var(--green); font-size: .7rem; font-weight: 700;
}
.company-active-badge i { font-size: .4rem; }

.company-facts { list-style: none; margin: 0; padding: 0 1.1rem .55rem; display: grid; gap: .4rem; }
.company-facts li { display: flex; align-items: flex-start; gap: .6rem; font-size: .82rem; line-height: 1.4; color: var(--dim); }
/* Title laporan client — tampil di atas baris Industri pada kartu. */
.company-facts li .company-report-title { font-weight: 600; color: var(--heading); }
.company-facts li i { flex: 0 0 14px; width: 14px; margin-top: .16rem; text-align: center; color: var(--dim); opacity: .8; }

.company-data {
  display: flex; align-items: baseline; justify-content: space-between; gap: .6rem;
  margin: 0 1.1rem .55rem; padding: .5rem .7rem;
  border: 1px solid var(--stroke); border-radius: .65rem; background: var(--card-press);
}
.company-data-label { display: inline-flex; align-items: center; gap: .45rem; font-size: .74rem; font-weight: 600; color: var(--dim); }
.company-data-label i { font-size: .74rem; }
.company-data-value { font-size: 1.15rem; font-weight: 700; color: var(--heading); font-variant-numeric: tabular-nums; line-height: 1.1; }

.company-file-row {
  display: flex; align-items: center; gap: .5rem; padding: 0 1.1rem 1rem;
  color: var(--dim); font-size: .74rem;
}
.company-file-row i { flex: 0 0 auto; font-size: .72rem; opacity: .8; }
.company-file-row .company-file { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.company-file { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .74rem; }

.company-card-actions {
  display: flex; flex-wrap: nowrap; align-items: center; gap: .35rem;
  padding: .7rem 1.05rem; border-top: 1px solid var(--stroke); background: var(--card-press);
}
.company-card-actions .btn {
  border-radius: .6rem; font-size: .78rem; font-weight: 600; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  padding: .3rem .5rem; line-height: 1.2;
}
.company-card-actions .btn i { font-size: .76rem; }
.company-card-actions .btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; box-shadow: none; }
.company-open { flex: 1 1 auto; min-width: 0; }
.company-open span { overflow: hidden; text-overflow: ellipsis; }
.company-action { flex: 0 0 auto; }
.company-action.btn-outline-secondary { color: var(--text); border-color: var(--stroke); background: var(--card); }
.company-action.btn-outline-secondary:hover { color: var(--blue); border-color: var(--blue); background: var(--card); }
.company-action-danger.btn-outline-secondary:hover { color: var(--red); border-color: var(--red); }
.company-action:active { transform: translateY(1px); }

/* Empty / error state */
.company-state {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: .35rem; padding: 3rem 1.5rem; border: 1px dashed var(--stroke);
  border-radius: 1rem; background: var(--card);
}
.company-state-icon {
  width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: .35rem;
  border-radius: 1rem; background: rgba(26, 115, 232, .1); color: var(--blue); font-size: 1.15rem;
}
html[data-bs-theme='dark'] .company-state-icon { background: rgba(66, 133, 244, .16); }
.company-state-title { font-weight: 700; color: var(--heading); }
.company-state-text { color: var(--dim); font-size: .85rem; max-width: 34ch; margin-bottom: .5rem; }
.company-state .btn { border-radius: .65rem; font-weight: 600; }

/* Loading skeleton */
.company-skeleton { pointer-events: none; }
.company-skeleton-body { padding: 0 1.1rem 1rem; display: grid; gap: .5rem; }
.company-skeleton-actions { justify-content: space-between; }
.sk {
  display: block; border-radius: .45rem;
  background: linear-gradient(90deg, var(--card-press) 25%, var(--stroke) 37%, var(--card-press) 63%);
  background-size: 400% 100%;
  animation: skShimmer 1.3s ease-in-out infinite;
}
.sk-tile { width: 44px; height: 44px; border-radius: .8rem; flex: 0 0 auto; }
.sk-line { height: .65rem; margin-bottom: .45rem; }
.sk-sm { width: 35%; }
.sk-metric { height: 2.1rem; border-radius: .65rem; }
.sk-btn { width: 28%; height: 1.9rem; border-radius: .6rem; }
@keyframes skShimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .sk { animation: none; }
  .company-card { transition: none; }
}

@media (max-width: 575.98px) {
  .company-card-actions { gap: .2rem; padding: .65rem .8rem; }
  .company-card-actions .btn { font-size: .72rem; padding: .28rem .36rem; gap: .24rem; }
  .company-card-actions .btn i { font-size: .72rem; }
  .company-open { flex: 0 0 auto; }
  .company-open span { overflow: visible; }
  .portfolio-stat { flex: 1 1 30%; min-width: 0; }
}
.loading-overlay { position: fixed; inset: 0; background: rgba(127,127,127,.35); z-index: 2050; display: flex; align-items: center; justify-content: center; }
.dataTables_wrapper .dt-buttons { margin-bottom: .5rem; }
.dataTables_wrapper { color: var(--text); }

/* Question Management — wrapping text cells */
#qTable .q-text { white-space: normal; min-width: 280px; }
#qTable .q-cat { white-space: normal; min-width: 160px; }

/* Edit Client modal: formasi sama dengan wizard New Client, dipadatkan
   agar seluruh dialog muat di viewport tanpa overflow/vscroll. */
#editModal .modal-header { padding: .65rem 1rem; }
#editModal .modal-body { padding: .75rem 1rem .35rem; }
#editModal .modal-footer { padding: .5rem 1rem; }
#editModal.fade .modal-dialog,
#editModal.show .modal-dialog { transition: none; transform: none; }
#editModal .form-label { margin-bottom: .2rem; font-size: .8rem; }
#editModal .form-control, #editModal .form-select { padding-top: .3rem; padding-bottom: .3rem; font-size: .85rem; }
#editModal .form-text { margin-top: .15rem; font-size: .72rem; }

/* ====================================================================
   AI report typography — used by every Quill surface that renders an
   AI analysis: the Generate Analisys modal (#aiQuill) and the saved
   report viewer (#reportViewQuill). The AI writes markdown (h1..h4,
   tables, lists); these rules turn that into a coherent, print-grade
   document hierarchy instead of default browser headings.
   ==================================================================== */
.ql-snow .ql-editor {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14.5px;
  line-height: 1.65;
  color: #1f2937;
}
.ql-snow .ql-editor > *:first-child { margin-top: 0; }

/* Judul laporan (h1 dari markdown "# ...") */
.ql-snow .ql-editor h1 {
  font-size: 1.45rem;
  font-weight: 750;
  color: #0f2c52;
  letter-spacing: .01em;
  margin: 1.5em 0 .6em;
  padding-bottom: .35em;
  border-bottom: 3px solid #0f2c52;
}
.ql-snow .ql-editor > h1:first-child { margin-top: 0; }

/* Section (h2 dari markdown "## ...") — aksen bar kiri */
.ql-snow .ql-editor h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f2c52;
  margin: 1.4em 0 .5em;
  padding: .12em 0 .12em .6em;
  border-left: 4px solid #2563a8;
  background: linear-gradient(90deg, #eef3f9, rgba(238, 243, 249, 0));
}

/* Subsection (h3) dan sub-subsection (h4+) */
.ql-snow .ql-editor h3 {
  font-size: 1.02rem;
  font-weight: 700;
  color: #1f3a5f;
  margin: 1.1em 0 .4em;
}
.ql-snow .ql-editor h4, .ql-snow .ql-editor h5, .ql-snow .ql-editor h6 {
  font-size: .95rem;
  font-weight: 650;
  color: #374151;
  margin: .9em 0 .35em;
}

/* Paragraf & teks */
.ql-snow .ql-editor p { margin: 0 0 .75em; }
.ql-snow .ql-editor strong { color: #111827; }

/* Daftar */
.ql-snow .ql-editor ul, .ql-snow .ql-editor ol { margin: 0 0 .8em; padding-left: 1.5em; }
.ql-snow .ql-editor li { margin-bottom: .28em; }
.ql-snow .ql-editor li > ul, .ql-snow .ql-editor li > ol { margin-top: .28em; margin-bottom: .28em; }

/* Pemisah section (markdown ---) */
.ql-snow .ql-editor hr {
  border: 0;
  border-top: 1px solid #d7dde5;
  margin: 1.4em 0;
}

/* Kutipan (biasanya catatan/scope) */
.ql-snow .ql-editor blockquote {
  border-left: 4px solid #c7d4e3;
  background: #f6f8fb;
  color: #334155;
  margin: 0 0 .9em;
  padding: .55em .9em;
  font-size: .93em;
}

/* Tabel laporan: header baris pertama ditonjolkan (Quill menyimpan
   header sebagai td pada tr pertama), garis tipis, zebra halus. */
.ql-snow .ql-editor table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0 1.2em;
  font-size: 12.5px;
  line-height: 1.45;
}
.ql-snow .ql-editor th, .ql-snow .ql-editor td {
  border: 1px solid #d7dde5;
  padding: 6px 9px;
  vertical-align: top;
  text-align: left;
}
/* Header row only: :first-child is per-parent, so a plain tr:first-child
   also hits the first data row whenever the table carries several tbody
   row groups (fresh paste path) — scope it to the FIRST row group. */
.ql-snow .ql-editor tbody:first-of-type tr:first-child td,
.ql-snow .ql-editor tr:first-child th {
  background: #0f2c52;
  border-color: #0f2c52;
  color: #fff;
  font-weight: 650;
}
.ql-snow .ql-editor tr:nth-child(even):not(:first-child) td { background: #f4f7fb; }

/* Kotak analisa singkat AI di bawah chart delta (halaman Perbandingan):
   kalimat sorotan bergaya callout navy, teks putih. */
.delta-ai-note {
  background: #0f2c52;
  color: #fff;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: .95rem;
  line-height: 1.55;
}
html[data-bs-theme='dark'] .delta-ai-note { background: #14304f; }

/* Judul tiap blok dimensi pada "Perbandingan per Dimensi Profil" (halaman
   Perbandingan): label .small dinaikkan 2pt (10.5pt -> 12.5pt), bold+italic. */
.group-title {
  font-size: 12.5pt;
  font-weight: 700;
  font-style: italic;
}

/* Print: header tabel tetap terbaca di PDF (sebagian driver menghapus
   background) — paksa warna header ikut tercetak. */
@media print {
  .pdf-footnote {
    display: flex;
    position: fixed;
    /* Chrome print clips fixed elements to the page content box, so the
       footer must sit inside it: left:0 = flush with the report's left
       margin edge (negative offsets are silently clipped away). */
    left: 0;
    bottom: 2mm;
    align-items: center;
    gap: 4px;
    font-size: 8.5pt;
    color: #222;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .pdf-footnote img { height: 5mm; width: auto; }

  /* Swatch warna laporan AI (span background-color inline) tetap tercetak. */
  .ql-snow .ql-editor span[style*="background-color"] {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .ql-snow .ql-editor table { border-top: 2px solid #0f2c52; }
  .ql-snow .ql-editor tbody:first-of-type tr:first-child td,
  .ql-snow .ql-editor tr:first-child th {
    background: #0f2c52 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .ql-snow .ql-editor h1, .ql-snow .ql-editor h2 { break-after: avoid; }
  .ql-snow .ql-editor table, .ql-snow .ql-editor ul, .ql-snow .ql-editor ol { break-inside: avoid-page; }

  /* Fallback untuk flip tema via JS (common.js beforeprint): bila event
     tidak sampai, dark theme tetap tidak boleh menghitamkan PDF. Bootstrap
     menurunkan warna tabel/kartu dari variabel CSS — paksa semuanya terang. */
  html[data-bs-theme='dark'] {
    --bs-body-bg: #fff;
    --bs-body-color: #212529;
    --bs-emphasis-color: #212529;
    --bs-secondary-color: #6c757d;
    --bs-tertiary-bg: #f8f9fa;
    --bs-border-color: #dee2e6;
  }
  html[data-bs-theme='dark'] .table,
  html[data-bs-theme='dark'] .table * {
    --bs-table-bg: #fff;
    --bs-table-color: #212529;
    --bs-table-border-color: #dee2e6;
    --bs-table-striped-bg: #f2f2f2;
    --bs-table-striped-color: #212529;
    --bs-table-hover-bg: #f5f5f5;
    --bs-table-hover-color: #212529;
    --bs-table-dark-bg: #fff;
    --bs-table-dark-color: #212529;
    --bs-table-dark-border-color: #dee2e6;
  }
  html[data-bs-theme='dark'] .card {
    --bs-card-bg: #fff;
    color: #212529;
  }
  html[data-bs-theme='dark'] table.level-matrix thead th {
    background: #e8eef9;
    color: #212529;
  }
  html[data-bs-theme='dark'] table.classification-legend thead th { color: #212529; }
  html[data-bs-theme='dark'] table.classification-legend .cl-range { background: #eef2fb; }
}

/* ---------- User Management ---------- */
.users-table td { vertical-align: middle; }
.users-table .priv-count { font-size: .78rem; color: var(--bs-secondary-color); }

.priv-tree,
.priv-children { list-style: none; margin: 0; padding: 0; }
.priv-children { margin-left: 1.6rem; border-left: 2px solid var(--bs-border-color); padding-left: .85rem; }
.priv-node + .priv-node { margin-top: .35rem; }
.priv-node > .priv-row { font-weight: 600; }
.priv-row {
  display: flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem .4rem;
  border-radius: .4rem;
}
.priv-row:hover { background: var(--bs-tertiary-bg); }
.priv-row-label {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin: 0;
  flex: 1;
  cursor: pointer;
}
.priv-row input.tree-check { flex: 0 0 auto; width: 1.05rem; height: 1.05rem; cursor: pointer; }
.priv-label { line-height: 1.2; }
.priv-tree-toolbar { display: flex; gap: .35rem; }

/* Collapse / expand toggle for parent nodes. */
.tree-toggle,
.tree-toggle-spacer {
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.35rem;
}
.tree-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--bs-secondary-color);
  border-radius: .3rem;
  cursor: pointer;
  font-size: .72rem;
  line-height: 1;
  transition: transform .15s ease, background-color .15s ease;
}
.tree-toggle:hover { background: var(--bs-secondary-bg); color: var(--bs-body-color); }
.priv-node.collapsed > .priv-children { display: none; }
.priv-node.collapsed > .priv-row > .tree-toggle { transform: rotate(-90deg); }
