:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #152033;
  --muted: #64748b;
  --line: #dbe3ee;
  --blue: #1c4f91;
  --navy: #102a4c;
  --gold: #f4c542;
  --red: #b42318;
  --green: #1d7a46;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 55%, var(--bg) 55%);
}

.login-card,
.panel,
.stat,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16, 42, 76, 0.08);
}

.login-card {
  box-shadow: 0 12px 34px rgba(16, 42, 76, 0.16);
}

.login-card {
  width: min(440px, 100%);
  padding: 32px;
}

.login-legal-links {
  position: fixed;
  right: 22px;
  bottom: 18px;
  display: flex;
  gap: 16px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
}

.login-legal-links a:hover,
.login-legal-links a:focus-visible {
  color: #fff;
  text-decoration: underline;
}

.legal-body {
  min-height: 100vh;
  padding: 48px 20px;
  background: #f5f7fb;
}

.legal-page {
  width: min(760px, 100%);
  margin: 0 auto;
  color: #243247;
  line-height: 1.65;
}

.legal-page h1 {
  margin: 18px 0 4px;
  color: var(--ink);
  font-size: 30px;
}

.legal-page h2 {
  margin: 30px 0 6px;
  color: var(--ink);
  font-size: 17px;
}

.legal-page p {
  margin-bottom: 12px;
}

.legal-back,
.legal-updated {
  color: var(--muted);
  font-size: 13px;
}

.legal-back:hover,
.legal-back:focus-visible {
  color: var(--blue);
  text-decoration: underline;
}

@media (max-width: 560px) {
  .login-legal-links {
    right: 16px;
    bottom: 12px;
  }

  .legal-body {
    padding: 28px 18px;
  }
}

.auth-card .grid {
  gap: 14px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 14px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  height: 1px;
  flex: 1;
  background: var(--line);
}

.auth-provider-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

#discordLogin {
  border-color: #5865f2;
  background: #5865f2;
  color: #fff;
}

#discordLogin:hover,
#discordLogin:focus-visible {
  border-color: #4752c4;
  background: #4752c4;
}

#robloxLogin {
  border-color: #e2231a;
  background: #e2231a;
  color: #fff;
}

#robloxLogin:hover,
#robloxLogin:focus-visible {
  border-color: #bd1d16;
  background: #bd1d16;
}

.auth-provider.provider-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.auth-signout {
  width: 100%;
  margin-top: 12px;
}

.form-message {
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-left: 3px solid var(--red);
  background: #fff1f2;
  color: #991b1b;
}

.form-message.success {
  border-color: #bbf7d0;
  border-left-color: #15803d;
  background: #f0fdf4;
  color: #166534;
}

.error-message {
  border: 1px solid #fecaca;
  border-left: 3px solid var(--red);
  background: #fff1f2;
  color: #991b1b;
  padding: 10px 12px;
}

.settings-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 14px;
}

.settings-status-list {
  display: grid;
  gap: 0;
}

.settings-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.settings-status-row:last-child {
  border-bottom: 0;
}

.employee-account-actions {
  margin-top: 14px;
}

@media (max-width: 820px) {
  .settings-page-grid {
    grid-template-columns: 1fr;
  }
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: 26px;
}

h2 {
  font-size: 20px;
}

.muted {
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 6px 11px;
  cursor: pointer;
  font-weight: 700;
}

.btn.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.btn.danger {
  border-color: var(--red);
  color: var(--red);
}

.btn.warning {
  border-color: #d97706;
  background: #f59e0b;
  color: #111827;
}

.btn.warning:hover:not(:disabled) {
  background: #d97706;
  color: #fff;
}

.icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 16px;
}

.inline-x {
  border: 0;
  background: transparent;
  color: var(--red);
  cursor: pointer;
  font-weight: 900;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

.icon-btn.edit {
  border-color: #bfd0e6;
  color: var(--blue);
}

.icon-btn.edit:hover {
  background: #eaf2fb;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 10px 12px;
}

.brand {
  display: flex;
  align-items: center;
  min-height: 38px;
  margin-bottom: 8px;
  padding: 2px 10px;
}

.brand-logo {
  display: block;
  width: 100%;
  max-width: 138px;
  height: auto;
}

.nav {
  display: grid;
  gap: 3px;
}

.sidebar > .nav:not(.nav-admin) {
  min-height: 0;
  flex: 1 1 auto;
  align-content: start;
  overflow-y: auto;
}

.nav-admin {
  flex: 0 0 auto;
}

.nav a {
  border-radius: 6px;
  color: #334155;
  padding: 8px 10px;
  font-weight: 700;
}

.nav a.nav-child {
  margin-left: 14px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 14px;
}

.nav a:hover {
  background: #eef3f9;
  color: var(--navy);
}

.nav a.active {
  background: #eef3f9;
  color: var(--navy);
  box-shadow: inset 3px 0 0 var(--blue);
}

.site-disclaimer {
  flex: 0 0 auto;
  margin: 12px 10px 4px;
  color: #7b8798;
  font-size: 10px;
  line-height: 1.4;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 54px;
  padding: 8px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar #logoutBtn {
  transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease;
}

.topbar #logoutBtn:hover {
  border-color: #dc2626;
  background: #fff1f2;
  color: #b42318;
}

.shift-header-indicator {
  min-width: 0;
}

.shift-header-indicator:not(.visible) {
  display: none;
}

.shift-header-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #dbe3ef;
  border-radius: 999px;
  background: #f8fafc;
  color: var(--muted);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.shift-header-link:hover {
  border-color: #bfd0e6;
  background: #eef3f9;
  color: var(--navy);
}

.shift-header-link.pending {
  border-color: #fca5a5;
  background: #fff1f2;
  color: #b91c1c;
  animation: shiftHeaderPulse 1.25s ease-in-out infinite;
}

.shift-header-link.pending:hover {
  border-color: #ef4444;
  background: #fee2e2;
  color: #991b1b;
}

.shift-header-icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
}

.shift-header-icon svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.content {
  padding: 20px;
}

body.workspace-locked {
  overflow: hidden;
}

body.workspace-locked .shell {
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
}

body.workspace-locked .shell > div {
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

body.workspace-locked .content {
  min-height: 0;
  height: calc(100vh - 54px);
  overflow: hidden;
  padding: clamp(8px, 1.7vh, 16px) clamp(10px, 1.4vw, 20px);
}

.grid {
  display: grid;
  gap: 12px;
}

.stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat {
  padding: 14px;
}

.stat strong {
  display: block;
  margin-top: 8px;
  color: var(--navy);
  font-size: 25px;
}

.stat small {
  display: block;
  margin-top: 8px;
}

.page-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.page-header h1 {
  margin-bottom: 3px;
}

.page-header p {
  margin-bottom: 0;
}

.page-intro h1 {
  margin-bottom: 6px;
}

.intro-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dashboard-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(12, 1fr);
}

.dashboard-split {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 16px;
}

.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.span-3-cols {
  grid-column: span 3;
}

.span-4-cols {
  grid-column: span 4;
}

.span-6-cols {
  grid-column: span 6;
}

.span-8-cols {
  grid-column: span 8;
}

.span-12-cols {
  grid-column: span 12;
}

.metric {
  padding: 14px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  color: var(--navy);
  font-size: 24px;
}

.quick-actions {
  display: grid;
  gap: 10px;
}

.quick-actions a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  font-weight: 800;
}

.quick-actions a:hover {
  border-color: var(--blue);
  background: #eaf2fb;
}

.panel {
  padding: 14px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.employee-toolbar-actions {
  flex-wrap: nowrap;
}

.employee-toolbar-actions #search {
  width: min(260px, 32vw);
}

