:root {
  --ink: #172033;
  --muted: #667085;
  --line: #ddd7f1;
  --soft: #f8f6ff;
  --panel: #ffffff;
  --primary: #7567db;
  --primary-dark: #4f3fb7;
  --primary-soft: #eeeafd;
  --blue: #7567db;
  --teal: #087f83;
  --green: #15803d;
  --amber: #b7791f;
  --red: #c24135;
  --violet: #7567db;
  --shadow: 0 14px 38px rgba(61, 45, 137, 0.1);
}

* {
  box-sizing: border-box;
}

/* This interface intentionally uses no motion effects. All hover and focus
   feedback must be immediate color, border, or outline changes only. */
*,
*::before,
*::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background: #f3f0fb;
  font-family: "Segoe UI", Arial, sans-serif;
}

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

button {
  cursor: pointer;
}

.is-hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(117, 103, 219, 0.16), transparent 34%),
    linear-gradient(145deg, #f8f6ff 0%, #ffffff 58%, #eeeafd 100%);
}

.login-card {
  width: min(440px, 100%);
  display: grid;
  gap: 14px;
  padding: 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-logo {
  width: 92px;
  height: 92px;
  object-fit: contain;
}

.login-copy {
  margin-bottom: 0;
  color: var(--muted);
}

.login-error {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
}

.login-options,
.inline-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.inline-check {
  justify-content: flex-start;
  color: var(--ink);
  font-size: 13px;
}

.inline-check input {
  width: auto;
}

.password-criteria {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.password-criteria.is-valid {
  color: #177245;
  font-weight: 700;
}

.password-criteria.is-invalid {
  color: var(--red);
}

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

.demo-users button {
  border: 1px solid var(--line);
  border-radius: 7px;
  min-height: 36px;
  background: var(--soft);
  color: var(--ink);
}

.app-shell {
  display: grid;
  grid-template-columns: clamp(220px, 18vw, 260px) minmax(0, 1fr);
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.sidebar {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: #21164c;
  color: #f8fafc;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mobile-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mobile-header-actions,
.mobile-footer {
  display: none;
}

.sidebar-menu {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
}

.mobile-menu-toggle {
  width: 42px;
  min-height: 38px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 7px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  font-size: 21px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.brand:focus-visible {
  border-radius: 8px;
  outline: 2px solid #fff;
  outline-offset: 4px;
}

.brand-logo {
  width: 54px;
  height: 54px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  padding: 5px;
}

.brand strong,
.brand span {
  display: block;
}

.brand span,
.signed-in-card span,
.signed-in-card small {
  color: #d8d3ff;
  font-size: 12px;
}

.signed-in-card {
  flex: 0 0 auto;
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.logout-button {
  flex: 0 0 auto;
  margin-top: auto;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.logout-button:hover {
  background: rgba(255, 255, 255, 0.16);
}

.role-switcher {
  display: grid;
  gap: 6px;
}

.role-switcher select,
.search-box input,
.detail-actions select,
label input,
label select,
label textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 11px;
  background: #fff;
  color: var(--ink);
}

.role-switcher select {
  background: #3b2c79;
  border-color: #5b4ab5;
  color: #fff;
}

.nav {
  display: grid;
  min-height: 0;
  overflow-y: auto;
  gap: 6px;
  padding-right: 2px;
}

.nav button {
  min-height: 42px;
  text-align: left;
  border: 0;
  border-radius: 7px;
  color: #d7dee8;
  background: transparent;
  padding: 0 12px;
}

.nav button.active,
.nav button:hover {
  color: #fff;
  background: #4f3fb7;
}

.workspace {
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px;
  min-width: 0;
  width: 100%;
  max-width: 100vw;
}

.topbar,
.panel-heading,
.toolbar,
.dialog-heading,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-heading,
.dialog-actions {
  flex-wrap: wrap;
}

.dialog-actions > button,
.detail-actions > button,
.person-card-actions > button {
  max-width: 100%;
}

.topbar {
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 28px;
}

h2 {
  margin-bottom: 0;
  font-size: 17px;
}

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

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

.asset-actions .compact-search {
  flex: 0 1 270px;
}

.asset-actions .compact-select {
  flex: 0 0 auto;
  min-width: max-content;
  white-space: nowrap;
}

.asset-actions > button {
  flex: 0 0 auto;
  white-space: nowrap;
}

#downloadAssets {
  order: 10;
}

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

.people-actions .compact-search {
  flex: 0 1 280px;
}

.people-actions .compact-select,
.people-actions > button {
  flex: 0 0 auto;
}

.knowledge-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
}

.compact-search {
  width: min(280px, 100%);
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
}

.keyword-search {
  position: relative;
}

.keyword-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 42;
  display: grid;
  gap: 4px;
  width: min(280px, calc(100vw - 48px));
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 16px 30px rgba(61, 45, 137, 0.16);
}

.keyword-suggestions button {
  border: 0;
  border-radius: 6px;
  padding: 9px 10px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.keyword-suggestions button:hover,
.keyword-suggestions button:focus-visible {
  background: var(--primary-soft);
}

.assignment-control {
  min-width: min(100%, 260px);
}

.primary-action,
.secondary-action,
.quiet-action,
.danger-action,
.text-action,
.icon-button,
.notification-bell,
.segmented button {
  border: 0;
  border-radius: 7px;
  min-height: 38px;
  padding: 0 14px;
  white-space: nowrap;
  box-shadow: 0 6px 14px rgba(61, 45, 137, 0.12);
}

.primary-action {
  background: var(--primary);
  color: #fff;
}

.secondary-action {
  background: var(--primary-soft);
  color: #3f3291;
}

.compact-assignment-action {
  align-self: flex-end;
  height: 38px;
  min-height: 38px;
  padding: 0 14px;
}

.quiet-action {
  background: #e8edf2;
  color: #273548;
}

.danger-action {
  background: #fee2e2;
  color: var(--red);
}

.text-action {
  background: transparent;
  color: var(--primary-dark);
  padding: 0;
  box-shadow: none;
}

.icon-button {
  width: 34px;
  padding: 0;
  background: #eef2f6;
}

.notification-wrap {
  position: relative;
}

.notification-bell {
  position: relative;
  width: 42px;
  padding: 0;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--primary-dark);
}

.notification-count {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  line-height: 1;
}

.notification-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  width: min(340px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 54px rgba(33, 22, 76, 0.18);
}

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

.notification-heading span,
.notification-item span,
.notification-empty {
  color: var(--muted);
  font-size: 12px;
}

.notification-list {
  display: grid;
  max-height: 360px;
  overflow: auto;
}

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

.notification-item:hover,
.notification-item:focus-visible {
  background: var(--primary-soft);
  outline: none;
}

.notification-empty {
  padding: 14px;
}

.view {
  display: none;
}

.active-view {
  display: block;
}

.page-overview,
.metric-dropdown {
  display: contents;
}

.metric-toggle,
#assetClock {
  display: none;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.metric-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 16px;
  border-left: 5px solid var(--primary);
}

.metric-card strong {
  display: block;
  font-size: 28px;
  margin-bottom: 2px;
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
}

.dashboard-layout,
.knowledge-layout,
.settings-grid,
.backend-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.knowledge-layout {
  margin-top: 14px;
  align-items: stretch;
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.15fr);
  height: min(640px, calc(100dvh - 220px));
  min-height: 420px;
}

.knowledge-topic-list,
.knowledge-detail {
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.knowledge-topic-list {
  margin-top: 0;
  align-content: start;
}

.knowledge-topic {
  width: 100%;
  color: inherit;
  text-align: left;
  cursor: pointer;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.knowledge-topic-main {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.knowledge-accordion-content {
  display: none;
}

.article-action-menu {
  position: relative;
}

.article-action-menu summary {
  cursor: pointer;
  list-style: none;
  padding: 2px 8px;
  font-size: 20px;
}

.article-action-list {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 40;
  display: grid;
  min-width: 140px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(61, 45, 137, 0.18);
}

.article-action-list button {
  border: 0;
  padding: 9px 10px;
  background: transparent;
  text-align: left;
}

.archived-article {
  background: #f7f5fb;
  opacity: 0.82;
}

.knowledge-topic.selected-topic {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 10px 20px rgba(61, 45, 137, 0.12);
}

.knowledge-detail {
  display: grid;
  align-content: start;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 16px;
  background: #fff;
}

.knowledge-detail h2 {
  margin: 10px 0 4px;
}

.knowledge-content {
  display: grid;
  gap: 10px;
  line-height: 1.6;
}

.knowledge-content p {
  margin: 0;
}

.operations-summary-panel {
  margin-top: 14px;
}

.operations-summary-list {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.backend-layout {
  align-items: start;
}

.backend-layout > .panel {
  max-height: min(720px, calc(100dvh - 340px));
}

.backend-layout > .panel:first-child {
  display: flex;
  flex-direction: column;
}

.dashboard-clock {
  margin-bottom: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--primary);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.dashboard-clock strong {
  display: block;
  font-size: 28px;
  line-height: 1.1;
}

.dashboard-clock span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.panel {
  padding: 16px;
  min-width: 0;
  overflow-wrap: anywhere;
}

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

.ticket-list-layout,
.ticket-list-panel {
  width: 100%;
  min-width: 0;
}

.ticket-list-panel {
  overflow: hidden;
}

.ticket-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.ticket-table th:first-child,
.ticket-table td:first-child {
  width: 26%;
}

.ticket-list-title {
  display: block;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
}

.ticket-list-identity {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
}

.ticket-list-identity > div {
  min-width: 0;
}

.ticket-state-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
}

.ticket-state-dot.active {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(26, 143, 73, 0.12);
}

.ticket-state-dot.inactive {
  background: #9aa3b2;
}

.ticket-list-id,
.ticket-detail-id {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.ticket-list-date {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.3;
}

.ticket-table th:nth-child(2),
.ticket-table td:nth-child(2),
.ticket-table th:nth-child(5),
.ticket-table td:nth-child(5) {
  width: 14%;
}

.ticket-table th:nth-child(3),
.ticket-table td:nth-child(3),
.ticket-table th:nth-child(4),
.ticket-table td:nth-child(4),
.ticket-table th:nth-child(7),
.ticket-table td:nth-child(7) {
  width: 10%;
}

.ticket-table th:nth-child(6),
.ticket-table td:nth-child(6) {
  width: 16%;
}

.ticket-table td {
  overflow-wrap: anywhere;
}

.ticket-table tbody tr:hover,
.ticket-table tbody tr:focus-visible,
.ticket-table tbody tr.selected {
  background: var(--primary-soft);
  outline: none;
}

.ticket-detail-layer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(560px, min(900px, 52vw));
}

.ticket-detail-backdrop {
  border: 0;
  background: rgba(23, 32, 51, 0.42);
  cursor: default;
}

.ticket-detail-drawer {
  min-width: 0;
  padding: 22px;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: #fff;
  box-shadow: -20px 0 44px rgba(33, 22, 76, 0.2);
}

.asset-table-wrap {
  margin-top: 14px;
  overflow-x: auto;
  overflow-y: visible;
  max-width: 100%;
}

.asset-filter-menu {
  position: relative;
}

.asset-filter-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 45;
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 10px;
  width: min(390px, calc(100vw - 40px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 18px 36px rgba(61, 45, 137, 0.18);
}

.asset-filter-dropdown .quiet-action {
  grid-column: 1 / -1;
  justify-self: end;
}

.asset-alternative-view {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.asset-view-card,
.asset-compact-row {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 14px;
  background: #fbfcfe;
}

.asset-view-heading,
.asset-compact-row,
.asset-view-pills {
  display: flex;
  align-items: center;
  gap: 8px;
}

.asset-view-heading,
.asset-compact-row {
  justify-content: space-between;
}

.asset-view-pills {
  flex-wrap: wrap;
  margin: 10px 0;
}

.asset-alternative-view.compact-mode {
  grid-template-columns: 1fr;
}

.queue-list,
.activity-feed,
.people-grid,
.article-list,
.lookup-list,
.role-matrix,
.activity-log-list,
.history-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.backend-layout .activity-log-list {
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.activity-detail-heading {
  margin: 6px 0 18px;
}

.activity-detail-drawer .activity-log-detail {
  display: grid;
  gap: 0;
}

.activity-log-searchbar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
}

.activity-log-searchbar > input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
}

.activity-filter-menu {
  position: relative;
}

.filter-toggle {
  min-width: 92px;
}

.activity-filter-dropdown {
  box-sizing: border-box;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 35;
  display: grid;
  gap: 10px;
  width: min(376px, calc(100vw - 48px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 18px 36px rgba(61, 45, 137, 0.18);
}

.activity-filter-dropdown label {
  min-width: 0;
  width: 100%;
}

.activity-filter-dropdown input,
.activity-filter-dropdown select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

.date-filter-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
}

.activity-filter-dropdown .primary-action {
  justify-self: end;
  min-width: 72px;
}

.queue-item,
.activity-item,
.person-card,
.article-card,
.lookup-row,
.role-row,
.activity-log-item,
.history-item {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  background: #fbfcfe;
}

.queue-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  cursor: pointer;
}

.queue-item:hover,
.queue-item:focus-visible {
  border-color: var(--primary);
  background: var(--primary-soft);
  outline: none;
}

.meta,
.hint {
  color: var(--muted);
  font-size: 12px;
}

.status-pill,
.priority,
.sla,
.countdown-pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 700;
}

.status-pill {
  background: #eef2f6;
  color: #334155;
}

.condition-pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 700;
}

.condition-good {
  background: #dcfce7;
  color: var(--green);
}

.condition-fair {
  background: #fff2d2;
  color: var(--amber);
}

.condition-faulty,
.condition-missing {
  background: #fee2e2;
  color: var(--red);
}

.priority-critical,
.sla-late,
.late-flag {
  background: #fee2e2;
  color: var(--red);
}

.sla-paused {
  background: #fff7d6;
  color: #946200;
}

.sla-resolved {
  background: #dcfce7;
  color: var(--green);
}

.sla-closed {
  background: #eef2f6;
  color: #475467;
}

.countdown-pill {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.countdown-pill.sla-paused,
.sla.sla-paused {
  background: #fff7d6;
  color: #946200;
}

.countdown-pill.sla-resolved,
.sla.sla-resolved {
  background: #dcfce7;
  color: var(--green);
}

.countdown-pill.sla-closed,
.sla.sla-closed {
  background: #eef2f6;
  color: #475467;
}

.priority-high {
  background: #fff2d2;
  color: var(--amber);
}

.priority-medium {
  background: #e6f4f1;
  color: var(--teal);
}

.priority-low {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.toolbar {
  margin-bottom: 12px;
  align-items: end;
  flex-wrap: wrap;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.segmented button {
  background: #fff;
  border: 1px solid var(--line);
}

.segmented button.active {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
}

.search-box {
  min-width: min(260px, 100%);
  flex: 1 1 260px;
}

.ticket-search-controls {
  display: flex;
  width: min(600px, 100%);
  flex: 0 1 600px;
  margin-left: auto;
  align-items: end;
  gap: 8px;
}

.ticket-search-controls .primary-action {
  flex: 0 0 auto;
}

.search-box span,
label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 14px;
}

.asset-table {
  width: max-content;
  min-width: 100%;
}

.asset-table th,
.asset-table td,
.asset-table strong,
.asset-table .status-pill,
.asset-table .condition-pill {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

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

th {
  color: #475467;
  font-size: 12px;
  background: #f7f9fb;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover,
tbody tr.selected {
  background: var(--primary-soft);
}

.asset-table tbody tr {
  cursor: default;
}

.asset-table tbody tr.action-menu-active {
  position: relative;
  z-index: 30;
}

.asset-table-wrap.menu-open .asset-table tbody tr:not(.action-menu-active) {
  pointer-events: none;
}

.asset-table-wrap.menu-open .asset-table tbody tr:not(.action-menu-active):hover {
  background: transparent;
}

.asset-table-wrap.menu-open .row-action-menu:not([open]) summary {
  opacity: 0;
  pointer-events: none;
}

.archived-asset-row {
  background: #fbf9ff;
  color: #667085;
}

.row-action-menu {
  position: relative;
  display: inline-block;
}

.row-action-menu[open] {
  z-index: 40;
}

.row-action-menu summary {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  box-shadow: 0 6px 14px rgba(61, 45, 137, 0.12);
  cursor: pointer;
  list-style: none;
  font-size: 20px;
  line-height: 1;
}

.row-action-menu summary::-webkit-details-marker {
  display: none;
}

.row-action-list {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  display: grid;
  min-width: 170px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 16px 30px rgba(61, 45, 137, 0.18);
}

.row-action-list button {
  border: 0;
  border-radius: 6px;
  padding: 9px 10px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.row-action-list button:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.row-action-list button:disabled {
  cursor: not-allowed;
  color: var(--muted);
  opacity: 0.6;
}

.detail-panel {
  min-height: 420px;
}

.detail-stack {
  display: grid;
  gap: 16px;
}

.ticket-summary {
  display: grid;
  gap: 8px;
}

.ticket-summary-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.ticket-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.ticket-meta-item {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.ticket-meta-item span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.ticket-meta-item strong {
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.25;
}

.ticket-content-focus {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--primary-soft);
}

.ticket-content-focus h2 {
  margin-bottom: 12px;
  font-size: 23px;
}

.ticket-content-focus p {
  margin-bottom: 0;
  font-size: 17px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.history-action-row {
  display: flex;
  justify-content: flex-end;
}

.detail-section {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.ticket-comment {
  margin: 10px 0;
}

.ticket-comment p {
  margin: 0 0 2px;
}

.internal-ticket-comment {
  padding: 9px 10px;
  border-left: 3px solid var(--primary);
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.internal-note-tag {
  display: inline-block;
  margin-left: 5px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  vertical-align: middle;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.person-card {
  display: grid;
  gap: 8px;
  cursor: pointer;
}

.person-avatar {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fff;
  background: var(--primary);
  font-weight: 800;
}

.large-avatar {
  width: 58px;
  height: 58px;
  font-size: 20px;
}

.person-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.panel-heading > h2,
.queue-item strong,
.person-card strong,
.article-card strong {
  overflow-wrap: anywhere;
}

.archived-person {
  background: #f7f5fb;
}

.archived-pill {
  background: #ede9fe;
  color: var(--primary-dark);
}

.person-card-actions,
.history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.compact-select {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.compact-select select {
  width: auto;
  min-height: 38px;
  padding: 0 10px;
}

.people-view-list,
.people-view-details,
.people-view-content {
  grid-template-columns: 1fr;
}

.people-view-list .person-card {
  grid-template-columns: auto minmax(160px, 0.7fr) minmax(220px, 1fr) minmax(220px, auto);
  align-items: center;
  column-gap: 14px;
}

.people-view-list .person-card-title {
  display: block;
}

.people-view-list .person-card-content {
  margin: 0;
}

.people-view-list .person-card-actions {
  grid-column: 1 / -1;
}

.people-view-icons {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.people-view-icons .person-card {
  justify-items: center;
  text-align: center;
}

.people-view-icons .person-card-content,
.people-view-icons .person-card-actions {
  display: none;
}

.people-view-content .person-card {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  column-gap: 14px;
}

.people-view-content .person-card-title,
.people-view-content .person-card > .meta,
.people-view-content .person-card-content {
  grid-column: 2;
}

.people-view-content .person-card > .meta {
  grid-row: 2;
  margin: -2px 0 8px;
}

.people-view-content .person-card-content {
  grid-row: 3;
  margin: 0;
}

.people-view-content .person-card-actions {
  grid-column: 1 / -1;
}

.people-detail-layer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 80;
  width: clamp(560px, 44vw, 760px);
  max-width: 100vw;
  padding: 22px;
  border-left: 1px solid var(--line);
  background: #fff;
  box-shadow: -20px 0 44px rgba(61, 45, 137, 0.16);
  overflow-y: auto;
}

.detail-close {
  position: sticky;
  top: 0;
  margin-left: auto;
  z-index: 2;
}

.people-detail-content {
  display: grid;
  gap: 14px;
}

.people-detail-header {
  display: flex;
  gap: 12px;
  align-items: center;
}

.compact-history {
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
}

.activity-log-item {
  display: grid;
  gap: 4px;
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.activity-log-item:hover,
.activity-log-item:focus-visible,
.selected-log {
  border-color: var(--primary);
  background: var(--primary-soft);
  outline: none;
}

.activity-log-detail {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

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

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

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

.detail-row strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

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

.wide {
  grid-column: 1 / -1;
}

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

dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.22);
}

dialog::backdrop {
  background: rgba(17, 24, 39, 0.48);
}

.dialog-card {
  padding: 18px;
  display: grid;
  gap: 14px;
  min-width: 0;
}

.small-dialog {
  max-width: 420px;
}

#appActionDialog {
  width: min(460px, calc(100vw - 32px));
}

.dialog-message {
  margin: 0;
  color: var(--ink);
  line-height: 1.5;
}

.danger-action {
  background: var(--red);
}

.toast-region {
  position: fixed;
  z-index: 300;
  right: 18px;
  bottom: 18px;
  display: grid;
  width: min(380px, calc(100vw - 32px));
  gap: 8px;
  pointer-events: none;
}

.app-toast {
  padding: 12px 14px;
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 18px 42px rgba(20, 13, 53, 0.22);
  line-height: 1.4;
}

.app-toast.error {
  border-left-color: var(--red);
}

.ticket-comment-composer {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.ticket-comment-composer textarea {
  min-height: 120px;
}

.ticket-comment-composer .dialog-actions {
  justify-content: flex-end;
}

.article-content-input {
  min-height: 240px;
  resize: vertical;
}

.lookup-row,
.role-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.lookup-manager-row {
  align-items: stretch;
  flex-direction: column;
}

.lookup-heading,
.lookup-option,
.lookup-option-list {
  display: flex;
  align-items: center;
}

.lookup-heading {
  justify-content: space-between;
  gap: 10px;
}

.lookup-option-list {
  flex-wrap: wrap;
  gap: 8px;
}

.lookup-option {
  gap: 6px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.lookup-option .text-action {
  padding: 2px 4px;
  font-size: 12px;
}

.lookup-control-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto auto;
  gap: 8px;
  align-items: center;
}

.lookup-control-row select {
  min-width: 0;
}

@media (max-width: 820px) {
  .lookup-control-row {
    grid-template-columns: 1fr 1fr;
  }

  .lookup-control-row select {
    grid-column: 1 / -1;
  }
}

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

.email-settings {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.email-settings textarea {
  min-height: 82px;
}

.notification-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfe;
}

.role-row ul {
  margin: 6px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 10;
  width: max-content;
  max-width: 260px;
  padding: 8px 10px;
  border-radius: 7px;
  background: #21164c;
  color: #fff;
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
  box-shadow: 0 10px 24px rgba(33, 22, 76, 0.22);
  opacity: 0;
  pointer-events: none;
  translate: -50% 0;
}

[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
  opacity: 1;
}

@media (max-width: 1180px) {
  [data-tooltip]::after {
    display: none;
  }

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

  .workspace {
    padding: 20px;
  }

  .asset-actions,
  .topbar-actions,
  .people-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 1050px) {
  .app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .sidebar {
    z-index: 2;
    min-width: 0;
    padding: 16px;
    gap: 14px;
  }

  .nav {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .workspace {
    min-width: 0;
    width: 100%;
    max-width: 100vw;
  }

  .panel,
  .table-panel,
  .asset-table-wrap {
    min-width: 0;
    max-width: 100%;
  }

  .dashboard-layout,
  .knowledge-layout,
  .settings-grid,
  .backend-layout {
    grid-template-columns: 1fr;
  }

  .knowledge-layout {
    height: auto;
    min-height: 0;
  }

  .knowledge-topic-list,
  .knowledge-detail {
    max-height: 52dvh;
  }

  .backend-layout > .panel {
    max-height: none;
  }

  .backend-layout > .panel:nth-child(2) {
    position: static;
  }

  .backend-layout .activity-log-list {
    max-height: 52dvh;
  }
}

@media (max-width: 720px) {
  .app-shell {
    display: block;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: visible;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 110;
    padding: 10px 12px;
    gap: 0;
    height: auto;
    overflow: visible;
    box-shadow: 0 8px 24px rgba(20, 13, 53, 0.2);
  }

  .nav {
    overflow: visible;
    padding-right: 0;
  }

  .brand {
    gap: 9px;
  }

  .brand-logo {
    width: 42px;
    height: 42px;
  }

  .brand strong {
    font-size: 14px;
  }

  .brand span {
    font-size: 10px;
  }

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

  .mobile-header-actions .notification-bell {
    min-height: 38px;
    border-color: rgba(255, 255, 255, 0.28);
  }

  .sidebar-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100dvh - 62px);
    overflow-y: auto;
    padding: 12px;
    gap: 12px;
    background: #21164c;
    box-shadow: 0 16px 28px rgba(20, 13, 53, 0.25);
  }

  .sidebar.mobile-menu-open .sidebar-menu {
    display: flex;
  }

  .sidebar-menu .nav {
    grid-template-columns: 1fr;
  }

  .sidebar-menu .logout-button {
    margin-top: 0;
  }

  .topbar .notification-bell {
    display: none;
  }

  .topbar .notification-wrap {
    position: static;
    width: 0;
    height: 0;
  }

  .notification-dropdown {
    position: fixed;
    top: 68px;
    left: 12px;
    right: 12px;
    z-index: 120;
    width: auto;
    max-height: calc(100dvh - 86px);
  }

  .notification-heading,
  .notification-item,
  .notification-empty {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .notification-list {
    max-height: calc(100dvh - 150px);
  }

  .mobile-footer {
    display: grid;
    gap: 4px;
    margin: 24px -16px -16px;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
    color: #ded9ff;
    background: #21164c;
    text-align: center;
    font-size: 12px;
  }

  .login-screen {
    padding: 14px;
  }

  .login-card {
    padding: 20px;
  }

  .workspace {
    display: flex;
    height: auto;
    min-height: calc(100dvh - 62px);
    flex-direction: column;
    overflow: visible;
    padding: 16px;
    max-width: 100%;
  }

  .toast-region {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
  }

  .workspace > .active-view {
    flex: 1 0 auto;
  }

  .topbar,
  .panel-heading,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar {
    gap: 8px;
    margin-bottom: 10px;
  }

  .toolbar .segmented {
    margin-bottom: 0;
  }

  .ticket-search-controls {
    width: 100%;
    flex: none;
    margin-left: 0;
    align-items: end;
    gap: 6px;
  }

  .ticket-search-controls .search-box {
    min-width: 0;
    flex: 1 1 auto;
  }

  .ticket-search-controls .search-box input {
    height: 38px;
    padding: 8px 10px;
  }

  .ticket-search-controls .primary-action {
    width: auto;
    min-height: 38px;
    padding: 8px 12px;
  }

  .dashboard-clock strong {
    font-size: 22px;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .asset-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .people-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .knowledge-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .knowledge-layout {
    display: block;
    margin-top: 10px;
  }

  .knowledge-topic-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .knowledge-layout > .knowledge-detail {
    display: none;
  }

  .knowledge-topic.accordion-expanded {
    border-color: var(--primary);
    background: var(--primary-soft);
  }

  .knowledge-topic.selected-topic:not(.accordion-expanded) {
    border-color: var(--line);
    background: #fff;
    box-shadow: var(--shadow);
  }

  .knowledge-topic-main {
    position: relative;
    padding-right: 22px;
  }

  .knowledge-topic-main::after {
    content: "+";
    position: absolute;
    top: 0;
    right: 0;
    color: var(--primary-dark);
    font-size: 18px;
    font-weight: 800;
  }

  .accordion-expanded .knowledge-topic-main::after {
    content: "−";
  }

  .knowledge-accordion-content.is-expanded {
    display: grid;
    grid-column: 1 / -1;
    gap: 12px;
    margin-top: 4px;
    padding: 14px 4px 4px;
    border-top: 1px solid var(--line);
    cursor: default;
  }

  .knowledge-accordion-content h2 {
    margin: 8px 0 3px;
    font-size: 17px;
  }

  .knowledge-accordion-content .knowledge-content {
    gap: 8px;
    font-size: 13px;
    line-height: 1.55;
  }

  .ticket-table,
  .ticket-table tbody,
  .ticket-table tr,
  .ticket-table td {
    display: block;
    width: 100% !important;
  }

  .ticket-table thead {
    display: none;
  }

  .ticket-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    overflow: hidden;
  }

  .ticket-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
  }

  .ticket-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
  }

  .ticket-table td:first-child {
    grid-column: 1 / -1;
  }

  .ticket-detail-layer {
    display: block;
  }

  .ticket-detail-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  .ticket-detail-drawer {
    position: absolute;
    inset: 0;
    width: 100%;
    border-left: 0;
    padding: 16px;
  }

  .ticket-meta-grid {
    grid-template-columns: 1fr;
  }

  .ticket-content-focus {
    padding: 16px;
  }

  .people-view-list .person-card,
  .people-view-content .person-card {
    grid-template-columns: 1fr;
  }

  .compact-select,
  .compact-select select,
  .compact-search,
  .keyword-search {
    width: 100%;
  }

  .keyword-suggestions {
    left: 0;
    right: auto;
    width: min(100%, calc(100vw - 32px));
  }

  .topbar-actions > button,
  .asset-actions > button,
  .people-actions > button,
  .knowledge-actions > button,
  .dialog-actions > button {
    width: 100%;
  }

  .page-overview {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: stretch;
    margin-bottom: 14px;
  }

  .page-overview .dashboard-clock,
  #assetClock {
    display: block;
    min-width: 0;
    margin-bottom: 0;
    padding: 12px 14px;
  }

  .metric-dropdown {
    position: relative;
    display: block;
  }

  .metric-toggle {
    display: block;
    height: 100%;
    min-height: 62px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--primary-dark);
    box-shadow: var(--shadow);
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
  }

  .metric-dropdown .metric-grid {
    position: absolute;
    z-index: 35;
    top: calc(100% + 6px);
    right: 0;
    display: none;
    width: min(260px, calc(100vw - 24px));
    margin: 0;
    padding: 8px;
    grid-template-columns: 1fr;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
  }

  .metric-dropdown.is-open .metric-grid {
    display: grid;
  }

  .metric-dropdown .metric-card {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    border-left-width: 4px;
    box-shadow: none;
  }

  .metric-dropdown .metric-card strong {
    margin: 0;
    font-size: 18px;
    line-height: 1.1;
  }

  .metric-dropdown .metric-card span {
    font-size: 11px;
    line-height: 1.25;
    text-align: right;
  }

  .form-grid,
  .notification-options {
    grid-template-columns: 1fr;
  }

  .activity-log-searchbar {
    grid-template-columns: 1fr;
  }

  .activity-filter-dropdown {
    left: 0;
    right: auto;
    width: min(100%, calc(100vw - 32px));
  }

  .date-filter-pair {
    grid-template-columns: 1fr;
  }

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

  .nav button {
    min-height: 38px;
    padding-inline: 10px;
  }

  .queue-item {
    grid-template-columns: 1fr;
  }

  .detail-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  dialog {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
  }

  .dialog-card {
    padding: 14px;
  }

  .people-detail-layer {
    width: 100vw;
    padding: 16px;
  }

  .people-detail-header {
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .workspace {
    padding: 12px;
  }

  .mobile-footer {
    margin: 24px -12px -12px;
  }

  .panel {
    padding: 12px;
  }

  .backend-layout .activity-log-list {
    max-height: 58dvh;
  }

  .knowledge-topic-list {
    max-height: none;
  }
}