@media (max-width: 700px) {
  .employee-toolbar-actions {
    flex-wrap: wrap;
    width: 100%;
  }

  .employee-toolbar-actions #search {
    width: 100%;
  }
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.table-wrap {
  overflow-x: auto;
}

.compact-table-wrap {
  overflow-x: visible;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
  text-align: left;
}

.compact-table {
  min-width: 0;
  table-layout: fixed;
}

.compact-table th,
.compact-table td {
  overflow-wrap: anywhere;
}

.wrap-cell {
  white-space: normal;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  vertical-align: top;
}

th {
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
}

.badge.danger-soft {
  border-color: #fecaca;
  background: #fff1f2;
  color: var(--red);
}

.badge.pill-pass {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.badge.pill-open {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.badge.pill-fail {
  border-color: #fecaca;
  background: #fff1f2;
  color: var(--red);
}

.badge.pill-review {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}

.badge.pill-retry {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.badge.pill-neutral {
  border-color: #d1d5db;
  background: #f8fafc;
  color: #475569;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.form-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-form {
  align-items: end;
  grid-template-columns: minmax(180px, 1fr) 170px minmax(260px, 2fr) auto;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-heading h2 {
  margin: 0;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.action-cell {
  display: flex;
  gap: 8px;
}

.table-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.effect-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.effect-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 9px 11px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.effect-option input {
  width: 16px;
  height: 16px;
}

label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
}

textarea {
  min-height: 82px;
  resize: vertical;
}

.compact-form textarea {
  min-height: 42px;
}

input[type="color"] {
  min-height: 42px;
  padding: 4px;
  cursor: pointer;
}

.color-field {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 8px;
  align-items: center;
}

.color-field input[type="color"] {
  min-width: 54px;
}

.color-value {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.span-2 {
  grid-column: 1 / -1;
}

.cards {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.admin-tools {
  margin-top: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: auto;
  min-height: 0;
  align-content: start;
}

.admin-tools-heading {
  margin: 0;
  padding: 2px 0 7px;
}

.admin-tools .card {
  display: flex;
  align-items: center;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 13px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(16, 42, 76, 0.06);
  transition: none;
}

.admin-tools .card h2 {
  margin: 0;
  font-size: 16px;
}

.admin-tools .card p {
  margin-bottom: 0;
}

.compact-list {
  display: grid;
  gap: 10px;
}

.compact-row {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 12px;
  overflow-wrap: anywhere;
}

.ia-page-shell {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(7px, 1.2vh, 12px);
  overflow: hidden;
}

@media (max-height: 760px) and (min-width: 861px) {
  .ia-case-heading h1 {
    font-size: 24px;
  }

  .ia-case-heading .btn,
  .ia-tabs .tab,
  .ia-subtle-btn {
    min-height: 30px;
    padding-top: 4px;
    padding-bottom: 4px;
  }

  .ia-details-inline {
    gap: 5px 14px;
  }

  .ia-summary-block {
    margin-top: 5px;
    padding-top: 5px;
  }

  .ia-entry-row,
  .ia-task-row {
    padding-top: 7px;
    padding-bottom: 7px;
  }
}

.ia-list-scroll {
  min-height: 0;
  overflow: hidden;
  display: grid;
  gap: 10px;
  align-content: start;
}

.ia-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  padding: 9px 10px;
}

.ia-filter-bar input,
.ia-filter-bar select,
.ia-filter-bar .btn {
  min-height: 36px;
}

.ia-filter-bar label {
  min-width: 150px;
}

.ia-search-input {
  width: 168px;
}

.ia-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(320px, 0.72fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 9px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.ia-main,
.ia-side {
  min-width: 0;
  min-height: 0;
}

.ia-main {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ia-column-scroll {
  overflow: visible;
}

.ia-side {
  align-self: start;
  height: 100%;
  overflow: hidden;
}

.ia-side > .ia-section-stack {
  height: 100%;
  grid-template-rows: auto auto;
  align-content: start;
}

.ia-header-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
}

.ia-search-shell {
  position: relative;
}

.ia-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 4;
  max-height: 168px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
  padding: 5px;
  gap: 2px;
}

.ia-search-results:empty {
  display: none;
}

.ia-search-shell:not(:focus-within) .ia-search-results {
  display: none;
}

.ia-subject-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  padding: 6px 8px;
  font: inherit;
  font-weight: 400;
}

.ia-subject-result small {
  color: var(--muted);
  font-weight: 400;
}

.ia-search-empty {
  margin: 3px 5px;
}

.ia-modal {
  width: min(680px, 100%);
}

.ia-subtle-btn {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
}

.ia-preview-image,
.ia-preview-frame {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-top: 8px;
}

.ia-preview-image {
  max-height: 240px;
  object-fit: cover;
}

.ia-preview-frame {
  min-height: 220px;
}

.ia-section-stack {
  display: grid;
  gap: 9px;
  min-height: 0;
}

.ia-main-section-stack {
  height: 100%;
  gap: 9px;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.ia-timeline-list {
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.ia-scroll-box {
  max-height: clamp(180px, 18vh, 220px);
  overflow-y: auto;
  padding-right: 4px;
}

.ia-scroll-box.evidence-box,
.ia-scroll-box.statements-box,
.ia-scroll-box.notes-box {
  max-height: clamp(180px, 18vh, 220px);
}

.ia-scroll-box.timeline-box {
  max-height: clamp(220px, 24vh, 260px);
}

.ia-scroll-box.team-box {
  max-height: 180px;
  width: 100%;
  overflow-x: hidden;
  padding-right: 0;
}

.team-box .ia-table {
  width: 100%;
  table-layout: fixed;
}

.team-box .ia-table th,
.team-box .ia-table td {
  padding-right: 5px;
  padding-left: 5px;
}

.team-box .ia-table th:first-child,
.team-box .ia-table td:first-child {
  width: 25%;
}

.team-box .ia-table th:nth-child(2),
.team-box .ia-table td:nth-child(2) {
  width: 20%;
}

.team-box .ia-table th:nth-child(3),
.team-box .ia-table td:nth-child(3) {
  width: auto;
}

.team-box .ia-table th:last-child,
.team-box .ia-table td:last-child {
  width: 116px;
  text-align: right;
}

.ia-table-box {
  max-height: 280px;
  overflow: auto;
}

.ia-case-table th,
.ia-case-table td {
  padding: 9px 10px;
}

.ia-case-table thead th {
  background: #f5f8fc;
  border-bottom-color: #cfd8e6;
}

.ia-case-row {
  cursor: pointer;
  transition: background-color 120ms ease;
}

.ia-case-row.alt {
  background: rgba(248, 250, 252, 0.58);
}

.ia-case-row:hover {
  background: rgba(37, 99, 235, 0.06);
}

.ia-case-row:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.28);
  outline-offset: -2px;
  background: rgba(37, 99, 235, 0.08);
}

.ia-subject-cell {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ia-case-date-cell {
  white-space: nowrap;
}

.ia-list-badge,
.ia-status-badge,
.ia-count-badge {
  padding: 3px 7px;
  font-size: 11px;
}

.ia-count-badge {
  min-height: 22px;
}

.ia-create-case-btn {
  min-height: 34px;
  padding: 6px 10px;
}

.ia-card-compact {
  padding: 9px 11px;
  border-color: #cfd8e6;
}

.ia-side .ia-card-compact {
  padding: 8px 10px;
}

.ia-summary-card {
  padding-top: 7px;
  padding-bottom: 7px;
}

.ia-details-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 20px;
  align-items: center;
}

.ia-details-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.ia-details-item small,
.ia-details-item strong,
.ia-details-item .badge {
  min-width: 0;
}

.ia-details-item small {
  margin: 0;
}

.ia-subject-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-align: left;
}

.ia-subject-button:hover strong {
  text-decoration: underline;
}

label:has(> #builderLoaStatus) {
  display: none;
}

.ia-summary-copy {
  margin: 0;
  line-height: 1.35;
  max-width: 90ch;
}

.ia-summary-block {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid #d3ddec;
}

.ia-summary-block h3 {
  margin: 0 0 4px;
  font-size: 14px;
}

.ia-status-form textarea {
  min-height: 72px;
}

.ia-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
}

.ia-table th,
.ia-table td {
  padding: 7px 8px;
  font-size: 13px;
  line-height: 1.2;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.ia-table th {
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.ia-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ia-table .muted {
  font-size: 12.5px;
}

.ia-cell-preview {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.ia-actions-inline {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}

.ia-meta-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.ia-top-meta {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.ia-top-meta-compact {
  align-items: center;
}

.ia-top-meta-item {
  min-width: 0;
}

.ia-top-meta-item small {
  display: block;
  margin-bottom: 4px;
}

.ia-case-heading {
  margin-bottom: 2px;
}

.ia-case-heading h1 {
  margin: 0;
}

.ia-action-col {
  width: 48px;
}

.ia-link-col {
  width: 82px;
}

.ia-date-col {
  width: 132px;
}

.ia-user-col {
  width: 120px;
}

.ia-btn-nowrap {
  white-space: nowrap;
}

.ia-task-toggle {
  width: 92px;
  justify-content: center;
  flex: 0 0 92px;
  min-height: 32px;
  padding: 5px 8px;
  font-size: 12px;
}

.ia-remove-btn {
  min-height: 32px;
  width: 32px;
  padding: 0;
  opacity: 0.62;
  font-size: 17px;
}

.ia-remove-btn:hover:not(:disabled) {
  opacity: 1;
}

.ia-inline-meta {
  font-weight: 600;
}

.ia-entry-list {
  display: grid;
  gap: 0;
}

.ia-workspace-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.ia-tabs {
  margin-bottom: 8px;
}

.ia-tab-heading {
  margin-bottom: 0;
  flex: 0 0 auto;
}

.ia-tab-scroll {
  flex: 1;
  max-height: 100%;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.ia-tab-scroll .ia-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.ia-entry-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 126px;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid #dbe3ee;
  padding: 11px 6px;
  min-width: 0;
  background: rgba(255, 255, 255, 0);
  transition: background-color 150ms ease, border-color 150ms ease;
}

.ia-entry-row:last-child {
  border-bottom: 0;
}

.ia-entry-row:hover {
  background: #f8fafc;
}

.ia-entry-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.ia-entry-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  min-width: 0;
}

.ia-entry-preview {
  margin: 0 0 4px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}

.ia-entry-actions {
  min-width: 0;
}

.ia-entry-side {
  display: grid;
  justify-items: end;
  gap: 6px;
  min-width: 0;
}

.ia-entry-date {
  white-space: nowrap;
  text-align: right;
}

.ia-task-list {
  display: grid;
  gap: 0;
  min-height: 0;
  overflow-y: auto;
}

.ia-task-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid #cbd7e6;
  padding: 5px 2px;
  transition: background-color 90ms ease, opacity 90ms ease, color 90ms ease;
}

.ia-task-row:last-child {
  border-bottom: 0;
}

.ia-task-row.clickable {
  cursor: pointer;
}

.ia-task-row.clickable:hover {
  background: rgba(37, 99, 235, 0.04);
}

.ia-task-row.is-complete {
  background: rgba(148, 163, 184, 0.08);
}

.ia-task-row.is-complete.clickable:hover {
  background: rgba(148, 163, 184, 0.12);
}

.ia-task-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.ia-task-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: color 70ms ease, opacity 70ms ease, text-decoration-color 70ms ease;
}

.ia-task-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  color: #fff;
  font-size: 11px;
  text-decoration: none;
}

.ia-task-row.is-complete .ia-task-state {
  border-color: #15803d;
  background: #15803d;
}

.ia-task-row.is-complete .ia-task-title,
.ia-task-row.is-complete .ia-task-main .muted {
  color: #64748b;
  opacity: 0.68;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.ia-task-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  justify-items: end;
  gap: 8px;
  min-width: 42px;
}

.ia-task-actions {
  min-width: 42px;
  gap: 8px;
}

.ia-card-compact .section-heading.compact-heading {
  margin: 0 0 6px;
  padding-bottom: 5px;
  border-bottom: 1px solid #e2e8f0;
}

.ia-side .section-heading.compact-heading {
  margin-bottom: 6px;
  padding-bottom: 5px;
}

.ia-card-compact .section-heading.compact-heading h2 {
  font-size: 16px;
  font-weight: 700;
}

.ia-chat-card {
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.ia-chat-card #iaCaseChatMount,
.ia-chat-card #iaSubjectChatMount {
  min-height: 0;
  flex: 1;
}

.ia-chat-card .conversation-shell {
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.ia-chat-card .chat-messages {
  min-height: 48px;
  max-height: none;
}

.ia-chat-card .chat-message {
  padding: 7px 9px;
}

.ia-subject-layout {
  grid-template-columns: minmax(0, 1.15fr) minmax(380px, 0.85fr);
  align-items: start;
  gap: 14px;
}

.ia-subject-details,
.ia-subject-chat {
  padding: 14px;
}

.ia-subject-details .detail-list {
  gap: 10px;
}

.ia-subject-circumstances {
  grid-column: 1 / -1;
}

.ia-subject-circumstances p {
  margin: 4px 0 0;
  line-height: 1.45;
  white-space: pre-wrap;
}

.ia-subject-chat {
  min-height: 270px;
  max-height: calc(100vh - 180px);
}

.ia-subject-chat .chat-messages {
  overflow-y: auto;
}

.ia-view-body {
  max-width: 100%;
  overflow-x: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ia-view-body p,
.ia-view-body a,
.ia-view-body iframe,
.ia-view-body img {
  max-width: 100%;
}

.selectable-row {
  width: 100%;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.selectable-row:hover {
  border-color: var(--blue);
  background: #eaf2fb;
}

.role-editor {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
}

.role-list-panel {
  padding: 12px;
}

.role-editor-panel {
  padding: 18px;
}

.role-list-item {
  width: 100%;
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

.role-list-item.active,
.role-list-item:hover {
  border-color: var(--blue);
  background: #eaf2fb;
}

.permission-editor {
  display: grid;
  gap: 10px;
  border-top: 0;
}

.permission-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 14px;
  background: #fff;
}

.permission-row input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.permission-page-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}

.permission-page-heading {
  margin: 0;
}

.discord-role-editor {
  min-height: 0;
  height: 100%;
  gap: 12px;
}

.discord-role-editor > .panel {
  min-height: 0;
  overflow: hidden;
}

.role-list-panel .compact-list {
  max-height: calc(100% - 46px);
  overflow-y: auto;
}

.role-editor-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0;
}

.discord-role-form {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-height: 0;
  height: 100%;
}

.role-editor-panel > .discord-role-form {
  flex: 1 1 auto;
  height: auto;
}

.permission-editor-header {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.discord-permission-editor {
  display: block;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 16px 16px;
}

.permission-category {
  padding-top: 14px;
}

.permission-category h3 {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.discord-permission-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.discord-permission-row > span:first-child {
  display: grid;
  gap: 2px;
}

.discord-permission-row small,
.roblox-role-link small {
  display: block;
  color: var(--muted);
  font-weight: 400;
}

.danger-permission strong {
  color: #b42318;
}

.permission-switch {
  position: relative;
  width: 38px;
  height: 22px;
  flex: 0 0 38px;
}

.permission-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.permission-switch i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: #b5bdc9;
  transition: background 120ms ease;
}

.permission-switch i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 120ms ease;
}

.permission-switch input:checked + i {
  background: var(--blue);
}

.permission-switch input:checked + i::after {
  transform: translateX(16px);
}

.permission-switch input:focus-visible + i {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.permission-savebar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.discord-save-all-bar {
  position: fixed;
  z-index: 45;
  left: calc(50% + 110px);
  bottom: 18px;
  transform: translateX(-50%);
  width: min(620px, calc(100vw - 280px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 12px 10px 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
}

.discord-save-all-bar[hidden] {
  display: none;
}

.discord-save-all-bar strong {
  font-size: 14px;
  color: #000;
}

.role-list-item .unsaved-indicator {
  color: #9a6700;
  font-size: 11px;
  font-weight: 700;
}

.role-list-item.has-unsaved {
  background: #fffbeb;
}

.editor-save-status {
  min-height: 18px;
  margin: 0 auto 0 0;
  color: var(--muted);
  font-size: 12px;
}

.editor-save-status.unsaved {
  color: #9a6700;
}

#createRankButton.has-unsaved,
#createGroupButton.has-unsaved {
  border-color: #d4a72c;
  background: #fff8c5;
  color: #633c01;
}

.roblox-role-link {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(320px, 1.3fr);
  align-items: end;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.roblox-role-fields {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) auto minmax(160px, 1fr);
  gap: 8px;
}

.group-members-panel {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}

.group-members-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.group-members-heading h2 {
  margin: 0;
  font-size: 16px;
}

.group-member-form {
  flex: 1 1 420px;
  max-width: 620px;
}

.group-member-form select {
  min-width: 0;
  flex: 1 1 auto;
}

.group-members-panel #groupMemberList {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 6px;
  max-height: 116px;
  margin-top: 8px;
  overflow-y: auto;
}

@media (max-width: 900px) {
  .discord-role-editor {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .roblox-role-link {
    grid-template-columns: 1fr;
  }

  .roblox-role-fields {
    grid-template-columns: 1fr auto;
  }

  .roblox-role-fields select {
    grid-column: 1 / -1;
  }

  .group-members-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .group-member-form {
    flex-basis: auto;
    max-width: none;
  }
}

.syllabus-outcome {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  align-items: center;
  gap: 10px;
}

.syllabus-grid {
  table-layout: auto;
}

.syllabus-abbr,
.grid-cell {
  width: 64px;
  text-align: center;
}

.grid-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 900;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.status-pass {
  background: #dcfce7;
  color: #166534;
}

.status-fail {
  background: #fee2e2;
  color: #b91c1c;
}

.status-retry {
  background: #ffedd5;
  color: #c2410c;
}

.dashboard-lower {
  margin-top: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-hero {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 18px 20px;
  box-shadow: 0 7px 22px rgba(16, 42, 76, 0.08);
}

.dashboard-page-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-page-shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-page-shell > .page-header {
  flex: 0 0 auto;
  margin-bottom: 0;
}

.admin-page-shell > .stats {
  flex: 0 0 auto;
  gap: 12px;
  border: 0;
  background: transparent;
  overflow: visible;
}

.admin-page-shell > .stats .stat {
  min-height: 68px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 13px;
  box-shadow: 0 6px 18px rgba(16, 42, 76, 0.06);
}

.admin-page-shell > .stats .stat strong {
  margin-top: 3px;
  font-size: 22px;
}

.admin-page-shell > .admin-tools {
  flex: 1;
}

.admin-category-grid {
  display: grid;
  flex: 1;
  min-height: 0;
  grid-template-columns: 1fr;
  gap: 14px;
  align-content: start;
  overflow-y: auto;
  padding-bottom: 2px;
}

.admin-tool-section {
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.admin-tool-section .admin-tools {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: visible;
}

.admin-tool-section.employee-tools .admin-tools {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-tool-section.sensitive-tools {
  border: 0;
  background: transparent;
}

.admin-tool-section.sensitive-tools .admin-tools-heading h2 {
  color: #8f2525;
}

.admin-tools .sensitive-card {
  border-color: #eed2d2;
  box-shadow: inset 3px 0 0 #c84a4a;
}

.admin-tools .sensitive-card:hover {
  border-color: #daa8a8;
  background: #fff7f7;
}

.employees-page-shell > .panel {
  box-shadow: none;
}

.employee-threshold-row td {
  background: #fff5f5;
}

.employee-threshold-row td:first-child {
  box-shadow: inset 3px 0 0 #dc2626;
}

.threshold-warning {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  border: 1px solid #fecaca;
  border-radius: 7px;
  margin-bottom: 10px;
  background: #fff5f5;
  color: #991b1b;
  padding: 9px 10px;
}

.threshold-warning > div {
  display: grid;
  gap: 2px;
}

.modal.patrol-review-modal {
  width: min(860px, 100%);
}

.patrol-review-modal .modal-body {
  max-height: min(58vh, 520px);
  overflow-y: auto;
  overflow-x: auto;
}

.patrol-review-modal table {
  width: 100%;
  min-width: 650px;
  table-layout: fixed;
}

.patrol-review-table th:nth-child(1) {
  width: 20%;
}

.patrol-review-table th:nth-child(2) {
  width: 27%;
}

.patrol-review-table th:nth-child(3) {
  width: 23%;
}

.patrol-review-table th:nth-child(4) {
  width: 30%;
}

.patrol-review-hours {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.patrol-review-actions {
  flex-wrap: nowrap;
}

.patrol-review-actions .btn {
  white-space: nowrap;
}

.patrol-action-modal-backdrop {
  z-index: 35;
}

.modal.patrol-action-modal {
  width: min(500px, 100%);
}

.patrol-action-summary {
  display: grid;
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--line);
}

.patrol-action-summary > div {
  display: grid;
  grid-template-columns: 125px minmax(0, 1fr);
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
}

.patrol-action-summary dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.patrol-action-summary dd {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
}

.patrol-action-summary dd small {
  margin-left: 5px;
  color: var(--muted);
  font-weight: 500;
}

.patrol-exemption-reason {
  margin-top: 14px;
}

.patrol-action-warning {
  margin: 14px 0 0;
  border-left: 3px solid var(--red);
  background: #fff7f7;
  color: #8f2525;
  padding: 9px 11px;
}

.patrol-action-error {
  margin: 10px 0 0;
  border: 1px solid #fecaca;
  border-left: 3px solid var(--red);
  background: #fff1f2;
  color: #991b1b;
  padding: 9px 11px;
  font-size: 13px;
  font-weight: 700;
}

.button-count {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  margin-left: 5px;
  padding: 0 5px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 11px;
  line-height: 1;
}

.input-with-action {
  position: relative;
  display: block;
}

.input-with-action input {
  padding-right: 42px;
}

.input-action-btn {
  position: absolute;
  top: 50%;
  right: 5px;
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--blue);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
}

.input-action-btn:hover:not(:disabled) {
  color: var(--navy);
}

.input-action-btn:disabled {
  cursor: wait;
  opacity: 0.55;
}

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

.dashboard-eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.dashboard-identity h1 {
  margin-bottom: 4px;
  color: var(--navy);
  font-size: 28px;
}

.dashboard-identity > p {
  margin-bottom: 12px;
  color: var(--muted);
}

.dashboard-identity .badge {
  border-color: var(--line);
  background: #f8fafc;
  color: var(--ink);
}

.dashboard-identity .dot {
  box-shadow: 0 0 0 2px rgba(29, 122, 70, 0.12);
}

.dashboard-quick-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 8px;
  align-self: center;
}

.dashboard-quick-links a {
  display: grid;
  gap: 4px;
  min-width: 130px;
  border: 1px solid #cbd9e9;
  border-radius: 7px;
  background: #f5f8fc;
  color: var(--navy);
  padding: 10px 12px;
  transition: background-color 140ms ease, transform 140ms ease;
}

.dashboard-quick-links a:hover {
  border-color: #9db9dc;
  background: #eaf2fb;
  transform: translateY(-1px);
}

.dashboard-quick-links span {
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.dashboard-quick-links strong {
  white-space: nowrap;
}

.dashboard-hero-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 10px;
  align-self: center;
}

.dashboard-hero-metrics > div {
  display: grid;
  gap: 2px;
  min-width: 170px;
  border-left: 1px solid var(--line);
  padding: 5px 4px 5px 18px;
}

.dashboard-hero-metrics span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.dashboard-hero-metrics strong {
  color: var(--navy);
  font-size: 23px;
  font-variant-numeric: tabular-nums;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.dashboard-metric {
  display: grid;
  gap: 3px;
  padding: 13px 15px;
}

.dashboard-metric > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-metric strong {
  color: var(--navy);
  font-size: 23px;
  font-variant-numeric: tabular-nums;
}

.dashboard-main-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.65fr);
  gap: 12px;
  align-items: start;
  margin-top: 12px;
}

.dashboard-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.7fr);
  gap: 12px;
  flex: 1;
  min-height: 0;
}

.dashboard-side-stack {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
}

.dashboard-actions-panel,
.dashboard-workspace .dashboard-notices-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.dashboard-employee-list {
  display: grid;
  gap: 0;
  margin: 0;
}

.dashboard-employee-list > div {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 7px 0;
}

.dashboard-employee-list > div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.dashboard-employee-list dt {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-employee-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.dashboard-employee-list dd small {
  display: block;
  color: var(--muted);
  font-weight: 500;
}

.dashboard-status-text {
  font-weight: 800;
}

.dashboard-actions-panel > .action-required-list {
  min-height: 0;
  overflow: hidden;
  padding-right: 3px;
}

.dashboard-workspace .dashboard-notice-grid {
  min-height: 0;
  overflow-y: auto;
  padding-right: 3px;
}

.dashboard-actions-panel .section-heading p,
.dashboard-notices-panel .section-heading p {
  margin: 3px 0 0;
}

.dashboard-profile-list {
  display: grid;
  gap: 0;
  margin: 0;
}

.dashboard-profile-list > div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
}

.dashboard-profile-list > div:last-child {
  border-bottom: 0;
}

.dashboard-profile-list dt {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-profile-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.dashboard-profile-list dd small {
  display: block;
  color: var(--muted);
  font-weight: 500;
}

.dashboard-notices-panel {
  margin-top: 12px;
}

.dashboard-workspace .dashboard-notices-panel {
  margin-top: 0;
}

.dashboard-workspace .dashboard-notice-grid {
  grid-template-columns: 1fr;
}

.dashboard-notice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.dashboard-notice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 11px;
}

.dashboard-notice.urgent {
  border-color: #fecaca;
  background: #fff8f8;
}

.dashboard-notice p {
  margin: 4px 0;
}

.dashboard-empty-state {
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px dashed #cbd5e1;
  border-radius: 7px;
  background: #f8fafc;
  padding: 14px;
}

.dashboard-empty-state > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-weight: 900;
}

.dashboard-empty-state p {
  margin: 3px 0 0;
}

.rank-row {
  cursor: grab;
}

.compact-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 10px;
  padding: 10px;
}

.compact-controls label {
  min-width: 180px;
}

.activity-controls {
  justify-content: flex-start;
}

.activity-controls label {
  min-width: 0;
  width: 180px;
}

.activity-controls .activity-search-label {
  width: min(260px, 100%);
}

.activity-table-panel {
  margin-top: 12px;
}

.activity-table {
  min-width: 780px;
}

.activity-table th:first-child {
  width: 17%;
}

.activity-table th:nth-child(2) {
  width: 15%;
}

.activity-table th:nth-child(3) {
  width: 17%;
}

.activity-table th:nth-child(4) {
  width: 12%;
}

.activity-time {
  font-variant-numeric: tabular-nums;
}

.activity-progress {
  display: grid;
  gap: 6px;
  max-width: 150px;
  font-variant-numeric: tabular-nums;
}

.activity-progress .progress-bar {
  height: 5px;
}

.card {
  padding: 13px;
}

.embedded-panel {
  padding: 13px;
}

.progress-inline {
  display: grid;
  gap: 6px;
  min-width: 90px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #1c4f91;
}

.chat-shell {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
  min-height: 0;
}

.chat-header {
  display: grid;
  gap: 2px;
  padding-bottom: 8px;
  border-bottom: 1px solid #dbe4ef;
}

.chat-messages {
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  padding: 2px 4px 2px 0;
}

.chat-bubble-row {
  display: flex;
}

.chat-bubble-row.own {
  justify-content: flex-end;
}

.chat-bubble-row.other {
  justify-content: flex-start;
}

.chat-message {
  display: grid;
  gap: 4px;
  max-width: min(78%, 560px);
  border: 1px solid #d8e2ef;
  border-radius: 12px;
  background: #ffffff;
  padding: 8px 10px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.chat-message.other {
  background: #ffffff;
}

.chat-message.own {
  background: #eaf2fb;
  border-color: #bfd3ec;
}

.chat-message-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chat-message p {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding-top: 2px;
}

.chat-form input {
  height: 36px;
  min-height: 36px;
  padding: 7px 10px;
}

.chat-send-error {
  grid-column: 1 / -1;
  color: var(--red);
}

.chat-bubble-row.pending {
  opacity: 0.68;
}

.floating-chat-root {
  position: fixed;
  right: 22px;
  bottom: 20px;
  z-index: 40;
}

.floating-chat-launcher {
  position: relative;
  display: grid;
  width: 50px;
  height: 50px;
  margin-left: auto;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 8px 22px rgba(16, 42, 76, 0.22);
  cursor: pointer;
}

.floating-chat-launcher.has-unread::after {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 11px;
  height: 11px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #dc2626;
  content: '';
}

.floating-chat-launcher svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.floating-chat-root.is-open .floating-chat-launcher {
  display: none;
}

.floating-chat-panel {
  width: min(440px, calc(100vw - 28px));
  height: min(520px, calc(100vh - 110px));
  margin-bottom: 10px;
  overflow: hidden;
  border: 1px solid #cbd7e6;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(15, 30, 50, 0.22);
}

.floating-chat-panel[hidden] {
  display: none;
}

.floating-chat-header {
  display: flex;
  height: 58px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #dbe4ef;
  background: #fff;
  padding: 9px 12px 9px 14px;
}

.floating-chat-header > div {
  display: grid;
  gap: 1px;
}

.floating-chat-header small {
  color: var(--muted);
}

.floating-chat-header button {
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 24px;
  cursor: pointer;
}

.floating-chat-body {
  display: grid;
  height: calc(100% - 58px);
  grid-template-columns: 126px minmax(0, 1fr);
}

.floating-chat-contacts {
  overflow-y: auto;
  border-right: 1px solid #dbe4ef;
  background: #f8fafc;
  padding: 6px;
}

.floating-chat-contacts button {
  position: relative;
  display: grid;
  width: 100%;
  gap: 2px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  padding: 9px 8px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.floating-chat-contacts button.has-unread::after {
  position: absolute;
  top: 10px;
  right: 7px;
  width: 8px;
  height: 8px;
  border: 1px solid #fff;
  border-radius: 50%;
  background: #dc2626;
  content: '';
}

.floating-chat-contacts button.has-unread span,
.floating-chat-contacts button.has-unread small {
  padding-right: 12px;
}

.floating-chat-contacts button.active {
  background: #e6effa;
  color: var(--navy);
}

.floating-chat-contacts span {
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.floating-chat-contacts small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.floating-chat-conversation,
.floating-chat-mount {
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.floating-chat-panel .chat-shell {
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border: 0;
  border-radius: 0;
  background: #f3f6fa;
  padding: 9px;
}

.floating-chat-panel .chat-messages {
  max-height: none;
}

.floating-chat-panel .chat-message {
  max-width: 82%;
  border-radius: 13px;
  padding: 7px 9px;
}

.floating-chat-panel .chat-message.own {
  border-color: #b8d1ec;
  background: #dcecff;
}

.floating-chat-panel .chat-message-meta .badge {
  display: none;
}

.floating-chat-panel .chat-form input {
  min-width: 0;
  background: #fff;
}

.success-toast {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 60;
  display: flex;
  min-width: 280px;
  max-width: calc(100vw - 32px);
  align-items: center;
  gap: 10px;
  border: 1px solid #a7d8b8;
  border-radius: 8px;
  background: #f2fbf5;
  color: #14532d;
  padding: 11px 13px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.success-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.success-toast > span {
  display: grid;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: #d8f3df;
  font-weight: 900;
}

.success-toast > div {
  display: grid;
  gap: 1px;
}

.success-toast small {
  color: #39724d;
}

.submission-view-label {
  display: block;
  margin-bottom: 5px;
}

.submission-stage-control {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.submission-stage-control select {
  width: auto;
  min-width: 150px;
  background: #fff;
}

.submission-assignment-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px 14px;
}

.submission-assignment-bar label {
  min-width: min(320px, 100%);
}

.response-filters {
  margin-bottom: 14px;
}

.response-list-heading {
  align-items: end;
}

.response-list-heading input {
  width: min(280px, 100%);
}

.response-summary {
  display: block;
  margin-top: 2px;
  font-size: 13px;
}

.settings-test-actions,
.settings-save-row {
  margin-top: 14px;
}

.settings-save-row {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}

.response-filters label:first-child {
  width: min(340px, 100%);
}

.closed-stage-list {
  display: grid;
  gap: 7px;
}

.form-danger-zone {
  border-top-color: #fecaca;
}

.submission-notes-panel {
  margin-top: 14px;
  padding: 14px;
}

.submission-notes-panel .section-heading p {
  margin: 2px 0 0;
}

.submission-note-list {
  max-height: 260px;
  overflow-y: auto;
  padding-right: 3px;
}

.submission-note-list .compact-row {
  padding: 9px 10px;
}

.submission-note-list p {
  margin: 0;
}

.submission-note-form {
  margin-top: 10px;
}

.cohort-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.training-manager-heading {
  margin-bottom: 14px;
}

.training-page-heading {
  margin-bottom: 14px;
}

.record-count {
  display: inline-grid;
  min-width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.training-browser {
  padding: 0;
  overflow: hidden;
}

.training-browser-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
}

.training-browser-toolbar input {
  width: min(360px, 100%);
}

.training-browser-toolbar select {
  width: 180px;
}

.training-browser-toolbar .record-count {
  margin-left: auto;
}

.training-record-list {
  display: grid;
}

.training-record-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 22px;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  border-bottom: 1px solid var(--line);
  padding: 10px 14px;
  background: #fff;
  color: var(--ink);
}

.training-record-row:last-child {
  border-bottom: 0;
}

a.training-record-row,
.training-record-link {
  transition: background-color 120ms ease, box-shadow 120ms ease;
}

a.training-record-row:hover,
a.training-record-row:focus-visible,
.training-record-link:hover,
.training-record-link:focus-visible {
  background: #f5f8fc;
  box-shadow: inset 3px 0 0 var(--blue);
  outline: 0;
}

.training-record-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.training-record-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.training-record-main small,
.training-record-meta small,
.training-record-summary small,
.training-outcome-row small,
.training-note small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.training-record-meta {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.training-row-arrow {
  color: #8a99ad;
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
}

.training-manager-row {
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 0;
}

.training-record-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 22px;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 10px 14px;
}

.training-row-edit {
  margin-right: 12px;
}

.training-list-section + .training-list-section {
  border-top: 8px solid var(--bg);
}

.training-list-label {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  padding: 8px 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.training-empty {
  display: grid;
  justify-items: start;
  gap: 3px;
  padding: 24px 14px;
  color: var(--muted);
}

.training-empty strong {
  color: var(--ink);
}

.training-edit-footer .modal-footer-spacer {
  flex: 1;
}

.training-edit-footer .btn[hidden] {
  display: none;
}

.training-roster .training-record-row {
  grid-template-columns: minmax(190px, 1fr) minmax(140px, 240px) auto auto;
}

.training-roster-progress {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) 76px;
  align-items: center;
  gap: 8px;
}

.training-roster-progress small {
  color: var(--muted);
}

.training-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.employee-picker-modal {
  width: min(540px, 100%);
}

.employee-picker-modal .modal-body {
  min-height: 116px;
}

.compact-confirm-modal {
  width: min(460px, 100%);
}

.training-actions-modal {
  width: min(660px, 100%);
}

.training-record-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.training-record-summary > div:first-child {
  display: grid;
  gap: 3px;
}

.training-record-summary .progress-inline {
  grid-column: 1 / -1;
  max-width: none;
}

.training-outcome-list {
  display: grid;
  margin-top: 4px;
}

.training-outcome-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.training-outcome-row > span {
  display: grid;
  gap: 2px;
}

.training-course-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, .8fr);
  gap: 14px;
  align-items: start;
}

.training-workspace-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
  align-items: start;
}

.training-workspace-sidebar {
  display: grid;
  gap: 14px;
}

.training-cohort-overview,
.training-cohort-staff {
  padding: 14px;
}

.training-cohort-description {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.45;
}

.training-staff-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.training-staff-list > span {
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
  font-weight: 600;
}

.training-staff-list > span:last-child {
  border-bottom: 0;
}

.training-progress-panel,
.training-course-summary,
.training-notes-panel {
  padding: 14px;
}

.training-progress-panel .progress-inline {
  width: 230px;
  margin-top: 8px;
}

.training-task-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.training-task-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 100px;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  border-bottom: 1px solid var(--line);
}

.training-task-code {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.training-task-state {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.training-task-state b {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: #eef2f7;
}

.training-task-state.pill-pass b { background: #dcfce7; color: var(--green); }
.training-task-state.pill-fail b { background: #fee2e2; color: var(--red); }
.training-task-state.pill-retry b { background: #ffedd5; color: #c2410c; }

.training-course-sidebar {
  display: grid;
  gap: 14px;
}

.training-course-summary {
  display: grid;
}

.training-summary-row {
  display: grid;
  grid-template-columns: 105px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.training-summary-row:first-child { padding-top: 0; }
.training-summary-row:last-child { border-bottom: 0; padding-bottom: 0; }
.training-summary-row > span:first-child { color: var(--muted); }
.training-summary-row strong { font-size: 13px; }

.training-note-list {
  display: grid;
}

.training-note {
  border-top: 1px solid var(--line);
  padding: 10px 0;
}

.training-note p {
  margin: 0 0 5px;
}

@media (max-width: 900px) {
  .training-course-layout,
  .training-workspace-layout {
    grid-template-columns: 1fr;
  }

  .training-roster .training-record-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .training-roster-progress {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (max-width: 640px) {
  .training-browser-toolbar {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .training-browser-toolbar input,
  .training-browser-toolbar select {
    width: 100%;
    max-width: none;
  }

  .training-browser-toolbar .record-count {
    margin-left: 0;
  }

  .training-record-row,
  .training-record-link {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .training-record-meta,
  .training-row-arrow {
    display: none;
  }

  .training-manager-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .training-record-link .badge {
    display: none;
  }

  .training-roster .training-record-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .training-row-actions {
    grid-column: 1 / -1;
  }

  .training-outcome-row,
  .training-task-row {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .training-outcome-row select,
  .training-task-state {
    grid-column: 2;
  }
}

.cohort-search,
.cohort-filter {
  width: auto;
  min-width: 0;
}

.cohort-search {
  min-width: 220px;
  max-width: 360px;
  padding: 8px 10px;
}

.cohort-filter {
  min-width: 150px;
  padding: 8px 10px;
}

.btn.subtle-remove {
  min-height: 30px;
  width: 30px;
  padding: 0;
  opacity: 0.45;
  border-color: #f3d0d0;
  color: var(--red);
  transition: opacity 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

.btn.subtle-remove:hover:not(:disabled) {
  opacity: 1;
  background: #fff1f2;
  border-color: #fecaca;
}

tr.clickable {
  cursor: pointer;
  transition: background-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

tr.clickable:hover,
tr.clickable:focus,
tr.clickable.row-active {
  background: #eaf2fb;
  box-shadow: inset 4px 0 0 var(--blue);
  outline: none;
}

tr.clickable:hover td,
tr.clickable:focus td,
tr.clickable.row-active td {
  border-bottom-color: #bfd0e6;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  background: rgba(15, 23, 42, 0.36);
}

.drawer-backdrop.open {
  display: block;
}

.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 21;
  width: min(660px, 100%);
  transform: translateX(100%);
  transition: transform 180ms ease;
  border-left: 1px solid var(--line);
  background: #fff;
  box-shadow: -20px 0 40px rgba(15, 23, 42, 0.18);
  overflow-y: auto;
}

.drawer.open {
  transform: translateX(0);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.42);
}

.modal-backdrop.open {
  display: grid;
}

.modal {
  width: min(560px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

.modal-header,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.modal-footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  justify-content: flex-end;
}

.modal-body {
  padding: 14px;
}

.drawer-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 14px;
}

.drawer-body {
  padding: 14px;
}

.drawer-issue-form {
  margin-bottom: 14px;
}

.drawer-issue-form h2 {
  margin-bottom: 0;
}

.disciplinary-history {
  display: grid;
  gap: 8px;
}

.compact-heading {
  margin: 4px 0 6px;
}

.disciplinary-record-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 10px 12px;
}

.disciplinary-record-row.revoked {
  background: #f8fafc;
}

.disciplinary-record-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.disciplinary-record-main p {
  margin: 0 0 5px;
}

.disciplinary-record-side {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.tab {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 6px 10px;
  cursor: pointer;
  font-weight: 800;
  min-height: 30px;
  font-size: 13px;
}

.tab.active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.detail-list {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-list div {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
}

.tab-alert-dot,
.investigation-marker {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #d97706;
}

.tab.active .tab-alert-dot {
  background: #fde68a;
}

.investigation-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  background: #fffaf3;
  padding: 9px 10px;
}

.investigation-indicator > div:first-child {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 2px 7px;
}

.investigation-indicator small {
  grid-column: 2;
  color: var(--muted);
}

.compact-btn {
  min-height: 30px;
  padding: 4px 9px;
  font-size: 12px;
}

.restricted-badge {
  color: var(--muted);
  white-space: nowrap;
}

.swatch {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  vertical-align: middle;
}

.actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.color-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.timer {
  font-size: 48px;
  font-weight: 900;
  color: var(--navy);
}

.notice {
  border: 1px solid #bfd0e6;
  border-radius: 6px;
  background: #eaf2fb;
  color: var(--navy);
  padding: 10px 12px;
}

.notice.error {
  border-color: #fecaca;
  background: #fff1f2;
  color: var(--red);
}

.notice-list,
.audit-list {
  display: grid;
  gap: 10px;
}

.action-required-list {
  display: grid;
  gap: 8px;
}

.action-required-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 10px 12px;
}

.action-required-row[hidden] {
  display: none;
}

.action-required-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.action-required-main strong,
.action-required-main small {
  min-width: 0;
}

.action-marker {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 9px;
}

.action-marker.danger {
  background: #dc2626;
}

.action-marker.warning {
  background: #d97706;
}

.action-marker.normal {
  background: #2563eb;
}

.action-required-row.danger {
  border-color: #fecaca;
  background: #fff7f7;
}

.action-required-row.warning {
  border-color: #fed7aa;
  background: #fffaf3;
}

.notice-card,
.audit-row {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 10px 12px;
  overflow-wrap: anywhere;
}

.notice-card p,
.compact-row p,
.compact-row span,
.compact-row small {
  overflow-wrap: anywhere;
}

.notice-card.urgent {
  border-color: #fecaca;
  background: #fff1f2;
}

.audit-row div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.audit-row p {
  margin: 5px 0;
  overflow-wrap: anywhere;
}

.notice-stack,
.active-duty-popup {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 36px));
}

.notice-popup,
.active-duty-popup {
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff1f2;
  color: var(--ink);
  padding: 14px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
}

.notice-popup p,
.active-duty-popup p {
  margin: 8px 0 12px;
}

.active-duty-popup.urgent {
  border-color: #fca5a5;
  background: #fff1f2;
  box-shadow: 0 18px 48px rgba(127, 29, 29, 0.24);
}

.active-duty-popup.urgent strong {
  color: #991b1b;
}

.active-duty-popup.urgent .btn.danger {
  min-width: 132px;
  background: #dc2626;
  color: #fff;
}

.active-duty-popup.urgent .btn.danger:hover:not(:disabled) {
  background: #b91c1c;
}

@keyframes shiftHeaderPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.16);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(220, 38, 38, 0.04);
  }
}

@media (max-width: 860px) {
  .discord-save-all-bar {
    left: 16px;
    right: 16px;
    width: auto;
    transform: none;
  }

  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .sidebar > .nav:not(.nav-admin) {
    flex: none;
    overflow: visible;
  }

  .site-disclaimer {
    margin-top: 16px;
  }

  .floating-chat-root {
    right: 12px;
    bottom: 12px;
  }

  .floating-chat-panel {
    width: calc(100vw - 24px);
    height: min(560px, calc(100vh - 84px));
  }

  .floating-chat-body {
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .stats,
  .form-grid,
  .compact-form {
    grid-template-columns: 1fr;
  }

  .page-intro,
  .dashboard-grid,
  .dashboard-split,
  .role-editor,
  .ia-layout,
  .ia-header-grid {
    grid-template-columns: 1fr;
  }

  .ia-top-meta,
  .ia-entry-row {
    grid-template-columns: 1fr;
  }

  .ia-details-inline {
    display: grid;
    grid-template-columns: 1fr;
  }

  .ia-details-item {
    flex-wrap: wrap;
  }

  .ia-entry-side {
    justify-items: start;
  }

  body.workspace-locked,
  body.workspace-locked .shell,
  body.workspace-locked .shell > div,
  body.workspace-locked .content,
  .ia-page-shell,
  .ia-layout,
  .ia-column-scroll,
  .ia-list-scroll {
    overflow: visible;
    height: auto;
    max-height: none;
  }

  .ia-search-results {
    position: static;
    margin-top: 6px;
  }

  .page-intro {
    display: grid;
  }

  .span-3-cols,
  .span-4-cols,
  .span-6-cols,
  .span-8-cols,
  .span-12-cols {
    grid-column: span 1;
  }

  .disciplinary-record-row {
    grid-template-columns: 1fr;
  }

  .disciplinary-record-side {
    justify-items: start;
  }

  .investigation-indicator {
    align-items: flex-start;
    flex-direction: column;
  }

  .ia-subject-chat {
    max-height: none;
  }

  .dashboard-hero,
  .dashboard-main-layout,
  .dashboard-workspace {
    display: grid;
    grid-template-columns: 1fr;
  }

  .dashboard-quick-links,
  .dashboard-metrics,
  .dashboard-notice-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-quick-links {
    width: 100%;
  }

  .dashboard-hero-metrics {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-hero-metrics > div {
    min-width: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 10px 0 0;
  }

  .dashboard-actions-panel,
  .dashboard-workspace .dashboard-notices-panel {
    overflow: visible;
  }

  .dashboard-side-stack {
    grid-template-rows: auto auto;
  }

  .admin-tools {
    grid-template-columns: 1fr;
  }

  .admin-category-grid {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .admin-tool-section.employee-tools {
    grid-column: auto;
  }

  .admin-tool-section .admin-tools,
  .admin-tool-section.employee-tools .admin-tools {
    grid-template-columns: 1fr;
  }
}

.forms-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.6fr);
  gap: 16px;
  align-items: start;
}

.forms-section {
  min-width: 0;
  padding: 0;
  overflow: hidden;
}

.forms-side-column {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.forms-section > .section-heading {
  margin: 0;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  padding: 11px 14px;
}

.section-count {
  min-width: 20px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.forms-section-empty {
  margin: 0;
  padding: 16px 14px;
}

.public-forms-breadcrumb {
  border-top: 0;
  background: #fff;
}

.forms-public-list {
  display: grid;
}

.forms-public-list .forms-file-row {
  color: var(--ink);
}

.forms-public-list .forms-file-main > span:last-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.forms-public-list .forms-file-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forms-row-arrow {
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
}

.form-catalog,
.form-admin-list {
  display: grid;
  gap: 0;
}

.form-catalog {
  display: grid;
  gap: 10px;
}

.form-catalog-card,
.form-admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.form-catalog-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(16, 42, 76, 0.05);
  transition: none;
  padding: 13px 14px;
}

.form-catalog-card:hover {
  border-color: var(--line);
  box-shadow: 0 5px 16px rgba(16, 42, 76, 0.05);
  transform: none;
}

.form-catalog-card h3,
.form-catalog-card p {
  margin-bottom: 4px;
}

.submissions-list {
  gap: 0;
}

.submissions-list .compact-row {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 11px 14px;
}

.submissions-list .compact-row:last-child {
  border-bottom: 0;
}

.submission-summary {
  display: grid;
  gap: 5px;
}

.submission-summary-top {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.submission-summary-top strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.submission-status-badge {
  flex: 0 0 auto;
  max-width: 145px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-admin-row {
  border-bottom: 1px solid var(--line);
  padding: 10px 2px;
}

.form-admin-row:last-child {
  border-bottom: 0;
}

.form-submissions-panel {
  margin-top: 14px;
}

.forms-explorer {
  padding: 0;
  overflow: hidden;
}

.forms-breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  padding: 10px 14px;
  color: var(--muted);
  font-size: 13px;
}

.forms-breadcrumb a {
  color: var(--blue);
  font-weight: 700;
}

.forms-explorer-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.forms-file-list {
  display: grid;
}

.forms-file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 64px;
  border-bottom: 1px solid var(--line);
  padding: 9px 14px;
}

.forms-file-row:last-child {
  border-bottom: 0;
}

.forms-file-row:hover {
  background: #f8fafc;
}

.forms-file-main {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.forms-file-main > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.forms-file-icon {
  position: relative;
  display: inline-block;
  flex: 0 0 28px;
  width: 28px;
  height: 24px;
  border-radius: 4px;
}

.folder-icon {
  height: 22px;
  margin-top: 3px;
  border: 1px solid #d29a1d;
  border-radius: 4px 5px 5px 5px;
  background: linear-gradient(180deg, #f5ca55 0%, #e6ad27 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58), 0 1px 2px rgba(91, 62, 10, 0.16);
}

.folder-icon::before {
  content: "";
  position: absolute;
  top: -5px;
  left: -1px;
  width: 13px;
  height: 7px;
  border: 1px solid #d29a1d;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  background: #efbd43;
}

.folder-icon::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 3px;
  right: 3px;
  height: 1px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.48);
}

.form-icon {
  flex-basis: 22px;
  width: 22px;
  height: 27px;
  margin: 0 3px;
  border: 1.5px solid #7896b8;
  border-radius: 3px;
  background: #fff;
}

.form-icon::before {
  content: "";
  position: absolute;
  top: -1.5px;
  right: -1.5px;
  width: 8px;
  height: 8px;
  border-radius: 0 3px 0 0;
  background: linear-gradient(45deg, #edf4fc 0 46%, #7896b8 47% 56%, #fff 57%);
}

.form-icon::after {
  content: "";
  position: absolute;
  top: 11px;
  left: 4px;
  width: 12px;
  height: 1.5px;
  border-radius: 2px;
  background: #7896b8;
  box-shadow: 0 4px 0 #9bb2ca, 0 8px 0 #9bb2ca;
}

.forms-explorer-empty {
  padding: 34px 18px;
  text-align: center;
}

.forms-explorer-empty p {
  margin: 5px 0 0;
}

.form-document-shell {
  width: min(780px, 100%);
  margin: 0 auto;
}

.form-document {
  display: grid;
  gap: 12px;
}

.form-question {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 5px 18px rgba(16, 42, 76, 0.06);
}

.form-question-label {
  color: var(--ink);
  font-size: 15px;
}

.form-question-label b {
  margin-left: 4px;
  color: var(--red);
}

.form-question label > small {
  font-weight: 500;
}

.form-document-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line);
  background: rgba(245, 247, 251, 0.96);
  padding: 12px 0;
}

.form-checkbox,
.inline-check {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
}

.form-checkbox input,
.inline-check input {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.readonly-form input:disabled,
.readonly-form select:disabled,
.readonly-form textarea:disabled {
  opacity: 1;
  background: #f8fafc;
  color: var(--ink);
}

.form-builder-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.form-builder-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}

.form-builder-canvas,
#builderFields {
  display: grid;
  gap: 12px;
}

.form-builder-title-card {
  border-top: 5px solid var(--blue);
}

.form-title-input {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 6px 2px 10px;
  font-size: 25px;
  font-weight: 800;
}

.form-builder-title-card textarea {
  min-height: 66px;
  margin-top: 8px;
}

.form-builder-field {
  border-left: 4px solid transparent;
}

.form-builder-field:focus-within {
  border-left-color: var(--blue);
}

.form-builder-field-top,
.form-builder-field-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.form-builder-field-top select {
  width: 190px;
}

.builder-drag-handle {
  color: var(--muted);
  font-weight: 900;
  letter-spacing: -2px;
}

.builder-question-input {
  margin: 10px 0 8px;
  font-weight: 800;
}

.form-builder-field-footer {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.form-builder-add {
  display: flex;
  justify-content: center;
}

.form-builder-settings {
  position: sticky;
  top: 68px;
  display: grid;
  gap: 14px;
}

.audience-section {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.audience-section h3,
.audience-section p {
  margin-bottom: 0;
}

@media (max-width: 860px) {
  .forms-page-grid,
  .form-builder-layout {
    grid-template-columns: 1fr;
  }

  .form-builder-settings {
    position: static;
  }

  .form-catalog-card,
  .form-admin-row,
  .form-builder-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .forms-file-row {
    grid-template-columns: 1fr;
  }

  .forms-file-row > .actions {
    padding-left: 39px;
    flex-wrap: wrap;
  }
}
